Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support regapic LRO #1276

Merged
merged 3 commits into from
Jun 7, 2022
Merged

feat: support regapic LRO #1276

merged 3 commits into from
Jun 7, 2022

Conversation

summer-ji-eng
Copy link
Contributor

@summer-ji-eng summer-ji-eng commented Jun 3, 2022

Enable using rest client to make long running operation call.

Example to use Rest SpeechClient to make LRO call, generator need to read speech_v1.yaml to construct httpRules which is array of `google.api.IHttpRules. Then we pass down the parameter to build OperationClient.

Here is an sample code in speech_client.ts

this.operationsClient = this._gaxModule
            .lro({
            auth: this.auth,
            grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
            protoJson: protoFilesRoot,
            httpRules: [
                {
                    selector: 'google.longrunning.Operations.GetOperation',
                    get: '/v1/operations/{name=**}'
                },
                {
                    selector: 'google.longrunning.Operations.ListOperations',
                    get: '/v1/operations',
                }
            ]

        })
            .operationsClient(opts);

@summer-ji-eng summer-ji-eng requested a review from a team as a code owner June 3, 2022 00:03
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Jun 3, 2022
Copy link
Contributor

@alexander-fenster alexander-fenster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just hope the override code works :)

@summer-ji-eng summer-ji-eng merged commit b9beedb into main Jun 7, 2022
@summer-ji-eng summer-ji-eng deleted the regapic_lro_new branch June 7, 2022 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants