-
Notifications
You must be signed in to change notification settings - Fork 12
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
feature request: add a way to differentiate V1 and V2 clients #640
Comments
What you have in googleapis/gax-php#470 for this solution seems fine to me. My only questions are:
|
Yes
I agree with this only if we don't see value in the
Yes, as the currently published composer requirements for |
I think we can always add this later if we find a use case for it. I think it would perhaps be the better solution long term. Let's keep it in our back pocket? If our only use case atm is for client info headers, I think the simple, gax-based class check will do the trick. |
I agree, there's not really a request for it and we can always add it later. Closing this as the |
We don't have a clean way to typehint V2 clients, or to tell a difference between the two. This would be handy simply for typehinting in GAX or other functions if we wanted to accept any client, or if we'd like to have conditional logic depending on the client type (see googleapis/gax-php#470 and googleapis/gax-php#450).
NOTE: With union types in PHP 8.0, typehinting any client may not be as important, but there would still be cases where it'd be nice to accept any API client.
Some ways I can see us doing this:
BaseClient
orClient
:The client interface could be empty:
This would not be typehint-able, but it would be able to be usable in
GapicClientTrait
.substr(__CLASS__, -10) === 'BaseClient'
if we need to differentiateThis is the easiest solution, but also the hackiest / least reliable.
... Thoughts?
The text was updated successfully, but these errors were encountered: