@google-cloud/apikeys 0.1.0

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.
@@ -0,0 +1,685 @@
1
+ /// <reference types="node" />
2
+ import type * as gax from 'google-gax';
3
+ import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax';
4
+ import { Transform } from 'stream';
5
+ import * as protos from '../../protos/protos';
6
+ /**
7
+ * Manages the API keys associated with projects.
8
+ * @class
9
+ * @memberof v2
10
+ */
11
+ export declare class ApiKeysClient {
12
+ private _terminated;
13
+ private _opts;
14
+ private _providedCustomServicePath;
15
+ private _gaxModule;
16
+ private _gaxGrpc;
17
+ private _protos;
18
+ private _defaults;
19
+ auth: gax.GoogleAuth;
20
+ descriptors: Descriptors;
21
+ warn: (code: string, message: string, warnType?: string) => void;
22
+ innerApiCalls: {
23
+ [name: string]: Function;
24
+ };
25
+ pathTemplates: {
26
+ [name: string]: gax.PathTemplate;
27
+ };
28
+ operationsClient: gax.OperationsClient;
29
+ apiKeysStub?: Promise<{
30
+ [name: string]: Function;
31
+ }>;
32
+ /**
33
+ * Construct an instance of ApiKeysClient.
34
+ *
35
+ * @param {object} [options] - The configuration object.
36
+ * The options accepted by the constructor are described in detail
37
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
38
+ * The common options are:
39
+ * @param {object} [options.credentials] - Credentials object.
40
+ * @param {string} [options.credentials.client_email]
41
+ * @param {string} [options.credentials.private_key]
42
+ * @param {string} [options.email] - Account email address. Required when
43
+ * using a .pem or .p12 keyFilename.
44
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
45
+ * .p12 key downloaded from the Google Developers Console. If you provide
46
+ * a path to a JSON file, the projectId option below is not necessary.
47
+ * NOTE: .pem and .p12 require you to specify options.email as well.
48
+ * @param {number} [options.port] - The port on which to connect to
49
+ * the remote host.
50
+ * @param {string} [options.projectId] - The project ID from the Google
51
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
52
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
53
+ * app is running in an environment which supports
54
+ * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
55
+ * your project ID will be detected automatically.
56
+ * @param {string} [options.apiEndpoint] - The domain name of the
57
+ * API remote host.
58
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
59
+ * Follows the structure of {@link gapicConfig}.
60
+ * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
61
+ * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
62
+ * For more information, please check the
63
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
64
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
65
+ * need to avoid loading the default gRPC version and want to use the fallback
66
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
67
+ * ```
68
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
69
+ * const client = new ApiKeysClient({fallback: 'rest'}, gax);
70
+ * ```
71
+ */
72
+ constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
73
+ /**
74
+ * Initialize the client.
75
+ * Performs asynchronous operations (such as authentication) and prepares the client.
76
+ * This function will be called automatically when any class method is called for the
77
+ * first time, but if you need to initialize it before calling an actual method,
78
+ * feel free to call initialize() directly.
79
+ *
80
+ * You can await on this method if you want to make sure the client is initialized.
81
+ *
82
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
83
+ */
84
+ initialize(): Promise<{
85
+ [name: string]: Function;
86
+ }>;
87
+ /**
88
+ * The DNS address for this API service.
89
+ * @returns {string} The DNS address for this service.
90
+ */
91
+ static get servicePath(): string;
92
+ /**
93
+ * The DNS address for this API service - same as servicePath(),
94
+ * exists for compatibility reasons.
95
+ * @returns {string} The DNS address for this service.
96
+ */
97
+ static get apiEndpoint(): string;
98
+ /**
99
+ * The port for this API service.
100
+ * @returns {number} The default port for this service.
101
+ */
102
+ static get port(): number;
103
+ /**
104
+ * The scopes needed to make gRPC calls for every method defined
105
+ * in this service.
106
+ * @returns {string[]} List of default scopes.
107
+ */
108
+ static get scopes(): string[];
109
+ getProjectId(): Promise<string>;
110
+ getProjectId(callback: Callback<string, undefined, undefined>): void;
111
+ /**
112
+ * Gets the metadata for an API key. The key string of the API key
113
+ * isn't included in the response.
114
+ *
115
+ * NOTE: Key is a global resource; hence the only supported value for
116
+ * location is `global`.
117
+ *
118
+ * @param {Object} request
119
+ * The request object that will be sent.
120
+ * @param {string} request.name
121
+ * Required. The resource name of the API key to get.
122
+ * @param {object} [options]
123
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
124
+ * @returns {Promise} - The promise which resolves to an array.
125
+ * The first element of the array is an object representing [Key]{@link google.api.apikeys.v2.Key}.
126
+ * Please see the
127
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
128
+ * for more details and examples.
129
+ * @example <caption>include:samples/generated/v2/api_keys.get_key.js</caption>
130
+ * region_tag:apikeys_v2_generated_ApiKeys_GetKey_async
131
+ */
132
+ getKey(request?: protos.google.api.apikeys.v2.IGetKeyRequest, options?: CallOptions): Promise<[
133
+ protos.google.api.apikeys.v2.IKey,
134
+ protos.google.api.apikeys.v2.IGetKeyRequest | undefined,
135
+ {} | undefined
136
+ ]>;
137
+ getKey(request: protos.google.api.apikeys.v2.IGetKeyRequest, options: CallOptions, callback: Callback<protos.google.api.apikeys.v2.IKey, protos.google.api.apikeys.v2.IGetKeyRequest | null | undefined, {} | null | undefined>): void;
138
+ getKey(request: protos.google.api.apikeys.v2.IGetKeyRequest, callback: Callback<protos.google.api.apikeys.v2.IKey, protos.google.api.apikeys.v2.IGetKeyRequest | null | undefined, {} | null | undefined>): void;
139
+ /**
140
+ * Get the key string for an API key.
141
+ *
142
+ * NOTE: Key is a global resource; hence the only supported value for
143
+ * location is `global`.
144
+ *
145
+ * @param {Object} request
146
+ * The request object that will be sent.
147
+ * @param {string} request.name
148
+ * Required. The resource name of the API key to be retrieved.
149
+ * @param {object} [options]
150
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
151
+ * @returns {Promise} - The promise which resolves to an array.
152
+ * The first element of the array is an object representing [GetKeyStringResponse]{@link google.api.apikeys.v2.GetKeyStringResponse}.
153
+ * Please see the
154
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
155
+ * for more details and examples.
156
+ * @example <caption>include:samples/generated/v2/api_keys.get_key_string.js</caption>
157
+ * region_tag:apikeys_v2_generated_ApiKeys_GetKeyString_async
158
+ */
159
+ getKeyString(request?: protos.google.api.apikeys.v2.IGetKeyStringRequest, options?: CallOptions): Promise<[
160
+ protos.google.api.apikeys.v2.IGetKeyStringResponse,
161
+ protos.google.api.apikeys.v2.IGetKeyStringRequest | undefined,
162
+ {} | undefined
163
+ ]>;
164
+ getKeyString(request: protos.google.api.apikeys.v2.IGetKeyStringRequest, options: CallOptions, callback: Callback<protos.google.api.apikeys.v2.IGetKeyStringResponse, protos.google.api.apikeys.v2.IGetKeyStringRequest | null | undefined, {} | null | undefined>): void;
165
+ getKeyString(request: protos.google.api.apikeys.v2.IGetKeyStringRequest, callback: Callback<protos.google.api.apikeys.v2.IGetKeyStringResponse, protos.google.api.apikeys.v2.IGetKeyStringRequest | null | undefined, {} | null | undefined>): void;
166
+ /**
167
+ * Find the parent project and resource name of the API
168
+ * key that matches the key string in the request. If the API key has been
169
+ * purged, resource name will not be set.
170
+ * The service account must have the `apikeys.keys.lookup` permission
171
+ * on the parent project.
172
+ *
173
+ * @param {Object} request
174
+ * The request object that will be sent.
175
+ * @param {string} request.keyString
176
+ * Required. Finds the project that owns the key string value.
177
+ * @param {object} [options]
178
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
179
+ * @returns {Promise} - The promise which resolves to an array.
180
+ * The first element of the array is an object representing [LookupKeyResponse]{@link google.api.apikeys.v2.LookupKeyResponse}.
181
+ * Please see the
182
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
183
+ * for more details and examples.
184
+ * @example <caption>include:samples/generated/v2/api_keys.lookup_key.js</caption>
185
+ * region_tag:apikeys_v2_generated_ApiKeys_LookupKey_async
186
+ */
187
+ lookupKey(request?: protos.google.api.apikeys.v2.ILookupKeyRequest, options?: CallOptions): Promise<[
188
+ protos.google.api.apikeys.v2.ILookupKeyResponse,
189
+ protos.google.api.apikeys.v2.ILookupKeyRequest | undefined,
190
+ {} | undefined
191
+ ]>;
192
+ lookupKey(request: protos.google.api.apikeys.v2.ILookupKeyRequest, options: CallOptions, callback: Callback<protos.google.api.apikeys.v2.ILookupKeyResponse, protos.google.api.apikeys.v2.ILookupKeyRequest | null | undefined, {} | null | undefined>): void;
193
+ lookupKey(request: protos.google.api.apikeys.v2.ILookupKeyRequest, callback: Callback<protos.google.api.apikeys.v2.ILookupKeyResponse, protos.google.api.apikeys.v2.ILookupKeyRequest | null | undefined, {} | null | undefined>): void;
194
+ /**
195
+ * Creates a new API key.
196
+ *
197
+ * NOTE: Key is a global resource; hence the only supported value for
198
+ * location is `global`.
199
+ *
200
+ * @param {Object} request
201
+ * The request object that will be sent.
202
+ * @param {string} request.parent
203
+ * Required. The project in which the API key is created.
204
+ * @param {google.api.apikeys.v2.Key} request.key
205
+ * Required. The API key fields to set at creation time.
206
+ * You can configure only the `display_name`, `restrictions`, and
207
+ * `annotations` fields.
208
+ * @param {string} request.keyId
209
+ * User specified key id (optional). If specified, it will become the final
210
+ * component of the key resource name.
211
+ *
212
+ * The id must be unique within the project, must conform with RFC-1034,
213
+ * is restricted to lower-cased letters, and has a maximum length of 63
214
+ * characters. In another word, the id must match the regular
215
+ * expression: `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
216
+ *
217
+ * The id must NOT be a UUID-like string.
218
+ * @param {object} [options]
219
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
220
+ * @returns {Promise} - The promise which resolves to an array.
221
+ * The first element of the array is an object representing
222
+ * a long running operation. Its `promise()` method returns a promise
223
+ * you can `await` for.
224
+ * Please see the
225
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
226
+ * for more details and examples.
227
+ * @example <caption>include:samples/generated/v2/api_keys.create_key.js</caption>
228
+ * region_tag:apikeys_v2_generated_ApiKeys_CreateKey_async
229
+ */
230
+ createKey(request?: protos.google.api.apikeys.v2.ICreateKeyRequest, options?: CallOptions): Promise<[
231
+ LROperation<protos.google.api.apikeys.v2.IKey, protos.google.protobuf.IEmpty>,
232
+ protos.google.longrunning.IOperation | undefined,
233
+ {} | undefined
234
+ ]>;
235
+ createKey(request: protos.google.api.apikeys.v2.ICreateKeyRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.apikeys.v2.IKey, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
236
+ createKey(request: protos.google.api.apikeys.v2.ICreateKeyRequest, callback: Callback<LROperation<protos.google.api.apikeys.v2.IKey, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
237
+ /**
238
+ * Check the status of the long running operation returned by `createKey()`.
239
+ * @param {String} name
240
+ * The operation name that will be passed.
241
+ * @returns {Promise} - The promise which resolves to an object.
242
+ * The decoded operation object has result and metadata field to get information from.
243
+ * Please see the
244
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
245
+ * for more details and examples.
246
+ * @example <caption>include:samples/generated/v2/api_keys.create_key.js</caption>
247
+ * region_tag:apikeys_v2_generated_ApiKeys_CreateKey_async
248
+ */
249
+ checkCreateKeyProgress(name: string): Promise<LROperation<protos.google.api.apikeys.v2.Key, protos.google.protobuf.Empty>>;
250
+ /**
251
+ * Patches the modifiable fields of an API key.
252
+ * The key string of the API key isn't included in the response.
253
+ *
254
+ * NOTE: Key is a global resource; hence the only supported value for
255
+ * location is `global`.
256
+ *
257
+ * @param {Object} request
258
+ * The request object that will be sent.
259
+ * @param {google.api.apikeys.v2.Key} request.key
260
+ * Required. Set the `name` field to the resource name of the API key to be
261
+ * updated. You can update only the `display_name`, `restrictions`, and
262
+ * `annotations` fields.
263
+ * @param {google.protobuf.FieldMask} request.updateMask
264
+ * The field mask specifies which fields to be updated as part of this
265
+ * request. All other fields are ignored.
266
+ * Mutable fields are: `display_name`, `restrictions`, and `annotations`.
267
+ * If an update mask is not provided, the service treats it as an implied mask
268
+ * equivalent to all allowed fields that are set on the wire. If the field
269
+ * mask has a special value "*", the service treats it equivalent to replace
270
+ * all allowed mutable fields.
271
+ * @param {object} [options]
272
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
273
+ * @returns {Promise} - The promise which resolves to an array.
274
+ * The first element of the array is an object representing
275
+ * a long running operation. Its `promise()` method returns a promise
276
+ * you can `await` for.
277
+ * Please see the
278
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
279
+ * for more details and examples.
280
+ * @example <caption>include:samples/generated/v2/api_keys.update_key.js</caption>
281
+ * region_tag:apikeys_v2_generated_ApiKeys_UpdateKey_async
282
+ */
283
+ updateKey(request?: protos.google.api.apikeys.v2.IUpdateKeyRequest, options?: CallOptions): Promise<[
284
+ LROperation<protos.google.api.apikeys.v2.IKey, protos.google.protobuf.IEmpty>,
285
+ protos.google.longrunning.IOperation | undefined,
286
+ {} | undefined
287
+ ]>;
288
+ updateKey(request: protos.google.api.apikeys.v2.IUpdateKeyRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.apikeys.v2.IKey, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
289
+ updateKey(request: protos.google.api.apikeys.v2.IUpdateKeyRequest, callback: Callback<LROperation<protos.google.api.apikeys.v2.IKey, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
290
+ /**
291
+ * Check the status of the long running operation returned by `updateKey()`.
292
+ * @param {String} name
293
+ * The operation name that will be passed.
294
+ * @returns {Promise} - The promise which resolves to an object.
295
+ * The decoded operation object has result and metadata field to get information from.
296
+ * Please see the
297
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
298
+ * for more details and examples.
299
+ * @example <caption>include:samples/generated/v2/api_keys.update_key.js</caption>
300
+ * region_tag:apikeys_v2_generated_ApiKeys_UpdateKey_async
301
+ */
302
+ checkUpdateKeyProgress(name: string): Promise<LROperation<protos.google.api.apikeys.v2.Key, protos.google.protobuf.Empty>>;
303
+ /**
304
+ * Deletes an API key. Deleted key can be retrieved within 30 days of
305
+ * deletion. Afterward, key will be purged from the project.
306
+ *
307
+ * NOTE: Key is a global resource; hence the only supported value for
308
+ * location is `global`.
309
+ *
310
+ * @param {Object} request
311
+ * The request object that will be sent.
312
+ * @param {string} request.name
313
+ * Required. The resource name of the API key to be deleted.
314
+ * @param {string} [request.etag]
315
+ * Optional. The etag known to the client for the expected state of the key.
316
+ * This is to be used for optimistic concurrency.
317
+ * @param {object} [options]
318
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
319
+ * @returns {Promise} - The promise which resolves to an array.
320
+ * The first element of the array is an object representing
321
+ * a long running operation. Its `promise()` method returns a promise
322
+ * you can `await` for.
323
+ * Please see the
324
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
325
+ * for more details and examples.
326
+ * @example <caption>include:samples/generated/v2/api_keys.delete_key.js</caption>
327
+ * region_tag:apikeys_v2_generated_ApiKeys_DeleteKey_async
328
+ */
329
+ deleteKey(request?: protos.google.api.apikeys.v2.IDeleteKeyRequest, options?: CallOptions): Promise<[
330
+ LROperation<protos.google.api.apikeys.v2.IKey, protos.google.protobuf.IEmpty>,
331
+ protos.google.longrunning.IOperation | undefined,
332
+ {} | undefined
333
+ ]>;
334
+ deleteKey(request: protos.google.api.apikeys.v2.IDeleteKeyRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.apikeys.v2.IKey, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
335
+ deleteKey(request: protos.google.api.apikeys.v2.IDeleteKeyRequest, callback: Callback<LROperation<protos.google.api.apikeys.v2.IKey, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
336
+ /**
337
+ * Check the status of the long running operation returned by `deleteKey()`.
338
+ * @param {String} name
339
+ * The operation name that will be passed.
340
+ * @returns {Promise} - The promise which resolves to an object.
341
+ * The decoded operation object has result and metadata field to get information from.
342
+ * Please see the
343
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
344
+ * for more details and examples.
345
+ * @example <caption>include:samples/generated/v2/api_keys.delete_key.js</caption>
346
+ * region_tag:apikeys_v2_generated_ApiKeys_DeleteKey_async
347
+ */
348
+ checkDeleteKeyProgress(name: string): Promise<LROperation<protos.google.api.apikeys.v2.Key, protos.google.protobuf.Empty>>;
349
+ /**
350
+ * Undeletes an API key which was deleted within 30 days.
351
+ *
352
+ * NOTE: Key is a global resource; hence the only supported value for
353
+ * location is `global`.
354
+ *
355
+ * @param {Object} request
356
+ * The request object that will be sent.
357
+ * @param {string} request.name
358
+ * Required. The resource name of the API key to be undeleted.
359
+ * @param {object} [options]
360
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
361
+ * @returns {Promise} - The promise which resolves to an array.
362
+ * The first element of the array is an object representing
363
+ * a long running operation. Its `promise()` method returns a promise
364
+ * you can `await` for.
365
+ * Please see the
366
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
367
+ * for more details and examples.
368
+ * @example <caption>include:samples/generated/v2/api_keys.undelete_key.js</caption>
369
+ * region_tag:apikeys_v2_generated_ApiKeys_UndeleteKey_async
370
+ */
371
+ undeleteKey(request?: protos.google.api.apikeys.v2.IUndeleteKeyRequest, options?: CallOptions): Promise<[
372
+ LROperation<protos.google.api.apikeys.v2.IKey, protos.google.protobuf.IEmpty>,
373
+ protos.google.longrunning.IOperation | undefined,
374
+ {} | undefined
375
+ ]>;
376
+ undeleteKey(request: protos.google.api.apikeys.v2.IUndeleteKeyRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.apikeys.v2.IKey, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
377
+ undeleteKey(request: protos.google.api.apikeys.v2.IUndeleteKeyRequest, callback: Callback<LROperation<protos.google.api.apikeys.v2.IKey, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
378
+ /**
379
+ * Check the status of the long running operation returned by `undeleteKey()`.
380
+ * @param {String} name
381
+ * The operation name that will be passed.
382
+ * @returns {Promise} - The promise which resolves to an object.
383
+ * The decoded operation object has result and metadata field to get information from.
384
+ * Please see the
385
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
386
+ * for more details and examples.
387
+ * @example <caption>include:samples/generated/v2/api_keys.undelete_key.js</caption>
388
+ * region_tag:apikeys_v2_generated_ApiKeys_UndeleteKey_async
389
+ */
390
+ checkUndeleteKeyProgress(name: string): Promise<LROperation<protos.google.api.apikeys.v2.Key, protos.google.protobuf.Empty>>;
391
+ /**
392
+ * Lists the API keys owned by a project. The key string of the API key
393
+ * isn't included in the response.
394
+ *
395
+ * NOTE: Key is a global resource; hence the only supported value for
396
+ * location is `global`.
397
+ *
398
+ * @param {Object} request
399
+ * The request object that will be sent.
400
+ * @param {string} request.parent
401
+ * Required. Lists all API keys associated with this project.
402
+ * @param {number} [request.pageSize]
403
+ * Optional. Specifies the maximum number of results to be returned at a time.
404
+ * @param {string} [request.pageToken]
405
+ * Optional. Requests a specific page of results.
406
+ * @param {boolean} [request.showDeleted]
407
+ * Optional. Indicate that keys deleted in the past 30 days should also be
408
+ * returned.
409
+ * @param {object} [options]
410
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
411
+ * @returns {Promise} - The promise which resolves to an array.
412
+ * The first element of the array is Array of [Key]{@link google.api.apikeys.v2.Key}.
413
+ * The client library will perform auto-pagination by default: it will call the API as many
414
+ * times as needed and will merge results from all the pages into this array.
415
+ * Note that it can affect your quota.
416
+ * We recommend using `listKeysAsync()`
417
+ * method described below for async iteration which you can stop as needed.
418
+ * Please see the
419
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
420
+ * for more details and examples.
421
+ */
422
+ listKeys(request?: protos.google.api.apikeys.v2.IListKeysRequest, options?: CallOptions): Promise<[
423
+ protos.google.api.apikeys.v2.IKey[],
424
+ protos.google.api.apikeys.v2.IListKeysRequest | null,
425
+ protos.google.api.apikeys.v2.IListKeysResponse
426
+ ]>;
427
+ listKeys(request: protos.google.api.apikeys.v2.IListKeysRequest, options: CallOptions, callback: PaginationCallback<protos.google.api.apikeys.v2.IListKeysRequest, protos.google.api.apikeys.v2.IListKeysResponse | null | undefined, protos.google.api.apikeys.v2.IKey>): void;
428
+ listKeys(request: protos.google.api.apikeys.v2.IListKeysRequest, callback: PaginationCallback<protos.google.api.apikeys.v2.IListKeysRequest, protos.google.api.apikeys.v2.IListKeysResponse | null | undefined, protos.google.api.apikeys.v2.IKey>): void;
429
+ /**
430
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
431
+ * @param {Object} request
432
+ * The request object that will be sent.
433
+ * @param {string} request.parent
434
+ * Required. Lists all API keys associated with this project.
435
+ * @param {number} [request.pageSize]
436
+ * Optional. Specifies the maximum number of results to be returned at a time.
437
+ * @param {string} [request.pageToken]
438
+ * Optional. Requests a specific page of results.
439
+ * @param {boolean} [request.showDeleted]
440
+ * Optional. Indicate that keys deleted in the past 30 days should also be
441
+ * returned.
442
+ * @param {object} [options]
443
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
444
+ * @returns {Stream}
445
+ * An object stream which emits an object representing [Key]{@link google.api.apikeys.v2.Key} on 'data' event.
446
+ * The client library will perform auto-pagination by default: it will call the API as many
447
+ * times as needed. Note that it can affect your quota.
448
+ * We recommend using `listKeysAsync()`
449
+ * method described below for async iteration which you can stop as needed.
450
+ * Please see the
451
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
452
+ * for more details and examples.
453
+ */
454
+ listKeysStream(request?: protos.google.api.apikeys.v2.IListKeysRequest, options?: CallOptions): Transform;
455
+ /**
456
+ * Equivalent to `listKeys`, but returns an iterable object.
457
+ *
458
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
459
+ * @param {Object} request
460
+ * The request object that will be sent.
461
+ * @param {string} request.parent
462
+ * Required. Lists all API keys associated with this project.
463
+ * @param {number} [request.pageSize]
464
+ * Optional. Specifies the maximum number of results to be returned at a time.
465
+ * @param {string} [request.pageToken]
466
+ * Optional. Requests a specific page of results.
467
+ * @param {boolean} [request.showDeleted]
468
+ * Optional. Indicate that keys deleted in the past 30 days should also be
469
+ * returned.
470
+ * @param {object} [options]
471
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
472
+ * @returns {Object}
473
+ * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
474
+ * When you iterate the returned iterable, each element will be an object representing
475
+ * [Key]{@link google.api.apikeys.v2.Key}. The API will be called under the hood as needed, once per the page,
476
+ * so you can stop the iteration when you don't need more results.
477
+ * Please see the
478
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
479
+ * for more details and examples.
480
+ * @example <caption>include:samples/generated/v2/api_keys.list_keys.js</caption>
481
+ * region_tag:apikeys_v2_generated_ApiKeys_ListKeys_async
482
+ */
483
+ listKeysAsync(request?: protos.google.api.apikeys.v2.IListKeysRequest, options?: CallOptions): AsyncIterable<protos.google.api.apikeys.v2.IKey>;
484
+ /**
485
+ * Gets the latest state of a long-running operation. Clients can use this
486
+ * method to poll the operation result at intervals as recommended by the API
487
+ * service.
488
+ *
489
+ * @param {Object} request - The request object that will be sent.
490
+ * @param {string} request.name - The name of the operation resource.
491
+ * @param {Object=} options
492
+ * Optional parameters. You can override the default settings for this call,
493
+ * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
494
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
495
+ * details.
496
+ * @param {function(?Error, ?Object)=} callback
497
+ * The function which will be called with the result of the API call.
498
+ *
499
+ * The second parameter to the callback is an object representing
500
+ * [google.longrunning.Operation]{@link
501
+ * external:"google.longrunning.Operation"}.
502
+ * @return {Promise} - The promise which resolves to an array.
503
+ * The first element of the array is an object representing
504
+ * [google.longrunning.Operation]{@link
505
+ * external:"google.longrunning.Operation"}. The promise has a method named
506
+ * "cancel" which cancels the ongoing API call.
507
+ *
508
+ * @example
509
+ * ```
510
+ * const client = longrunning.operationsClient();
511
+ * const name = '';
512
+ * const [response] = await client.getOperation({name});
513
+ * // doThingsWith(response)
514
+ * ```
515
+ */
516
+ getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;
517
+ /**
518
+ * Lists operations that match the specified filter in the request. If the
519
+ * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
520
+ *
521
+ * For-await-of syntax is used with the iterable to recursively get response element on-demand.
522
+ *
523
+ * @param {Object} request - The request object that will be sent.
524
+ * @param {string} request.name - The name of the operation collection.
525
+ * @param {string} request.filter - The standard list filter.
526
+ * @param {number=} request.pageSize -
527
+ * The maximum number of resources contained in the underlying API
528
+ * response. If page streaming is performed per-resource, this
529
+ * parameter does not affect the return value. If page streaming is
530
+ * performed per-page, this determines the maximum number of
531
+ * resources in a page.
532
+ * @param {Object=} options
533
+ * Optional parameters. You can override the default settings for this call,
534
+ * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
535
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
536
+ * details.
537
+ * @returns {Object}
538
+ * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
539
+ *
540
+ * @example
541
+ * ```
542
+ * const client = longrunning.operationsClient();
543
+ * for await (const response of client.listOperationsAsync(request));
544
+ * // doThingsWith(response)
545
+ * ```
546
+ */
547
+ listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;
548
+ /**
549
+ * Starts asynchronous cancellation on a long-running operation. The server
550
+ * makes a best effort to cancel the operation, but success is not
551
+ * guaranteed. If the server doesn't support this method, it returns
552
+ * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
553
+ * {@link Operations.GetOperation} or
554
+ * other methods to check whether the cancellation succeeded or whether the
555
+ * operation completed despite cancellation. On successful cancellation,
556
+ * the operation is not deleted; instead, it becomes an operation with
557
+ * an {@link Operation.error} value with a {@link google.rpc.Status.code} of
558
+ * 1, corresponding to `Code.CANCELLED`.
559
+ *
560
+ * @param {Object} request - The request object that will be sent.
561
+ * @param {string} request.name - The name of the operation resource to be cancelled.
562
+ * @param {Object=} options
563
+ * Optional parameters. You can override the default settings for this call,
564
+ * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
565
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
566
+ * details.
567
+ * @param {function(?Error)=} callback
568
+ * The function which will be called with the result of the API call.
569
+ * @return {Promise} - The promise which resolves when API call finishes.
570
+ * The promise has a method named "cancel" which cancels the ongoing API
571
+ * call.
572
+ *
573
+ * @example
574
+ * ```
575
+ * const client = longrunning.operationsClient();
576
+ * await client.cancelOperation({name: ''});
577
+ * ```
578
+ */
579
+ cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;
580
+ /**
581
+ * Deletes a long-running operation. This method indicates that the client is
582
+ * no longer interested in the operation result. It does not cancel the
583
+ * operation. If the server doesn't support this method, it returns
584
+ * `google.rpc.Code.UNIMPLEMENTED`.
585
+ *
586
+ * @param {Object} request - The request object that will be sent.
587
+ * @param {string} request.name - The name of the operation resource to be deleted.
588
+ * @param {Object=} options
589
+ * Optional parameters. You can override the default settings for this call,
590
+ * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
591
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
592
+ * details.
593
+ * @param {function(?Error)=} callback
594
+ * The function which will be called with the result of the API call.
595
+ * @return {Promise} - The promise which resolves when API call finishes.
596
+ * The promise has a method named "cancel" which cancels the ongoing API
597
+ * call.
598
+ *
599
+ * @example
600
+ * ```
601
+ * const client = longrunning.operationsClient();
602
+ * await client.deleteOperation({name: ''});
603
+ * ```
604
+ */
605
+ deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;
606
+ /**
607
+ * Return a fully-qualified key resource name string.
608
+ *
609
+ * @param {string} project
610
+ * @param {string} location
611
+ * @param {string} key
612
+ * @returns {string} Resource name string.
613
+ */
614
+ keyPath(project: string, location: string, key: string): string;
615
+ /**
616
+ * Parse the project from Key resource.
617
+ *
618
+ * @param {string} keyName
619
+ * A fully-qualified path representing Key resource.
620
+ * @returns {string} A string representing the project.
621
+ */
622
+ matchProjectFromKeyName(keyName: string): string | number;
623
+ /**
624
+ * Parse the location from Key resource.
625
+ *
626
+ * @param {string} keyName
627
+ * A fully-qualified path representing Key resource.
628
+ * @returns {string} A string representing the location.
629
+ */
630
+ matchLocationFromKeyName(keyName: string): string | number;
631
+ /**
632
+ * Parse the key from Key resource.
633
+ *
634
+ * @param {string} keyName
635
+ * A fully-qualified path representing Key resource.
636
+ * @returns {string} A string representing the key.
637
+ */
638
+ matchKeyFromKeyName(keyName: string): string | number;
639
+ /**
640
+ * Return a fully-qualified location resource name string.
641
+ *
642
+ * @param {string} project
643
+ * @param {string} location
644
+ * @returns {string} Resource name string.
645
+ */
646
+ locationPath(project: string, location: string): string;
647
+ /**
648
+ * Parse the project from Location resource.
649
+ *
650
+ * @param {string} locationName
651
+ * A fully-qualified path representing Location resource.
652
+ * @returns {string} A string representing the project.
653
+ */
654
+ matchProjectFromLocationName(locationName: string): string | number;
655
+ /**
656
+ * Parse the location from Location resource.
657
+ *
658
+ * @param {string} locationName
659
+ * A fully-qualified path representing Location resource.
660
+ * @returns {string} A string representing the location.
661
+ */
662
+ matchLocationFromLocationName(locationName: string): string | number;
663
+ /**
664
+ * Return a fully-qualified project resource name string.
665
+ *
666
+ * @param {string} project
667
+ * @returns {string} Resource name string.
668
+ */
669
+ projectPath(project: string): string;
670
+ /**
671
+ * Parse the project from Project resource.
672
+ *
673
+ * @param {string} projectName
674
+ * A fully-qualified path representing Project resource.
675
+ * @returns {string} A string representing the project.
676
+ */
677
+ matchProjectFromProjectName(projectName: string): string | number;
678
+ /**
679
+ * Terminate the gRPC channel and close the client.
680
+ *
681
+ * The client will no longer be usable and all future behavior is undefined.
682
+ * @returns {Promise} A promise that resolves when the client is closed.
683
+ */
684
+ close(): Promise<void>;
685
+ }