Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch Client to positional args (#155)
- Loading branch information
Showing
30 changed files
with
1,889 additions
and
2,776 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 1 addition & 7 deletions
8
gapic-generator/templates/default/service/client/method/def/_request_normal.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
<%- assert_locals method -%> | ||
if request.nil? && request_fields.empty? | ||
raise ArgumentError, "request must be provided" | ||
end | ||
if !request.nil? && !request_fields.empty? | ||
raise ArgumentError, "cannot pass both request object and named arguments" | ||
end | ||
raise ArgumentError, "request must be provided" if request.nil? | ||
|
||
request ||= request_fields | ||
request = Google::Gax::Protobuf.coerce request, to: <%= method.request_type %> |
6 changes: 0 additions & 6 deletions
6
gapic-generator/templates/default/service/client/method/def/_signature.erb
This file was deleted.
Oops, something went wrong.
25 changes: 7 additions & 18 deletions
25
gapic-generator/templates/default/service/client/method/docs/_request_normal.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,14 @@ | ||
<%- assert_locals method -%> | ||
# @overload <%= method.name %>(request, options: nil) | ||
# @param request [<%= method.request_type %> | Hash] | ||
# @param request [<%= method.request_type %> | Hash] | ||
<%- if method.doc_description -%> | ||
<%= indent method.doc_description, "# " %> | ||
<%= indent method.doc_description, "# " %> | ||
<%- end -%> | ||
# @param options [Google::Gax::ApiCall::Options, Hash] | ||
# Overrides the default settings for this call, e.g, timeout, retries, etc. | ||
# | ||
<%- arg_list = method.arguments.map { |arg| "#{arg.name}: nil"}.join ", " -%> | ||
# @overload <%= method.name %>(<%= arg_list %>, options: nil) | ||
# When using a hash, the following fields are supported: | ||
# | ||
<%- method.arguments.each do |arg| -%> | ||
# @param <%= arg.name %> [<%= arg.doc_types %>] | ||
<%- if arg.doc_description -%> | ||
# * `<%= arg.name %>` (`<%= arg.doc_types %>`)<%- if arg.doc_description -%>: | ||
<%= indent arg.doc_description, "# " %> | ||
<%- end -%> | ||
<%- end -%> | ||
# @param options [Google::Gax::ApiCall::Options, Hash] | ||
# Overrides the default settings for this call, e.g, timeout, retries, etc. | ||
<%- if method.arguments.find { |arg| arg.name == "options" } -%> | ||
# | ||
# If you want to provide a {<%= method.request_type %>#options} | ||
# value you will need to pass all attributes in a Hash instead of using | ||
# named arguments. | ||
<%- end -%> | ||
<%- end -%># @param options [Google::Gax::ApiCall::Options, Hash] | ||
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.