Skip to content

Commit

Permalink
fix!: remove LRO mixin methods where not needed (#443)
Browse files Browse the repository at this point in the history
* test: use fully qualified request type name in tests

PiperOrigin-RevId: 475685359

Source-Link: googleapis/googleapis@7a12973

Source-Link: googleapis/googleapis-gen@370c729
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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Sep 22, 2022
1 parent 6a065a9 commit 2810a6f
Show file tree
Hide file tree
Showing 14 changed files with 764 additions and 2,568 deletions.
203 changes: 0 additions & 203 deletions packages/google-cloud-talent/src/v4beta1/company_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import type {
CallOptions,
Descriptors,
ClientOptions,
GrpcClientOptions,
PaginationCallback,
GaxCall,
} from 'google-gax';
Expand Down Expand Up @@ -61,7 +60,6 @@ export class CompanyServiceClient {
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: {[name: string]: Function};
pathTemplates: {[name: string]: gax.PathTemplate};
operationsClient: gax.OperationsClient;
companyServiceStub?: Promise<{[name: string]: Function}>;

/**
Expand Down Expand Up @@ -208,29 +206,6 @@ export class CompanyServiceClient {
),
};

const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
// This API contains "long-running operations", which return a
// an Operation object that allows for tracking of the operation,
// rather than holding a request open.
const lroOptions: GrpcClientOptions = {
auth: this.auth,
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
};
if (opts.fallback === 'rest') {
lroOptions.protoJson = protoFilesRoot;
lroOptions.httpRules = [
{
selector: 'google.longrunning.Operations.GetOperation',
get: '/v4beta1/{name=projects/*/operations/*}',
},
];
}
this.operationsClient = this._gaxModule
.lro(lroOptions)
.operationsClient(opts);

this.descriptors.longrunning = {};

// Put together the default options sent with requests.
this._defaults = this._gaxGrpc.constructSettings(
'google.cloud.talent.v4beta1.CompanyService',
Expand Down Expand Up @@ -991,183 +966,6 @@ export class CompanyServiceClient {
callSettings
) as AsyncIterable<protos.google.cloud.talent.v4beta1.ICompany>;
}
/**
* Gets the latest state of a long-running operation. Clients can use this
* method to poll the operation result at intervals as recommended by the API
* service.
*
* @param {Object} request - The request object that will be sent.
* @param {string} request.name - The name of the operation resource.
* @param {Object=} options
* Optional parameters. You can override the default settings for this call,
* e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
* details.
* @param {function(?Error, ?Object)=} callback
* The function which will be called with the result of the API call.
*
* The second parameter to the callback is an object representing
* [google.longrunning.Operation]{@link
* external:"google.longrunning.Operation"}.
* @return {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing
* [google.longrunning.Operation]{@link
* external:"google.longrunning.Operation"}. The promise has a method named
* "cancel" which cancels the ongoing API call.
*
* @example
* ```
* const client = longrunning.operationsClient();
* const name = '';
* const [response] = await client.getOperation({name});
* // doThingsWith(response)
* ```
*/
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]> {
return this.operationsClient.getOperation(request, options, callback);
}
/**
* Lists operations that match the specified filter in the request. If the
* server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
*
* For-await-of syntax is used with the iterable to recursively get response element on-demand.
*
* @param {Object} request - The request object that will be sent.
* @param {string} request.name - The name of the operation collection.
* @param {string} request.filter - The standard list filter.
* @param {number=} request.pageSize -
* The maximum number of resources contained in the underlying API
* response. If page streaming is performed per-resource, this
* parameter does not affect the return value. If page streaming is
* performed per-page, this determines the maximum number of
* resources in a page.
* @param {Object=} options
* Optional parameters. You can override the default settings for this call,
* e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
* details.
* @returns {Object}
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
*
* @example
* ```
* const client = longrunning.operationsClient();
* for await (const response of client.listOperationsAsync(request));
* // doThingsWith(response)
* ```
*/
listOperationsAsync(
request: protos.google.longrunning.ListOperationsRequest,
options?: gax.CallOptions
): AsyncIterable<protos.google.longrunning.ListOperationsResponse> {
return this.operationsClient.listOperationsAsync(request, options);
}
/**
* Starts asynchronous cancellation on a long-running operation. The server
* makes a best effort to cancel the operation, but success is not
* guaranteed. If the server doesn't support this method, it returns
* `google.rpc.Code.UNIMPLEMENTED`. Clients can use
* {@link Operations.GetOperation} or
* other methods to check whether the cancellation succeeded or whether the
* operation completed despite cancellation. On successful cancellation,
* the operation is not deleted; instead, it becomes an operation with
* an {@link Operation.error} value with a {@link google.rpc.Status.code} of
* 1, corresponding to `Code.CANCELLED`.
*
* @param {Object} request - The request object that will be sent.
* @param {string} request.name - The name of the operation resource to be cancelled.
* @param {Object=} options
* Optional parameters. You can override the default settings for this call,
* e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
* details.
* @param {function(?Error)=} callback
* The function which will be called with the result of the API call.
* @return {Promise} - The promise which resolves when API call finishes.
* The promise has a method named "cancel" which cancels the ongoing API
* call.
*
* @example
* ```
* const client = longrunning.operationsClient();
* await client.cancelOperation({name: ''});
* ```
*/
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> {
return this.operationsClient.cancelOperation(request, options, callback);
}

/**
* Deletes a long-running operation. This method indicates that the client is
* no longer interested in the operation result. It does not cancel the
* operation. If the server doesn't support this method, it returns
* `google.rpc.Code.UNIMPLEMENTED`.
*
* @param {Object} request - The request object that will be sent.
* @param {string} request.name - The name of the operation resource to be deleted.
* @param {Object=} options
* Optional parameters. You can override the default settings for this call,
* e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
* details.
* @param {function(?Error)=} callback
* The function which will be called with the result of the API call.
* @return {Promise} - The promise which resolves when API call finishes.
* The promise has a method named "cancel" which cancels the ongoing API
* call.
*
* @example
* ```
* const client = longrunning.operationsClient();
* await client.deleteOperation({name: ''});
* ```
*/
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> {
return this.operationsClient.deleteOperation(request, options, callback);
}

// --------------------
// -- Path templates --
// --------------------
Expand Down Expand Up @@ -1429,7 +1227,6 @@ export class CompanyServiceClient {
return this.companyServiceStub.then(stub => {
this._terminated = true;
stub.close();
this.operationsClient.close();
});
}
return Promise.resolve();
Expand Down
Loading

0 comments on commit 2810a6f

Please sign in to comment.