Byron / google-apis-rs

A binding and CLI generator for all Google APIs
http://byron.github.io/google-apis-rs
Other
983 stars 132 forks source link

Made doit() method for ObjectInsertCall public #495

Closed Rodion-Bozhenko closed 2 months ago

Rodion-Bozhenko commented 2 months ago

Readme for google_storage1 says that .objects().insert() method could be invoked like this

let r = hub.objects().insert(...).doit().await

but it is impossible since doit() is private

Byron commented 2 months ago

It's recommended to apply patches in locally vendored copies of the source code as needed. However, it makes no sense to apply patches to a file in gen/ as all these will be overwritten the next time the generator runs.

A viable patch would fix the documentation generator to not propose using methods which are private, but instead use their public counterparts.

IvanUkhov commented 2 months ago

Indeed, the files in gen are generated programmatically. They are not supposed to be changed by hand. So if you would like to propose some change, it has to be done in the templates used for the generation. They are here:

https://github.com/Byron/google-apis-rs/blob/main/src/generator/templates

And here is the documentation that has to be updated:

https://github.com/Byron/google-apis-rs/blob/main/src/generator/templates/api/lib/lib.mako#L154-L163

And here are the lines deciding whether it is public or private:

https://github.com/Byron/google-apis-rs/blob/main/src/generator/templates/api/lib/mbuild.mako#L439-L471 https://github.com/Byron/google-apis-rs/blob/main/src/generator/templates/api/lib/mbuild.mako#L528

Rodion-Bozhenko commented 2 months ago

It's recommended to apply patches in locally vendored copies of the source code as needed. However, it makes no sense to apply patches to a file in gen/ as all these will be overwritten the next time the generator runs.

A viable patch would fix the documentation generator to not propose using methods which are private, but instead use their public counterparts.

Got it. Thanks for response