Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

operationsClient is not exported #483

Closed
alexander-fenster opened this issue Dec 9, 2019 · 3 comments
Closed

operationsClient is not exported #483

alexander-fenster opened this issue Dec 9, 2019 · 3 comments
Assignees
Labels
api: speech Issues related to the googleapis/nodejs-speech API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@alexander-fenster
Copy link
Contributor

hey guys! looks like the recent move to Typescript has changed things a bit.
SpeechClient doesn't expose operationsClient, neither public or private. Can somebody please show an example with new client library?

LROs still look unusable in cases when environment (like Firebase functions) won't be able to wait for the completion too long.

Originally posted by @idudinov in #399 (comment)

@alexander-fenster
Copy link
Contributor Author

Hi @idudinov,

Thank you for your report, I apologize for breaking stuff! We'll fix it soon. As a first step, we need to export the OperationsClient type from our google-gax library here googleapis/gax-nodejs#677, then I'll update the generator to use this type so that operationsClient will be available. If everything goes well the fixed release will come really soon.

@alexander-fenster alexander-fenster self-assigned this Dec 9, 2019
@alexander-fenster
Copy link
Contributor Author

@idudinov

Before it is fixed, this snippet should work (I tried in Node REPL, it might require adding some types-related bells and whistles if you do it in your TypeScript code, but you get the idea):

> const speech = require('@google-cloud/speech')
undefined
> const client = new speech.SpeechClient()
undefined
> client.constructor.servicePath
'speech.googleapis.com'
> client.constructor.port
443
> const gax = require('google-gax')
undefined
> const operationsClient = gax.lro({auth: client.auth}).operationsClient({servicePath: client.constructor.servicePath, port: client.constructor.port})
undefined

That's pretty much the same code as is used inside the SpeechClient constructor for creating that operationsClient. The main thing is to pass servicePath, port, and auth into the right places, and it should just work.

@alexander-fenster
Copy link
Contributor Author

Fixed in #485.

@google-cloud-label-sync google-cloud-label-sync bot added the api: speech Issues related to the googleapis/nodejs-speech API. label Jan 31, 2020
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: speech Issues related to the googleapis/nodejs-speech API. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants