diff --git a/gapic-generator/templates/default/service/client/method/_def.erb b/gapic-generator/templates/default/service/client/method/_def.erb index aceab58a9..2b3909cdc 100644 --- a/gapic-generator/templates/default/service/client/method/_def.erb +++ b/gapic-generator/templates/default/service/client/method/_def.erb @@ -13,7 +13,7 @@ # @example <%= indent method.code_example, "# " %> # -<%= render partial: "service/client/method/def/signature", locals: { method: method } -%> +def <%= method.name %> request, options = nil, &block <%= indent render(partial: "service/client/method/def/request", locals: { method: method }), 2 %> <%= indent render(partial: "service/client/method/def/options_defaults", locals: { method: method }), 2 %> diff --git a/gapic-generator/templates/default/service/client/method/def/_request_normal.erb b/gapic-generator/templates/default/service/client/method/def/_request_normal.erb index 6189179fb..09e752207 100644 --- a/gapic-generator/templates/default/service/client/method/def/_request_normal.erb +++ b/gapic-generator/templates/default/service/client/method/def/_request_normal.erb @@ -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 %> diff --git a/gapic-generator/templates/default/service/client/method/def/_signature.erb b/gapic-generator/templates/default/service/client/method/def/_signature.erb deleted file mode 100644 index 5e76f9203..000000000 --- a/gapic-generator/templates/default/service/client/method/def/_signature.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%- assert_locals method -%> -<%- if method.client_streaming? -%> -def <%= method.name %> request, options: nil, &block -<%- else -%> -def <%= method.name %> request = nil, options: nil, **request_fields, &block -<%- end -%> diff --git a/gapic-generator/templates/default/service/client/method/docs/_request_normal.erb b/gapic-generator/templates/default/service/client/method/docs/_request_normal.erb index 618cceeca..351fe276b 100644 --- a/gapic-generator/templates/default/service/client/method/docs/_request_normal.erb +++ b/gapic-generator/templates/default/service/client/method/docs/_request_normal.erb @@ -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. diff --git a/gapic-generator/templates/default/service/client/method/docs/_request_streaming.erb b/gapic-generator/templates/default/service/client/method/docs/_request_streaming.erb index b6fff1867..d925218bc 100644 --- a/gapic-generator/templates/default/service/client/method/docs/_request_streaming.erb +++ b/gapic-generator/templates/default/service/client/method/docs/_request_streaming.erb @@ -2,4 +2,4 @@ # @param request [Google::Gax::StreamInput, Enumerable<<%= method.request_type %> | Hash>] # An enumerable of {<%= method.request_type %>} instances. # @param options [Google::Gax::ApiCall::Options, Hash] -# Overrides the default settings for this call, e.g, timeout, retries, etc. +# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. diff --git a/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/echo/client.rb b/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/echo/client.rb index 67908998e..2007a8b68 100644 --- a/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/echo/client.rb +++ b/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/echo/client.rb @@ -108,19 +108,17 @@ def initialize ## # This method simply echos the request. This method is showcases unary rpcs. # - # @overload echo(request, options: nil) - # @param request [Google::Showcase::V1alpha3::EchoRequest | Hash] - # This method simply echos the request. This method is showcases unary rpcs. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload echo(content: nil, error: nil, options: nil) - # @param content [String] + # @param request [Google::Showcase::V1alpha3::EchoRequest | Hash] + # This method simply echos the request. This method is showcases unary rpcs. + # + # When using a hash, the following fields are supported: + # + # * `content` (`String`): # The content to be echoed by the server. - # @param error [Google::Rpc::Status | Hash] + # * `error` (`Google::Rpc::Status | Hash`): # The error to be thrown by the server. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::EchoResponse] @@ -133,13 +131,9 @@ def initialize # @example # TODO # - def echo request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def echo request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::EchoRequest # Converts hash and nil to an options object @@ -172,20 +166,18 @@ def echo request = nil, options: nil, **request_fields, &block # This method split the given content into words and will pass each word back # through the stream. This method showcases server-side streaming rpcs. # - # @overload expand(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ExpandRequest | Hash] - # This method split the given content into words and will pass each word back - # through the stream. This method showcases server-side streaming rpcs. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ExpandRequest | Hash] + # This method split the given content into words and will pass each word back + # through the stream. This method showcases server-side streaming rpcs. # - # @overload expand(content: nil, error: nil, options: nil) - # @param content [String] + # When using a hash, the following fields are supported: + # + # * `content` (`String`): # The content that will be split into words and returned on the stream. - # @param error [Google::Rpc::Status | Hash] + # * `error` (`Google::Rpc::Status | Hash`): # The error that is thrown after all words are sent on the stream. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Enumerable] @@ -198,13 +190,9 @@ def echo request = nil, options: nil, **request_fields, &block # @example # TODO # - def expand request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def expand request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ExpandRequest # Converts hash and nil to an options object @@ -241,7 +229,7 @@ def expand request = nil, options: nil, **request_fields, &block # @param request [Google::Gax::StreamInput, Enumerable] # An enumerable of {Google::Showcase::V1alpha3::EchoRequest} instances. # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::EchoResponse] @@ -254,7 +242,7 @@ def expand request = nil, options: nil, **request_fields, &block # @example # TODO # - def collect request, options: nil, &block + def collect request, options = nil, &block unless request.is_a? Enumerable if request.respond_to? :to_enum request = request.to_enum @@ -301,7 +289,7 @@ def collect request, options: nil, &block # @param request [Google::Gax::StreamInput, Enumerable] # An enumerable of {Google::Showcase::V1alpha3::EchoRequest} instances. # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Enumerable] @@ -314,7 +302,7 @@ def collect request, options: nil, &block # @example # TODO # - def chat request, options: nil, &block + def chat request, options = nil, &block unless request.is_a? Enumerable if request.respond_to? :to_enum request = request.to_enum @@ -357,22 +345,20 @@ def chat request, options: nil, &block # This is similar to the Expand method but instead of returning a stream of # expanded words, this method returns a paged list of expanded words. # - # @overload paged_expand(request, options: nil) - # @param request [Google::Showcase::V1alpha3::PagedExpandRequest | Hash] - # This is similar to the Expand method but instead of returning a stream of - # expanded words, this method returns a paged list of expanded words. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::PagedExpandRequest | Hash] + # This is similar to the Expand method but instead of returning a stream of + # expanded words, this method returns a paged list of expanded words. # - # @overload paged_expand(content: nil, page_size: nil, page_token: nil, options: nil) - # @param content [String] + # When using a hash, the following fields are supported: + # + # * `content` (`String`): # The string to expand. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The amount of words to returned in each page. - # @param page_token [String] + # * `page_token` (`String`): # The position of the page to be returned. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -385,13 +371,9 @@ def chat request, options: nil, &block # @example # TODO # - def paged_expand request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def paged_expand request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::PagedExpandRequest # Converts hash and nil to an options object @@ -425,25 +407,23 @@ def paged_expand request = nil, options: nil, **request_fields, &block # This method will wait the requested amount of and then return. # This method showcases how a client handles a request timing out. # - # @overload wait(request, options: nil) - # @param request [Google::Showcase::V1alpha3::WaitRequest | Hash] - # This method will wait the requested amount of and then return. - # This method showcases how a client handles a request timing out. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::WaitRequest | Hash] + # This method will wait the requested amount of and then return. + # This method showcases how a client handles a request timing out. # - # @overload wait(end_time: nil, ttl: nil, error: nil, success: nil, options: nil) - # @param end_time [Google::Protobuf::Timestamp | Hash] + # When using a hash, the following fields are supported: + # + # * `end_time` (`Google::Protobuf::Timestamp | Hash`): # The time that this operation will complete. - # @param ttl [Google::Protobuf::Duration | Hash] + # * `ttl` (`Google::Protobuf::Duration | Hash`): # The duration of this operation. - # @param error [Google::Rpc::Status | Hash] + # * `error` (`Google::Rpc::Status | Hash`): # The error that will be returned by the server. If this code is specified # to be the OK rpc code, an empty response will be returned. - # @param success [Google::Showcase::V1alpha3::WaitResponse | Hash] + # * `success` (`Google::Showcase::V1alpha3::WaitResponse | Hash`): # The response to be returned on operation completion. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -456,13 +436,9 @@ def paged_expand request = nil, options: nil, **request_fields, &block # @example # TODO # - def wait request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def wait request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::WaitRequest # Converts hash and nil to an options object diff --git a/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/echo/operations.rb b/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/echo/operations.rb index fd38327b6..3d6e714c5 100644 --- a/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/echo/operations.rb +++ b/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/echo/operations.rb @@ -106,27 +106,25 @@ def initialize # NOTE: the `name` binding below allows API services to override the binding # to use different resource name schemes, such as `users/*/operations`. # - # @overload list_operations(request, options: nil) - # @param request [Google::Longrunning::ListOperationsRequest | Hash] - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding below allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::ListOperationsRequest | Hash] + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding below allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation collection. - # @param filter [String] + # * `filter` (`String`): # The standard list filter. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The standard list page size. - # @param page_token [String] + # * `page_token` (`String`): # The standard list page token. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -139,13 +137,9 @@ def initialize # @example # TODO # - def list_operations request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_operations request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::ListOperationsRequest # Converts hash and nil to an options object @@ -187,19 +181,17 @@ def list_operations request = nil, options: nil, **request_fields, &block # method to poll the operation result at intervals as recommended by the API # service. # - # @overload get_operation(request, options: nil) - # @param request [Google::Longrunning::GetOperationRequest | Hash] - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Longrunning::GetOperationRequest | Hash] + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # When using a hash, the following fields are supported: # - # @overload get_operation(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The name of the operation resource. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -212,13 +204,9 @@ def list_operations request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::GetOperationRequest # Converts hash and nil to an options object @@ -260,20 +248,18 @@ def get_operation request = nil, options: nil, **request_fields, &block # operation. If the server doesn't support this method, it returns # `google.rpc.Code.UNIMPLEMENTED`. # - # @overload delete_operation(request, options: nil) - # @param request [Google::Longrunning::DeleteOperationRequest | Hash] - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload delete_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::DeleteOperationRequest | Hash] + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -286,13 +272,9 @@ def get_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::DeleteOperationRequest # Converts hash and nil to an options object @@ -339,26 +321,24 @@ def delete_operation request = nil, options: nil, **request_fields, &block # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, # corresponding to `Code.CANCELLED`. # - # @overload cancel_operation(request, options: nil) - # @param request [Google::Longrunning::CancelOperationRequest | Hash] - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - # corresponding to `Code.CANCELLED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload cancel_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::CancelOperationRequest | Hash] + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + # corresponding to `Code.CANCELLED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be cancelled. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -371,13 +351,9 @@ def delete_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def cancel_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def cancel_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::CancelOperationRequest # Converts hash and nil to an options object diff --git a/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/identity/client.rb b/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/identity/client.rb index ab7bc45c1..1b9d16fee 100644 --- a/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/identity/client.rb +++ b/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/identity/client.rb @@ -107,17 +107,15 @@ def initialize ## # Creates a user. # - # @overload create_user(request, options: nil) - # @param request [Google::Showcase::V1alpha3::CreateUserRequest | Hash] - # Creates a user. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload create_user(user: nil, options: nil) - # @param user [Google::Showcase::V1alpha3::User | Hash] + # @param request [Google::Showcase::V1alpha3::CreateUserRequest | Hash] + # Creates a user. + # + # When using a hash, the following fields are supported: + # + # * `user` (`Google::Showcase::V1alpha3::User | Hash`): # The user to create. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::User] @@ -130,13 +128,9 @@ def initialize # @example # TODO # - def create_user request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_user request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::CreateUserRequest # Converts hash and nil to an options object @@ -168,17 +162,15 @@ def create_user request = nil, options: nil, **request_fields, &block ## # Retrieves the User with the given uri. # - # @overload get_user(request, options: nil) - # @param request [Google::Showcase::V1alpha3::GetUserRequest | Hash] - # Retrieves the User with the given uri. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::GetUserRequest | Hash] + # Retrieves the User with the given uri. # - # @overload get_user(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The resource name of the requested user. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::User] @@ -191,13 +183,9 @@ def create_user request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_user request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_user request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::GetUserRequest # Converts hash and nil to an options object @@ -235,20 +223,18 @@ def get_user request = nil, options: nil, **request_fields, &block ## # Updates a user. # - # @overload update_user(request, options: nil) - # @param request [Google::Showcase::V1alpha3::UpdateUserRequest | Hash] - # Updates a user. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::UpdateUserRequest | Hash] + # Updates a user. + # + # When using a hash, the following fields are supported: # - # @overload update_user(user: nil, update_mask: nil, options: nil) - # @param user [Google::Showcase::V1alpha3::User | Hash] + # * `user` (`Google::Showcase::V1alpha3::User | Hash`): # The user to update. - # @param update_mask [Google::Protobuf::FieldMask | Hash] + # * `update_mask` (`Google::Protobuf::FieldMask | Hash`): # The field mask to determine wich fields are to be updated. If empty, the # server will assume all fields are to be updated. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::User] @@ -261,13 +247,9 @@ def get_user request = nil, options: nil, **request_fields, &block # @example # TODO # - def update_user request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def update_user request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::UpdateUserRequest # Converts hash and nil to an options object @@ -305,17 +287,15 @@ def update_user request = nil, options: nil, **request_fields, &block ## # Deletes a user, their profile, and all of their authored messages. # - # @overload delete_user(request, options: nil) - # @param request [Google::Showcase::V1alpha3::DeleteUserRequest | Hash] - # Deletes a user, their profile, and all of their authored messages. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::DeleteUserRequest | Hash] + # Deletes a user, their profile, and all of their authored messages. + # + # When using a hash, the following fields are supported: # - # @overload delete_user(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name of the user to delete. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -328,13 +308,9 @@ def update_user request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_user request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_user request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::DeleteUserRequest # Converts hash and nil to an options object @@ -372,22 +348,20 @@ def delete_user request = nil, options: nil, **request_fields, &block ## # Lists all users. # - # @overload list_users(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ListUsersRequest | Hash] - # Lists all users. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ListUsersRequest | Hash] + # Lists all users. # - # @overload list_users(page_size: nil, page_token: nil, options: nil) - # @param page_size [Integer] + # When using a hash, the following fields are supported: + # + # * `page_size` (`Integer`): # The maximum number of users to return. Server may return fewer users # than requested. If unspecified, server will pick an appropriate default. - # @param page_token [String] + # * `page_token` (`String`): # The value of google.showcase.v1alpha3.ListUsersResponse.next_page_token # returned from the previous call to # `google.showcase.v1alpha3.Identity\ListUsers` method. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -400,13 +374,9 @@ def delete_user request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_users request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_users request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ListUsersRequest # Converts hash and nil to an options object diff --git a/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/messaging/client.rb b/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/messaging/client.rb index 9f53a8123..ac408917e 100644 --- a/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/messaging/client.rb +++ b/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/messaging/client.rb @@ -111,17 +111,15 @@ def initialize ## # Creates a room. # - # @overload create_room(request, options: nil) - # @param request [Google::Showcase::V1alpha3::CreateRoomRequest | Hash] - # Creates a room. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload create_room(room: nil, options: nil) - # @param room [Google::Showcase::V1alpha3::Room | Hash] + # @param request [Google::Showcase::V1alpha3::CreateRoomRequest | Hash] + # Creates a room. + # + # When using a hash, the following fields are supported: + # + # * `room` (`Google::Showcase::V1alpha3::Room | Hash`): # The room to create. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Room] @@ -134,13 +132,9 @@ def initialize # @example # TODO # - def create_room request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_room request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::CreateRoomRequest # Converts hash and nil to an options object @@ -172,17 +166,15 @@ def create_room request = nil, options: nil, **request_fields, &block ## # Retrieves the Room with the given resource name. # - # @overload get_room(request, options: nil) - # @param request [Google::Showcase::V1alpha3::GetRoomRequest | Hash] - # Retrieves the Room with the given resource name. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::GetRoomRequest | Hash] + # Retrieves the Room with the given resource name. + # + # When using a hash, the following fields are supported: # - # @overload get_room(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name of the requested room. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Room] @@ -195,13 +187,9 @@ def create_room request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_room request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_room request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::GetRoomRequest # Converts hash and nil to an options object @@ -239,20 +227,18 @@ def get_room request = nil, options: nil, **request_fields, &block ## # Updates a room. # - # @overload update_room(request, options: nil) - # @param request [Google::Showcase::V1alpha3::UpdateRoomRequest | Hash] - # Updates a room. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::UpdateRoomRequest | Hash] + # Updates a room. + # + # When using a hash, the following fields are supported: # - # @overload update_room(room: nil, update_mask: nil, options: nil) - # @param room [Google::Showcase::V1alpha3::Room | Hash] + # * `room` (`Google::Showcase::V1alpha3::Room | Hash`): # The room to update. - # @param update_mask [Google::Protobuf::FieldMask | Hash] + # * `update_mask` (`Google::Protobuf::FieldMask | Hash`): # The field mask to determine wich fields are to be updated. If empty, the # server will assume all fields are to be updated. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Room] @@ -265,13 +251,9 @@ def get_room request = nil, options: nil, **request_fields, &block # @example # TODO # - def update_room request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def update_room request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::UpdateRoomRequest # Converts hash and nil to an options object @@ -309,17 +291,15 @@ def update_room request = nil, options: nil, **request_fields, &block ## # Deletes a room and all of its blurbs. # - # @overload delete_room(request, options: nil) - # @param request [Google::Showcase::V1alpha3::DeleteRoomRequest | Hash] - # Deletes a room and all of its blurbs. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::DeleteRoomRequest | Hash] + # Deletes a room and all of its blurbs. # - # @overload delete_room(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The resource name of the requested room. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -332,13 +312,9 @@ def update_room request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_room request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_room request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::DeleteRoomRequest # Converts hash and nil to an options object @@ -376,22 +352,20 @@ def delete_room request = nil, options: nil, **request_fields, &block ## # Lists all chat rooms. # - # @overload list_rooms(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ListRoomsRequest | Hash] - # Lists all chat rooms. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ListRoomsRequest | Hash] + # Lists all chat rooms. # - # @overload list_rooms(page_size: nil, page_token: nil, options: nil) - # @param page_size [Integer] + # When using a hash, the following fields are supported: + # + # * `page_size` (`Integer`): # The maximum number of rooms return. Server may return fewer rooms # than requested. If unspecified, server will pick an appropriate default. - # @param page_token [String] + # * `page_token` (`String`): # The value of google.showcase.v1alpha3.ListRoomsResponse.next_page_token # returned from the previous call to # `google.showcase.v1alpha3.Messaging\ListRooms` method. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -404,13 +378,9 @@ def delete_room request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_rooms request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_rooms request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ListRoomsRequest # Converts hash and nil to an options object @@ -445,22 +415,20 @@ def list_rooms request = nil, options: nil, **request_fields, &block # message in that room. If the parent is a profile, the blurb is understood # to be a post on the profile. # - # @overload create_blurb(request, options: nil) - # @param request [Google::Showcase::V1alpha3::CreateBlurbRequest | Hash] - # Creates a blurb. If the parent is a room, the blurb is understood to be a - # message in that room. If the parent is a profile, the blurb is understood - # to be a post on the profile. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::CreateBlurbRequest | Hash] + # Creates a blurb. If the parent is a room, the blurb is understood to be a + # message in that room. If the parent is a profile, the blurb is understood + # to be a post on the profile. + # + # When using a hash, the following fields are supported: # - # @overload create_blurb(parent: nil, blurb: nil, options: nil) - # @param parent [String] + # * `parent` (`String`): # The resource name of the chat room or user profile that this blurb will # be tied to. - # @param blurb [Google::Showcase::V1alpha3::Blurb | Hash] + # * `blurb` (`Google::Showcase::V1alpha3::Blurb | Hash`): # The blurb to create. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Blurb] @@ -473,13 +441,9 @@ def list_rooms request = nil, options: nil, **request_fields, &block # @example # TODO # - def create_blurb request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_blurb request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::CreateBlurbRequest # Converts hash and nil to an options object @@ -517,17 +481,15 @@ def create_blurb request = nil, options: nil, **request_fields, &block ## # Retrieves the Blurb with the given resource name. # - # @overload get_blurb(request, options: nil) - # @param request [Google::Showcase::V1alpha3::GetBlurbRequest | Hash] - # Retrieves the Blurb with the given resource name. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::GetBlurbRequest | Hash] + # Retrieves the Blurb with the given resource name. # - # @overload get_blurb(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The resource name of the requested blurb. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Blurb] @@ -540,13 +502,9 @@ def create_blurb request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_blurb request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_blurb request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::GetBlurbRequest # Converts hash and nil to an options object @@ -584,20 +542,18 @@ def get_blurb request = nil, options: nil, **request_fields, &block ## # Updates a blurb. # - # @overload update_blurb(request, options: nil) - # @param request [Google::Showcase::V1alpha3::UpdateBlurbRequest | Hash] - # Updates a blurb. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::UpdateBlurbRequest | Hash] + # Updates a blurb. # - # @overload update_blurb(blurb: nil, update_mask: nil, options: nil) - # @param blurb [Google::Showcase::V1alpha3::Blurb | Hash] + # When using a hash, the following fields are supported: + # + # * `blurb` (`Google::Showcase::V1alpha3::Blurb | Hash`): # The blurb to update. - # @param update_mask [Google::Protobuf::FieldMask | Hash] + # * `update_mask` (`Google::Protobuf::FieldMask | Hash`): # The field mask to determine wich fields are to be updated. If empty, the # server will assume all fields are to be updated. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Blurb] @@ -610,13 +566,9 @@ def get_blurb request = nil, options: nil, **request_fields, &block # @example # TODO # - def update_blurb request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def update_blurb request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::UpdateBlurbRequest # Converts hash and nil to an options object @@ -654,17 +606,15 @@ def update_blurb request = nil, options: nil, **request_fields, &block ## # Deletes a blurb. # - # @overload delete_blurb(request, options: nil) - # @param request [Google::Showcase::V1alpha3::DeleteBlurbRequest | Hash] - # Deletes a blurb. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::DeleteBlurbRequest | Hash] + # Deletes a blurb. + # + # When using a hash, the following fields are supported: # - # @overload delete_blurb(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name of the requested blurb. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -677,13 +627,9 @@ def update_blurb request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_blurb request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_blurb request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::DeleteBlurbRequest # Converts hash and nil to an options object @@ -722,26 +668,24 @@ def delete_blurb request = nil, options: nil, **request_fields, &block # Lists blurbs for a specific chat room or user profile depending on the # parent resource name. # - # @overload list_blurbs(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ListBlurbsRequest | Hash] - # Lists blurbs for a specific chat room or user profile depending on the - # parent resource name. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ListBlurbsRequest | Hash] + # Lists blurbs for a specific chat room or user profile depending on the + # parent resource name. # - # @overload list_blurbs(parent: nil, page_size: nil, page_token: nil, options: nil) - # @param parent [String] + # When using a hash, the following fields are supported: + # + # * `parent` (`String`): # The resource name of the requested room or profile whos blurbs to list. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of blurbs to return. Server may return fewer # blurbs than requested. If unspecified, server will pick an appropriate # default. - # @param page_token [String] + # * `page_token` (`String`): # The value of google.showcase.v1alpha3.ListBlurbsResponse.next_page_token # returned from the previous call to # `google.showcase.v1alpha3.Messaging\ListBlurbs` method. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -754,13 +698,9 @@ def delete_blurb request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_blurbs request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_blurbs request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ListBlurbsRequest # Converts hash and nil to an options object @@ -801,32 +741,30 @@ def list_blurbs request = nil, options: nil, **request_fields, &block # for blurbs containing to words found in the query. Only posts that # contain an exact match of a queried word will be returned. # - # @overload search_blurbs(request, options: nil) - # @param request [Google::Showcase::V1alpha3::SearchBlurbsRequest | Hash] - # This method searches through all blurbs across all rooms and profiles - # for blurbs containing to words found in the query. Only posts that - # contain an exact match of a queried word will be returned. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::SearchBlurbsRequest | Hash] + # This method searches through all blurbs across all rooms and profiles + # for blurbs containing to words found in the query. Only posts that + # contain an exact match of a queried word will be returned. # - # @overload search_blurbs(query: nil, parent: nil, page_size: nil, page_token: nil, options: nil) - # @param query [String] + # When using a hash, the following fields are supported: + # + # * `query` (`String`): # The query used to search for blurbs containing to words of this string. # Only posts that contain an exact match of a queried word will be returned. - # @param parent [String] + # * `parent` (`String`): # The rooms or profiles to search. If unset, `SearchBlurbs` will search all # rooms and all profiles. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of blurbs return. Server may return fewer # blurbs than requested. If unspecified, server will pick an appropriate # default. - # @param page_token [String] + # * `page_token` (`String`): # The value of # google.showcase.v1alpha3.SearchBlurbsResponse.next_page_token # returned from the previous call to # `google.showcase.v1alpha3.Messaging\SearchBlurbs` method. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -839,13 +777,9 @@ def list_blurbs request = nil, options: nil, **request_fields, &block # @example # TODO # - def search_blurbs request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def search_blurbs request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::SearchBlurbsRequest # Converts hash and nil to an options object @@ -885,20 +819,18 @@ def search_blurbs request = nil, options: nil, **request_fields, &block # This returns a stream that emits the blurbs that are created for a # particular chat room or user profile. # - # @overload stream_blurbs(request, options: nil) - # @param request [Google::Showcase::V1alpha3::StreamBlurbsRequest | Hash] - # This returns a stream that emits the blurbs that are created for a - # particular chat room or user profile. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::StreamBlurbsRequest | Hash] + # This returns a stream that emits the blurbs that are created for a + # particular chat room or user profile. + # + # When using a hash, the following fields are supported: # - # @overload stream_blurbs(name: nil, expire_time: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name of a chat room or user profile whose blurbs to stream. - # @param expire_time [Google::Protobuf::Timestamp | Hash] + # * `expire_time` (`Google::Protobuf::Timestamp | Hash`): # The time at which this stream will close. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Enumerable] @@ -911,13 +843,9 @@ def search_blurbs request = nil, options: nil, **request_fields, &block # @example # TODO # - def stream_blurbs request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def stream_blurbs request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::StreamBlurbsRequest # Converts hash and nil to an options object @@ -959,7 +887,7 @@ def stream_blurbs request = nil, options: nil, **request_fields, &block # @param request [Google::Gax::StreamInput, Enumerable] # An enumerable of {Google::Showcase::V1alpha3::CreateBlurbRequest} instances. # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::SendBlurbsResponse] @@ -972,7 +900,7 @@ def stream_blurbs request = nil, options: nil, **request_fields, &block # @example # TODO # - def send_blurbs request, options: nil, &block + def send_blurbs request, options = nil, &block unless request.is_a? Enumerable if request.respond_to? :to_enum request = request.to_enum @@ -1026,7 +954,7 @@ def send_blurbs request, options: nil, &block # @param request [Google::Gax::StreamInput, Enumerable] # An enumerable of {Google::Showcase::V1alpha3::ConnectRequest} instances. # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Enumerable] @@ -1039,7 +967,7 @@ def send_blurbs request, options: nil, &block # @example # TODO # - def connect request, options: nil, &block + def connect request, options = nil, &block unless request.is_a? Enumerable if request.respond_to? :to_enum request = request.to_enum diff --git a/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/messaging/operations.rb b/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/messaging/operations.rb index 4d6f3d5c9..e4ff4fe05 100644 --- a/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/messaging/operations.rb +++ b/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/messaging/operations.rb @@ -106,27 +106,25 @@ def initialize # NOTE: the `name` binding below allows API services to override the binding # to use different resource name schemes, such as `users/*/operations`. # - # @overload list_operations(request, options: nil) - # @param request [Google::Longrunning::ListOperationsRequest | Hash] - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding below allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::ListOperationsRequest | Hash] + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding below allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation collection. - # @param filter [String] + # * `filter` (`String`): # The standard list filter. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The standard list page size. - # @param page_token [String] + # * `page_token` (`String`): # The standard list page token. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -139,13 +137,9 @@ def initialize # @example # TODO # - def list_operations request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_operations request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::ListOperationsRequest # Converts hash and nil to an options object @@ -187,19 +181,17 @@ def list_operations request = nil, options: nil, **request_fields, &block # method to poll the operation result at intervals as recommended by the API # service. # - # @overload get_operation(request, options: nil) - # @param request [Google::Longrunning::GetOperationRequest | Hash] - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Longrunning::GetOperationRequest | Hash] + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # When using a hash, the following fields are supported: # - # @overload get_operation(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The name of the operation resource. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -212,13 +204,9 @@ def list_operations request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::GetOperationRequest # Converts hash and nil to an options object @@ -260,20 +248,18 @@ def get_operation request = nil, options: nil, **request_fields, &block # operation. If the server doesn't support this method, it returns # `google.rpc.Code.UNIMPLEMENTED`. # - # @overload delete_operation(request, options: nil) - # @param request [Google::Longrunning::DeleteOperationRequest | Hash] - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload delete_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::DeleteOperationRequest | Hash] + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -286,13 +272,9 @@ def get_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::DeleteOperationRequest # Converts hash and nil to an options object @@ -339,26 +321,24 @@ def delete_operation request = nil, options: nil, **request_fields, &block # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, # corresponding to `Code.CANCELLED`. # - # @overload cancel_operation(request, options: nil) - # @param request [Google::Longrunning::CancelOperationRequest | Hash] - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - # corresponding to `Code.CANCELLED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload cancel_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::CancelOperationRequest | Hash] + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + # corresponding to `Code.CANCELLED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be cancelled. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -371,13 +351,9 @@ def delete_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def cancel_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def cancel_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::CancelOperationRequest # Converts hash and nil to an options object diff --git a/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/testing/client.rb b/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/testing/client.rb index a5b7d959d..e70bc7aa4 100644 --- a/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/testing/client.rb +++ b/shared/output/cloud/showcase/lib/google/showcase/v1alpha3/testing/client.rb @@ -107,19 +107,17 @@ def initialize ## # Creates a new testing session. # - # @overload create_session(request, options: nil) - # @param request [Google::Showcase::V1alpha3::CreateSessionRequest | Hash] - # Creates a new testing session. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload create_session(session: nil, options: nil) - # @param session [Google::Showcase::V1alpha3::Session | Hash] + # @param request [Google::Showcase::V1alpha3::CreateSessionRequest | Hash] + # Creates a new testing session. + # + # When using a hash, the following fields are supported: + # + # * `session` (`Google::Showcase::V1alpha3::Session | Hash`): # The session to be created. # Sessions are immutable once they are created (although they can # be deleted). - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Session] @@ -132,13 +130,9 @@ def initialize # @example # TODO # - def create_session request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_session request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::CreateSessionRequest # Converts hash and nil to an options object @@ -170,17 +164,15 @@ def create_session request = nil, options: nil, **request_fields, &block ## # Gets a testing session. # - # @overload get_session(request, options: nil) - # @param request [Google::Showcase::V1alpha3::GetSessionRequest | Hash] - # Gets a testing session. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::GetSessionRequest | Hash] + # Gets a testing session. # - # @overload get_session(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The session to be retrieved. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Session] @@ -193,13 +185,9 @@ def create_session request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_session request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_session request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::GetSessionRequest # Converts hash and nil to an options object @@ -237,19 +225,17 @@ def get_session request = nil, options: nil, **request_fields, &block ## # Lists the current test sessions. # - # @overload list_sessions(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ListSessionsRequest | Hash] - # Lists the current test sessions. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ListSessionsRequest | Hash] + # Lists the current test sessions. # - # @overload list_sessions(page_size: nil, page_token: nil, options: nil) - # @param page_size [Integer] + # When using a hash, the following fields are supported: + # + # * `page_size` (`Integer`): # The maximum number of sessions to return per page. - # @param page_token [String] + # * `page_token` (`String`): # The page token, for retrieving subsequent pages. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -262,13 +248,9 @@ def get_session request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_sessions request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_sessions request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ListSessionsRequest # Converts hash and nil to an options object @@ -301,17 +283,15 @@ def list_sessions request = nil, options: nil, **request_fields, &block ## # Delete a test session. # - # @overload delete_session(request, options: nil) - # @param request [Google::Showcase::V1alpha3::DeleteSessionRequest | Hash] - # Delete a test session. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::DeleteSessionRequest | Hash] + # Delete a test session. # - # @overload delete_session(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The session to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -324,13 +304,9 @@ def list_sessions request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_session request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_session request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::DeleteSessionRequest # Converts hash and nil to an options object @@ -370,19 +346,17 @@ def delete_session request = nil, options: nil, **request_fields, &block # This generates a report detailing which tests have been completed, # and an overall rollup. # - # @overload report_session(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ReportSessionRequest | Hash] - # Report on the status of a session. - # This generates a report detailing which tests have been completed, - # and an overall rollup. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ReportSessionRequest | Hash] + # Report on the status of a session. + # This generates a report detailing which tests have been completed, + # and an overall rollup. # - # @overload report_session(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The session to be reported on. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::ReportSessionResponse] @@ -395,13 +369,9 @@ def delete_session request = nil, options: nil, **request_fields, &block # @example # TODO # - def report_session request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def report_session request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ReportSessionRequest # Converts hash and nil to an options object @@ -439,21 +409,19 @@ def report_session request = nil, options: nil, **request_fields, &block ## # List the tests of a sessesion. # - # @overload list_tests(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ListTestsRequest | Hash] - # List the tests of a sessesion. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ListTestsRequest | Hash] + # List the tests of a sessesion. # - # @overload list_tests(parent: nil, page_size: nil, page_token: nil, options: nil) - # @param parent [String] + # When using a hash, the following fields are supported: + # + # * `parent` (`String`): # The session. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of tests to return per page. - # @param page_token [String] + # * `page_token` (`String`): # The page token, for retrieving subsequent pages. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -466,13 +434,9 @@ def report_session request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_tests request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_tests request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ListTestsRequest # Converts hash and nil to an options object @@ -516,22 +480,20 @@ def list_tests request = nil, options: nil, **request_fields, &block # # This method will error if attempting to delete a required test. # - # @overload delete_test(request, options: nil) - # @param request [Google::Showcase::V1alpha3::DeleteTestRequest | Hash] - # Explicitly decline to implement a test. + # @param request [Google::Showcase::V1alpha3::DeleteTestRequest | Hash] + # Explicitly decline to implement a test. # - # This removes the test from subsequent `ListTests` calls, and - # attempting to do the test will error. + # This removes the test from subsequent `ListTests` calls, and + # attempting to do the test will error. # - # This method will error if attempting to delete a required test. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # This method will error if attempting to delete a required test. # - # @overload delete_test(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The test to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -544,13 +506,9 @@ def list_tests request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_test request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_test request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::DeleteTestRequest # Converts hash and nil to an options object @@ -591,24 +549,22 @@ def delete_test request = nil, options: nil, **request_fields, &block # In cases where a test involves registering a final answer at the # end of the test, this method provides the means to do so. # - # @overload verify_test(request, options: nil) - # @param request [Google::Showcase::V1alpha3::VerifyTestRequest | Hash] - # Register a response to a test. + # @param request [Google::Showcase::V1alpha3::VerifyTestRequest | Hash] + # Register a response to a test. # - # In cases where a test involves registering a final answer at the - # end of the test, this method provides the means to do so. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # In cases where a test involves registering a final answer at the + # end of the test, this method provides the means to do so. # - # @overload verify_test(name: nil, answer: nil, answers: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The test to have an answer registered to it. - # @param answer [String] + # * `answer` (`String`): # The answer from the test. - # @param answers [String] + # * `answers` (`String`): # The answers from the test if multiple are to be checked - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::VerifyTestResponse] @@ -621,13 +577,9 @@ def delete_test request = nil, options: nil, **request_fields, &block # @example # TODO # - def verify_test request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def verify_test request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::VerifyTestRequest # Converts hash and nil to an options object diff --git a/shared/output/cloud/speech/lib/google/cloud/speech/v1/speech/client.rb b/shared/output/cloud/speech/lib/google/cloud/speech/v1/speech/client.rb index 30f09e5c4..cb2f14eb1 100644 --- a/shared/output/cloud/speech/lib/google/cloud/speech/v1/speech/client.rb +++ b/shared/output/cloud/speech/lib/google/cloud/speech/v1/speech/client.rb @@ -110,21 +110,19 @@ def initialize # Performs synchronous speech recognition: receive results after all audio # has been sent and processed. # - # @overload recognize(request, options: nil) - # @param request [Google::Cloud::Speech::V1::RecognizeRequest | Hash] - # Performs synchronous speech recognition: receive results after all audio - # has been sent and processed. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Cloud::Speech::V1::RecognizeRequest | Hash] + # Performs synchronous speech recognition: receive results after all audio + # has been sent and processed. # - # @overload recognize(config: nil, audio: nil, options: nil) - # @param config [Google::Cloud::Speech::V1::RecognitionConfig | Hash] + # When using a hash, the following fields are supported: + # + # * `config` (`Google::Cloud::Speech::V1::RecognitionConfig | Hash`): # *Required* Provides information to the recognizer that specifies how to # process the request. - # @param audio [Google::Cloud::Speech::V1::RecognitionAudio | Hash] + # * `audio` (`Google::Cloud::Speech::V1::RecognitionAudio | Hash`): # *Required* The audio data to be recognized. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Speech::V1::RecognizeResponse] @@ -137,13 +135,9 @@ def initialize # @example # TODO # - def recognize request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def recognize request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Speech::V1::RecognizeRequest # Converts hash and nil to an options object @@ -178,23 +172,21 @@ def recognize request = nil, options: nil, **request_fields, &block # `Operation.error` or an `Operation.response` which contains # a `LongRunningRecognizeResponse` message. # - # @overload long_running_recognize(request, options: nil) - # @param request [Google::Cloud::Speech::V1::LongRunningRecognizeRequest | Hash] - # Performs asynchronous speech recognition: receive results via the - # google.longrunning.Operations interface. Returns either an - # `Operation.error` or an `Operation.response` which contains - # a `LongRunningRecognizeResponse` message. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Cloud::Speech::V1::LongRunningRecognizeRequest | Hash] + # Performs asynchronous speech recognition: receive results via the + # google.longrunning.Operations interface. Returns either an + # `Operation.error` or an `Operation.response` which contains + # a `LongRunningRecognizeResponse` message. # - # @overload long_running_recognize(config: nil, audio: nil, options: nil) - # @param config [Google::Cloud::Speech::V1::RecognitionConfig | Hash] + # When using a hash, the following fields are supported: + # + # * `config` (`Google::Cloud::Speech::V1::RecognitionConfig | Hash`): # *Required* Provides information to the recognizer that specifies how to # process the request. - # @param audio [Google::Cloud::Speech::V1::RecognitionAudio | Hash] + # * `audio` (`Google::Cloud::Speech::V1::RecognitionAudio | Hash`): # *Required* The audio data to be recognized. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -207,13 +199,9 @@ def recognize request = nil, options: nil, **request_fields, &block # @example # TODO # - def long_running_recognize request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def long_running_recognize request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Speech::V1::LongRunningRecognizeRequest # Converts hash and nil to an options object @@ -250,7 +238,7 @@ def long_running_recognize request = nil, options: nil, **request_fields, &block # @param request [Google::Gax::StreamInput, Enumerable] # An enumerable of {Google::Cloud::Speech::V1::StreamingRecognizeRequest} instances. # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Enumerable] @@ -263,7 +251,7 @@ def long_running_recognize request = nil, options: nil, **request_fields, &block # @example # TODO # - def streaming_recognize request, options: nil, &block + def streaming_recognize request, options = nil, &block unless request.is_a? Enumerable if request.respond_to? :to_enum request = request.to_enum diff --git a/shared/output/cloud/speech/lib/google/cloud/speech/v1/speech/operations.rb b/shared/output/cloud/speech/lib/google/cloud/speech/v1/speech/operations.rb index 6918857de..707fc767c 100644 --- a/shared/output/cloud/speech/lib/google/cloud/speech/v1/speech/operations.rb +++ b/shared/output/cloud/speech/lib/google/cloud/speech/v1/speech/operations.rb @@ -107,27 +107,25 @@ def initialize # NOTE: the `name` binding below allows API services to override the binding # to use different resource name schemes, such as `users/*/operations`. # - # @overload list_operations(request, options: nil) - # @param request [Google::Longrunning::ListOperationsRequest | Hash] - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding below allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::ListOperationsRequest | Hash] + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding below allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation collection. - # @param filter [String] + # * `filter` (`String`): # The standard list filter. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The standard list page size. - # @param page_token [String] + # * `page_token` (`String`): # The standard list page token. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -140,13 +138,9 @@ def initialize # @example # TODO # - def list_operations request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_operations request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::ListOperationsRequest # Converts hash and nil to an options object @@ -188,19 +182,17 @@ def list_operations request = nil, options: nil, **request_fields, &block # method to poll the operation result at intervals as recommended by the API # service. # - # @overload get_operation(request, options: nil) - # @param request [Google::Longrunning::GetOperationRequest | Hash] - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Longrunning::GetOperationRequest | Hash] + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # When using a hash, the following fields are supported: # - # @overload get_operation(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The name of the operation resource. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -213,13 +205,9 @@ def list_operations request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::GetOperationRequest # Converts hash and nil to an options object @@ -261,20 +249,18 @@ def get_operation request = nil, options: nil, **request_fields, &block # operation. If the server doesn't support this method, it returns # `google.rpc.Code.UNIMPLEMENTED`. # - # @overload delete_operation(request, options: nil) - # @param request [Google::Longrunning::DeleteOperationRequest | Hash] - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload delete_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::DeleteOperationRequest | Hash] + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -287,13 +273,9 @@ def get_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::DeleteOperationRequest # Converts hash and nil to an options object @@ -340,26 +322,24 @@ def delete_operation request = nil, options: nil, **request_fields, &block # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, # corresponding to `Code.CANCELLED`. # - # @overload cancel_operation(request, options: nil) - # @param request [Google::Longrunning::CancelOperationRequest | Hash] - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - # corresponding to `Code.CANCELLED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload cancel_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::CancelOperationRequest | Hash] + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + # corresponding to `Code.CANCELLED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be cancelled. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -372,13 +352,9 @@ def delete_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def cancel_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def cancel_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::CancelOperationRequest # Converts hash and nil to an options object diff --git a/shared/output/cloud/vision/lib/google/cloud/vision/v1/image_annotator/client.rb b/shared/output/cloud/vision/lib/google/cloud/vision/v1/image_annotator/client.rb index b5583c480..6829c03e1 100644 --- a/shared/output/cloud/vision/lib/google/cloud/vision/v1/image_annotator/client.rb +++ b/shared/output/cloud/vision/lib/google/cloud/vision/v1/image_annotator/client.rb @@ -109,17 +109,15 @@ def initialize ## # Run image detection and annotation for a batch of images. # - # @overload batch_annotate_images(request, options: nil) - # @param request [Google::Cloud::Vision::V1::BatchAnnotateImagesRequest | Hash] - # Run image detection and annotation for a batch of images. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Cloud::Vision::V1::BatchAnnotateImagesRequest | Hash] + # Run image detection and annotation for a batch of images. # - # @overload batch_annotate_images(requests: nil, options: nil) - # @param requests [Google::Cloud::Vision::V1::AnnotateImageRequest | Hash] + # When using a hash, the following fields are supported: + # + # * `requests` (`Google::Cloud::Vision::V1::AnnotateImageRequest | Hash`): # Individual image annotation requests for this batch. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::BatchAnnotateImagesResponse] @@ -132,13 +130,9 @@ def initialize # @example # TODO # - def batch_annotate_images request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def batch_annotate_images request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::BatchAnnotateImagesRequest # Converts hash and nil to an options object @@ -175,22 +169,20 @@ def batch_annotate_images request = nil, options: nil, **request_fields, &block # `Operation.metadata` contains `OperationMetadata` (metadata). # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). # - # @overload async_batch_annotate_files(request, options: nil) - # @param request [Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest | Hash] - # Run asynchronous image detection and annotation for a list of generic - # files, such as PDF files, which may contain multiple pages and multiple - # images per page. Progress and results can be retrieved through the - # `google.longrunning.Operations` interface. - # `Operation.metadata` contains `OperationMetadata` (metadata). - # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest | Hash] + # Run asynchronous image detection and annotation for a list of generic + # files, such as PDF files, which may contain multiple pages and multiple + # images per page. Progress and results can be retrieved through the + # `google.longrunning.Operations` interface. + # `Operation.metadata` contains `OperationMetadata` (metadata). + # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). # - # @overload async_batch_annotate_files(requests: nil, options: nil) - # @param requests [Google::Cloud::Vision::V1::AsyncAnnotateFileRequest | Hash] + # When using a hash, the following fields are supported: + # + # * `requests` (`Google::Cloud::Vision::V1::AsyncAnnotateFileRequest | Hash`): # Individual async file annotation requests for this batch. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -203,13 +195,9 @@ def batch_annotate_images request = nil, options: nil, **request_fields, &block # @example # TODO # - def async_batch_annotate_files request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def async_batch_annotate_files request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest # Converts hash and nil to an options object diff --git a/shared/output/cloud/vision/lib/google/cloud/vision/v1/image_annotator/operations.rb b/shared/output/cloud/vision/lib/google/cloud/vision/v1/image_annotator/operations.rb index 8f222b374..c901af922 100644 --- a/shared/output/cloud/vision/lib/google/cloud/vision/v1/image_annotator/operations.rb +++ b/shared/output/cloud/vision/lib/google/cloud/vision/v1/image_annotator/operations.rb @@ -107,27 +107,25 @@ def initialize # NOTE: the `name` binding below allows API services to override the binding # to use different resource name schemes, such as `users/*/operations`. # - # @overload list_operations(request, options: nil) - # @param request [Google::Longrunning::ListOperationsRequest | Hash] - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding below allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::ListOperationsRequest | Hash] + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding below allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation collection. - # @param filter [String] + # * `filter` (`String`): # The standard list filter. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The standard list page size. - # @param page_token [String] + # * `page_token` (`String`): # The standard list page token. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -140,13 +138,9 @@ def initialize # @example # TODO # - def list_operations request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_operations request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::ListOperationsRequest # Converts hash and nil to an options object @@ -188,19 +182,17 @@ def list_operations request = nil, options: nil, **request_fields, &block # method to poll the operation result at intervals as recommended by the API # service. # - # @overload get_operation(request, options: nil) - # @param request [Google::Longrunning::GetOperationRequest | Hash] - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Longrunning::GetOperationRequest | Hash] + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # When using a hash, the following fields are supported: # - # @overload get_operation(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The name of the operation resource. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -213,13 +205,9 @@ def list_operations request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::GetOperationRequest # Converts hash and nil to an options object @@ -261,20 +249,18 @@ def get_operation request = nil, options: nil, **request_fields, &block # operation. If the server doesn't support this method, it returns # `google.rpc.Code.UNIMPLEMENTED`. # - # @overload delete_operation(request, options: nil) - # @param request [Google::Longrunning::DeleteOperationRequest | Hash] - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload delete_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::DeleteOperationRequest | Hash] + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -287,13 +273,9 @@ def get_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::DeleteOperationRequest # Converts hash and nil to an options object @@ -340,26 +322,24 @@ def delete_operation request = nil, options: nil, **request_fields, &block # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, # corresponding to `Code.CANCELLED`. # - # @overload cancel_operation(request, options: nil) - # @param request [Google::Longrunning::CancelOperationRequest | Hash] - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - # corresponding to `Code.CANCELLED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload cancel_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::CancelOperationRequest | Hash] + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + # corresponding to `Code.CANCELLED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be cancelled. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -372,13 +352,9 @@ def delete_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def cancel_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def cancel_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::CancelOperationRequest # Converts hash and nil to an options object diff --git a/shared/output/cloud/vision/lib/google/cloud/vision/v1/product_search/client.rb b/shared/output/cloud/vision/lib/google/cloud/vision/v1/product_search/client.rb index 6c56004fd..1d965b5d0 100644 --- a/shared/output/cloud/vision/lib/google/cloud/vision/v1/product_search/client.rb +++ b/shared/output/cloud/vision/lib/google/cloud/vision/v1/product_search/client.rb @@ -114,31 +114,29 @@ def initialize # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than # 4096 characters. # - # @overload create_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::CreateProductSetRequest | Hash] - # Creates and returns a new ProductSet resource. + # @param request [Google::Cloud::Vision::V1::CreateProductSetRequest | Hash] + # Creates and returns a new ProductSet resource. # - # Possible errors: + # Possible errors: # - # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - # 4096 characters. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than + # 4096 characters. # - # @overload create_product_set(parent: nil, product_set: nil, product_set_id: nil, options: nil) - # @param parent [String] + # When using a hash, the following fields are supported: + # + # * `parent` (`String`): # The project in which the ProductSet should be created. # # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param product_set [Google::Cloud::Vision::V1::ProductSet | Hash] + # * `product_set` (`Google::Cloud::Vision::V1::ProductSet | Hash`): # The ProductSet to create. - # @param product_set_id [String] + # * `product_set_id` (`String`): # A user-supplied resource id for this ProductSet. If set, the server will # attempt to use this value as the resource id. If it is already in use, an # error is returned with code ALREADY_EXISTS. Must be at most 128 characters # long. It cannot contain the character `/`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::ProductSet] @@ -151,13 +149,9 @@ def initialize # @example # TODO # - def create_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::CreateProductSetRequest # Converts hash and nil to an options object @@ -200,28 +194,26 @@ def create_product_set request = nil, options: nil, **request_fields, &block # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less # than 1. # - # @overload list_product_sets(request, options: nil) - # @param request [Google::Cloud::Vision::V1::ListProductSetsRequest | Hash] - # Lists ProductSets in an unspecified order. + # @param request [Google::Cloud::Vision::V1::ListProductSetsRequest | Hash] + # Lists ProductSets in an unspecified order. + # + # Possible errors: # - # Possible errors: + # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less + # than 1. # - # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - # than 1. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload list_product_sets(parent: nil, page_size: nil, page_token: nil, options: nil) - # @param parent [String] + # * `parent` (`String`): # The project from which ProductSets should be listed. # # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [String] + # * `page_token` (`String`): # The next_page_token returned from a previous List request, if any. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -234,13 +226,9 @@ def create_product_set request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_product_sets request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_product_sets request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::ListProductSetsRequest # Converts hash and nil to an options object @@ -283,24 +271,22 @@ def list_product_sets request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the ProductSet does not exist. # - # @overload get_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::GetProductSetRequest | Hash] - # Gets information associated with a ProductSet. + # @param request [Google::Cloud::Vision::V1::GetProductSetRequest | Hash] + # Gets information associated with a ProductSet. + # + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the ProductSet does not exist. # - # * Returns NOT_FOUND if the ProductSet does not exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload get_product_set(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # Resource name of the ProductSet to get. # # Format is: # `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::ProductSet] @@ -313,13 +299,9 @@ def list_product_sets request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::GetProductSetRequest # Converts hash and nil to an options object @@ -364,29 +346,27 @@ def get_product_set request = nil, options: nil, **request_fields, &block # * Returns INVALID_ARGUMENT if display_name is present in update_mask but # missing from the request or longer than 4096 characters. # - # @overload update_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::UpdateProductSetRequest | Hash] - # Makes changes to a ProductSet resource. - # Only display_name can be updated currently. + # @param request [Google::Cloud::Vision::V1::UpdateProductSetRequest | Hash] + # Makes changes to a ProductSet resource. + # Only display_name can be updated currently. + # + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the ProductSet does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but + # missing from the request or longer than 4096 characters. # - # * Returns NOT_FOUND if the ProductSet does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but - # missing from the request or longer than 4096 characters. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload update_product_set(product_set: nil, update_mask: nil, options: nil) - # @param product_set [Google::Cloud::Vision::V1::ProductSet | Hash] + # * `product_set` (`Google::Cloud::Vision::V1::ProductSet | Hash`): # The ProductSet resource which replaces the one on the server. - # @param update_mask [Google::Protobuf::FieldMask | Hash] + # * `update_mask` (`Google::Protobuf::FieldMask | Hash`): # The [FieldMask][google.protobuf.FieldMask] that specifies which fields to # update. # If update_mask isn't specified, all mutable fields are to be updated. # Valid mask path is `display_name`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::ProductSet] @@ -399,13 +379,9 @@ def get_product_set request = nil, options: nil, **request_fields, &block # @example # TODO # - def update_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def update_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::UpdateProductSetRequest # Converts hash and nil to an options object @@ -450,27 +426,25 @@ def update_product_set request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the ProductSet does not exist. # - # @overload delete_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::DeleteProductSetRequest | Hash] - # Permanently deletes a ProductSet. Products and ReferenceImages in the - # ProductSet are not deleted. + # @param request [Google::Cloud::Vision::V1::DeleteProductSetRequest | Hash] + # Permanently deletes a ProductSet. Products and ReferenceImages in the + # ProductSet are not deleted. + # + # The actual image files are not deleted from Google Cloud Storage. # - # The actual image files are not deleted from Google Cloud Storage. + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the ProductSet does not exist. # - # * Returns NOT_FOUND if the ProductSet does not exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload delete_product_set(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # Resource name of the ProductSet to delete. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -483,13 +457,9 @@ def update_product_set request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::DeleteProductSetRequest # Converts hash and nil to an options object @@ -534,34 +504,32 @@ def delete_product_set request = nil, options: nil, **request_fields, &block # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. # * Returns INVALID_ARGUMENT if product_category is missing or invalid. # - # @overload create_product(request, options: nil) - # @param request [Google::Cloud::Vision::V1::CreateProductRequest | Hash] - # Creates and returns a new product resource. + # @param request [Google::Cloud::Vision::V1::CreateProductRequest | Hash] + # Creates and returns a new product resource. + # + # Possible errors: # - # Possible errors: + # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is missing or invalid. # - # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is missing or invalid. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload create_product(parent: nil, product: nil, product_id: nil, options: nil) - # @param parent [String] + # * `parent` (`String`): # The project in which the Product should be created. # # Format is # `projects/PROJECT_ID/locations/LOC_ID`. - # @param product [Google::Cloud::Vision::V1::Product | Hash] + # * `product` (`Google::Cloud::Vision::V1::Product | Hash`): # The product to create. - # @param product_id [String] + # * `product_id` (`String`): # A user-supplied resource id for this Product. If set, the server will # attempt to use this value as the resource id. If it is already in use, an # error is returned with code ALREADY_EXISTS. Must be at most 128 characters # long. It cannot contain the character `/`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::Product] @@ -574,13 +542,9 @@ def delete_product_set request = nil, options: nil, **request_fields, &block # @example # TODO # - def create_product request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_product request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::CreateProductRequest # Converts hash and nil to an options object @@ -622,28 +586,26 @@ def create_product request = nil, options: nil, **request_fields, &block # # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. # - # @overload list_products(request, options: nil) - # @param request [Google::Cloud::Vision::V1::ListProductsRequest | Hash] - # Lists products in an unspecified order. + # @param request [Google::Cloud::Vision::V1::ListProductsRequest | Hash] + # Lists products in an unspecified order. # - # Possible errors: + # Possible errors: # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. # - # @overload list_products(parent: nil, page_size: nil, page_token: nil, options: nil) - # @param parent [String] + # When using a hash, the following fields are supported: + # + # * `parent` (`String`): # The project OR ProductSet from which Products should be listed. # # Format: # `projects/PROJECT_ID/locations/LOC_ID` - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [String] + # * `page_token` (`String`): # The next_page_token returned from a previous List request, if any. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -656,13 +618,9 @@ def create_product request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_products request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_products request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::ListProductsRequest # Converts hash and nil to an options object @@ -705,24 +663,22 @@ def list_products request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the Product does not exist. # - # @overload get_product(request, options: nil) - # @param request [Google::Cloud::Vision::V1::GetProductRequest | Hash] - # Gets information associated with a Product. + # @param request [Google::Cloud::Vision::V1::GetProductRequest | Hash] + # Gets information associated with a Product. # - # Possible errors: + # Possible errors: # - # * Returns NOT_FOUND if the Product does not exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns NOT_FOUND if the Product does not exist. # - # @overload get_product(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # Resource name of the Product to get. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::Product] @@ -735,13 +691,9 @@ def list_products request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_product request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_product request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::GetProductRequest # Converts hash and nil to an options object @@ -793,38 +745,36 @@ def get_product request = nil, options: nil, **request_fields, &block # longer than 4096 characters. # * Returns INVALID_ARGUMENT if product_category is present in update_mask. # - # @overload update_product(request, options: nil) - # @param request [Google::Cloud::Vision::V1::UpdateProductRequest | Hash] - # Makes changes to a Product resource. - # Only the `display_name`, `description`, and `labels` fields can be updated - # right now. + # @param request [Google::Cloud::Vision::V1::UpdateProductRequest | Hash] + # Makes changes to a Product resource. + # Only the `display_name`, `description`, and `labels` fields can be updated + # right now. # - # If labels are updated, the change will not be reflected in queries until - # the next index time. + # If labels are updated, the change will not be reflected in queries until + # the next index time. # - # Possible errors: + # Possible errors: # - # * Returns NOT_FOUND if the Product does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is - # missing from the request or longer than 4096 characters. - # * Returns INVALID_ARGUMENT if description is present in update_mask but is - # longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is present in update_mask. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns NOT_FOUND if the Product does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is + # missing from the request or longer than 4096 characters. + # * Returns INVALID_ARGUMENT if description is present in update_mask but is + # longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is present in update_mask. # - # @overload update_product(product: nil, update_mask: nil, options: nil) - # @param product [Google::Cloud::Vision::V1::Product | Hash] + # When using a hash, the following fields are supported: + # + # * `product` (`Google::Cloud::Vision::V1::Product | Hash`): # The Product resource which replaces the one on the server. # product.name is immutable. - # @param update_mask [Google::Protobuf::FieldMask | Hash] + # * `update_mask` (`Google::Protobuf::FieldMask | Hash`): # The [FieldMask][google.protobuf.FieldMask] that specifies which fields # to update. # If update_mask isn't specified, all mutable fields are to be updated. # Valid mask paths include `product_labels`, `display_name`, and # `description`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::Product] @@ -837,13 +787,9 @@ def get_product request = nil, options: nil, **request_fields, &block # @example # TODO # - def update_product request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def update_product request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::UpdateProductRequest # Converts hash and nil to an options object @@ -889,28 +835,26 @@ def update_product request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the product does not exist. # - # @overload delete_product(request, options: nil) - # @param request [Google::Cloud::Vision::V1::DeleteProductRequest | Hash] - # Permanently deletes a product and its reference images. + # @param request [Google::Cloud::Vision::V1::DeleteProductRequest | Hash] + # Permanently deletes a product and its reference images. # - # Metadata of the product and all its images will be deleted right away, but - # search queries against ProductSets containing the product may still work - # until all related caches are refreshed. + # Metadata of the product and all its images will be deleted right away, but + # search queries against ProductSets containing the product may still work + # until all related caches are refreshed. # - # Possible errors: + # Possible errors: # - # * Returns NOT_FOUND if the product does not exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns NOT_FOUND if the product does not exist. # - # @overload delete_product(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # Resource name of product to delete. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -923,13 +867,9 @@ def update_product request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_product request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_product request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::DeleteProductRequest # Converts hash and nil to an options object @@ -985,46 +925,44 @@ def delete_product request = nil, options: nil, **request_fields, &block # compatible with the parent product's product_category is detected. # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. # - # @overload create_reference_image(request, options: nil) - # @param request [Google::Cloud::Vision::V1::CreateReferenceImageRequest | Hash] - # Creates and returns a new ReferenceImage resource. + # @param request [Google::Cloud::Vision::V1::CreateReferenceImageRequest | Hash] + # Creates and returns a new ReferenceImage resource. + # + # The `bounding_poly` field is optional. If `bounding_poly` is not specified, + # the system will try to detect regions of interest in the image that are + # compatible with the product_category on the parent product. If it is + # specified, detection is ALWAYS skipped. The system converts polygons into + # non-rotated rectangles. # - # The `bounding_poly` field is optional. If `bounding_poly` is not specified, - # the system will try to detect regions of interest in the image that are - # compatible with the product_category on the parent product. If it is - # specified, detection is ALWAYS skipped. The system converts polygons into - # non-rotated rectangles. + # Note that the pipeline will resize the image if the image resolution is too + # large to process (above 50MP). # - # Note that the pipeline will resize the image if the image resolution is too - # large to process (above 50MP). + # Possible errors: # - # Possible errors: + # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if the product does not exist. + # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing + # compatible with the parent product's product_category is detected. + # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. # - # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if the product does not exist. - # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing - # compatible with the parent product's product_category is detected. - # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload create_reference_image(parent: nil, reference_image: nil, reference_image_id: nil, options: nil) - # @param parent [String] + # * `parent` (`String`): # Resource name of the product in which to create the reference image. # # Format is # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @param reference_image [Google::Cloud::Vision::V1::ReferenceImage | Hash] + # * `reference_image` (`Google::Cloud::Vision::V1::ReferenceImage | Hash`): # The reference image to create. # If an image ID is specified, it is ignored. - # @param reference_image_id [String] + # * `reference_image_id` (`String`): # A user-supplied resource id for the ReferenceImage to be added. If set, # the server will attempt to use this value as the resource id. If it is # already in use, an error is returned with code ALREADY_EXISTS. Must be at # most 128 characters long. It cannot contain the character `/`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::ReferenceImage] @@ -1037,13 +975,9 @@ def delete_product request = nil, options: nil, **request_fields, &block # @example # TODO # - def create_reference_image request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_reference_image request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::CreateReferenceImageRequest # Converts hash and nil to an options object @@ -1091,31 +1025,29 @@ def create_reference_image request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the reference image does not exist. # - # @overload delete_reference_image(request, options: nil) - # @param request [Google::Cloud::Vision::V1::DeleteReferenceImageRequest | Hash] - # Permanently deletes a reference image. + # @param request [Google::Cloud::Vision::V1::DeleteReferenceImageRequest | Hash] + # Permanently deletes a reference image. + # + # The image metadata will be deleted right away, but search queries + # against ProductSets containing the image may still work until all related + # caches are refreshed. # - # The image metadata will be deleted right away, but search queries - # against ProductSets containing the image may still work until all related - # caches are refreshed. + # The actual image files are not deleted from Google Cloud Storage. # - # The actual image files are not deleted from Google Cloud Storage. + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the reference image does not exist. # - # * Returns NOT_FOUND if the reference image does not exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload delete_reference_image(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name of the reference image to delete. # # Format is: # # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -1128,13 +1060,9 @@ def create_reference_image request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_reference_image request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_reference_image request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::DeleteReferenceImageRequest # Converts hash and nil to an options object @@ -1178,33 +1106,31 @@ def delete_reference_image request = nil, options: nil, **request_fields, &block # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less # than 1. # - # @overload list_reference_images(request, options: nil) - # @param request [Google::Cloud::Vision::V1::ListReferenceImagesRequest | Hash] - # Lists reference images. + # @param request [Google::Cloud::Vision::V1::ListReferenceImagesRequest | Hash] + # Lists reference images. + # + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the parent product does not exist. + # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less + # than 1. # - # * Returns NOT_FOUND if the parent product does not exist. - # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less - # than 1. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload list_reference_images(parent: nil, page_size: nil, page_token: nil, options: nil) - # @param parent [String] + # * `parent` (`String`): # Resource name of the product containing the reference images. # # Format is # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [String] + # * `page_token` (`String`): # A token identifying a page of results to be returned. This is the value # of `nextPageToken` returned in a previous reference image list request. # # Defaults to the first page if not specified. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -1217,13 +1143,9 @@ def delete_reference_image request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_reference_images request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_reference_images request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::ListReferenceImagesRequest # Converts hash and nil to an options object @@ -1266,25 +1188,23 @@ def list_reference_images request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the specified image does not exist. # - # @overload get_reference_image(request, options: nil) - # @param request [Google::Cloud::Vision::V1::GetReferenceImageRequest | Hash] - # Gets information associated with a ReferenceImage. + # @param request [Google::Cloud::Vision::V1::GetReferenceImageRequest | Hash] + # Gets information associated with a ReferenceImage. + # + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the specified image does not exist. # - # * Returns NOT_FOUND if the specified image does not exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload get_reference_image(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name of the ReferenceImage to get. # # Format is: # # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::ReferenceImage] @@ -1297,13 +1217,9 @@ def list_reference_images request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_reference_image request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_reference_image request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::GetReferenceImageRequest # Converts hash and nil to an options object @@ -1348,32 +1264,30 @@ def get_reference_image request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. # - # @overload add_product_to_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::AddProductToProductSetRequest | Hash] - # Adds a Product to the specified ProductSet. If the Product is already - # present, no change is made. + # @param request [Google::Cloud::Vision::V1::AddProductToProductSetRequest | Hash] + # Adds a Product to the specified ProductSet. If the Product is already + # present, no change is made. + # + # One Product can be added to at most 100 ProductSets. # - # One Product can be added to at most 100 ProductSets. + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. # - # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload add_product_to_product_set(name: nil, product: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name for the ProductSet to modify. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param product [String] + # * `product` (`String`): # The resource name for the Product to be added to this ProductSet. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -1386,13 +1300,9 @@ def get_reference_image request = nil, options: nil, **request_fields, &block # @example # TODO # - def add_product_to_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def add_product_to_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::AddProductToProductSetRequest # Converts hash and nil to an options object @@ -1434,29 +1344,27 @@ def add_product_to_product_set request = nil, options: nil, **request_fields, &b # # * Returns NOT_FOUND If the Product is not found under the ProductSet. # - # @overload remove_product_from_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::RemoveProductFromProductSetRequest | Hash] - # Removes a Product from the specified ProductSet. + # @param request [Google::Cloud::Vision::V1::RemoveProductFromProductSetRequest | Hash] + # Removes a Product from the specified ProductSet. # - # Possible errors: + # Possible errors: # - # * Returns NOT_FOUND If the Product is not found under the ProductSet. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns NOT_FOUND If the Product is not found under the ProductSet. # - # @overload remove_product_from_product_set(name: nil, product: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The resource name for the ProductSet to modify. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param product [String] + # * `product` (`String`): # The resource name for the Product to be removed from this ProductSet. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -1469,13 +1377,9 @@ def add_product_to_product_set request = nil, options: nil, **request_fields, &b # @example # TODO # - def remove_product_from_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def remove_product_from_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::RemoveProductFromProductSetRequest # Converts hash and nil to an options object @@ -1519,30 +1423,28 @@ def remove_product_from_product_set request = nil, options: nil, **request_field # # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. # - # @overload list_products_in_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::ListProductsInProductSetRequest | Hash] - # Lists the Products in a ProductSet, in an unspecified order. If the - # ProductSet does not exist, the products field of the response will be - # empty. + # @param request [Google::Cloud::Vision::V1::ListProductsInProductSetRequest | Hash] + # Lists the Products in a ProductSet, in an unspecified order. If the + # ProductSet does not exist, the products field of the response will be + # empty. # - # Possible errors: + # Possible errors: # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. # - # @overload list_products_in_product_set(name: nil, page_size: nil, page_token: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The ProductSet resource for which to retrieve Products. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [String] + # * `page_token` (`String`): # The next_page_token returned from a previous List request, if any. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -1555,13 +1457,9 @@ def remove_product_from_product_set request = nil, options: nil, **request_field # @example # TODO # - def list_products_in_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_products_in_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::ListProductsInProductSetRequest # Converts hash and nil to an options object @@ -1610,31 +1508,29 @@ def list_products_in_product_set request = nil, options: nil, **request_fields, # For the format of the csv file please see # [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. # - # @overload import_product_sets(request, options: nil) - # @param request [Google::Cloud::Vision::V1::ImportProductSetsRequest | Hash] - # Asynchronous API that imports a list of reference images to specified - # product sets based on a list of image information. + # @param request [Google::Cloud::Vision::V1::ImportProductSetsRequest | Hash] + # Asynchronous API that imports a list of reference images to specified + # product sets based on a list of image information. # - # The [google.longrunning.Operation][google.longrunning.Operation] API can be - # used to keep track of the progress and results of the request. - # `Operation.metadata` contains `BatchOperationMetadata`. (progress) - # `Operation.response` contains `ImportProductSetsResponse`. (results) + # The [google.longrunning.Operation][google.longrunning.Operation] API can be + # used to keep track of the progress and results of the request. + # `Operation.metadata` contains `BatchOperationMetadata`. (progress) + # `Operation.response` contains `ImportProductSetsResponse`. (results) # - # The input source of this method is a csv file on Google Cloud Storage. - # For the format of the csv file please see - # [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # The input source of this method is a csv file on Google Cloud Storage. + # For the format of the csv file please see + # [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. # - # @overload import_product_sets(parent: nil, input_config: nil, options: nil) - # @param parent [String] + # When using a hash, the following fields are supported: + # + # * `parent` (`String`): # The project in which the ProductSets should be imported. # # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param input_config [Google::Cloud::Vision::V1::ImportProductSetsInputConfig | Hash] + # * `input_config` (`Google::Cloud::Vision::V1::ImportProductSetsInputConfig | Hash`): # The input content for the list of requests. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -1647,13 +1543,9 @@ def list_products_in_product_set request = nil, options: nil, **request_fields, # @example # TODO # - def import_product_sets request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def import_product_sets request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::ImportProductSetsRequest # Converts hash and nil to an options object diff --git a/shared/output/cloud/vision/lib/google/cloud/vision/v1/product_search/operations.rb b/shared/output/cloud/vision/lib/google/cloud/vision/v1/product_search/operations.rb index 0ffe7730a..e515913c2 100644 --- a/shared/output/cloud/vision/lib/google/cloud/vision/v1/product_search/operations.rb +++ b/shared/output/cloud/vision/lib/google/cloud/vision/v1/product_search/operations.rb @@ -107,27 +107,25 @@ def initialize # NOTE: the `name` binding below allows API services to override the binding # to use different resource name schemes, such as `users/*/operations`. # - # @overload list_operations(request, options: nil) - # @param request [Google::Longrunning::ListOperationsRequest | Hash] - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding below allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::ListOperationsRequest | Hash] + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding below allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation collection. - # @param filter [String] + # * `filter` (`String`): # The standard list filter. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The standard list page size. - # @param page_token [String] + # * `page_token` (`String`): # The standard list page token. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -140,13 +138,9 @@ def initialize # @example # TODO # - def list_operations request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_operations request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::ListOperationsRequest # Converts hash and nil to an options object @@ -188,19 +182,17 @@ def list_operations request = nil, options: nil, **request_fields, &block # method to poll the operation result at intervals as recommended by the API # service. # - # @overload get_operation(request, options: nil) - # @param request [Google::Longrunning::GetOperationRequest | Hash] - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Longrunning::GetOperationRequest | Hash] + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # When using a hash, the following fields are supported: # - # @overload get_operation(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The name of the operation resource. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -213,13 +205,9 @@ def list_operations request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::GetOperationRequest # Converts hash and nil to an options object @@ -261,20 +249,18 @@ def get_operation request = nil, options: nil, **request_fields, &block # operation. If the server doesn't support this method, it returns # `google.rpc.Code.UNIMPLEMENTED`. # - # @overload delete_operation(request, options: nil) - # @param request [Google::Longrunning::DeleteOperationRequest | Hash] - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload delete_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::DeleteOperationRequest | Hash] + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -287,13 +273,9 @@ def get_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::DeleteOperationRequest # Converts hash and nil to an options object @@ -340,26 +322,24 @@ def delete_operation request = nil, options: nil, **request_fields, &block # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, # corresponding to `Code.CANCELLED`. # - # @overload cancel_operation(request, options: nil) - # @param request [Google::Longrunning::CancelOperationRequest | Hash] - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - # corresponding to `Code.CANCELLED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload cancel_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::CancelOperationRequest | Hash] + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + # corresponding to `Code.CANCELLED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be cancelled. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -372,13 +352,9 @@ def delete_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def cancel_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def cancel_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::CancelOperationRequest # Converts hash and nil to an options object diff --git a/shared/output/gapic/templates/googleads/lib/google/ads/google_ads/v1/services/campaign_service/client.rb b/shared/output/gapic/templates/googleads/lib/google/ads/google_ads/v1/services/campaign_service/client.rb index d20d6d68a..9e749078b 100644 --- a/shared/output/gapic/templates/googleads/lib/google/ads/google_ads/v1/services/campaign_service/client.rb +++ b/shared/output/gapic/templates/googleads/lib/google/ads/google_ads/v1/services/campaign_service/client.rb @@ -114,17 +114,15 @@ def initialize ## # Returns the requested campaign in full detail. # - # @overload get_campaign(request, options: nil) - # @param request [Google::Ads::Googleads::V1::Services::GetCampaignRequest | Hash] - # Returns the requested campaign in full detail. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Ads::Googleads::V1::Services::GetCampaignRequest | Hash] + # Returns the requested campaign in full detail. # - # @overload get_campaign(resource_name: nil, options: nil) - # @param resource_name [String] + # When using a hash, the following fields are supported: + # + # * `resource_name` (`String`): # The resource name of the campaign to fetch. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Ads::Googleads::V1::Resources::Campaign] @@ -137,13 +135,9 @@ def initialize # @example # TODO # - def get_campaign request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_campaign request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Ads::Googleads::V1::Services::GetCampaignRequest # Converts hash and nil to an options object @@ -181,27 +175,25 @@ def get_campaign request = nil, options: nil, **request_fields, &block ## # Creates, updates, or removes campaigns. Operation statuses are returned. # - # @overload mutate_campaigns(request, options: nil) - # @param request [Google::Ads::Googleads::V1::Services::MutateCampaignsRequest | Hash] - # Creates, updates, or removes campaigns. Operation statuses are returned. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Ads::Googleads::V1::Services::MutateCampaignsRequest | Hash] + # Creates, updates, or removes campaigns. Operation statuses are returned. # - # @overload mutate_campaigns(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, options: nil) - # @param customer_id [String] + # When using a hash, the following fields are supported: + # + # * `customer_id` (`String`): # The ID of the customer whose campaigns are being modified. - # @param operations [Google::Ads::Googleads::V1::Services::CampaignOperation | Hash] + # * `operations` (`Google::Ads::Googleads::V1::Services::CampaignOperation | Hash`): # The list of operations to perform on individual campaigns. - # @param partial_failure [Boolean] + # * `partial_failure` (`Boolean`): # If true, successful operations will be carried out and invalid # operations will return errors. If false, all operations will be carried # out in one transaction if and only if they are all valid. # Default is false. - # @param validate_only [Boolean] + # * `validate_only` (`Boolean`): # If true, the request is validated but not executed. Only errors are # returned, not results. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Ads::Googleads::V1::Services::MutateCampaignsResponse] @@ -214,13 +206,9 @@ def get_campaign request = nil, options: nil, **request_fields, &block # @example # TODO # - def mutate_campaigns request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def mutate_campaigns request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Ads::Googleads::V1::Services::MutateCampaignsRequest # Converts hash and nil to an options object diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/echo/client.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/echo/client.rb index 7f0a939f6..dbd48d03b 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/echo/client.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/echo/client.rb @@ -116,19 +116,17 @@ def initialize ## # This method simply echos the request. This method is showcases unary rpcs. # - # @overload echo(request, options: nil) - # @param request [Google::Showcase::V1alpha3::EchoRequest | Hash] - # This method simply echos the request. This method is showcases unary rpcs. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload echo(content: nil, error: nil, options: nil) - # @param content [String] + # @param request [Google::Showcase::V1alpha3::EchoRequest | Hash] + # This method simply echos the request. This method is showcases unary rpcs. + # + # When using a hash, the following fields are supported: + # + # * `content` (`String`): # The content to be echoed by the server. - # @param error [Google::Rpc::Status | Hash] + # * `error` (`Google::Rpc::Status | Hash`): # The error to be thrown by the server. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::EchoResponse] @@ -141,13 +139,9 @@ def initialize # @example # TODO # - def echo request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def echo request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::EchoRequest # Converts hash and nil to an options object @@ -180,20 +174,18 @@ def echo request = nil, options: nil, **request_fields, &block # This method split the given content into words and will pass each word back # through the stream. This method showcases server-side streaming rpcs. # - # @overload expand(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ExpandRequest | Hash] - # This method split the given content into words and will pass each word back - # through the stream. This method showcases server-side streaming rpcs. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ExpandRequest | Hash] + # This method split the given content into words and will pass each word back + # through the stream. This method showcases server-side streaming rpcs. # - # @overload expand(content: nil, error: nil, options: nil) - # @param content [String] + # When using a hash, the following fields are supported: + # + # * `content` (`String`): # The content that will be split into words and returned on the stream. - # @param error [Google::Rpc::Status | Hash] + # * `error` (`Google::Rpc::Status | Hash`): # The error that is thrown after all words are sent on the stream. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Enumerable] @@ -206,13 +198,9 @@ def echo request = nil, options: nil, **request_fields, &block # @example # TODO # - def expand request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def expand request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ExpandRequest # Converts hash and nil to an options object @@ -249,7 +237,7 @@ def expand request = nil, options: nil, **request_fields, &block # @param request [Google::Gax::StreamInput, Enumerable] # An enumerable of {Google::Showcase::V1alpha3::EchoRequest} instances. # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::EchoResponse] @@ -262,7 +250,7 @@ def expand request = nil, options: nil, **request_fields, &block # @example # TODO # - def collect request, options: nil, &block + def collect request, options = nil, &block unless request.is_a? Enumerable if request.respond_to? :to_enum request = request.to_enum @@ -309,7 +297,7 @@ def collect request, options: nil, &block # @param request [Google::Gax::StreamInput, Enumerable] # An enumerable of {Google::Showcase::V1alpha3::EchoRequest} instances. # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Enumerable] @@ -322,7 +310,7 @@ def collect request, options: nil, &block # @example # TODO # - def chat request, options: nil, &block + def chat request, options = nil, &block unless request.is_a? Enumerable if request.respond_to? :to_enum request = request.to_enum @@ -365,22 +353,20 @@ def chat request, options: nil, &block # This is similar to the Expand method but instead of returning a stream of # expanded words, this method returns a paged list of expanded words. # - # @overload paged_expand(request, options: nil) - # @param request [Google::Showcase::V1alpha3::PagedExpandRequest | Hash] - # This is similar to the Expand method but instead of returning a stream of - # expanded words, this method returns a paged list of expanded words. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::PagedExpandRequest | Hash] + # This is similar to the Expand method but instead of returning a stream of + # expanded words, this method returns a paged list of expanded words. # - # @overload paged_expand(content: nil, page_size: nil, page_token: nil, options: nil) - # @param content [String] + # When using a hash, the following fields are supported: + # + # * `content` (`String`): # The string to expand. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The amount of words to returned in each page. - # @param page_token [String] + # * `page_token` (`String`): # The position of the page to be returned. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -393,13 +379,9 @@ def chat request, options: nil, &block # @example # TODO # - def paged_expand request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def paged_expand request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::PagedExpandRequest # Converts hash and nil to an options object @@ -433,25 +415,23 @@ def paged_expand request = nil, options: nil, **request_fields, &block # This method will wait the requested amount of and then return. # This method showcases how a client handles a request timing out. # - # @overload wait(request, options: nil) - # @param request [Google::Showcase::V1alpha3::WaitRequest | Hash] - # This method will wait the requested amount of and then return. - # This method showcases how a client handles a request timing out. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::WaitRequest | Hash] + # This method will wait the requested amount of and then return. + # This method showcases how a client handles a request timing out. # - # @overload wait(end_time: nil, ttl: nil, error: nil, success: nil, options: nil) - # @param end_time [Google::Protobuf::Timestamp | Hash] + # When using a hash, the following fields are supported: + # + # * `end_time` (`Google::Protobuf::Timestamp | Hash`): # The time that this operation will complete. - # @param ttl [Google::Protobuf::Duration | Hash] + # * `ttl` (`Google::Protobuf::Duration | Hash`): # The duration of this operation. - # @param error [Google::Rpc::Status | Hash] + # * `error` (`Google::Rpc::Status | Hash`): # The error that will be returned by the server. If this code is specified # to be the OK rpc code, an empty response will be returned. - # @param success [Google::Showcase::V1alpha3::WaitResponse | Hash] + # * `success` (`Google::Showcase::V1alpha3::WaitResponse | Hash`): # The response to be returned on operation completion. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -464,13 +444,9 @@ def paged_expand request = nil, options: nil, **request_fields, &block # @example # TODO # - def wait request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def wait request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::WaitRequest # Converts hash and nil to an options object diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/echo/operations.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/echo/operations.rb index 81b1a3dc6..33b517deb 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/echo/operations.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/echo/operations.rb @@ -114,27 +114,25 @@ def initialize # NOTE: the `name` binding below allows API services to override the binding # to use different resource name schemes, such as `users/*/operations`. # - # @overload list_operations(request, options: nil) - # @param request [Google::Longrunning::ListOperationsRequest | Hash] - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding below allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::ListOperationsRequest | Hash] + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding below allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation collection. - # @param filter [String] + # * `filter` (`String`): # The standard list filter. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The standard list page size. - # @param page_token [String] + # * `page_token` (`String`): # The standard list page token. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -147,13 +145,9 @@ def initialize # @example # TODO # - def list_operations request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_operations request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::ListOperationsRequest # Converts hash and nil to an options object @@ -195,19 +189,17 @@ def list_operations request = nil, options: nil, **request_fields, &block # method to poll the operation result at intervals as recommended by the API # service. # - # @overload get_operation(request, options: nil) - # @param request [Google::Longrunning::GetOperationRequest | Hash] - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Longrunning::GetOperationRequest | Hash] + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # When using a hash, the following fields are supported: # - # @overload get_operation(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The name of the operation resource. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -220,13 +212,9 @@ def list_operations request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::GetOperationRequest # Converts hash and nil to an options object @@ -268,20 +256,18 @@ def get_operation request = nil, options: nil, **request_fields, &block # operation. If the server doesn't support this method, it returns # `google.rpc.Code.UNIMPLEMENTED`. # - # @overload delete_operation(request, options: nil) - # @param request [Google::Longrunning::DeleteOperationRequest | Hash] - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload delete_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::DeleteOperationRequest | Hash] + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -294,13 +280,9 @@ def get_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::DeleteOperationRequest # Converts hash and nil to an options object @@ -347,26 +329,24 @@ def delete_operation request = nil, options: nil, **request_fields, &block # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, # corresponding to `Code.CANCELLED`. # - # @overload cancel_operation(request, options: nil) - # @param request [Google::Longrunning::CancelOperationRequest | Hash] - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - # corresponding to `Code.CANCELLED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload cancel_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::CancelOperationRequest | Hash] + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + # corresponding to `Code.CANCELLED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be cancelled. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -379,13 +359,9 @@ def delete_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def cancel_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def cancel_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::CancelOperationRequest # Converts hash and nil to an options object diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/identity/client.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/identity/client.rb index 2a8424d63..4abe2859c 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/identity/client.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/identity/client.rb @@ -115,17 +115,15 @@ def initialize ## # Creates a user. # - # @overload create_user(request, options: nil) - # @param request [Google::Showcase::V1alpha3::CreateUserRequest | Hash] - # Creates a user. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload create_user(user: nil, options: nil) - # @param user [Google::Showcase::V1alpha3::User | Hash] + # @param request [Google::Showcase::V1alpha3::CreateUserRequest | Hash] + # Creates a user. + # + # When using a hash, the following fields are supported: + # + # * `user` (`Google::Showcase::V1alpha3::User | Hash`): # The user to create. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::User] @@ -138,13 +136,9 @@ def initialize # @example # TODO # - def create_user request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_user request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::CreateUserRequest # Converts hash and nil to an options object @@ -176,17 +170,15 @@ def create_user request = nil, options: nil, **request_fields, &block ## # Retrieves the User with the given uri. # - # @overload get_user(request, options: nil) - # @param request [Google::Showcase::V1alpha3::GetUserRequest | Hash] - # Retrieves the User with the given uri. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::GetUserRequest | Hash] + # Retrieves the User with the given uri. # - # @overload get_user(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The resource name of the requested user. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::User] @@ -199,13 +191,9 @@ def create_user request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_user request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_user request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::GetUserRequest # Converts hash and nil to an options object @@ -243,20 +231,18 @@ def get_user request = nil, options: nil, **request_fields, &block ## # Updates a user. # - # @overload update_user(request, options: nil) - # @param request [Google::Showcase::V1alpha3::UpdateUserRequest | Hash] - # Updates a user. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::UpdateUserRequest | Hash] + # Updates a user. + # + # When using a hash, the following fields are supported: # - # @overload update_user(user: nil, update_mask: nil, options: nil) - # @param user [Google::Showcase::V1alpha3::User | Hash] + # * `user` (`Google::Showcase::V1alpha3::User | Hash`): # The user to update. - # @param update_mask [Google::Protobuf::FieldMask | Hash] + # * `update_mask` (`Google::Protobuf::FieldMask | Hash`): # The field mask to determine wich fields are to be updated. If empty, the # server will assume all fields are to be updated. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::User] @@ -269,13 +255,9 @@ def get_user request = nil, options: nil, **request_fields, &block # @example # TODO # - def update_user request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def update_user request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::UpdateUserRequest # Converts hash and nil to an options object @@ -313,17 +295,15 @@ def update_user request = nil, options: nil, **request_fields, &block ## # Deletes a user, their profile, and all of their authored messages. # - # @overload delete_user(request, options: nil) - # @param request [Google::Showcase::V1alpha3::DeleteUserRequest | Hash] - # Deletes a user, their profile, and all of their authored messages. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::DeleteUserRequest | Hash] + # Deletes a user, their profile, and all of their authored messages. + # + # When using a hash, the following fields are supported: # - # @overload delete_user(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name of the user to delete. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -336,13 +316,9 @@ def update_user request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_user request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_user request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::DeleteUserRequest # Converts hash and nil to an options object @@ -380,22 +356,20 @@ def delete_user request = nil, options: nil, **request_fields, &block ## # Lists all users. # - # @overload list_users(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ListUsersRequest | Hash] - # Lists all users. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ListUsersRequest | Hash] + # Lists all users. # - # @overload list_users(page_size: nil, page_token: nil, options: nil) - # @param page_size [Integer] + # When using a hash, the following fields are supported: + # + # * `page_size` (`Integer`): # The maximum number of users to return. Server may return fewer users # than requested. If unspecified, server will pick an appropriate default. - # @param page_token [String] + # * `page_token` (`String`): # The value of google.showcase.v1alpha3.ListUsersResponse.next_page_token # returned from the previous call to # `google.showcase.v1alpha3.Identity\ListUsers` method. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -408,13 +382,9 @@ def delete_user request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_users request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_users request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ListUsersRequest # Converts hash and nil to an options object diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/messaging/client.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/messaging/client.rb index 183186bd4..889df24ed 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/messaging/client.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/messaging/client.rb @@ -119,17 +119,15 @@ def initialize ## # Creates a room. # - # @overload create_room(request, options: nil) - # @param request [Google::Showcase::V1alpha3::CreateRoomRequest | Hash] - # Creates a room. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload create_room(room: nil, options: nil) - # @param room [Google::Showcase::V1alpha3::Room | Hash] + # @param request [Google::Showcase::V1alpha3::CreateRoomRequest | Hash] + # Creates a room. + # + # When using a hash, the following fields are supported: + # + # * `room` (`Google::Showcase::V1alpha3::Room | Hash`): # The room to create. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Room] @@ -142,13 +140,9 @@ def initialize # @example # TODO # - def create_room request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_room request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::CreateRoomRequest # Converts hash and nil to an options object @@ -180,17 +174,15 @@ def create_room request = nil, options: nil, **request_fields, &block ## # Retrieves the Room with the given resource name. # - # @overload get_room(request, options: nil) - # @param request [Google::Showcase::V1alpha3::GetRoomRequest | Hash] - # Retrieves the Room with the given resource name. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::GetRoomRequest | Hash] + # Retrieves the Room with the given resource name. + # + # When using a hash, the following fields are supported: # - # @overload get_room(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name of the requested room. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Room] @@ -203,13 +195,9 @@ def create_room request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_room request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_room request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::GetRoomRequest # Converts hash and nil to an options object @@ -247,20 +235,18 @@ def get_room request = nil, options: nil, **request_fields, &block ## # Updates a room. # - # @overload update_room(request, options: nil) - # @param request [Google::Showcase::V1alpha3::UpdateRoomRequest | Hash] - # Updates a room. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::UpdateRoomRequest | Hash] + # Updates a room. + # + # When using a hash, the following fields are supported: # - # @overload update_room(room: nil, update_mask: nil, options: nil) - # @param room [Google::Showcase::V1alpha3::Room | Hash] + # * `room` (`Google::Showcase::V1alpha3::Room | Hash`): # The room to update. - # @param update_mask [Google::Protobuf::FieldMask | Hash] + # * `update_mask` (`Google::Protobuf::FieldMask | Hash`): # The field mask to determine wich fields are to be updated. If empty, the # server will assume all fields are to be updated. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Room] @@ -273,13 +259,9 @@ def get_room request = nil, options: nil, **request_fields, &block # @example # TODO # - def update_room request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def update_room request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::UpdateRoomRequest # Converts hash and nil to an options object @@ -317,17 +299,15 @@ def update_room request = nil, options: nil, **request_fields, &block ## # Deletes a room and all of its blurbs. # - # @overload delete_room(request, options: nil) - # @param request [Google::Showcase::V1alpha3::DeleteRoomRequest | Hash] - # Deletes a room and all of its blurbs. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::DeleteRoomRequest | Hash] + # Deletes a room and all of its blurbs. # - # @overload delete_room(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The resource name of the requested room. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -340,13 +320,9 @@ def update_room request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_room request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_room request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::DeleteRoomRequest # Converts hash and nil to an options object @@ -384,22 +360,20 @@ def delete_room request = nil, options: nil, **request_fields, &block ## # Lists all chat rooms. # - # @overload list_rooms(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ListRoomsRequest | Hash] - # Lists all chat rooms. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ListRoomsRequest | Hash] + # Lists all chat rooms. # - # @overload list_rooms(page_size: nil, page_token: nil, options: nil) - # @param page_size [Integer] + # When using a hash, the following fields are supported: + # + # * `page_size` (`Integer`): # The maximum number of rooms return. Server may return fewer rooms # than requested. If unspecified, server will pick an appropriate default. - # @param page_token [String] + # * `page_token` (`String`): # The value of google.showcase.v1alpha3.ListRoomsResponse.next_page_token # returned from the previous call to # `google.showcase.v1alpha3.Messaging\ListRooms` method. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -412,13 +386,9 @@ def delete_room request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_rooms request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_rooms request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ListRoomsRequest # Converts hash and nil to an options object @@ -453,22 +423,20 @@ def list_rooms request = nil, options: nil, **request_fields, &block # message in that room. If the parent is a profile, the blurb is understood # to be a post on the profile. # - # @overload create_blurb(request, options: nil) - # @param request [Google::Showcase::V1alpha3::CreateBlurbRequest | Hash] - # Creates a blurb. If the parent is a room, the blurb is understood to be a - # message in that room. If the parent is a profile, the blurb is understood - # to be a post on the profile. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::CreateBlurbRequest | Hash] + # Creates a blurb. If the parent is a room, the blurb is understood to be a + # message in that room. If the parent is a profile, the blurb is understood + # to be a post on the profile. + # + # When using a hash, the following fields are supported: # - # @overload create_blurb(parent: nil, blurb: nil, options: nil) - # @param parent [String] + # * `parent` (`String`): # The resource name of the chat room or user profile that this blurb will # be tied to. - # @param blurb [Google::Showcase::V1alpha3::Blurb | Hash] + # * `blurb` (`Google::Showcase::V1alpha3::Blurb | Hash`): # The blurb to create. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Blurb] @@ -481,13 +449,9 @@ def list_rooms request = nil, options: nil, **request_fields, &block # @example # TODO # - def create_blurb request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_blurb request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::CreateBlurbRequest # Converts hash and nil to an options object @@ -525,17 +489,15 @@ def create_blurb request = nil, options: nil, **request_fields, &block ## # Retrieves the Blurb with the given resource name. # - # @overload get_blurb(request, options: nil) - # @param request [Google::Showcase::V1alpha3::GetBlurbRequest | Hash] - # Retrieves the Blurb with the given resource name. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::GetBlurbRequest | Hash] + # Retrieves the Blurb with the given resource name. # - # @overload get_blurb(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The resource name of the requested blurb. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Blurb] @@ -548,13 +510,9 @@ def create_blurb request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_blurb request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_blurb request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::GetBlurbRequest # Converts hash and nil to an options object @@ -592,20 +550,18 @@ def get_blurb request = nil, options: nil, **request_fields, &block ## # Updates a blurb. # - # @overload update_blurb(request, options: nil) - # @param request [Google::Showcase::V1alpha3::UpdateBlurbRequest | Hash] - # Updates a blurb. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::UpdateBlurbRequest | Hash] + # Updates a blurb. # - # @overload update_blurb(blurb: nil, update_mask: nil, options: nil) - # @param blurb [Google::Showcase::V1alpha3::Blurb | Hash] + # When using a hash, the following fields are supported: + # + # * `blurb` (`Google::Showcase::V1alpha3::Blurb | Hash`): # The blurb to update. - # @param update_mask [Google::Protobuf::FieldMask | Hash] + # * `update_mask` (`Google::Protobuf::FieldMask | Hash`): # The field mask to determine wich fields are to be updated. If empty, the # server will assume all fields are to be updated. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Blurb] @@ -618,13 +574,9 @@ def get_blurb request = nil, options: nil, **request_fields, &block # @example # TODO # - def update_blurb request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def update_blurb request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::UpdateBlurbRequest # Converts hash and nil to an options object @@ -662,17 +614,15 @@ def update_blurb request = nil, options: nil, **request_fields, &block ## # Deletes a blurb. # - # @overload delete_blurb(request, options: nil) - # @param request [Google::Showcase::V1alpha3::DeleteBlurbRequest | Hash] - # Deletes a blurb. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::DeleteBlurbRequest | Hash] + # Deletes a blurb. + # + # When using a hash, the following fields are supported: # - # @overload delete_blurb(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name of the requested blurb. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -685,13 +635,9 @@ def update_blurb request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_blurb request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_blurb request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::DeleteBlurbRequest # Converts hash and nil to an options object @@ -730,26 +676,24 @@ def delete_blurb request = nil, options: nil, **request_fields, &block # Lists blurbs for a specific chat room or user profile depending on the # parent resource name. # - # @overload list_blurbs(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ListBlurbsRequest | Hash] - # Lists blurbs for a specific chat room or user profile depending on the - # parent resource name. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ListBlurbsRequest | Hash] + # Lists blurbs for a specific chat room or user profile depending on the + # parent resource name. # - # @overload list_blurbs(parent: nil, page_size: nil, page_token: nil, options: nil) - # @param parent [String] + # When using a hash, the following fields are supported: + # + # * `parent` (`String`): # The resource name of the requested room or profile whos blurbs to list. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of blurbs to return. Server may return fewer # blurbs than requested. If unspecified, server will pick an appropriate # default. - # @param page_token [String] + # * `page_token` (`String`): # The value of google.showcase.v1alpha3.ListBlurbsResponse.next_page_token # returned from the previous call to # `google.showcase.v1alpha3.Messaging\ListBlurbs` method. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -762,13 +706,9 @@ def delete_blurb request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_blurbs request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_blurbs request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ListBlurbsRequest # Converts hash and nil to an options object @@ -809,32 +749,30 @@ def list_blurbs request = nil, options: nil, **request_fields, &block # for blurbs containing to words found in the query. Only posts that # contain an exact match of a queried word will be returned. # - # @overload search_blurbs(request, options: nil) - # @param request [Google::Showcase::V1alpha3::SearchBlurbsRequest | Hash] - # This method searches through all blurbs across all rooms and profiles - # for blurbs containing to words found in the query. Only posts that - # contain an exact match of a queried word will be returned. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::SearchBlurbsRequest | Hash] + # This method searches through all blurbs across all rooms and profiles + # for blurbs containing to words found in the query. Only posts that + # contain an exact match of a queried word will be returned. # - # @overload search_blurbs(query: nil, parent: nil, page_size: nil, page_token: nil, options: nil) - # @param query [String] + # When using a hash, the following fields are supported: + # + # * `query` (`String`): # The query used to search for blurbs containing to words of this string. # Only posts that contain an exact match of a queried word will be returned. - # @param parent [String] + # * `parent` (`String`): # The rooms or profiles to search. If unset, `SearchBlurbs` will search all # rooms and all profiles. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of blurbs return. Server may return fewer # blurbs than requested. If unspecified, server will pick an appropriate # default. - # @param page_token [String] + # * `page_token` (`String`): # The value of # google.showcase.v1alpha3.SearchBlurbsResponse.next_page_token # returned from the previous call to # `google.showcase.v1alpha3.Messaging\SearchBlurbs` method. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -847,13 +785,9 @@ def list_blurbs request = nil, options: nil, **request_fields, &block # @example # TODO # - def search_blurbs request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def search_blurbs request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::SearchBlurbsRequest # Converts hash and nil to an options object @@ -893,20 +827,18 @@ def search_blurbs request = nil, options: nil, **request_fields, &block # This returns a stream that emits the blurbs that are created for a # particular chat room or user profile. # - # @overload stream_blurbs(request, options: nil) - # @param request [Google::Showcase::V1alpha3::StreamBlurbsRequest | Hash] - # This returns a stream that emits the blurbs that are created for a - # particular chat room or user profile. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::StreamBlurbsRequest | Hash] + # This returns a stream that emits the blurbs that are created for a + # particular chat room or user profile. + # + # When using a hash, the following fields are supported: # - # @overload stream_blurbs(name: nil, expire_time: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name of a chat room or user profile whose blurbs to stream. - # @param expire_time [Google::Protobuf::Timestamp | Hash] + # * `expire_time` (`Google::Protobuf::Timestamp | Hash`): # The time at which this stream will close. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Enumerable] @@ -919,13 +851,9 @@ def search_blurbs request = nil, options: nil, **request_fields, &block # @example # TODO # - def stream_blurbs request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def stream_blurbs request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::StreamBlurbsRequest # Converts hash and nil to an options object @@ -967,7 +895,7 @@ def stream_blurbs request = nil, options: nil, **request_fields, &block # @param request [Google::Gax::StreamInput, Enumerable] # An enumerable of {Google::Showcase::V1alpha3::CreateBlurbRequest} instances. # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::SendBlurbsResponse] @@ -980,7 +908,7 @@ def stream_blurbs request = nil, options: nil, **request_fields, &block # @example # TODO # - def send_blurbs request, options: nil, &block + def send_blurbs request, options = nil, &block unless request.is_a? Enumerable if request.respond_to? :to_enum request = request.to_enum @@ -1034,7 +962,7 @@ def send_blurbs request, options: nil, &block # @param request [Google::Gax::StreamInput, Enumerable] # An enumerable of {Google::Showcase::V1alpha3::ConnectRequest} instances. # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Enumerable] @@ -1047,7 +975,7 @@ def send_blurbs request, options: nil, &block # @example # TODO # - def connect request, options: nil, &block + def connect request, options = nil, &block unless request.is_a? Enumerable if request.respond_to? :to_enum request = request.to_enum diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/messaging/operations.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/messaging/operations.rb index b4b205e95..f275e4efd 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/messaging/operations.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/messaging/operations.rb @@ -114,27 +114,25 @@ def initialize # NOTE: the `name` binding below allows API services to override the binding # to use different resource name schemes, such as `users/*/operations`. # - # @overload list_operations(request, options: nil) - # @param request [Google::Longrunning::ListOperationsRequest | Hash] - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding below allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::ListOperationsRequest | Hash] + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding below allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation collection. - # @param filter [String] + # * `filter` (`String`): # The standard list filter. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The standard list page size. - # @param page_token [String] + # * `page_token` (`String`): # The standard list page token. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -147,13 +145,9 @@ def initialize # @example # TODO # - def list_operations request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_operations request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::ListOperationsRequest # Converts hash and nil to an options object @@ -195,19 +189,17 @@ def list_operations request = nil, options: nil, **request_fields, &block # method to poll the operation result at intervals as recommended by the API # service. # - # @overload get_operation(request, options: nil) - # @param request [Google::Longrunning::GetOperationRequest | Hash] - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Longrunning::GetOperationRequest | Hash] + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # When using a hash, the following fields are supported: # - # @overload get_operation(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The name of the operation resource. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -220,13 +212,9 @@ def list_operations request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::GetOperationRequest # Converts hash and nil to an options object @@ -268,20 +256,18 @@ def get_operation request = nil, options: nil, **request_fields, &block # operation. If the server doesn't support this method, it returns # `google.rpc.Code.UNIMPLEMENTED`. # - # @overload delete_operation(request, options: nil) - # @param request [Google::Longrunning::DeleteOperationRequest | Hash] - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload delete_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::DeleteOperationRequest | Hash] + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -294,13 +280,9 @@ def get_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::DeleteOperationRequest # Converts hash and nil to an options object @@ -347,26 +329,24 @@ def delete_operation request = nil, options: nil, **request_fields, &block # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, # corresponding to `Code.CANCELLED`. # - # @overload cancel_operation(request, options: nil) - # @param request [Google::Longrunning::CancelOperationRequest | Hash] - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - # corresponding to `Code.CANCELLED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload cancel_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::CancelOperationRequest | Hash] + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + # corresponding to `Code.CANCELLED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be cancelled. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -379,13 +359,9 @@ def delete_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def cancel_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def cancel_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::CancelOperationRequest # Converts hash and nil to an options object diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/testing/client.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/testing/client.rb index fd0fc492d..06e832173 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/testing/client.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1alpha3/testing/client.rb @@ -115,19 +115,17 @@ def initialize ## # Creates a new testing session. # - # @overload create_session(request, options: nil) - # @param request [Google::Showcase::V1alpha3::CreateSessionRequest | Hash] - # Creates a new testing session. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload create_session(session: nil, options: nil) - # @param session [Google::Showcase::V1alpha3::Session | Hash] + # @param request [Google::Showcase::V1alpha3::CreateSessionRequest | Hash] + # Creates a new testing session. + # + # When using a hash, the following fields are supported: + # + # * `session` (`Google::Showcase::V1alpha3::Session | Hash`): # The session to be created. # Sessions are immutable once they are created (although they can # be deleted). - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Session] @@ -140,13 +138,9 @@ def initialize # @example # TODO # - def create_session request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_session request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::CreateSessionRequest # Converts hash and nil to an options object @@ -178,17 +172,15 @@ def create_session request = nil, options: nil, **request_fields, &block ## # Gets a testing session. # - # @overload get_session(request, options: nil) - # @param request [Google::Showcase::V1alpha3::GetSessionRequest | Hash] - # Gets a testing session. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::GetSessionRequest | Hash] + # Gets a testing session. # - # @overload get_session(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The session to be retrieved. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::Session] @@ -201,13 +193,9 @@ def create_session request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_session request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_session request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::GetSessionRequest # Converts hash and nil to an options object @@ -245,19 +233,17 @@ def get_session request = nil, options: nil, **request_fields, &block ## # Lists the current test sessions. # - # @overload list_sessions(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ListSessionsRequest | Hash] - # Lists the current test sessions. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ListSessionsRequest | Hash] + # Lists the current test sessions. # - # @overload list_sessions(page_size: nil, page_token: nil, options: nil) - # @param page_size [Integer] + # When using a hash, the following fields are supported: + # + # * `page_size` (`Integer`): # The maximum number of sessions to return per page. - # @param page_token [String] + # * `page_token` (`String`): # The page token, for retrieving subsequent pages. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -270,13 +256,9 @@ def get_session request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_sessions request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_sessions request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ListSessionsRequest # Converts hash and nil to an options object @@ -309,17 +291,15 @@ def list_sessions request = nil, options: nil, **request_fields, &block ## # Delete a test session. # - # @overload delete_session(request, options: nil) - # @param request [Google::Showcase::V1alpha3::DeleteSessionRequest | Hash] - # Delete a test session. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::DeleteSessionRequest | Hash] + # Delete a test session. # - # @overload delete_session(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The session to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -332,13 +312,9 @@ def list_sessions request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_session request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_session request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::DeleteSessionRequest # Converts hash and nil to an options object @@ -378,19 +354,17 @@ def delete_session request = nil, options: nil, **request_fields, &block # This generates a report detailing which tests have been completed, # and an overall rollup. # - # @overload report_session(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ReportSessionRequest | Hash] - # Report on the status of a session. - # This generates a report detailing which tests have been completed, - # and an overall rollup. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ReportSessionRequest | Hash] + # Report on the status of a session. + # This generates a report detailing which tests have been completed, + # and an overall rollup. # - # @overload report_session(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The session to be reported on. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::ReportSessionResponse] @@ -403,13 +377,9 @@ def delete_session request = nil, options: nil, **request_fields, &block # @example # TODO # - def report_session request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def report_session request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ReportSessionRequest # Converts hash and nil to an options object @@ -447,21 +417,19 @@ def report_session request = nil, options: nil, **request_fields, &block ## # List the tests of a sessesion. # - # @overload list_tests(request, options: nil) - # @param request [Google::Showcase::V1alpha3::ListTestsRequest | Hash] - # List the tests of a sessesion. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Showcase::V1alpha3::ListTestsRequest | Hash] + # List the tests of a sessesion. # - # @overload list_tests(parent: nil, page_size: nil, page_token: nil, options: nil) - # @param parent [String] + # When using a hash, the following fields are supported: + # + # * `parent` (`String`): # The session. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of tests to return per page. - # @param page_token [String] + # * `page_token` (`String`): # The page token, for retrieving subsequent pages. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -474,13 +442,9 @@ def report_session request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_tests request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_tests request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::ListTestsRequest # Converts hash and nil to an options object @@ -524,22 +488,20 @@ def list_tests request = nil, options: nil, **request_fields, &block # # This method will error if attempting to delete a required test. # - # @overload delete_test(request, options: nil) - # @param request [Google::Showcase::V1alpha3::DeleteTestRequest | Hash] - # Explicitly decline to implement a test. + # @param request [Google::Showcase::V1alpha3::DeleteTestRequest | Hash] + # Explicitly decline to implement a test. # - # This removes the test from subsequent `ListTests` calls, and - # attempting to do the test will error. + # This removes the test from subsequent `ListTests` calls, and + # attempting to do the test will error. # - # This method will error if attempting to delete a required test. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # This method will error if attempting to delete a required test. # - # @overload delete_test(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The test to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -552,13 +514,9 @@ def list_tests request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_test request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_test request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::DeleteTestRequest # Converts hash and nil to an options object @@ -599,24 +557,22 @@ def delete_test request = nil, options: nil, **request_fields, &block # In cases where a test involves registering a final answer at the # end of the test, this method provides the means to do so. # - # @overload verify_test(request, options: nil) - # @param request [Google::Showcase::V1alpha3::VerifyTestRequest | Hash] - # Register a response to a test. + # @param request [Google::Showcase::V1alpha3::VerifyTestRequest | Hash] + # Register a response to a test. # - # In cases where a test involves registering a final answer at the - # end of the test, this method provides the means to do so. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # In cases where a test involves registering a final answer at the + # end of the test, this method provides the means to do so. # - # @overload verify_test(name: nil, answer: nil, answers: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The test to have an answer registered to it. - # @param answer [String] + # * `answer` (`String`): # The answer from the test. - # @param answers [String] + # * `answers` (`String`): # The answers from the test if multiple are to be checked - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Showcase::V1alpha3::VerifyTestResponse] @@ -629,13 +585,9 @@ def delete_test request = nil, options: nil, **request_fields, &block # @example # TODO # - def verify_test request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def verify_test request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Showcase::V1alpha3::VerifyTestRequest # Converts hash and nil to an options object diff --git a/shared/output/gapic/templates/speech/lib/google/cloud/speech/v1/speech/client.rb b/shared/output/gapic/templates/speech/lib/google/cloud/speech/v1/speech/client.rb index 7a5b589af..72e622917 100644 --- a/shared/output/gapic/templates/speech/lib/google/cloud/speech/v1/speech/client.rb +++ b/shared/output/gapic/templates/speech/lib/google/cloud/speech/v1/speech/client.rb @@ -118,21 +118,19 @@ def initialize # Performs synchronous speech recognition: receive results after all audio # has been sent and processed. # - # @overload recognize(request, options: nil) - # @param request [Google::Cloud::Speech::V1::RecognizeRequest | Hash] - # Performs synchronous speech recognition: receive results after all audio - # has been sent and processed. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Cloud::Speech::V1::RecognizeRequest | Hash] + # Performs synchronous speech recognition: receive results after all audio + # has been sent and processed. # - # @overload recognize(config: nil, audio: nil, options: nil) - # @param config [Google::Cloud::Speech::V1::RecognitionConfig | Hash] + # When using a hash, the following fields are supported: + # + # * `config` (`Google::Cloud::Speech::V1::RecognitionConfig | Hash`): # *Required* Provides information to the recognizer that specifies how to # process the request. - # @param audio [Google::Cloud::Speech::V1::RecognitionAudio | Hash] + # * `audio` (`Google::Cloud::Speech::V1::RecognitionAudio | Hash`): # *Required* The audio data to be recognized. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Speech::V1::RecognizeResponse] @@ -145,13 +143,9 @@ def initialize # @example # TODO # - def recognize request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def recognize request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Speech::V1::RecognizeRequest # Converts hash and nil to an options object @@ -186,23 +180,21 @@ def recognize request = nil, options: nil, **request_fields, &block # `Operation.error` or an `Operation.response` which contains # a `LongRunningRecognizeResponse` message. # - # @overload long_running_recognize(request, options: nil) - # @param request [Google::Cloud::Speech::V1::LongRunningRecognizeRequest | Hash] - # Performs asynchronous speech recognition: receive results via the - # google.longrunning.Operations interface. Returns either an - # `Operation.error` or an `Operation.response` which contains - # a `LongRunningRecognizeResponse` message. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Cloud::Speech::V1::LongRunningRecognizeRequest | Hash] + # Performs asynchronous speech recognition: receive results via the + # google.longrunning.Operations interface. Returns either an + # `Operation.error` or an `Operation.response` which contains + # a `LongRunningRecognizeResponse` message. # - # @overload long_running_recognize(config: nil, audio: nil, options: nil) - # @param config [Google::Cloud::Speech::V1::RecognitionConfig | Hash] + # When using a hash, the following fields are supported: + # + # * `config` (`Google::Cloud::Speech::V1::RecognitionConfig | Hash`): # *Required* Provides information to the recognizer that specifies how to # process the request. - # @param audio [Google::Cloud::Speech::V1::RecognitionAudio | Hash] + # * `audio` (`Google::Cloud::Speech::V1::RecognitionAudio | Hash`): # *Required* The audio data to be recognized. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -215,13 +207,9 @@ def recognize request = nil, options: nil, **request_fields, &block # @example # TODO # - def long_running_recognize request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def long_running_recognize request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Speech::V1::LongRunningRecognizeRequest # Converts hash and nil to an options object @@ -258,7 +246,7 @@ def long_running_recognize request = nil, options: nil, **request_fields, &block # @param request [Google::Gax::StreamInput, Enumerable] # An enumerable of {Google::Cloud::Speech::V1::StreamingRecognizeRequest} instances. # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Enumerable] @@ -271,7 +259,7 @@ def long_running_recognize request = nil, options: nil, **request_fields, &block # @example # TODO # - def streaming_recognize request, options: nil, &block + def streaming_recognize request, options = nil, &block unless request.is_a? Enumerable if request.respond_to? :to_enum request = request.to_enum diff --git a/shared/output/gapic/templates/speech/lib/google/cloud/speech/v1/speech/operations.rb b/shared/output/gapic/templates/speech/lib/google/cloud/speech/v1/speech/operations.rb index 546abc37f..a15883de7 100644 --- a/shared/output/gapic/templates/speech/lib/google/cloud/speech/v1/speech/operations.rb +++ b/shared/output/gapic/templates/speech/lib/google/cloud/speech/v1/speech/operations.rb @@ -115,27 +115,25 @@ def initialize # NOTE: the `name` binding below allows API services to override the binding # to use different resource name schemes, such as `users/*/operations`. # - # @overload list_operations(request, options: nil) - # @param request [Google::Longrunning::ListOperationsRequest | Hash] - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding below allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::ListOperationsRequest | Hash] + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding below allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation collection. - # @param filter [String] + # * `filter` (`String`): # The standard list filter. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The standard list page size. - # @param page_token [String] + # * `page_token` (`String`): # The standard list page token. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -148,13 +146,9 @@ def initialize # @example # TODO # - def list_operations request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_operations request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::ListOperationsRequest # Converts hash and nil to an options object @@ -196,19 +190,17 @@ def list_operations request = nil, options: nil, **request_fields, &block # method to poll the operation result at intervals as recommended by the API # service. # - # @overload get_operation(request, options: nil) - # @param request [Google::Longrunning::GetOperationRequest | Hash] - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Longrunning::GetOperationRequest | Hash] + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # When using a hash, the following fields are supported: # - # @overload get_operation(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The name of the operation resource. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -221,13 +213,9 @@ def list_operations request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::GetOperationRequest # Converts hash and nil to an options object @@ -269,20 +257,18 @@ def get_operation request = nil, options: nil, **request_fields, &block # operation. If the server doesn't support this method, it returns # `google.rpc.Code.UNIMPLEMENTED`. # - # @overload delete_operation(request, options: nil) - # @param request [Google::Longrunning::DeleteOperationRequest | Hash] - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload delete_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::DeleteOperationRequest | Hash] + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -295,13 +281,9 @@ def get_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::DeleteOperationRequest # Converts hash and nil to an options object @@ -348,26 +330,24 @@ def delete_operation request = nil, options: nil, **request_fields, &block # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, # corresponding to `Code.CANCELLED`. # - # @overload cancel_operation(request, options: nil) - # @param request [Google::Longrunning::CancelOperationRequest | Hash] - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - # corresponding to `Code.CANCELLED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload cancel_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::CancelOperationRequest | Hash] + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + # corresponding to `Code.CANCELLED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be cancelled. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -380,13 +360,9 @@ def delete_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def cancel_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def cancel_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::CancelOperationRequest # Converts hash and nil to an options object diff --git a/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/image_annotator/client.rb b/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/image_annotator/client.rb index 41efd7f91..677b04087 100644 --- a/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/image_annotator/client.rb +++ b/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/image_annotator/client.rb @@ -117,17 +117,15 @@ def initialize ## # Run image detection and annotation for a batch of images. # - # @overload batch_annotate_images(request, options: nil) - # @param request [Google::Cloud::Vision::V1::BatchAnnotateImagesRequest | Hash] - # Run image detection and annotation for a batch of images. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Cloud::Vision::V1::BatchAnnotateImagesRequest | Hash] + # Run image detection and annotation for a batch of images. # - # @overload batch_annotate_images(requests: nil, options: nil) - # @param requests [Google::Cloud::Vision::V1::AnnotateImageRequest | Hash] + # When using a hash, the following fields are supported: + # + # * `requests` (`Google::Cloud::Vision::V1::AnnotateImageRequest | Hash`): # Individual image annotation requests for this batch. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::BatchAnnotateImagesResponse] @@ -140,13 +138,9 @@ def initialize # @example # TODO # - def batch_annotate_images request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def batch_annotate_images request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::BatchAnnotateImagesRequest # Converts hash and nil to an options object @@ -183,22 +177,20 @@ def batch_annotate_images request = nil, options: nil, **request_fields, &block # `Operation.metadata` contains `OperationMetadata` (metadata). # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). # - # @overload async_batch_annotate_files(request, options: nil) - # @param request [Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest | Hash] - # Run asynchronous image detection and annotation for a list of generic - # files, such as PDF files, which may contain multiple pages and multiple - # images per page. Progress and results can be retrieved through the - # `google.longrunning.Operations` interface. - # `Operation.metadata` contains `OperationMetadata` (metadata). - # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest | Hash] + # Run asynchronous image detection and annotation for a list of generic + # files, such as PDF files, which may contain multiple pages and multiple + # images per page. Progress and results can be retrieved through the + # `google.longrunning.Operations` interface. + # `Operation.metadata` contains `OperationMetadata` (metadata). + # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). # - # @overload async_batch_annotate_files(requests: nil, options: nil) - # @param requests [Google::Cloud::Vision::V1::AsyncAnnotateFileRequest | Hash] + # When using a hash, the following fields are supported: + # + # * `requests` (`Google::Cloud::Vision::V1::AsyncAnnotateFileRequest | Hash`): # Individual async file annotation requests for this batch. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -211,13 +203,9 @@ def batch_annotate_images request = nil, options: nil, **request_fields, &block # @example # TODO # - def async_batch_annotate_files request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def async_batch_annotate_files request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest # Converts hash and nil to an options object diff --git a/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/image_annotator/operations.rb b/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/image_annotator/operations.rb index b1127b138..e5ebe02b2 100644 --- a/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/image_annotator/operations.rb +++ b/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/image_annotator/operations.rb @@ -115,27 +115,25 @@ def initialize # NOTE: the `name` binding below allows API services to override the binding # to use different resource name schemes, such as `users/*/operations`. # - # @overload list_operations(request, options: nil) - # @param request [Google::Longrunning::ListOperationsRequest | Hash] - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding below allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::ListOperationsRequest | Hash] + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding below allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation collection. - # @param filter [String] + # * `filter` (`String`): # The standard list filter. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The standard list page size. - # @param page_token [String] + # * `page_token` (`String`): # The standard list page token. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -148,13 +146,9 @@ def initialize # @example # TODO # - def list_operations request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_operations request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::ListOperationsRequest # Converts hash and nil to an options object @@ -196,19 +190,17 @@ def list_operations request = nil, options: nil, **request_fields, &block # method to poll the operation result at intervals as recommended by the API # service. # - # @overload get_operation(request, options: nil) - # @param request [Google::Longrunning::GetOperationRequest | Hash] - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Longrunning::GetOperationRequest | Hash] + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # When using a hash, the following fields are supported: # - # @overload get_operation(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The name of the operation resource. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -221,13 +213,9 @@ def list_operations request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::GetOperationRequest # Converts hash and nil to an options object @@ -269,20 +257,18 @@ def get_operation request = nil, options: nil, **request_fields, &block # operation. If the server doesn't support this method, it returns # `google.rpc.Code.UNIMPLEMENTED`. # - # @overload delete_operation(request, options: nil) - # @param request [Google::Longrunning::DeleteOperationRequest | Hash] - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload delete_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::DeleteOperationRequest | Hash] + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -295,13 +281,9 @@ def get_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::DeleteOperationRequest # Converts hash and nil to an options object @@ -348,26 +330,24 @@ def delete_operation request = nil, options: nil, **request_fields, &block # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, # corresponding to `Code.CANCELLED`. # - # @overload cancel_operation(request, options: nil) - # @param request [Google::Longrunning::CancelOperationRequest | Hash] - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - # corresponding to `Code.CANCELLED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload cancel_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::CancelOperationRequest | Hash] + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + # corresponding to `Code.CANCELLED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be cancelled. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -380,13 +360,9 @@ def delete_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def cancel_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def cancel_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::CancelOperationRequest # Converts hash and nil to an options object diff --git a/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/product_search/client.rb b/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/product_search/client.rb index add4ee0b0..1bfd5fed6 100644 --- a/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/product_search/client.rb +++ b/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/product_search/client.rb @@ -122,31 +122,29 @@ def initialize # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than # 4096 characters. # - # @overload create_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::CreateProductSetRequest | Hash] - # Creates and returns a new ProductSet resource. + # @param request [Google::Cloud::Vision::V1::CreateProductSetRequest | Hash] + # Creates and returns a new ProductSet resource. # - # Possible errors: + # Possible errors: # - # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - # 4096 characters. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than + # 4096 characters. # - # @overload create_product_set(parent: nil, product_set: nil, product_set_id: nil, options: nil) - # @param parent [String] + # When using a hash, the following fields are supported: + # + # * `parent` (`String`): # The project in which the ProductSet should be created. # # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param product_set [Google::Cloud::Vision::V1::ProductSet | Hash] + # * `product_set` (`Google::Cloud::Vision::V1::ProductSet | Hash`): # The ProductSet to create. - # @param product_set_id [String] + # * `product_set_id` (`String`): # A user-supplied resource id for this ProductSet. If set, the server will # attempt to use this value as the resource id. If it is already in use, an # error is returned with code ALREADY_EXISTS. Must be at most 128 characters # long. It cannot contain the character `/`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::ProductSet] @@ -159,13 +157,9 @@ def initialize # @example # TODO # - def create_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::CreateProductSetRequest # Converts hash and nil to an options object @@ -208,28 +202,26 @@ def create_product_set request = nil, options: nil, **request_fields, &block # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less # than 1. # - # @overload list_product_sets(request, options: nil) - # @param request [Google::Cloud::Vision::V1::ListProductSetsRequest | Hash] - # Lists ProductSets in an unspecified order. + # @param request [Google::Cloud::Vision::V1::ListProductSetsRequest | Hash] + # Lists ProductSets in an unspecified order. + # + # Possible errors: # - # Possible errors: + # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less + # than 1. # - # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - # than 1. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload list_product_sets(parent: nil, page_size: nil, page_token: nil, options: nil) - # @param parent [String] + # * `parent` (`String`): # The project from which ProductSets should be listed. # # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [String] + # * `page_token` (`String`): # The next_page_token returned from a previous List request, if any. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -242,13 +234,9 @@ def create_product_set request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_product_sets request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_product_sets request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::ListProductSetsRequest # Converts hash and nil to an options object @@ -291,24 +279,22 @@ def list_product_sets request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the ProductSet does not exist. # - # @overload get_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::GetProductSetRequest | Hash] - # Gets information associated with a ProductSet. + # @param request [Google::Cloud::Vision::V1::GetProductSetRequest | Hash] + # Gets information associated with a ProductSet. + # + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the ProductSet does not exist. # - # * Returns NOT_FOUND if the ProductSet does not exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload get_product_set(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # Resource name of the ProductSet to get. # # Format is: # `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::ProductSet] @@ -321,13 +307,9 @@ def list_product_sets request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::GetProductSetRequest # Converts hash and nil to an options object @@ -372,29 +354,27 @@ def get_product_set request = nil, options: nil, **request_fields, &block # * Returns INVALID_ARGUMENT if display_name is present in update_mask but # missing from the request or longer than 4096 characters. # - # @overload update_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::UpdateProductSetRequest | Hash] - # Makes changes to a ProductSet resource. - # Only display_name can be updated currently. + # @param request [Google::Cloud::Vision::V1::UpdateProductSetRequest | Hash] + # Makes changes to a ProductSet resource. + # Only display_name can be updated currently. + # + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the ProductSet does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but + # missing from the request or longer than 4096 characters. # - # * Returns NOT_FOUND if the ProductSet does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but - # missing from the request or longer than 4096 characters. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload update_product_set(product_set: nil, update_mask: nil, options: nil) - # @param product_set [Google::Cloud::Vision::V1::ProductSet | Hash] + # * `product_set` (`Google::Cloud::Vision::V1::ProductSet | Hash`): # The ProductSet resource which replaces the one on the server. - # @param update_mask [Google::Protobuf::FieldMask | Hash] + # * `update_mask` (`Google::Protobuf::FieldMask | Hash`): # The [FieldMask][google.protobuf.FieldMask] that specifies which fields to # update. # If update_mask isn't specified, all mutable fields are to be updated. # Valid mask path is `display_name`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::ProductSet] @@ -407,13 +387,9 @@ def get_product_set request = nil, options: nil, **request_fields, &block # @example # TODO # - def update_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def update_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::UpdateProductSetRequest # Converts hash and nil to an options object @@ -458,27 +434,25 @@ def update_product_set request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the ProductSet does not exist. # - # @overload delete_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::DeleteProductSetRequest | Hash] - # Permanently deletes a ProductSet. Products and ReferenceImages in the - # ProductSet are not deleted. + # @param request [Google::Cloud::Vision::V1::DeleteProductSetRequest | Hash] + # Permanently deletes a ProductSet. Products and ReferenceImages in the + # ProductSet are not deleted. + # + # The actual image files are not deleted from Google Cloud Storage. # - # The actual image files are not deleted from Google Cloud Storage. + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the ProductSet does not exist. # - # * Returns NOT_FOUND if the ProductSet does not exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload delete_product_set(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # Resource name of the ProductSet to delete. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -491,13 +465,9 @@ def update_product_set request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::DeleteProductSetRequest # Converts hash and nil to an options object @@ -542,34 +512,32 @@ def delete_product_set request = nil, options: nil, **request_fields, &block # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. # * Returns INVALID_ARGUMENT if product_category is missing or invalid. # - # @overload create_product(request, options: nil) - # @param request [Google::Cloud::Vision::V1::CreateProductRequest | Hash] - # Creates and returns a new product resource. + # @param request [Google::Cloud::Vision::V1::CreateProductRequest | Hash] + # Creates and returns a new product resource. + # + # Possible errors: # - # Possible errors: + # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is missing or invalid. # - # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is missing or invalid. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload create_product(parent: nil, product: nil, product_id: nil, options: nil) - # @param parent [String] + # * `parent` (`String`): # The project in which the Product should be created. # # Format is # `projects/PROJECT_ID/locations/LOC_ID`. - # @param product [Google::Cloud::Vision::V1::Product | Hash] + # * `product` (`Google::Cloud::Vision::V1::Product | Hash`): # The product to create. - # @param product_id [String] + # * `product_id` (`String`): # A user-supplied resource id for this Product. If set, the server will # attempt to use this value as the resource id. If it is already in use, an # error is returned with code ALREADY_EXISTS. Must be at most 128 characters # long. It cannot contain the character `/`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::Product] @@ -582,13 +550,9 @@ def delete_product_set request = nil, options: nil, **request_fields, &block # @example # TODO # - def create_product request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_product request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::CreateProductRequest # Converts hash and nil to an options object @@ -630,28 +594,26 @@ def create_product request = nil, options: nil, **request_fields, &block # # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. # - # @overload list_products(request, options: nil) - # @param request [Google::Cloud::Vision::V1::ListProductsRequest | Hash] - # Lists products in an unspecified order. + # @param request [Google::Cloud::Vision::V1::ListProductsRequest | Hash] + # Lists products in an unspecified order. # - # Possible errors: + # Possible errors: # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. # - # @overload list_products(parent: nil, page_size: nil, page_token: nil, options: nil) - # @param parent [String] + # When using a hash, the following fields are supported: + # + # * `parent` (`String`): # The project OR ProductSet from which Products should be listed. # # Format: # `projects/PROJECT_ID/locations/LOC_ID` - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [String] + # * `page_token` (`String`): # The next_page_token returned from a previous List request, if any. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -664,13 +626,9 @@ def create_product request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_products request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_products request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::ListProductsRequest # Converts hash and nil to an options object @@ -713,24 +671,22 @@ def list_products request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the Product does not exist. # - # @overload get_product(request, options: nil) - # @param request [Google::Cloud::Vision::V1::GetProductRequest | Hash] - # Gets information associated with a Product. + # @param request [Google::Cloud::Vision::V1::GetProductRequest | Hash] + # Gets information associated with a Product. # - # Possible errors: + # Possible errors: # - # * Returns NOT_FOUND if the Product does not exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns NOT_FOUND if the Product does not exist. # - # @overload get_product(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # Resource name of the Product to get. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::Product] @@ -743,13 +699,9 @@ def list_products request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_product request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_product request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::GetProductRequest # Converts hash and nil to an options object @@ -801,38 +753,36 @@ def get_product request = nil, options: nil, **request_fields, &block # longer than 4096 characters. # * Returns INVALID_ARGUMENT if product_category is present in update_mask. # - # @overload update_product(request, options: nil) - # @param request [Google::Cloud::Vision::V1::UpdateProductRequest | Hash] - # Makes changes to a Product resource. - # Only the `display_name`, `description`, and `labels` fields can be updated - # right now. + # @param request [Google::Cloud::Vision::V1::UpdateProductRequest | Hash] + # Makes changes to a Product resource. + # Only the `display_name`, `description`, and `labels` fields can be updated + # right now. # - # If labels are updated, the change will not be reflected in queries until - # the next index time. + # If labels are updated, the change will not be reflected in queries until + # the next index time. # - # Possible errors: + # Possible errors: # - # * Returns NOT_FOUND if the Product does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is - # missing from the request or longer than 4096 characters. - # * Returns INVALID_ARGUMENT if description is present in update_mask but is - # longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is present in update_mask. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns NOT_FOUND if the Product does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is + # missing from the request or longer than 4096 characters. + # * Returns INVALID_ARGUMENT if description is present in update_mask but is + # longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is present in update_mask. # - # @overload update_product(product: nil, update_mask: nil, options: nil) - # @param product [Google::Cloud::Vision::V1::Product | Hash] + # When using a hash, the following fields are supported: + # + # * `product` (`Google::Cloud::Vision::V1::Product | Hash`): # The Product resource which replaces the one on the server. # product.name is immutable. - # @param update_mask [Google::Protobuf::FieldMask | Hash] + # * `update_mask` (`Google::Protobuf::FieldMask | Hash`): # The [FieldMask][google.protobuf.FieldMask] that specifies which fields # to update. # If update_mask isn't specified, all mutable fields are to be updated. # Valid mask paths include `product_labels`, `display_name`, and # `description`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::Product] @@ -845,13 +795,9 @@ def get_product request = nil, options: nil, **request_fields, &block # @example # TODO # - def update_product request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def update_product request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::UpdateProductRequest # Converts hash and nil to an options object @@ -897,28 +843,26 @@ def update_product request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the product does not exist. # - # @overload delete_product(request, options: nil) - # @param request [Google::Cloud::Vision::V1::DeleteProductRequest | Hash] - # Permanently deletes a product and its reference images. + # @param request [Google::Cloud::Vision::V1::DeleteProductRequest | Hash] + # Permanently deletes a product and its reference images. # - # Metadata of the product and all its images will be deleted right away, but - # search queries against ProductSets containing the product may still work - # until all related caches are refreshed. + # Metadata of the product and all its images will be deleted right away, but + # search queries against ProductSets containing the product may still work + # until all related caches are refreshed. # - # Possible errors: + # Possible errors: # - # * Returns NOT_FOUND if the product does not exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns NOT_FOUND if the product does not exist. # - # @overload delete_product(name: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # Resource name of product to delete. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -931,13 +875,9 @@ def update_product request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_product request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_product request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::DeleteProductRequest # Converts hash and nil to an options object @@ -993,46 +933,44 @@ def delete_product request = nil, options: nil, **request_fields, &block # compatible with the parent product's product_category is detected. # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. # - # @overload create_reference_image(request, options: nil) - # @param request [Google::Cloud::Vision::V1::CreateReferenceImageRequest | Hash] - # Creates and returns a new ReferenceImage resource. + # @param request [Google::Cloud::Vision::V1::CreateReferenceImageRequest | Hash] + # Creates and returns a new ReferenceImage resource. + # + # The `bounding_poly` field is optional. If `bounding_poly` is not specified, + # the system will try to detect regions of interest in the image that are + # compatible with the product_category on the parent product. If it is + # specified, detection is ALWAYS skipped. The system converts polygons into + # non-rotated rectangles. # - # The `bounding_poly` field is optional. If `bounding_poly` is not specified, - # the system will try to detect regions of interest in the image that are - # compatible with the product_category on the parent product. If it is - # specified, detection is ALWAYS skipped. The system converts polygons into - # non-rotated rectangles. + # Note that the pipeline will resize the image if the image resolution is too + # large to process (above 50MP). # - # Note that the pipeline will resize the image if the image resolution is too - # large to process (above 50MP). + # Possible errors: # - # Possible errors: + # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if the product does not exist. + # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing + # compatible with the parent product's product_category is detected. + # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. # - # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if the product does not exist. - # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing - # compatible with the parent product's product_category is detected. - # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload create_reference_image(parent: nil, reference_image: nil, reference_image_id: nil, options: nil) - # @param parent [String] + # * `parent` (`String`): # Resource name of the product in which to create the reference image. # # Format is # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @param reference_image [Google::Cloud::Vision::V1::ReferenceImage | Hash] + # * `reference_image` (`Google::Cloud::Vision::V1::ReferenceImage | Hash`): # The reference image to create. # If an image ID is specified, it is ignored. - # @param reference_image_id [String] + # * `reference_image_id` (`String`): # A user-supplied resource id for the ReferenceImage to be added. If set, # the server will attempt to use this value as the resource id. If it is # already in use, an error is returned with code ALREADY_EXISTS. Must be at # most 128 characters long. It cannot contain the character `/`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::ReferenceImage] @@ -1045,13 +983,9 @@ def delete_product request = nil, options: nil, **request_fields, &block # @example # TODO # - def create_reference_image request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def create_reference_image request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::CreateReferenceImageRequest # Converts hash and nil to an options object @@ -1099,31 +1033,29 @@ def create_reference_image request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the reference image does not exist. # - # @overload delete_reference_image(request, options: nil) - # @param request [Google::Cloud::Vision::V1::DeleteReferenceImageRequest | Hash] - # Permanently deletes a reference image. + # @param request [Google::Cloud::Vision::V1::DeleteReferenceImageRequest | Hash] + # Permanently deletes a reference image. + # + # The image metadata will be deleted right away, but search queries + # against ProductSets containing the image may still work until all related + # caches are refreshed. # - # The image metadata will be deleted right away, but search queries - # against ProductSets containing the image may still work until all related - # caches are refreshed. + # The actual image files are not deleted from Google Cloud Storage. # - # The actual image files are not deleted from Google Cloud Storage. + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the reference image does not exist. # - # * Returns NOT_FOUND if the reference image does not exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload delete_reference_image(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name of the reference image to delete. # # Format is: # # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -1136,13 +1068,9 @@ def create_reference_image request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_reference_image request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_reference_image request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::DeleteReferenceImageRequest # Converts hash and nil to an options object @@ -1186,33 +1114,31 @@ def delete_reference_image request = nil, options: nil, **request_fields, &block # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less # than 1. # - # @overload list_reference_images(request, options: nil) - # @param request [Google::Cloud::Vision::V1::ListReferenceImagesRequest | Hash] - # Lists reference images. + # @param request [Google::Cloud::Vision::V1::ListReferenceImagesRequest | Hash] + # Lists reference images. + # + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the parent product does not exist. + # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less + # than 1. # - # * Returns NOT_FOUND if the parent product does not exist. - # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less - # than 1. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload list_reference_images(parent: nil, page_size: nil, page_token: nil, options: nil) - # @param parent [String] + # * `parent` (`String`): # Resource name of the product containing the reference images. # # Format is # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [String] + # * `page_token` (`String`): # A token identifying a page of results to be returned. This is the value # of `nextPageToken` returned in a previous reference image list request. # # Defaults to the first page if not specified. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -1225,13 +1151,9 @@ def delete_reference_image request = nil, options: nil, **request_fields, &block # @example # TODO # - def list_reference_images request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_reference_images request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::ListReferenceImagesRequest # Converts hash and nil to an options object @@ -1274,25 +1196,23 @@ def list_reference_images request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the specified image does not exist. # - # @overload get_reference_image(request, options: nil) - # @param request [Google::Cloud::Vision::V1::GetReferenceImageRequest | Hash] - # Gets information associated with a ReferenceImage. + # @param request [Google::Cloud::Vision::V1::GetReferenceImageRequest | Hash] + # Gets information associated with a ReferenceImage. + # + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the specified image does not exist. # - # * Returns NOT_FOUND if the specified image does not exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload get_reference_image(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name of the ReferenceImage to get. # # Format is: # # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Cloud::Vision::V1::ReferenceImage] @@ -1305,13 +1225,9 @@ def list_reference_images request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_reference_image request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_reference_image request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::GetReferenceImageRequest # Converts hash and nil to an options object @@ -1356,32 +1272,30 @@ def get_reference_image request = nil, options: nil, **request_fields, &block # # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. # - # @overload add_product_to_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::AddProductToProductSetRequest | Hash] - # Adds a Product to the specified ProductSet. If the Product is already - # present, no change is made. + # @param request [Google::Cloud::Vision::V1::AddProductToProductSetRequest | Hash] + # Adds a Product to the specified ProductSet. If the Product is already + # present, no change is made. + # + # One Product can be added to at most 100 ProductSets. # - # One Product can be added to at most 100 ProductSets. + # Possible errors: # - # Possible errors: + # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. # - # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # When using a hash, the following fields are supported: # - # @overload add_product_to_product_set(name: nil, product: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The resource name for the ProductSet to modify. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param product [String] + # * `product` (`String`): # The resource name for the Product to be added to this ProductSet. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -1394,13 +1308,9 @@ def get_reference_image request = nil, options: nil, **request_fields, &block # @example # TODO # - def add_product_to_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def add_product_to_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::AddProductToProductSetRequest # Converts hash and nil to an options object @@ -1442,29 +1352,27 @@ def add_product_to_product_set request = nil, options: nil, **request_fields, &b # # * Returns NOT_FOUND If the Product is not found under the ProductSet. # - # @overload remove_product_from_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::RemoveProductFromProductSetRequest | Hash] - # Removes a Product from the specified ProductSet. + # @param request [Google::Cloud::Vision::V1::RemoveProductFromProductSetRequest | Hash] + # Removes a Product from the specified ProductSet. # - # Possible errors: + # Possible errors: # - # * Returns NOT_FOUND If the Product is not found under the ProductSet. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns NOT_FOUND If the Product is not found under the ProductSet. # - # @overload remove_product_from_product_set(name: nil, product: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The resource name for the ProductSet to modify. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param product [String] + # * `product` (`String`): # The resource name for the Product to be removed from this ProductSet. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -1477,13 +1385,9 @@ def add_product_to_product_set request = nil, options: nil, **request_fields, &b # @example # TODO # - def remove_product_from_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def remove_product_from_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::RemoveProductFromProductSetRequest # Converts hash and nil to an options object @@ -1527,30 +1431,28 @@ def remove_product_from_product_set request = nil, options: nil, **request_field # # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. # - # @overload list_products_in_product_set(request, options: nil) - # @param request [Google::Cloud::Vision::V1::ListProductsInProductSetRequest | Hash] - # Lists the Products in a ProductSet, in an unspecified order. If the - # ProductSet does not exist, the products field of the response will be - # empty. + # @param request [Google::Cloud::Vision::V1::ListProductsInProductSetRequest | Hash] + # Lists the Products in a ProductSet, in an unspecified order. If the + # ProductSet does not exist, the products field of the response will be + # empty. # - # Possible errors: + # Possible errors: # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. # - # @overload list_products_in_product_set(name: nil, page_size: nil, page_token: nil, options: nil) - # @param name [String] + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The ProductSet resource for which to retrieve Products. # # Format is: # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param page_size [Integer] + # * `page_size` (`Integer`): # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [String] + # * `page_token` (`String`): # The next_page_token returned from a previous List request, if any. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -1563,13 +1465,9 @@ def remove_product_from_product_set request = nil, options: nil, **request_field # @example # TODO # - def list_products_in_product_set request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_products_in_product_set request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::ListProductsInProductSetRequest # Converts hash and nil to an options object @@ -1618,31 +1516,29 @@ def list_products_in_product_set request = nil, options: nil, **request_fields, # For the format of the csv file please see # [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. # - # @overload import_product_sets(request, options: nil) - # @param request [Google::Cloud::Vision::V1::ImportProductSetsRequest | Hash] - # Asynchronous API that imports a list of reference images to specified - # product sets based on a list of image information. + # @param request [Google::Cloud::Vision::V1::ImportProductSetsRequest | Hash] + # Asynchronous API that imports a list of reference images to specified + # product sets based on a list of image information. # - # The [google.longrunning.Operation][google.longrunning.Operation] API can be - # used to keep track of the progress and results of the request. - # `Operation.metadata` contains `BatchOperationMetadata`. (progress) - # `Operation.response` contains `ImportProductSetsResponse`. (results) + # The [google.longrunning.Operation][google.longrunning.Operation] API can be + # used to keep track of the progress and results of the request. + # `Operation.metadata` contains `BatchOperationMetadata`. (progress) + # `Operation.response` contains `ImportProductSetsResponse`. (results) # - # The input source of this method is a csv file on Google Cloud Storage. - # For the format of the csv file please see - # [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # The input source of this method is a csv file on Google Cloud Storage. + # For the format of the csv file please see + # [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. # - # @overload import_product_sets(parent: nil, input_config: nil, options: nil) - # @param parent [String] + # When using a hash, the following fields are supported: + # + # * `parent` (`String`): # The project in which the ProductSets should be imported. # # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param input_config [Google::Cloud::Vision::V1::ImportProductSetsInputConfig | Hash] + # * `input_config` (`Google::Cloud::Vision::V1::ImportProductSetsInputConfig | Hash`): # The input content for the list of requests. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -1655,13 +1551,9 @@ def list_products_in_product_set request = nil, options: nil, **request_fields, # @example # TODO # - def import_product_sets request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def import_product_sets request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Cloud::Vision::V1::ImportProductSetsRequest # Converts hash and nil to an options object diff --git a/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/product_search/operations.rb b/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/product_search/operations.rb index cdd751759..d2182c556 100644 --- a/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/product_search/operations.rb +++ b/shared/output/gapic/templates/vision/lib/google/cloud/vision/v1/product_search/operations.rb @@ -115,27 +115,25 @@ def initialize # NOTE: the `name` binding below allows API services to override the binding # to use different resource name schemes, such as `users/*/operations`. # - # @overload list_operations(request, options: nil) - # @param request [Google::Longrunning::ListOperationsRequest | Hash] - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding below allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::ListOperationsRequest | Hash] + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding below allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation collection. - # @param filter [String] + # * `filter` (`String`): # The standard list filter. - # @param page_size [Integer] + # * `page_size` (`Integer`): # The standard list page size. - # @param page_token [String] + # * `page_token` (`String`): # The standard list page token. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::PagedEnumerable] @@ -148,13 +146,9 @@ def initialize # @example # TODO # - def list_operations request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def list_operations request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::ListOperationsRequest # Converts hash and nil to an options object @@ -196,19 +190,17 @@ def list_operations request = nil, options: nil, **request_fields, &block # method to poll the operation result at intervals as recommended by the API # service. # - # @overload get_operation(request, options: nil) - # @param request [Google::Longrunning::GetOperationRequest | Hash] - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param request [Google::Longrunning::GetOperationRequest | Hash] + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # When using a hash, the following fields are supported: # - # @overload get_operation(name: nil, options: nil) - # @param name [String] + # * `name` (`String`): # The name of the operation resource. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Gax::Operation] @@ -221,13 +213,9 @@ def list_operations request = nil, options: nil, **request_fields, &block # @example # TODO # - def get_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def get_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::GetOperationRequest # Converts hash and nil to an options object @@ -269,20 +257,18 @@ def get_operation request = nil, options: nil, **request_fields, &block # operation. If the server doesn't support this method, it returns # `google.rpc.Code.UNIMPLEMENTED`. # - # @overload delete_operation(request, options: nil) - # @param request [Google::Longrunning::DeleteOperationRequest | Hash] - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload delete_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::DeleteOperationRequest | Hash] + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be deleted. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -295,13 +281,9 @@ def get_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def delete_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def delete_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::DeleteOperationRequest # Converts hash and nil to an options object @@ -348,26 +330,24 @@ def delete_operation request = nil, options: nil, **request_fields, &block # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, # corresponding to `Code.CANCELLED`. # - # @overload cancel_operation(request, options: nil) - # @param request [Google::Longrunning::CancelOperationRequest | Hash] - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - # corresponding to `Code.CANCELLED`. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. - # - # @overload cancel_operation(name: nil, options: nil) - # @param name [String] + # @param request [Google::Longrunning::CancelOperationRequest | Hash] + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + # corresponding to `Code.CANCELLED`. + # + # When using a hash, the following fields are supported: + # + # * `name` (`String`): # The name of the operation resource to be cancelled. - # @param options [Google::Gax::ApiCall::Options, Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. + # @param options [Google::Gax::ApiCall::Options, Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [Google::Protobuf::Empty] @@ -380,13 +360,9 @@ def delete_operation request = nil, options: nil, **request_fields, &block # @example # TODO # - def cancel_operation request = nil, options: nil, **request_fields, &block - raise ArgumentError, "request must be provided" if request.nil? && request_fields.empty? - if !request.nil? && !request_fields.empty? - raise ArgumentError, "cannot pass both request object and named arguments" - end + def cancel_operation request, options = nil, &block + raise ArgumentError, "request must be provided" if request.nil? - request ||= request_fields request = Google::Gax::Protobuf.coerce request, to: Google::Longrunning::CancelOperationRequest # Converts hash and nil to an options object