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

Commit bb6bd48

Browse files
fix!: remove LRO mixin methods where not needed (#443)
* test: use fully qualified request type name in tests PiperOrigin-RevId: 475685359 Source-Link: googleapis/googleapis@7a12973 Source-Link: https://github.com/googleapis/googleapis-gen/commit/370c729e2ba062a167449c27882ba5f379c5c34d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzcwYzcyOWUyYmEwNjJhMTY3NDQ5YzI3ODgyYmE1ZjM3OWM1YzM0ZCJ9 * 🦉 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 c5fd3aa commit bb6bd48

14 files changed

Lines changed: 764 additions & 2568 deletions

src/v4beta1/company_service_client.ts

Lines changed: 0 additions & 203 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import type {
2323
CallOptions,
2424
Descriptors,
2525
ClientOptions,
26-
GrpcClientOptions,
2726
PaginationCallback,
2827
GaxCall,
2928
} from 'google-gax';
@@ -61,7 +60,6 @@ export class CompanyServiceClient {
6160
warn: (code: string, message: string, warnType?: string) => void;
6261
innerApiCalls: {[name: string]: Function};
6362
pathTemplates: {[name: string]: gax.PathTemplate};
64-
operationsClient: gax.OperationsClient;
6563
companyServiceStub?: Promise<{[name: string]: Function}>;
6664

6765
/**
@@ -208,29 +206,6 @@ export class CompanyServiceClient {
208206
),
209207
};
210208

211-
const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
212-
// This API contains "long-running operations", which return a
213-
// an Operation object that allows for tracking of the operation,
214-
// rather than holding a request open.
215-
const lroOptions: GrpcClientOptions = {
216-
auth: this.auth,
217-
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
218-
};
219-
if (opts.fallback === 'rest') {
220-
lroOptions.protoJson = protoFilesRoot;
221-
lroOptions.httpRules = [
222-
{
223-
selector: 'google.longrunning.Operations.GetOperation',
224-
get: '/v4beta1/{name=projects/*/operations/*}',
225-
},
226-
];
227-
}
228-
this.operationsClient = this._gaxModule
229-
.lro(lroOptions)
230-
.operationsClient(opts);
231-
232-
this.descriptors.longrunning = {};
233-
234209
// Put together the default options sent with requests.
235210
this._defaults = this._gaxGrpc.constructSettings(
236211
'google.cloud.talent.v4beta1.CompanyService',
@@ -991,183 +966,6 @@ export class CompanyServiceClient {
991966
callSettings
992967
) as AsyncIterable<protos.google.cloud.talent.v4beta1.ICompany>;
993968
}
994-
/**
995-
* Gets the latest state of a long-running operation. Clients can use this
996-
* method to poll the operation result at intervals as recommended by the API
997-
* service.
998-
*
999-
* @param {Object} request - The request object that will be sent.
1000-
* @param {string} request.name - The name of the operation resource.
1001-
* @param {Object=} options
1002-
* Optional parameters. You can override the default settings for this call,
1003-
* e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
1004-
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
1005-
* details.
1006-
* @param {function(?Error, ?Object)=} callback
1007-
* The function which will be called with the result of the API call.
1008-
*
1009-
* The second parameter to the callback is an object representing
1010-
* [google.longrunning.Operation]{@link
1011-
* external:"google.longrunning.Operation"}.
1012-
* @return {Promise} - The promise which resolves to an array.
1013-
* The first element of the array is an object representing
1014-
* [google.longrunning.Operation]{@link
1015-
* external:"google.longrunning.Operation"}. The promise has a method named
1016-
* "cancel" which cancels the ongoing API call.
1017-
*
1018-
* @example
1019-
* ```
1020-
* const client = longrunning.operationsClient();
1021-
* const name = '';
1022-
* const [response] = await client.getOperation({name});
1023-
* // doThingsWith(response)
1024-
* ```
1025-
*/
1026-
getOperation(
1027-
request: protos.google.longrunning.GetOperationRequest,
1028-
options?:
1029-
| gax.CallOptions
1030-
| Callback<
1031-
protos.google.longrunning.Operation,
1032-
protos.google.longrunning.GetOperationRequest,
1033-
{} | null | undefined
1034-
>,
1035-
callback?: Callback<
1036-
protos.google.longrunning.Operation,
1037-
protos.google.longrunning.GetOperationRequest,
1038-
{} | null | undefined
1039-
>
1040-
): Promise<[protos.google.longrunning.Operation]> {
1041-
return this.operationsClient.getOperation(request, options, callback);
1042-
}
1043-
/**
1044-
* Lists operations that match the specified filter in the request. If the
1045-
* server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
1046-
*
1047-
* For-await-of syntax is used with the iterable to recursively get response element on-demand.
1048-
*
1049-
* @param {Object} request - The request object that will be sent.
1050-
* @param {string} request.name - The name of the operation collection.
1051-
* @param {string} request.filter - The standard list filter.
1052-
* @param {number=} request.pageSize -
1053-
* The maximum number of resources contained in the underlying API
1054-
* response. If page streaming is performed per-resource, this
1055-
* parameter does not affect the return value. If page streaming is
1056-
* performed per-page, this determines the maximum number of
1057-
* resources in a page.
1058-
* @param {Object=} options
1059-
* Optional parameters. You can override the default settings for this call,
1060-
* e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
1061-
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
1062-
* details.
1063-
* @returns {Object}
1064-
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
1065-
*
1066-
* @example
1067-
* ```
1068-
* const client = longrunning.operationsClient();
1069-
* for await (const response of client.listOperationsAsync(request));
1070-
* // doThingsWith(response)
1071-
* ```
1072-
*/
1073-
listOperationsAsync(
1074-
request: protos.google.longrunning.ListOperationsRequest,
1075-
options?: gax.CallOptions
1076-
): AsyncIterable<protos.google.longrunning.ListOperationsResponse> {
1077-
return this.operationsClient.listOperationsAsync(request, options);
1078-
}
1079-
/**
1080-
* Starts asynchronous cancellation on a long-running operation. The server
1081-
* makes a best effort to cancel the operation, but success is not
1082-
* guaranteed. If the server doesn't support this method, it returns
1083-
* `google.rpc.Code.UNIMPLEMENTED`. Clients can use
1084-
* {@link Operations.GetOperation} or
1085-
* other methods to check whether the cancellation succeeded or whether the
1086-
* operation completed despite cancellation. On successful cancellation,
1087-
* the operation is not deleted; instead, it becomes an operation with
1088-
* an {@link Operation.error} value with a {@link google.rpc.Status.code} of
1089-
* 1, corresponding to `Code.CANCELLED`.
1090-
*
1091-
* @param {Object} request - The request object that will be sent.
1092-
* @param {string} request.name - The name of the operation resource to be cancelled.
1093-
* @param {Object=} options
1094-
* Optional parameters. You can override the default settings for this call,
1095-
* e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
1096-
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
1097-
* details.
1098-
* @param {function(?Error)=} callback
1099-
* The function which will be called with the result of the API call.
1100-
* @return {Promise} - The promise which resolves when API call finishes.
1101-
* The promise has a method named "cancel" which cancels the ongoing API
1102-
* call.
1103-
*
1104-
* @example
1105-
* ```
1106-
* const client = longrunning.operationsClient();
1107-
* await client.cancelOperation({name: ''});
1108-
* ```
1109-
*/
1110-
cancelOperation(
1111-
request: protos.google.longrunning.CancelOperationRequest,
1112-
options?:
1113-
| gax.CallOptions
1114-
| Callback<
1115-
protos.google.protobuf.Empty,
1116-
protos.google.longrunning.CancelOperationRequest,
1117-
{} | undefined | null
1118-
>,
1119-
callback?: Callback<
1120-
protos.google.longrunning.CancelOperationRequest,
1121-
protos.google.protobuf.Empty,
1122-
{} | undefined | null
1123-
>
1124-
): Promise<protos.google.protobuf.Empty> {
1125-
return this.operationsClient.cancelOperation(request, options, callback);
1126-
}
1127-
1128-
/**
1129-
* Deletes a long-running operation. This method indicates that the client is
1130-
* no longer interested in the operation result. It does not cancel the
1131-
* operation. If the server doesn't support this method, it returns
1132-
* `google.rpc.Code.UNIMPLEMENTED`.
1133-
*
1134-
* @param {Object} request - The request object that will be sent.
1135-
* @param {string} request.name - The name of the operation resource to be deleted.
1136-
* @param {Object=} options
1137-
* Optional parameters. You can override the default settings for this call,
1138-
* e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
1139-
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
1140-
* details.
1141-
* @param {function(?Error)=} callback
1142-
* The function which will be called with the result of the API call.
1143-
* @return {Promise} - The promise which resolves when API call finishes.
1144-
* The promise has a method named "cancel" which cancels the ongoing API
1145-
* call.
1146-
*
1147-
* @example
1148-
* ```
1149-
* const client = longrunning.operationsClient();
1150-
* await client.deleteOperation({name: ''});
1151-
* ```
1152-
*/
1153-
deleteOperation(
1154-
request: protos.google.longrunning.DeleteOperationRequest,
1155-
options?:
1156-
| gax.CallOptions
1157-
| Callback<
1158-
protos.google.protobuf.Empty,
1159-
protos.google.longrunning.DeleteOperationRequest,
1160-
{} | null | undefined
1161-
>,
1162-
callback?: Callback<
1163-
protos.google.protobuf.Empty,
1164-
protos.google.longrunning.DeleteOperationRequest,
1165-
{} | null | undefined
1166-
>
1167-
): Promise<protos.google.protobuf.Empty> {
1168-
return this.operationsClient.deleteOperation(request, options, callback);
1169-
}
1170-
1171969
// --------------------
1172970
// -- Path templates --
1173971
// --------------------
@@ -1429,7 +1227,6 @@ export class CompanyServiceClient {
14291227
return this.companyServiceStub.then(stub => {
14301228
this._terminated = true;
14311229
stub.close();
1432-
this.operationsClient.close();
14331230
});
14341231
}
14351232
return Promise.resolve();

0 commit comments

Comments
 (0)