-
Notifications
You must be signed in to change notification settings - Fork 13
feat: Add union type to support the ClientOptions class in the client constructor #725
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
Conversation
bshaffer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick review!
| { | ||
| // TODO(vNext): Remove the forced addition of these `use` clauses. | ||
| $this->ctx->type(Type::fromName(\Google\ApiCore\PathTemplate::class)); | ||
| $this->ctx->type(Type::fromName(\Google\ApiCore\Options\ClientOptions::class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably go in private function construct(), to keep it together with the function it goes with below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see what you mean, my thought was to match 1 to 1 how does this gets placed in the generated file. For example, due finding Google\ApiCore\PathTemplate on the generated file, I was able to determine how this gets added.
Still, I am not completely opposed to moving it to another place.
bshaffer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When these changes roll out, we'll need to pin to whatever minimum version of GAX supports the new method signatures in GapicClientTrait::buildLCientOptions (in google-cloud-php)
| public function __construct(array $options = []) | ||
| public function __construct(array|ClientOptions $options = []) | ||
| { | ||
| $clientOptions = $this->buildClientOptions($options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As buildClientOptions doesn't support ClientOptions, we'll need to update this in GAX (this is somewhat handled in googleapis/gax-php#580, but should probably be separated from the changes to make the properties public).
385be71 to
e282b86
Compare
a6111a4 to
9fd49ea
Compare
No description provided.