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

consider removing required $name parameter from OperationsClient::listOperations #500

Open
bshaffer opened this issue Jan 28, 2022 · 2 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@bshaffer
Copy link
Contributor

bshaffer commented Jan 28, 2022

There are five APIs which allow calls to listOperations without a$name parameter:

  • Functions
  • ServiceManagement
  • ServiceUsage
  • Speech
  • VideoIntelligence

Out of these APIs, only VideoIntelligence provides bindings for calling listOperations with a $name parameter.

Because of this, it would be better to make the $name parameter to OperationsClient::listOperations optional, and throw an exception when it's required (I believe the API would handle throwing this exception anyway). Otherwise, users are forced to provide this parameter when it isn't necessary and/or supported.

It looks like the ListOperationsRequest proto does not require the $name parameter, so I believe this is as a result of the parameter moving from required to optional, and we will just have to fix it in the next version (or add a way for the generator to make these parameters optional)

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jan 29, 2022
@vam-google vam-google added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p2 Moderately-important priority. Fix may not be included in next release. and removed triage me I really want to be triaged. labels Jan 31, 2022
@bshaffer bshaffer transferred this issue from googleapis/gax-php Aug 4, 2022
@bshaffer
Copy link
Contributor Author

bshaffer commented Aug 4, 2022

This could be achieved by giving any parameter in requiredToOptional parameters a default null value, which would make that parameter optional:

public function listOperations($name = null, array $options = [])
{
    //...
}

@noahdietz
Copy link
Collaborator

Yeah this makes sense...rather unfortunate that it is in this state, but your approach makes sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants