Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

Commit 5205ddc

Browse files
feat(kms): enable generation of Locations mixin (#578)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 481650929 Source-Link: https://togithub.com/googleapis/googleapis/commit/62e82e76c6ab8405731c1dfc9edb604745beedfb Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/d6de38b5d51dafb942ccd1268d6d04eb6ff116af Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDZkZTM4YjVkNTFkYWZiOTQyY2NkMTI2OGQ2ZDA0ZWI2ZmYxMTZhZiJ9
1 parent 4d72fac commit 5205ddc

4 files changed

Lines changed: 581 additions & 2 deletions

File tree

src/v1/ekm_service_client.ts

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import type {
2727
GaxCall,
2828
IamClient,
2929
IamProtos,
30+
LocationsClient,
31+
LocationProtos,
3032
} from 'google-gax';
3133
import {Transform} from 'stream';
3234
import * as protos from '../../protos/protos';
@@ -66,6 +68,7 @@ export class EkmServiceClient {
6668
warn: (code: string, message: string, warnType?: string) => void;
6769
innerApiCalls: {[name: string]: Function};
6870
iamClient: IamClient;
71+
locationsClient: LocationsClient;
6972
pathTemplates: {[name: string]: gax.PathTemplate};
7073
ekmServiceStub?: Promise<{[name: string]: Function}>;
7174

@@ -161,6 +164,11 @@ export class EkmServiceClient {
161164
}
162165
this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts);
163166

167+
this.locationsClient = new this._gaxModule.LocationsClient(
168+
this._gaxGrpc,
169+
opts
170+
);
171+
164172
// Determine the client header string.
165173
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
166174
if (typeof process !== 'undefined' && 'versions' in process) {
@@ -1007,6 +1015,86 @@ export class EkmServiceClient {
10071015
return this.iamClient.testIamPermissions(request, options, callback);
10081016
}
10091017

1018+
/**
1019+
* Gets information about a location.
1020+
*
1021+
* @param {Object} request
1022+
* The request object that will be sent.
1023+
* @param {string} request.name
1024+
* Resource name for the location.
1025+
* @param {object} [options]
1026+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1027+
* @returns {Promise} - The promise which resolves to an array.
1028+
* The first element of the array is an object representing [Location]{@link google.cloud.location.Location}.
1029+
* Please see the
1030+
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
1031+
* for more details and examples.
1032+
* @example
1033+
* ```
1034+
* const [response] = await client.getLocation(request);
1035+
* ```
1036+
*/
1037+
getLocation(
1038+
request: LocationProtos.google.cloud.location.IGetLocationRequest,
1039+
options?:
1040+
| gax.CallOptions
1041+
| Callback<
1042+
LocationProtos.google.cloud.location.ILocation,
1043+
| LocationProtos.google.cloud.location.IGetLocationRequest
1044+
| null
1045+
| undefined,
1046+
{} | null | undefined
1047+
>,
1048+
callback?: Callback<
1049+
LocationProtos.google.cloud.location.ILocation,
1050+
| LocationProtos.google.cloud.location.IGetLocationRequest
1051+
| null
1052+
| undefined,
1053+
{} | null | undefined
1054+
>
1055+
): Promise<LocationProtos.google.cloud.location.ILocation> {
1056+
return this.locationsClient.getLocation(request, options, callback);
1057+
}
1058+
1059+
/**
1060+
* Lists information about the supported locations for this service. Returns an iterable object.
1061+
*
1062+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1063+
* @param {Object} request
1064+
* The request object that will be sent.
1065+
* @param {string} request.name
1066+
* The resource that owns the locations collection, if applicable.
1067+
* @param {string} request.filter
1068+
* The standard list filter.
1069+
* @param {number} request.pageSize
1070+
* The standard list page size.
1071+
* @param {string} request.pageToken
1072+
* The standard list page token.
1073+
* @param {object} [options]
1074+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1075+
* @returns {Object}
1076+
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
1077+
* When you iterate the returned iterable, each element will be an object representing
1078+
* [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page,
1079+
* so you can stop the iteration when you don't need more results.
1080+
* Please see the
1081+
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1082+
* for more details and examples.
1083+
* @example
1084+
* ```
1085+
* const iterable = client.listLocationsAsync(request);
1086+
* for await (const response of iterable) {
1087+
* // process response
1088+
* }
1089+
* ```
1090+
*/
1091+
listLocationsAsync(
1092+
request: LocationProtos.google.cloud.location.IListLocationsRequest,
1093+
options?: CallOptions
1094+
): AsyncIterable<LocationProtos.google.cloud.location.ILocation> {
1095+
return this.locationsClient.listLocationsAsync(request, options);
1096+
}
1097+
10101098
// --------------------
10111099
// -- Path templates --
10121100
// --------------------
@@ -1479,6 +1567,7 @@ export class EkmServiceClient {
14791567
this._terminated = true;
14801568
stub.close();
14811569
this.iamClient.close();
1570+
this.locationsClient.close();
14821571
});
14831572
}
14841573
return Promise.resolve();

