Skip to content

Commit d45855b

Browse files
build: ensure there's only a single service config file for the Spanner Admin Instances API (#2309)
* build: ensure there's only a single service config file for the Spanner Admin Instances API PiperOrigin-RevId: 763646865 Source-Link: googleapis/googleapis@0a4ce50 Source-Link: googleapis/googleapis-gen@88e6355 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODhlNjM1NTE5NTk0ZTFhMTU5YTFmODExZDE0OTU4YzU1Y2ZhOGE4NSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 610d1b9 commit d45855b

File tree

2 files changed

+592
-12
lines changed

2 files changed

+592
-12
lines changed

src/v1/instance_admin_client.ts

Lines changed: 277 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -282,31 +282,72 @@ export class InstanceAdminClient {
282282
lroOptions.protoJson = protoFilesRoot;
283283
lroOptions.httpRules = [
284284
{
285-
selector: 'google.longrunning.Operations.GetOperation',
286-
get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
285+
selector: 'google.longrunning.Operations.CancelOperation',
286+
post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',
287287
additional_bindings: [
288-
{get: '/v1/{name=projects/*/instances/*/operations/*}'},
288+
{post: '/v1/{name=projects/*/instances/*/operations/*}:cancel'},
289+
{
290+
post: '/v1/{name=projects/*/instances/*/backups/*/operations/*}:cancel',
291+
},
292+
{
293+
post: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}:cancel',
294+
},
295+
{
296+
post: '/v1/{name=projects/*/instanceConfigs/*/operations/*}:cancel',
297+
},
298+
{
299+
post: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}:cancel',
300+
},
289301
],
290302
},
291303
{
292-
selector: 'google.longrunning.Operations.ListOperations',
293-
get: '/v1/{name=projects/*/instances/*/databases/*/operations}',
304+
selector: 'google.longrunning.Operations.DeleteOperation',
305+
delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
294306
additional_bindings: [
295-
{get: '/v1/{name=projects/*/instances/*/operations}'},
307+
{delete: '/v1/{name=projects/*/instances/*/operations/*}'},
308+
{
309+
delete:
310+
'/v1/{name=projects/*/instances/*/backups/*/operations/*}',
311+
},
312+
{
313+
delete:
314+
'/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}',
315+
},
316+
{delete: '/v1/{name=projects/*/instanceConfigs/*/operations/*}'},
317+
{
318+
delete:
319+
'/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}',
320+
},
296321
],
297322
},
298323
{
299-
selector: 'google.longrunning.Operations.CancelOperation',
300-
post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',
324+
selector: 'google.longrunning.Operations.GetOperation',
325+
get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
301326
additional_bindings: [
302-
{post: '/v1/{name=projects/*/instances/*/operations/*}:cancel'},
327+
{get: '/v1/{name=projects/*/instances/*/operations/*}'},
328+
{get: '/v1/{name=projects/*/instances/*/backups/*/operations/*}'},
329+
{
330+
get: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}',
331+
},
332+
{get: '/v1/{name=projects/*/instanceConfigs/*/operations/*}'},
333+
{
334+
get: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}',
335+
},
303336
],
304337
},
305338
{
306-
selector: 'google.longrunning.Operations.DeleteOperation',
307-
delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
339+
selector: 'google.longrunning.Operations.ListOperations',
340+
get: '/v1/{name=projects/*/instances/*/databases/*/operations}',
308341
additional_bindings: [
309-
{delete: '/v1/{name=projects/*/instances/*/operations/*}'},
342+
{get: '/v1/{name=projects/*/instances/*/operations}'},
343+
{get: '/v1/{name=projects/*/instances/*/backups/*/operations}'},
344+
{
345+
get: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations}',
346+
},
347+
{get: '/v1/{name=projects/*/instanceConfigs/*/operations}'},
348+
{
349+
get: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations}',
350+
},
310351
],
311352
},
312353
];
@@ -4853,6 +4894,230 @@ export class InstanceAdminClient {
48534894
callSettings,
48544895
) as AsyncIterable<protos.google.longrunning.IOperation>;
48554896
}
4897+
/**
4898+
* Gets the latest state of a long-running operation. Clients can use this
4899+
* method to poll the operation result at intervals as recommended by the API
4900+
* service.
4901+
*
4902+
* @param {Object} request - The request object that will be sent.
4903+
* @param {string} request.name - The name of the operation resource.
4904+
* @param {Object=} options
4905+
* Optional parameters. You can override the default settings for this call,
4906+
* e.g, timeout, retries, paginations, etc. See {@link
4907+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
4908+
* for the details.
4909+
* @param {function(?Error, ?Object)=} callback
4910+
* The function which will be called with the result of the API call.
4911+
*
4912+
* The second parameter to the callback is an object representing
4913+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
4914+
* @return {Promise} - The promise which resolves to an array.
4915+
* The first element of the array is an object representing
4916+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
4917+
* The promise has a method named "cancel" which cancels the ongoing API call.
4918+
*
4919+
* @example
4920+
* ```
4921+
* const client = longrunning.operationsClient();
4922+
* const name = '';
4923+
* const [response] = await client.getOperation({name});
4924+
* // doThingsWith(response)
4925+
* ```
4926+
*/
4927+
getOperation(
4928+
request: protos.google.longrunning.GetOperationRequest,
4929+
optionsOrCallback?:
4930+
| gax.CallOptions
4931+
| Callback<
4932+
protos.google.longrunning.Operation,
4933+
protos.google.longrunning.GetOperationRequest,
4934+
{} | null | undefined
4935+
>,
4936+
callback?: Callback<
4937+
protos.google.longrunning.Operation,
4938+
protos.google.longrunning.GetOperationRequest,
4939+
{} | null | undefined
4940+
>,
4941+
): Promise<[protos.google.longrunning.Operation]> {
4942+
let options: gax.CallOptions;
4943+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
4944+
callback = optionsOrCallback;
4945+
options = {};
4946+
} else {
4947+
options = optionsOrCallback as gax.CallOptions;
4948+
}
4949+
options = options || {};
4950+
options.otherArgs = options.otherArgs || {};
4951+
options.otherArgs.headers = options.otherArgs.headers || {};
4952+
options.otherArgs.headers['x-goog-request-params'] =
4953+
this._gaxModule.routingHeader.fromParams({
4954+
name: request.name ?? '',
4955+
});
4956+
return this.operationsClient.getOperation(request, options, callback);
4957+
}
4958+
/**
4959+
* Lists operations that match the specified filter in the request. If the
4960+
* server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
4961+
*
4962+
* For-await-of syntax is used with the iterable to recursively get response element on-demand.
4963+
*
4964+
* @param {Object} request - The request object that will be sent.
4965+
* @param {string} request.name - The name of the operation collection.
4966+
* @param {string} request.filter - The standard list filter.
4967+
* @param {number=} request.pageSize -
4968+
* The maximum number of resources contained in the underlying API
4969+
* response. If page streaming is performed per-resource, this
4970+
* parameter does not affect the return value. If page streaming is
4971+
* performed per-page, this determines the maximum number of
4972+
* resources in a page.
4973+
* @param {Object=} options
4974+
* Optional parameters. You can override the default settings for this call,
4975+
* e.g, timeout, retries, paginations, etc. See {@link
4976+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
4977+
* details.
4978+
* @returns {Object}
4979+
* An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
4980+
*
4981+
* @example
4982+
* ```
4983+
* const client = longrunning.operationsClient();
4984+
* for await (const response of client.listOperationsAsync(request));
4985+
* // doThingsWith(response)
4986+
* ```
4987+
*/
4988+
listOperationsAsync(
4989+
request: protos.google.longrunning.ListOperationsRequest,
4990+
options?: gax.CallOptions,
4991+
): AsyncIterable<protos.google.longrunning.IOperation> {
4992+
options = options || {};
4993+
options.otherArgs = options.otherArgs || {};
4994+
options.otherArgs.headers = options.otherArgs.headers || {};
4995+
options.otherArgs.headers['x-goog-request-params'] =
4996+
this._gaxModule.routingHeader.fromParams({
4997+
name: request.name ?? '',
4998+
});
4999+
return this.operationsClient.listOperationsAsync(request, options);
5000+
}
5001+
/**
5002+
* Starts asynchronous cancellation on a long-running operation. The server
5003+
* makes a best effort to cancel the operation, but success is not
5004+
* guaranteed. If the server doesn't support this method, it returns
5005+
* `google.rpc.Code.UNIMPLEMENTED`. Clients can use
5006+
* {@link Operations.GetOperation} or
5007+
* other methods to check whether the cancellation succeeded or whether the
5008+
* operation completed despite cancellation. On successful cancellation,
5009+
* the operation is not deleted; instead, it becomes an operation with
5010+
* an {@link Operation.error} value with a {@link google.rpc.Status.code} of
5011+
* 1, corresponding to `Code.CANCELLED`.
5012+
*
5013+
* @param {Object} request - The request object that will be sent.
5014+
* @param {string} request.name - The name of the operation resource to be cancelled.
5015+
* @param {Object=} options
5016+
* Optional parameters. You can override the default settings for this call,
5017+
* e.g, timeout, retries, paginations, etc. See {@link
5018+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
5019+
* details.
5020+
* @param {function(?Error)=} callback
5021+
* The function which will be called with the result of the API call.
5022+
* @return {Promise} - The promise which resolves when API call finishes.
5023+
* The promise has a method named "cancel" which cancels the ongoing API
5024+
* call.
5025+
*
5026+
* @example
5027+
* ```
5028+
* const client = longrunning.operationsClient();
5029+
* await client.cancelOperation({name: ''});
5030+
* ```
5031+
*/
5032+
cancelOperation(
5033+
request: protos.google.longrunning.CancelOperationRequest,
5034+
optionsOrCallback?:
5035+
| gax.CallOptions
5036+
| Callback<
5037+
protos.google.longrunning.CancelOperationRequest,
5038+
protos.google.protobuf.Empty,
5039+
{} | undefined | null
5040+
>,
5041+
callback?: Callback<
5042+
protos.google.longrunning.CancelOperationRequest,
5043+
protos.google.protobuf.Empty,
5044+
{} | undefined | null
5045+
>,
5046+
): Promise<protos.google.protobuf.Empty> {
5047+
let options: gax.CallOptions;
5048+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
5049+
callback = optionsOrCallback;
5050+
options = {};
5051+
} else {
5052+
options = optionsOrCallback as gax.CallOptions;
5053+
}
5054+
options = options || {};
5055+
options.otherArgs = options.otherArgs || {};
5056+
options.otherArgs.headers = options.otherArgs.headers || {};
5057+
options.otherArgs.headers['x-goog-request-params'] =
5058+
this._gaxModule.routingHeader.fromParams({
5059+
name: request.name ?? '',
5060+
});
5061+
return this.operationsClient.cancelOperation(request, options, callback);
5062+
}
5063+
5064+
/**
5065+
* Deletes a long-running operation. This method indicates that the client is
5066+
* no longer interested in the operation result. It does not cancel the
5067+
* operation. If the server doesn't support this method, it returns
5068+
* `google.rpc.Code.UNIMPLEMENTED`.
5069+
*
5070+
* @param {Object} request - The request object that will be sent.
5071+
* @param {string} request.name - The name of the operation resource to be deleted.
5072+
* @param {Object=} options
5073+
* Optional parameters. You can override the default settings for this call,
5074+
* e.g, timeout, retries, paginations, etc. See {@link
5075+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
5076+
* for the details.
5077+
* @param {function(?Error)=} callback
5078+
* The function which will be called with the result of the API call.
5079+
* @return {Promise} - The promise which resolves when API call finishes.
5080+
* The promise has a method named "cancel" which cancels the ongoing API
5081+
* call.
5082+
*
5083+
* @example
5084+
* ```
5085+
* const client = longrunning.operationsClient();
5086+
* await client.deleteOperation({name: ''});
5087+
* ```
5088+
*/
5089+
deleteOperation(
5090+
request: protos.google.longrunning.DeleteOperationRequest,
5091+
optionsOrCallback?:
5092+
| gax.CallOptions
5093+
| Callback<
5094+
protos.google.protobuf.Empty,
5095+
protos.google.longrunning.DeleteOperationRequest,
5096+
{} | null | undefined
5097+
>,
5098+
callback?: Callback<
5099+
protos.google.protobuf.Empty,
5100+
protos.google.longrunning.DeleteOperationRequest,
5101+
{} | null | undefined
5102+
>,
5103+
): Promise<protos.google.protobuf.Empty> {
5104+
let options: gax.CallOptions;
5105+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
5106+
callback = optionsOrCallback;
5107+
options = {};
5108+
} else {
5109+
options = optionsOrCallback as gax.CallOptions;
5110+
}
5111+
options = options || {};
5112+
options.otherArgs = options.otherArgs || {};
5113+
options.otherArgs.headers = options.otherArgs.headers || {};
5114+
options.otherArgs.headers['x-goog-request-params'] =
5115+
this._gaxModule.routingHeader.fromParams({
5116+
name: request.name ?? '',
5117+
});
5118+
return this.operationsClient.deleteOperation(request, options, callback);
5119+
}
5120+
48565121
// --------------------
48575122
// -- Path templates --
48585123
// --------------------

0 commit comments

Comments
 (0)