@googleapis/sts 9.1.0 → 11.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## [11.0.1](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v11.0.0...sts-v11.0.1) (2025-07-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **sts:** update the API ([eebd09d](https://github.com/googleapis/google-api-nodejs-client/commit/eebd09d1bf7991f11e4e33e63592e144e540321b))
9
+ * **sts:** update the API ([3ab0938](https://github.com/googleapis/google-api-nodejs-client/commit/3ab093828b82861bae6fb50abef2f86a910b85bc))
10
+
11
+ ## [11.0.0](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v10.0.1...sts-v11.0.0) (2025-06-30)
12
+
13
+
14
+ ### ⚠ BREAKING CHANGES
15
+
16
+ * upgrade to node 18
17
+
18
+ ### Features
19
+
20
+ * upgrade to node 18 ([682fbb8](https://github.com/googleapis/google-api-nodejs-client/commit/682fbb869189ae92b3e9a194d37d0548af0c1f92))
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * **deps:** upgrade googleapis-common to 8.0.2-rc ([f4b0990](https://github.com/googleapis/google-api-nodejs-client/commit/f4b099071040cfbcfe4a2e7d487d45ee93b369e0))
26
+ * **sts:** update the API ([3ab0938](https://github.com/googleapis/google-api-nodejs-client/commit/3ab093828b82861bae6fb50abef2f86a910b85bc))
27
+
28
+ ## [10.0.1](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v10.0.0...sts-v10.0.1) (2025-06-04)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **deps:** upgrade googleapis-common to 8.0.2-rc ([f4b0990](https://github.com/googleapis/google-api-nodejs-client/commit/f4b099071040cfbcfe4a2e7d487d45ee93b369e0))
34
+
35
+ ## [10.0.0](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v9.1.0...sts-v10.0.0) (2025-05-29)
36
+
37
+
38
+ ### ⚠ BREAKING CHANGES
39
+
40
+ * upgrade to node 18
41
+
42
+ ### Features
43
+
44
+ * upgrade to node 18 ([682fbb8](https://github.com/googleapis/google-api-nodejs-client/commit/682fbb869189ae92b3e9a194d37d0548af0c1f92))
45
+
3
46
  ## [9.1.0](https://github.com/googleapis/google-api-nodejs-client/compare/sts-v9.0.1...sts-v9.1.0) (2025-02-04)
4
47
 
5
48
 
package/build/index.d.ts CHANGED
@@ -14,4 +14,4 @@ declare const auth: AuthPlus;
14
14
  export { auth };
15
15
  export { sts_v1 };
16
16
  export { sts_v1beta };
17
- export { AuthPlus, GlobalOptions, APIRequestContext, GoogleConfigurable, StreamMethodOptions, GaxiosPromise, MethodOptions, BodyResponseCallback, } from 'googleapis-common';
17
+ export { AuthPlus, GlobalOptions, APIRequestContext, GoogleConfigurable, StreamMethodOptions, MethodOptions, BodyResponseCallback, } from 'googleapis-common';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,kCAAkC;AAElC,yDAAuE;AACvE,6BAA4B;AAqBpB,uFArBA,WAAM,OAqBA;AApBd,qCAAoC;AAqB5B,2FArBA,mBAAU,OAqBA;AAnBL,QAAA,QAAQ,GAAG;IACtB,EAAE,EAAE,WAAM,CAAC,GAAG;IACd,MAAM,EAAE,mBAAU,CAAC,GAAG;CACvB,CAAC;AAMF,SAAgB,GAAG,CAEjB,gBAAuE;IAEvE,OAAO,IAAA,0BAAM,EAAI,KAAK,EAAE,gBAAgB,EAAE,gBAAQ,EAAE,IAAI,CAAC,CAAC;AAC5D,CAAC;AALD,kBAKC;AAED,MAAM,IAAI,GAAG,IAAI,4BAAQ,EAAE,CAAC;AACpB,oBAAI;AAGZ,uDAS2B;AARzB,6GAAA,QAAQ,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,kCAAkC;AAElC,yDAAuE;AACvE,6BAA4B;AAqBpB,uFArBA,WAAM,OAqBA;AApBd,qCAAoC;AAqB5B,2FArBA,mBAAU,OAqBA;AAnBL,QAAA,QAAQ,GAAG;IACtB,EAAE,EAAE,WAAM,CAAC,GAAG;IACd,MAAM,EAAE,mBAAU,CAAC,GAAG;CACvB,CAAC;AAMF,SAAgB,GAAG,CAEjB,gBAAuE;IAEvE,OAAO,IAAA,0BAAM,EAAI,KAAK,EAAE,gBAAgB,EAAE,gBAAQ,EAAE,IAAI,CAAC,CAAC;AAC5D,CAAC;AALD,kBAKC;AAED,MAAM,IAAI,GAAG,IAAI,4BAAQ,EAAE,CAAC;AACpB,oBAAI;AAGZ,uDAQ2B;AAPzB,6GAAA,QAAQ,OAAA"}
package/build/v1.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosPromise, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
2
+ import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
3
3
  import { Readable } from 'stream';
4
4
  export declare namespace sts_v1 {
5
5
  export interface Options extends GlobalOptions {
@@ -174,7 +174,7 @@ export declare namespace sts_v1 {
174
174
  */
175
175
  requestedTokenType?: string | null;
176
176
  /**
177
- * The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings. Required when exchanging an external credential for a Google access token.
177
+ * The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings; for example, `https://www.googleapis.com/auth/cloud-platform`. Required when exchanging an external credential for a Google access token. For a list of OAuth 2.0 scopes, see [OAuth 2.0 Scopes for Google APIs](https://developers.google.com/identity/protocols/oauth2/scopes).
178
178
  */
179
179
  scope?: string | null;
180
180
  /**
@@ -250,14 +250,75 @@ export declare namespace sts_v1 {
250
250
  constructor(context: APIRequestContext);
251
251
  /**
252
252
  * Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within an identity pool, or it applies a Credential Access Boundary to a Google access token. Note that workforce pools do not support Credential Access Boundaries. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.
253
+ * @example
254
+ * ```js
255
+ * // Before running the sample:
256
+ * // - Enable the API at:
257
+ * // https://console.developers.google.com/apis/api/sts.googleapis.com
258
+ * // - Login into gcloud by running:
259
+ * // ```sh
260
+ * // $ gcloud auth application-default login
261
+ * // ```
262
+ * // - Install the npm module by running:
263
+ * // ```sh
264
+ * // $ npm install googleapis
265
+ * // ```
266
+ *
267
+ * const {google} = require('googleapis');
268
+ * const sts = google.sts('v1');
269
+ *
270
+ * async function main() {
271
+ * const auth = new google.auth.GoogleAuth({
272
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
273
+ * scopes: [],
274
+ * });
275
+ *
276
+ * // Acquire an auth client, and bind it to all future calls
277
+ * const authClient = await auth.getClient();
278
+ * google.options({auth: authClient});
279
+ *
280
+ * // Do the magic
281
+ * const res = await sts.token({
282
+ * // Request body metadata
283
+ * requestBody: {
284
+ * // request body parameters
285
+ * // {
286
+ * // "audience": "my_audience",
287
+ * // "grantType": "my_grantType",
288
+ * // "options": "my_options",
289
+ * // "requestedTokenType": "my_requestedTokenType",
290
+ * // "scope": "my_scope",
291
+ * // "subjectToken": "my_subjectToken",
292
+ * // "subjectTokenType": "my_subjectTokenType"
293
+ * // }
294
+ * },
295
+ * });
296
+ * console.log(res.data);
297
+ *
298
+ * // Example response
299
+ * // {
300
+ * // "access_boundary_session_key": "my_access_boundary_session_key",
301
+ * // "access_token": "my_access_token",
302
+ * // "expires_in": 0,
303
+ * // "issued_token_type": "my_issued_token_type",
304
+ * // "token_type": "my_token_type"
305
+ * // }
306
+ * }
307
+ *
308
+ * main().catch(e => {
309
+ * console.error(e);
310
+ * throw e;
311
+ * });
312
+ *
313
+ * ```
253
314
  *
254
315
  * @param params - Parameters for request
255
316
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
256
317
  * @param callback - Optional callback that handles the response.
257
318
  * @returns A promise if used with async/await, or void if used with a callback.
258
319
  */
259
- token(params: Params$Resource$V1$Token, options: StreamMethodOptions): GaxiosPromise<Readable>;
260
- token(params?: Params$Resource$V1$Token, options?: MethodOptions): GaxiosPromise<Schema$GoogleIdentityStsV1ExchangeTokenResponse>;
320
+ token(params: Params$Resource$V1$Token, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
321
+ token(params?: Params$Resource$V1$Token, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$GoogleIdentityStsV1ExchangeTokenResponse>>;
261
322
  token(params: Params$Resource$V1$Token, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
262
323
  token(params: Params$Resource$V1$Token, options: MethodOptions | BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeTokenResponse>, callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeTokenResponse>): void;
263
324
  token(params: Params$Resource$V1$Token, callback: BodyResponseCallback<Schema$GoogleIdentityStsV1ExchangeTokenResponse>): void;
package/build/v1.js.map CHANGED
@@ -1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AM,KAAN,cAAM,QAmbtB"}
package/build/v1beta.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosPromise, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
2
+ import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
3
3
  import { Readable } from 'stream';
4
4
  export declare namespace sts_v1beta {
5
5
  export interface Options extends GlobalOptions {
@@ -161,7 +161,7 @@ export declare namespace sts_v1beta {
161
161
  */
162
162
  requestedTokenType?: string | null;
163
163
  /**
164
- * The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings. Required when exchanging an external credential for a Google access token.
164
+ * The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings; for example, `https://www.googleapis.com/auth/cloud-platform`. Required when exchanging an external credential for a Google access token. For a list of OAuth 2.0 scopes, see [OAuth 2.0 Scopes for Google APIs](https://developers.google.com/identity/protocols/oauth2/scopes).
165
165
  */
166
166
  scope?: string | null;
167
167
  /**
@@ -246,14 +246,74 @@ export declare namespace sts_v1beta {
246
246
  constructor(context: APIRequestContext);
247
247
  /**
248
248
  * Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within a workload identity pool, or it applies a Credential Access Boundary to a Google access token. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.
249
+ * @example
250
+ * ```js
251
+ * // Before running the sample:
252
+ * // - Enable the API at:
253
+ * // https://console.developers.google.com/apis/api/sts.googleapis.com
254
+ * // - Login into gcloud by running:
255
+ * // ```sh
256
+ * // $ gcloud auth application-default login
257
+ * // ```
258
+ * // - Install the npm module by running:
259
+ * // ```sh
260
+ * // $ npm install googleapis
261
+ * // ```
262
+ *
263
+ * const {google} = require('googleapis');
264
+ * const sts = google.sts('v1beta');
265
+ *
266
+ * async function main() {
267
+ * const auth = new google.auth.GoogleAuth({
268
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
269
+ * scopes: [],
270
+ * });
271
+ *
272
+ * // Acquire an auth client, and bind it to all future calls
273
+ * const authClient = await auth.getClient();
274
+ * google.options({auth: authClient});
275
+ *
276
+ * // Do the magic
277
+ * const res = await sts.token({
278
+ * // Request body metadata
279
+ * requestBody: {
280
+ * // request body parameters
281
+ * // {
282
+ * // "audience": "my_audience",
283
+ * // "grantType": "my_grantType",
284
+ * // "options": "my_options",
285
+ * // "requestedTokenType": "my_requestedTokenType",
286
+ * // "scope": "my_scope",
287
+ * // "subjectToken": "my_subjectToken",
288
+ * // "subjectTokenType": "my_subjectTokenType"
289
+ * // }
290
+ * },
291
+ * });
292
+ * console.log(res.data);
293
+ *
294
+ * // Example response
295
+ * // {
296
+ * // "access_token": "my_access_token",
297
+ * // "expires_in": 0,
298
+ * // "issued_token_type": "my_issued_token_type",
299
+ * // "token_type": "my_token_type"
300
+ * // }
301
+ * }
302
+ *
303
+ * main().catch(e => {
304
+ * console.error(e);
305
+ * throw e;
306
+ * });
307
+ *
308
+ * ```
249
309
  *
250
310
  * @param params - Parameters for request
251
311
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
252
312
  * @param callback - Optional callback that handles the response.
253
313
  * @returns A promise if used with async/await, or void if used with a callback.
254
314
  */
255
- token(params: Params$Resource$V1beta$Token, options: StreamMethodOptions): GaxiosPromise<Readable>;
256
- token(params?: Params$Resource$V1beta$Token, options?: MethodOptions): GaxiosPromise<Schema$GoogleIdentityStsV1betaExchangeTokenResponse>;
315
+ token(params: Params$Resource$V1beta$Token, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
316
+ token(params?: Params$Resource$V1beta$Token, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$GoogleIdentityStsV1betaExchangeTokenResponse>>;
257
317
  token(params: Params$Resource$V1beta$Token, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
258
318
  token(params: Params$Resource$V1beta$Token, options: MethodOptions | BodyResponseCallback<Schema$GoogleIdentityStsV1betaExchangeTokenResponse>, callback: BodyResponseCallback<Schema$GoogleIdentityStsV1betaExchangeTokenResponse>): void;
259
319
  token(params: Params$Resource$V1beta$Token, callback: BodyResponseCallback<Schema$GoogleIdentityStsV1betaExchangeTokenResponse>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"v1beta.js","sourceRoot":"","sources":["../v1beta.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,uDAAuD;AACvD,sDAAsD;AACtD,0DAA0D;AAC1D,oDAAoD;AACpD,4CAA4C;AAE5C,yDAe2B;AAG3B,IAAiB,UAAU,CA8W1B;AA9WD,WAAiB,UAAU;IAgEzB;;;;;;;;;;OAUG;IACH,MAAa,GAAG;QAId,YAAY,OAAsB,EAAE,MAA2B;YAC7D,IAAI,CAAC,OAAO,GAAG;gBACb,QAAQ,EAAE,OAAO,IAAI,EAAE;gBACvB,MAAM;aACP,CAAC;YAEF,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClD,CAAC;KACF;IAZY,cAAG,MAYf,CAAA;IA6KD,MAAa,eAAe;QAE1B,YAAY,OAA0B;YACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;QAqCD,KAAK,CACH,gBAGkC,EAClC,iBAIkC,EAClC,QAEkC;YAKlC,IAAI,MAAM,GAA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AC9D,MAAM,EAAE,MAAM;oBACd,UAAU,EAAE,EAAE;iBACf,EACD,OAAO,CACR;gBACD,MAAM;gBACN,cAAc,EAAE,EAAE;gBAClB,UAAU,EAAE,EAAE;gBACd,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB,CAAC;YACF,IAAI,QAAQ,EAAE;gBACZ,IAAA,oCAAgB,EACd,UAAU,EACV,QAAyC,CAC1C,CAAC;aACH;iBAAM;gBACL,OAAO,IAAA,oCAAgB,EACrB,UAAU,CACX,CAAC;aACH;QACH,CAAC;KACF;IAlKY,0BAAe,kBAkK3B,CAAA;AAQH,CAAC,EA9agB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QA8a1B"}
package/index.ts CHANGED
@@ -43,7 +43,6 @@ export {
43
43
  APIRequestContext,
44
44
  GoogleConfigurable,
45
45
  StreamMethodOptions,
46
- GaxiosPromise,
47
46
  MethodOptions,
48
47
  BodyResponseCallback,
49
48
  } from 'googleapis-common';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@googleapis/sts",
3
- "version": "9.1.0",
3
+ "version": "11.0.1",
4
4
  "description": "sts",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "webpack": "webpack"
29
29
  },
30
30
  "dependencies": {
31
- "googleapis-common": "^7.0.0"
31
+ "googleapis-common": "^8.0.2-rc.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@microsoft/api-documenter": "^7.8.10",
package/v1.ts CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  Compute,
24
24
  UserRefreshClient,
25
25
  BaseExternalAccountClient,
26
- GaxiosPromise,
26
+ GaxiosResponseWithHTTP2,
27
27
  GoogleConfigurable,
28
28
  createAPIRequest,
29
29
  MethodOptions,
@@ -227,7 +227,7 @@ export namespace sts_v1 {
227
227
  */
228
228
  requestedTokenType?: string | null;
229
229
  /**
230
- * The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings. Required when exchanging an external credential for a Google access token.
230
+ * The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings; for example, `https://www.googleapis.com/auth/cloud-platform`. Required when exchanging an external credential for a Google access token. For a list of OAuth 2.0 scopes, see [OAuth 2.0 Scopes for Google APIs](https://developers.google.com/identity/protocols/oauth2/scopes).
231
231
  */
232
232
  scope?: string | null;
233
233
  /**
@@ -307,6 +307,67 @@ export namespace sts_v1 {
307
307
 
308
308
  /**
309
309
  * Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within an identity pool, or it applies a Credential Access Boundary to a Google access token. Note that workforce pools do not support Credential Access Boundaries. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.
310
+ * @example
311
+ * ```js
312
+ * // Before running the sample:
313
+ * // - Enable the API at:
314
+ * // https://console.developers.google.com/apis/api/sts.googleapis.com
315
+ * // - Login into gcloud by running:
316
+ * // ```sh
317
+ * // $ gcloud auth application-default login
318
+ * // ```
319
+ * // - Install the npm module by running:
320
+ * // ```sh
321
+ * // $ npm install googleapis
322
+ * // ```
323
+ *
324
+ * const {google} = require('googleapis');
325
+ * const sts = google.sts('v1');
326
+ *
327
+ * async function main() {
328
+ * const auth = new google.auth.GoogleAuth({
329
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
330
+ * scopes: [],
331
+ * });
332
+ *
333
+ * // Acquire an auth client, and bind it to all future calls
334
+ * const authClient = await auth.getClient();
335
+ * google.options({auth: authClient});
336
+ *
337
+ * // Do the magic
338
+ * const res = await sts.token({
339
+ * // Request body metadata
340
+ * requestBody: {
341
+ * // request body parameters
342
+ * // {
343
+ * // "audience": "my_audience",
344
+ * // "grantType": "my_grantType",
345
+ * // "options": "my_options",
346
+ * // "requestedTokenType": "my_requestedTokenType",
347
+ * // "scope": "my_scope",
348
+ * // "subjectToken": "my_subjectToken",
349
+ * // "subjectTokenType": "my_subjectTokenType"
350
+ * // }
351
+ * },
352
+ * });
353
+ * console.log(res.data);
354
+ *
355
+ * // Example response
356
+ * // {
357
+ * // "access_boundary_session_key": "my_access_boundary_session_key",
358
+ * // "access_token": "my_access_token",
359
+ * // "expires_in": 0,
360
+ * // "issued_token_type": "my_issued_token_type",
361
+ * // "token_type": "my_token_type"
362
+ * // }
363
+ * }
364
+ *
365
+ * main().catch(e => {
366
+ * console.error(e);
367
+ * throw e;
368
+ * });
369
+ *
370
+ * ```
310
371
  *
311
372
  * @param params - Parameters for request
312
373
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -316,11 +377,13 @@ export namespace sts_v1 {
316
377
  token(
317
378
  params: Params$Resource$V1$Token,
318
379
  options: StreamMethodOptions
319
- ): GaxiosPromise<Readable>;
380
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
320
381
  token(
321
382
  params?: Params$Resource$V1$Token,
322
383
  options?: MethodOptions
323
- ): GaxiosPromise<Schema$GoogleIdentityStsV1ExchangeTokenResponse>;
384
+ ): Promise<
385
+ GaxiosResponseWithHTTP2<Schema$GoogleIdentityStsV1ExchangeTokenResponse>
386
+ >;
324
387
  token(
325
388
  params: Params$Resource$V1$Token,
326
389
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -355,8 +418,10 @@ export namespace sts_v1 {
355
418
  | BodyResponseCallback<Readable>
356
419
  ):
357
420
  | void
358
- | GaxiosPromise<Schema$GoogleIdentityStsV1ExchangeTokenResponse>
359
- | GaxiosPromise<Readable> {
421
+ | Promise<
422
+ GaxiosResponseWithHTTP2<Schema$GoogleIdentityStsV1ExchangeTokenResponse>
423
+ >
424
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
360
425
  let params = (paramsOrCallback || {}) as Params$Resource$V1$Token;
361
426
  let options = (optionsOrCallback || {}) as MethodOptions;
362
427
 
package/v1beta.ts CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  Compute,
24
24
  UserRefreshClient,
25
25
  BaseExternalAccountClient,
26
- GaxiosPromise,
26
+ GaxiosResponseWithHTTP2,
27
27
  GoogleConfigurable,
28
28
  createAPIRequest,
29
29
  MethodOptions,
@@ -214,7 +214,7 @@ export namespace sts_v1beta {
214
214
  */
215
215
  requestedTokenType?: string | null;
216
216
  /**
217
- * The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings. Required when exchanging an external credential for a Google access token.
217
+ * The OAuth 2.0 scopes to include on the resulting access token, formatted as a list of space-delimited, case-sensitive strings; for example, `https://www.googleapis.com/auth/cloud-platform`. Required when exchanging an external credential for a Google access token. For a list of OAuth 2.0 scopes, see [OAuth 2.0 Scopes for Google APIs](https://developers.google.com/identity/protocols/oauth2/scopes).
218
218
  */
219
219
  scope?: string | null;
220
220
  /**
@@ -303,6 +303,66 @@ export namespace sts_v1beta {
303
303
 
304
304
  /**
305
305
  * Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within a workload identity pool, or it applies a Credential Access Boundary to a Google access token. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.
306
+ * @example
307
+ * ```js
308
+ * // Before running the sample:
309
+ * // - Enable the API at:
310
+ * // https://console.developers.google.com/apis/api/sts.googleapis.com
311
+ * // - Login into gcloud by running:
312
+ * // ```sh
313
+ * // $ gcloud auth application-default login
314
+ * // ```
315
+ * // - Install the npm module by running:
316
+ * // ```sh
317
+ * // $ npm install googleapis
318
+ * // ```
319
+ *
320
+ * const {google} = require('googleapis');
321
+ * const sts = google.sts('v1beta');
322
+ *
323
+ * async function main() {
324
+ * const auth = new google.auth.GoogleAuth({
325
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
326
+ * scopes: [],
327
+ * });
328
+ *
329
+ * // Acquire an auth client, and bind it to all future calls
330
+ * const authClient = await auth.getClient();
331
+ * google.options({auth: authClient});
332
+ *
333
+ * // Do the magic
334
+ * const res = await sts.token({
335
+ * // Request body metadata
336
+ * requestBody: {
337
+ * // request body parameters
338
+ * // {
339
+ * // "audience": "my_audience",
340
+ * // "grantType": "my_grantType",
341
+ * // "options": "my_options",
342
+ * // "requestedTokenType": "my_requestedTokenType",
343
+ * // "scope": "my_scope",
344
+ * // "subjectToken": "my_subjectToken",
345
+ * // "subjectTokenType": "my_subjectTokenType"
346
+ * // }
347
+ * },
348
+ * });
349
+ * console.log(res.data);
350
+ *
351
+ * // Example response
352
+ * // {
353
+ * // "access_token": "my_access_token",
354
+ * // "expires_in": 0,
355
+ * // "issued_token_type": "my_issued_token_type",
356
+ * // "token_type": "my_token_type"
357
+ * // }
358
+ * }
359
+ *
360
+ * main().catch(e => {
361
+ * console.error(e);
362
+ * throw e;
363
+ * });
364
+ *
365
+ * ```
306
366
  *
307
367
  * @param params - Parameters for request
308
368
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -312,11 +372,13 @@ export namespace sts_v1beta {
312
372
  token(
313
373
  params: Params$Resource$V1beta$Token,
314
374
  options: StreamMethodOptions
315
- ): GaxiosPromise<Readable>;
375
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
316
376
  token(
317
377
  params?: Params$Resource$V1beta$Token,
318
378
  options?: MethodOptions
319
- ): GaxiosPromise<Schema$GoogleIdentityStsV1betaExchangeTokenResponse>;
379
+ ): Promise<
380
+ GaxiosResponseWithHTTP2<Schema$GoogleIdentityStsV1betaExchangeTokenResponse>
381
+ >;
320
382
  token(
321
383
  params: Params$Resource$V1beta$Token,
322
384
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -351,8 +413,10 @@ export namespace sts_v1beta {
351
413
  | BodyResponseCallback<Readable>
352
414
  ):
353
415
  | void
354
- | GaxiosPromise<Schema$GoogleIdentityStsV1betaExchangeTokenResponse>
355
- | GaxiosPromise<Readable> {
416
+ | Promise<
417
+ GaxiosResponseWithHTTP2<Schema$GoogleIdentityStsV1betaExchangeTokenResponse>
418
+ >
419
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
356
420
  let params = (paramsOrCallback || {}) as Params$Resource$V1beta$Token;
357
421
  let options = (optionsOrCallback || {}) as MethodOptions;
358
422