src/v1/key_management_service_client.ts

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import type {
2727
GaxCall,
2828
IamClient,
2929
IamProtos,
30+
LocationsClient,
31+
LocationProtos,
3032
} from 'google-gax';
3133
import {Transform} from 'stream';
3234
import * as protos from '../../protos/protos';
@@ -73,6 +75,7 @@ export class KeyManagementServiceClient {
7375
warn: (code: string, message: string, warnType?: string) => void;
7476
innerApiCalls: {[name: string]: Function};
7577
iamClient: IamClient;
78+
locationsClient: LocationsClient;
7679
pathTemplates: {[name: string]: gax.PathTemplate};
7780
keyManagementServiceStub?: Promise<{[name: string]: Function}>;
7881

@@ -168,6 +171,11 @@ export class KeyManagementServiceClient {
168171
}
169172
this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts);
170173

174+
this.locationsClient = new this._gaxModule.LocationsClient(
175+
this._gaxGrpc,
176+
opts
177+
);
178+
171179
// Determine the client header string.
172180
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
173181
if (typeof process !== 'undefined' && 'versions' in process) {
@@ -3898,6 +3906,86 @@ export class KeyManagementServiceClient {
38983906
return this.iamClient.testIamPermissions(request, options, callback);
38993907
}
39003908

3909+
/**
3910+
* Gets information about a location.
3911+
*
3912+
* @param {Object} request
3913+
* The request object that will be sent.
3914+
* @param {string} request.name
3915+
* Resource name for the location.
3916+
* @param {object} [options]
3917+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
3918+
* @returns {Promise} - The promise which resolves to an array.
3919+
* The first element of the array is an object representing [Location]{@link google.cloud.location.Location}.
3920+
* Please see the
3921+
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
3922+
* for more details and examples.
3923+
* @example
3924+
* ```
3925+
* const [response] = await client.getLocation(request);
3926+
* ```
3927+
*/
3928+
getLocation(
3929+
request: LocationProtos.google.cloud.location.IGetLocationRequest,
3930+
options?:
3931+
| gax.CallOptions
3932+
| Callback<
3933+
LocationProtos.google.cloud.location.ILocation,
3934+
| LocationProtos.google.cloud.location.IGetLocationRequest
3935+
| null
3936+
| undefined,
3937+
{} | null | undefined
3938+
>,
3939+
callback?: Callback<
3940+
LocationProtos.google.cloud.location.ILocation,
3941+
| LocationProtos.google.cloud.location.IGetLocationRequest
3942+
| null
3943+
| undefined,
3944+
{} | null | undefined
3945+
>
3946+
): Promise<LocationProtos.google.cloud.location.ILocation> {
3947+
return this.locationsClient.getLocation(request, options, callback);
3948+
}
3949+
3950+
/**
3951+
* Lists information about the supported locations for this service. Returns an iterable object.
3952+
*
3953+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
3954+
* @param {Object} request
3955+
* The request object that will be sent.
3956+
* @param {string} request.name
3957+
* The resource that owns the locations collection, if applicable.
3958+
* @param {string} request.filter
3959+
* The standard list filter.
3960+
* @param {number} request.pageSize
3961+
* The standard list page size.
3962+
* @param {string} request.pageToken
3963+
* The standard list page token.
3964+
* @param {object} [options]
3965+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
3966+
* @returns {Object}
3967+
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
3968+
* When you iterate the returned iterable, each element will be an object representing
3969+
* [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page,
3970+
* so you can stop the iteration when you don't need more results.
3971+
* Please see the
3972+
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
3973+
* for more details and examples.
3974+
* @example
3975+
* ```
3976+
* const iterable = client.listLocationsAsync(request);
3977+
* for await (const response of iterable) {
3978+
* // process response
3979+
* }
3980+
* ```
3981+
*/
3982+
listLocationsAsync(
3983+
request: LocationProtos.google.cloud.location.IListLocationsRequest,
3984+
options?: CallOptions
3985+
): AsyncIterable<LocationProtos.google.cloud.location.ILocation> {
3986+
return this.locationsClient.listLocationsAsync(request, options);
3987+
}
3988+
39013989
// --------------------
39023990
// -- Path templates --
39033991
// --------------------
@@ -4370,6 +4458,7 @@ export class KeyManagementServiceClient {
43704458
this._terminated = true;
43714459
stub.close();
43724460
this.iamClient.close();
4461+
this.locationsClient.close();
43734462
});
43744463
}
43754464
return Promise.resolve();

0 commit comments

Comments
 (0)