From b67e8b029ecbab7d28f06566ba07879222aa4e20 Mon Sep 17 00:00:00 2001 From: Viacheslav Rostovtsev <58152857+viacheslav-rostovtsev@users.noreply.github.com> Date: Thu, 17 Nov 2022 18:05:35 -0800 Subject: [PATCH] feat: use retry policy in regapic templates (#854) * feat: use retry policy in regapic templates --- .../default/service/rest/client/_config.erb | 36 ++++-- .../client/method/def/_options_defaults.erb | 6 +- .../rest/client/method/docs/_request.erb | 2 - .../cloud/compute/v1/addresses/rest/client.rb | 70 +++++++---- .../v1/global_operations/rest/client.rb | 46 ++++--- .../cloud/compute/v1/networks/rest/client.rb | 46 ++++--- .../rest/client.rb | 38 ++++-- .../v1/region_operations/rest/client.rb | 62 +++++---- .../v1beta1/compliance/rest/client.rb | 94 ++++++++------ .../showcase/v1beta1/echo/rest/client.rb | 62 +++++---- .../showcase/v1beta1/echo/rest/operations.rb | 62 +++++---- .../showcase/v1beta1/identity/rest/client.rb | 70 +++++++---- .../showcase/v1beta1/messaging/rest/client.rb | 118 ++++++++++-------- .../v1beta1/messaging/rest/operations.rb | 62 +++++---- .../showcase/v1beta1/testing/rest/client.rb | 94 ++++++++------ 15 files changed, 551 insertions(+), 317 deletions(-) diff --git a/gapic-generator/templates/default/service/rest/client/_config.erb b/gapic-generator/templates/default/service/rest/client/_config.erb index 2accf6a58..a18ec703f 100644 --- a/gapic-generator/templates/default/service/rest/client/_config.erb +++ b/gapic-generator/templates/default/service/rest/client/_config.erb @@ -4,7 +4,11 @@ # Configuration class for the <%= service.name %> REST API. # # This class represents the configuration for <%= service.name %> REST, -# providing control over credentials, timeouts, retry behavior, logging. +# providing control over timeouts, retry behavior, logging, transport +# parameters, and other low-level controls. Certain parameters can also be +# applied individually to specific RPCs. See +# {<%= service.rest.client_name_full %>::Configuration::Rpcs} +# for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. @@ -13,17 +17,17 @@ # @example # # # Modify the global config, setting the timeout for -# # <%= method_service.methods.first.name %> to 20 seconds, +# # <%= method_service.rest.methods.first.name %> to 20 seconds, # # and all remaining timeouts to 10 seconds. -# <%= service.client_name_full %>.configure do |config| +# <%= service.rest.client_name_full %>.configure do |config| # config.timeout = 10.0 -# config.rpcs.<%= method_service.methods.first.name %>.timeout = 20.0 +# config.rpcs.<%= method_service.rest.methods.first.name %>.timeout = 20.0 # end # # # Apply the above configuration only to a new client. -# client = <%= service.client_name_full %>.new do |config| +# client = <%= service.rest.client_name_full %>.new do |config| # config.timeout = 10.0 -# config.rpcs.<%= method_service.methods.first.name %>.timeout = 20.0 +# config.rpcs.<%= method_service.rest.methods.first.name %>.timeout = 20.0 # end # <%- end -%> @@ -56,6 +60,14 @@ # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] +# @!attribute [rw] retry_policy +# The retry policy. The value is a hash with the following keys: +# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. +# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. +# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. +# * `:retry_codes` (*type:* `Array`) - The error codes that should +# trigger a retry. +# @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] @@ -73,6 +85,7 @@ class Configuration config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private @@ -102,9 +115,14 @@ class Configuration # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # - # there is one other field (`retry_policy`) that can be set - # but is currently not supported for REST Gapic libraries. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. # class Rpcs <%- method_service.rest.methods.each do |method| -%> diff --git a/gapic-generator/templates/default/service/rest/client/method/def/_options_defaults.erb b/gapic-generator/templates/default/service/rest/client/method/def/_options_defaults.erb index ada78ed4d..93e107f75 100644 --- a/gapic-generator/templates/default/service/rest/client/method/def/_options_defaults.erb +++ b/gapic-generator/templates/default/service/rest/client/method/def/_options_defaults.erb @@ -14,7 +14,9 @@ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.<%= method.name %>.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.<%= method.name %>.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata \ No newline at end of file + metadata: @config.metadata, + retry_policy: @config.retry_policy \ No newline at end of file diff --git a/gapic-generator/templates/default/service/rest/client/method/docs/_request.erb b/gapic-generator/templates/default/service/rest/client/method/docs/_request.erb index e3fd728de..1a3d37a17 100644 --- a/gapic-generator/templates/default/service/rest/client/method/docs/_request.erb +++ b/gapic-generator/templates/default/service/rest/client/method/docs/_request.erb @@ -8,8 +8,6 @@ # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. -# Note: currently retry functionality is not implemented. While it is possible -# to set it using ::Gapic::CallOptions, it will not be applied <%-if method.arguments.any?-%> # <%- arg_list = method.arguments.map { |arg| "#{arg.name}: nil"}.join ", " -%> diff --git a/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/addresses/rest/client.rb b/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/addresses/rest/client.rb index 3e090dfe2..43b9c82b4 100644 --- a/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/addresses/rest/client.rb +++ b/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/addresses/rest/client.rb @@ -159,8 +159,6 @@ def initialize # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil) # Pass arguments to `aggregated_list` via keyword arguments. Note that at @@ -218,10 +216,12 @@ def aggregated_list request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.aggregated_list.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @addresses_stub.aggregated_list request, options do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @addresses_stub, :aggregated_list, "items", request, result, options @@ -248,8 +248,6 @@ def aggregated_list request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload delete(address: nil, project: nil, region: nil, request_id: nil) # Pass arguments to `delete` via keyword arguments. Note that at @@ -295,10 +293,12 @@ def delete request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.delete.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @addresses_stub.delete request, options do |result, response| result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation( @@ -333,8 +333,6 @@ def delete request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload get(address: nil, project: nil, region: nil) # Pass arguments to `get` via keyword arguments. Note that at @@ -374,10 +372,12 @@ def get request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.get.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @addresses_stub.get request, options do |result, response| yield result, response if block_given? @@ -403,8 +403,6 @@ def get request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload insert(address_resource: nil, project: nil, region: nil, request_id: nil) # Pass arguments to `insert` via keyword arguments. Note that at @@ -450,10 +448,12 @@ def insert request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.insert.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.insert.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @addresses_stub.insert request, options do |result, response| result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation( @@ -488,8 +488,6 @@ def insert request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil) # Pass arguments to `list` via keyword arguments. Note that at @@ -547,10 +545,12 @@ def list request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.list.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @addresses_stub.list request, options do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @addresses_stub, :list, "items", request, result, options @@ -569,7 +569,11 @@ def list request, options = nil # Configuration class for the Addresses REST API. # # This class represents the configuration for Addresses REST, - # providing control over credentials, timeouts, retry behavior, logging. + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Compute::V1::Addresses::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. @@ -579,13 +583,13 @@ def list request, options = nil # # Modify the global config, setting the timeout for # # aggregated_list to 20 seconds, # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Compute::V1::Addresses::Client.configure do |config| + # ::Google::Cloud::Compute::V1::Addresses::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.aggregated_list.timeout = 20.0 # end # # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Compute::V1::Addresses::Client.new do |config| + # client = ::Google::Cloud::Compute::V1::Addresses::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.aggregated_list.timeout = 20.0 # end @@ -619,6 +623,14 @@ def list request, options = nil # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] @@ -636,6 +648,7 @@ class Configuration config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private @@ -665,9 +678,14 @@ def rpcs # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # - # there is one other field (`retry_policy`) that can be set - # but is currently not supported for REST Gapic libraries. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. # class Rpcs ## diff --git a/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/global_operations/rest/client.rb b/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/global_operations/rest/client.rb index 5593ea2b2..b86170bcd 100644 --- a/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/global_operations/rest/client.rb +++ b/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/global_operations/rest/client.rb @@ -145,8 +145,6 @@ def initialize # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload delete(operation: nil, project: nil) # Pass arguments to `delete` via keyword arguments. Note that at @@ -184,10 +182,12 @@ def delete request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.delete.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @global_operations_stub.delete request, options do |result, response| yield result, response if block_given? @@ -213,8 +213,6 @@ def delete request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload get(operation: nil, project: nil) # Pass arguments to `get` via keyword arguments. Note that at @@ -252,10 +250,12 @@ def get request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.get.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @global_operations_stub.get request, options do |result, response| yield result, response if block_given? @@ -273,7 +273,11 @@ def get request, options = nil # Configuration class for the GlobalOperations REST API. # # This class represents the configuration for GlobalOperations REST, - # providing control over credentials, timeouts, retry behavior, logging. + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. @@ -283,13 +287,13 @@ def get request, options = nil # # Modify the global config, setting the timeout for # # delete to 20 seconds, # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Compute::V1::GlobalOperations::Client.configure do |config| + # ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.delete.timeout = 20.0 # end # # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Compute::V1::GlobalOperations::Client.new do |config| + # client = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.delete.timeout = 20.0 # end @@ -323,6 +327,14 @@ def get request, options = nil # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] @@ -340,6 +352,7 @@ class Configuration config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private @@ -369,9 +382,14 @@ def rpcs # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # - # there is one other field (`retry_policy`) that can be set - # but is currently not supported for REST Gapic libraries. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. # class Rpcs ## diff --git a/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/networks/rest/client.rb b/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/networks/rest/client.rb index 5753bcc2d..363b3ef1f 100644 --- a/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/networks/rest/client.rb +++ b/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/networks/rest/client.rb @@ -159,8 +159,6 @@ def initialize # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload list_peering_routes(direction: nil, filter: nil, max_results: nil, network: nil, order_by: nil, page_token: nil, peering_name: nil, project: nil, region: nil, return_partial_success: nil) # Pass arguments to `list_peering_routes` via keyword arguments. Note that at @@ -224,10 +222,12 @@ def list_peering_routes request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_peering_routes.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.list_peering_routes.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @networks_stub.list_peering_routes request, options do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @networks_stub, :list_peering_routes, "items", request, result, options @@ -254,8 +254,6 @@ def list_peering_routes request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload remove_peering(network: nil, networks_remove_peering_request_resource: nil, project: nil, request_id: nil) # Pass arguments to `remove_peering` via keyword arguments. Note that at @@ -301,10 +299,12 @@ def remove_peering request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.remove_peering.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.remove_peering.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @networks_stub.remove_peering request, options do |result, response| result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation( @@ -330,7 +330,11 @@ def remove_peering request, options = nil # Configuration class for the Networks REST API. # # This class represents the configuration for Networks REST, - # providing control over credentials, timeouts, retry behavior, logging. + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Compute::V1::Networks::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. @@ -340,13 +344,13 @@ def remove_peering request, options = nil # # Modify the global config, setting the timeout for # # list_peering_routes to 20 seconds, # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Compute::V1::Networks::Client.configure do |config| + # ::Google::Cloud::Compute::V1::Networks::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.list_peering_routes.timeout = 20.0 # end # # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Compute::V1::Networks::Client.new do |config| + # client = ::Google::Cloud::Compute::V1::Networks::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.list_peering_routes.timeout = 20.0 # end @@ -380,6 +384,14 @@ def remove_peering request, options = nil # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] @@ -397,6 +409,7 @@ class Configuration config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private @@ -426,9 +439,14 @@ def rpcs # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # - # there is one other field (`retry_policy`) that can be set - # but is currently not supported for REST Gapic libraries. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. # class Rpcs ## diff --git a/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb b/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb index 45348c6b6..3f655ddec 100644 --- a/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +++ b/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb @@ -163,8 +163,6 @@ def initialize # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload resize(instance_group_manager: nil, project: nil, region: nil, request_id: nil, size: nil) # Pass arguments to `resize` via keyword arguments. Note that at @@ -212,10 +210,12 @@ def resize request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.resize.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.resize.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @region_instance_group_managers_stub.resize request, options do |result, response| result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation( @@ -242,7 +242,11 @@ def resize request, options = nil # Configuration class for the RegionInstanceGroupManagers REST API. # # This class represents the configuration for RegionInstanceGroupManagers REST, - # providing control over credentials, timeouts, retry behavior, logging. + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. @@ -252,13 +256,13 @@ def resize request, options = nil # # Modify the global config, setting the timeout for # # resize to 20 seconds, # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Client.configure do |config| + # ::Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.resize.timeout = 20.0 # end # # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Client.new do |config| + # client = ::Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.resize.timeout = 20.0 # end @@ -292,6 +296,14 @@ def resize request, options = nil # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] @@ -309,6 +321,7 @@ class Configuration config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private @@ -338,9 +351,14 @@ def rpcs # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # - # there is one other field (`retry_policy`) that can be set - # but is currently not supported for REST Gapic libraries. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. # class Rpcs ## diff --git a/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/region_operations/rest/client.rb b/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/region_operations/rest/client.rb index bceb10e91..165679e33 100644 --- a/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/region_operations/rest/client.rb +++ b/shared/output/cloud/compute_small/lib/google/cloud/compute/v1/region_operations/rest/client.rb @@ -145,8 +145,6 @@ def initialize # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload delete(operation: nil, project: nil, region: nil) # Pass arguments to `delete` via keyword arguments. Note that at @@ -186,10 +184,12 @@ def delete request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.delete.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @region_operations_stub.delete request, options do |result, response| yield result, response if block_given? @@ -215,8 +215,6 @@ def delete request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload get(operation: nil, project: nil, region: nil) # Pass arguments to `get` via keyword arguments. Note that at @@ -256,10 +254,12 @@ def get request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.get.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @region_operations_stub.get request, options do |result, response| yield result, response if block_given? @@ -285,8 +285,6 @@ def get request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil) # Pass arguments to `list` via keyword arguments. Note that at @@ -344,10 +342,12 @@ def list request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.list.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @region_operations_stub.list request, options do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @region_operations_stub, :list, "items", request, result, options @@ -378,8 +378,6 @@ def list request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload wait(operation: nil, project: nil, region: nil) # Pass arguments to `wait` via keyword arguments. Note that at @@ -419,10 +417,12 @@ def wait request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.wait.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.wait.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @region_operations_stub.wait request, options do |result, response| yield result, response if block_given? @@ -440,7 +440,11 @@ def wait request, options = nil # Configuration class for the RegionOperations REST API. # # This class represents the configuration for RegionOperations REST, - # providing control over credentials, timeouts, retry behavior, logging. + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Compute::V1::RegionOperations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. @@ -450,13 +454,13 @@ def wait request, options = nil # # Modify the global config, setting the timeout for # # delete to 20 seconds, # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Compute::V1::RegionOperations::Client.configure do |config| + # ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.delete.timeout = 20.0 # end # # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Compute::V1::RegionOperations::Client.new do |config| + # client = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.delete.timeout = 20.0 # end @@ -490,6 +494,14 @@ def wait request, options = nil # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] @@ -507,6 +519,7 @@ class Configuration config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private @@ -536,9 +549,14 @@ def rpcs # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # - # there is one other field (`retry_policy`) that can be set - # but is currently not supported for REST Gapic libraries. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. # class Rpcs ## diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/compliance/rest/client.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/compliance/rest/client.rb index 35722f236..2a46a2d78 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/compliance/rest/client.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/compliance/rest/client.rb @@ -147,8 +147,6 @@ def initialize # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload repeat_data_body(name: nil, info: nil, server_verify: nil, intended_binding_uri: nil, f_int32: nil, f_int64: nil, f_double: nil, p_int32: nil, p_int64: nil, p_double: nil) # Pass arguments to `repeat_data_body` via keyword arguments. Note that at @@ -197,10 +195,12 @@ def repeat_data_body request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.repeat_data_body.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.repeat_data_body.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @compliance_stub.repeat_data_body request, options do |result, response| yield result, response if block_given? @@ -224,8 +224,6 @@ def repeat_data_body request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload repeat_data_body_info(name: nil, info: nil, server_verify: nil, intended_binding_uri: nil, f_int32: nil, f_int64: nil, f_double: nil, p_int32: nil, p_int64: nil, p_double: nil) # Pass arguments to `repeat_data_body_info` via keyword arguments. Note that at @@ -274,10 +272,12 @@ def repeat_data_body_info request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.repeat_data_body_info.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.repeat_data_body_info.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @compliance_stub.repeat_data_body_info request, options do |result, response| yield result, response if block_given? @@ -300,8 +300,6 @@ def repeat_data_body_info request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload repeat_data_query(name: nil, info: nil, server_verify: nil, intended_binding_uri: nil, f_int32: nil, f_int64: nil, f_double: nil, p_int32: nil, p_int64: nil, p_double: nil) # Pass arguments to `repeat_data_query` via keyword arguments. Note that at @@ -350,10 +348,12 @@ def repeat_data_query request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.repeat_data_query.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.repeat_data_query.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @compliance_stub.repeat_data_query request, options do |result, response| yield result, response if block_given? @@ -377,8 +377,6 @@ def repeat_data_query request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload repeat_data_simple_path(name: nil, info: nil, server_verify: nil, intended_binding_uri: nil, f_int32: nil, f_int64: nil, f_double: nil, p_int32: nil, p_int64: nil, p_double: nil) # Pass arguments to `repeat_data_simple_path` via keyword arguments. Note that at @@ -427,10 +425,12 @@ def repeat_data_simple_path request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.repeat_data_simple_path.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.repeat_data_simple_path.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @compliance_stub.repeat_data_simple_path request, options do |result, response| yield result, response if block_given? @@ -452,8 +452,6 @@ def repeat_data_simple_path request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload repeat_data_path_resource(name: nil, info: nil, server_verify: nil, intended_binding_uri: nil, f_int32: nil, f_int64: nil, f_double: nil, p_int32: nil, p_int64: nil, p_double: nil) # Pass arguments to `repeat_data_path_resource` via keyword arguments. Note that at @@ -502,10 +500,12 @@ def repeat_data_path_resource request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.repeat_data_path_resource.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.repeat_data_path_resource.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @compliance_stub.repeat_data_path_resource request, options do |result, response| yield result, response if block_given? @@ -527,8 +527,6 @@ def repeat_data_path_resource request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload repeat_data_path_trailing_resource(name: nil, info: nil, server_verify: nil, intended_binding_uri: nil, f_int32: nil, f_int64: nil, f_double: nil, p_int32: nil, p_int64: nil, p_double: nil) # Pass arguments to `repeat_data_path_trailing_resource` via keyword arguments. Note that at @@ -577,10 +575,12 @@ def repeat_data_path_trailing_resource request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.repeat_data_path_trailing_resource.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.repeat_data_path_trailing_resource.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @compliance_stub.repeat_data_path_trailing_resource request, options do |result, response| yield result, response if block_given? @@ -602,8 +602,6 @@ def repeat_data_path_trailing_resource request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload repeat_data_body_put(name: nil, info: nil, server_verify: nil, intended_binding_uri: nil, f_int32: nil, f_int64: nil, f_double: nil, p_int32: nil, p_int64: nil, p_double: nil) # Pass arguments to `repeat_data_body_put` via keyword arguments. Note that at @@ -652,10 +650,12 @@ def repeat_data_body_put request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.repeat_data_body_put.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.repeat_data_body_put.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @compliance_stub.repeat_data_body_put request, options do |result, response| yield result, response if block_given? @@ -677,8 +677,6 @@ def repeat_data_body_put request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload repeat_data_body_patch(name: nil, info: nil, server_verify: nil, intended_binding_uri: nil, f_int32: nil, f_int64: nil, f_double: nil, p_int32: nil, p_int64: nil, p_double: nil) # Pass arguments to `repeat_data_body_patch` via keyword arguments. Note that at @@ -727,10 +725,12 @@ def repeat_data_body_patch request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.repeat_data_body_patch.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.repeat_data_body_patch.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @compliance_stub.repeat_data_body_patch request, options do |result, response| yield result, response if block_given? @@ -744,7 +744,11 @@ def repeat_data_body_patch request, options = nil # Configuration class for the Compliance REST API. # # This class represents the configuration for Compliance REST, - # providing control over credentials, timeouts, retry behavior, logging. + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Showcase::V1beta1::Compliance::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. @@ -754,13 +758,13 @@ def repeat_data_body_patch request, options = nil # # Modify the global config, setting the timeout for # # repeat_data_body to 20 seconds, # # and all remaining timeouts to 10 seconds. - # ::Google::Showcase::V1beta1::Compliance::Client.configure do |config| + # ::Google::Showcase::V1beta1::Compliance::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.repeat_data_body.timeout = 20.0 # end # # # Apply the above configuration only to a new client. - # client = ::Google::Showcase::V1beta1::Compliance::Client.new do |config| + # client = ::Google::Showcase::V1beta1::Compliance::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.repeat_data_body.timeout = 20.0 # end @@ -794,6 +798,14 @@ def repeat_data_body_patch request, options = nil # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] @@ -812,6 +824,7 @@ class Configuration config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private @@ -841,9 +854,14 @@ def rpcs # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # - # there is one other field (`retry_policy`) that can be set - # but is currently not supported for REST Gapic libraries. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. # class Rpcs ## diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest/client.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest/client.rb index c99f026c0..402ef2c07 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest/client.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest/client.rb @@ -162,8 +162,6 @@ def initialize # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload echo(content: nil, error: nil) # Pass arguments to `echo` via keyword arguments. Note that at @@ -201,10 +199,12 @@ def echo request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.echo.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.echo.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @echo_stub.echo request, options do |result, response| yield result, response if block_given? @@ -227,8 +227,6 @@ def echo request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload paged_expand(content: nil, page_size: nil, page_token: nil) # Pass arguments to `paged_expand` via keyword arguments. Note that at @@ -268,10 +266,12 @@ def paged_expand request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.paged_expand.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.paged_expand.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @echo_stub.paged_expand request, options do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @echo_stub, :paged_expand, "responses", request, result, @@ -296,8 +296,6 @@ def paged_expand request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload wait(end_time: nil, ttl: nil, error: nil, success: nil) # Pass arguments to `wait` via keyword arguments. Note that at @@ -340,10 +338,12 @@ def wait request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.wait.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.wait.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @echo_stub.wait request, options do |result, response| result = ::Gapic::Operation.new result, @operations_client, options: options @@ -368,8 +368,6 @@ def wait request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload block(response_delay: nil, error: nil, success: nil) # Pass arguments to `block` via keyword arguments. Note that at @@ -410,10 +408,12 @@ def block request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.block.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.block.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @echo_stub.block request, options do |result, response| yield result, response if block_given? @@ -427,7 +427,11 @@ def block request, options = nil # Configuration class for the Echo REST API. # # This class represents the configuration for Echo REST, - # providing control over credentials, timeouts, retry behavior, logging. + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Showcase::V1beta1::Echo::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. @@ -437,13 +441,13 @@ def block request, options = nil # # Modify the global config, setting the timeout for # # echo to 20 seconds, # # and all remaining timeouts to 10 seconds. - # ::Google::Showcase::V1beta1::Echo::Client.configure do |config| + # ::Google::Showcase::V1beta1::Echo::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.echo.timeout = 20.0 # end # # # Apply the above configuration only to a new client. - # client = ::Google::Showcase::V1beta1::Echo::Client.new do |config| + # client = ::Google::Showcase::V1beta1::Echo::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.echo.timeout = 20.0 # end @@ -477,6 +481,14 @@ def block request, options = nil # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] @@ -495,6 +507,7 @@ class Configuration config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private @@ -524,9 +537,14 @@ def rpcs # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # - # there is one other field (`retry_policy`) that can be set - # but is currently not supported for REST Gapic libraries. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. # class Rpcs ## diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest/operations.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest/operations.rb index 2b3341a94..6e534ed57 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest/operations.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/echo/rest/operations.rb @@ -122,8 +122,6 @@ def initialize # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) # Pass arguments to `list_operations` via keyword arguments. Note that at @@ -165,10 +163,12 @@ def list_operations request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @operations_stub.list_operations request, options do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, @@ -194,8 +194,6 @@ def list_operations request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload get_operation(name: nil) # Pass arguments to `get_operation` via keyword arguments. Note that at @@ -231,10 +229,12 @@ def get_operation request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @operations_stub.get_operation request, options do |result, response| result = ::Gapic::Operation.new result, @operations_client, options: options @@ -260,8 +260,6 @@ def get_operation request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload delete_operation(name: nil) # Pass arguments to `delete_operation` via keyword arguments. Note that at @@ -297,10 +295,12 @@ def delete_operation request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @operations_stub.delete_operation request, options do |result, response| yield result, response if block_given? @@ -331,8 +331,6 @@ def delete_operation request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload cancel_operation(name: nil) # Pass arguments to `cancel_operation` via keyword arguments. Note that at @@ -368,10 +366,12 @@ def cancel_operation request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @operations_stub.cancel_operation request, options do |result, response| yield result, response if block_given? @@ -385,7 +385,11 @@ def cancel_operation request, options = nil # Configuration class for the Operations REST API. # # This class represents the configuration for Operations REST, - # providing control over credentials, timeouts, retry behavior, logging. + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. @@ -395,13 +399,13 @@ def cancel_operation request, options = nil # # Modify the global config, setting the timeout for # # list_operations to 20 seconds, # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.list_operations.timeout = 20.0 # end # # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.list_operations.timeout = 20.0 # end @@ -435,6 +439,14 @@ def cancel_operation request, options = nil # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] @@ -453,6 +465,7 @@ class Configuration config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private @@ -482,9 +495,14 @@ def rpcs # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # - # there is one other field (`retry_policy`) that can be set - # but is currently not supported for REST Gapic libraries. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. # class Rpcs ## diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/identity/rest/client.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/identity/rest/client.rb index 91a64ba78..4be1b7958 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/identity/rest/client.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/identity/rest/client.rb @@ -147,8 +147,6 @@ def initialize # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload create_user(user: nil) # Pass arguments to `create_user` via keyword arguments. Note that at @@ -184,10 +182,12 @@ def create_user request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_user.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.create_user.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @identity_stub.create_user request, options do |result, response| yield result, response if block_given? @@ -209,8 +209,6 @@ def create_user request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload get_user(name: nil) # Pass arguments to `get_user` via keyword arguments. Note that at @@ -246,10 +244,12 @@ def get_user request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_user.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.get_user.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @identity_stub.get_user request, options do |result, response| yield result, response if block_given? @@ -271,8 +271,6 @@ def get_user request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload update_user(user: nil, update_mask: nil) # Pass arguments to `update_user` via keyword arguments. Note that at @@ -311,10 +309,12 @@ def update_user request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_user.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.update_user.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @identity_stub.update_user request, options do |result, response| yield result, response if block_given? @@ -336,8 +336,6 @@ def update_user request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload delete_user(name: nil) # Pass arguments to `delete_user` via keyword arguments. Note that at @@ -373,10 +371,12 @@ def delete_user request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_user.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.delete_user.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @identity_stub.delete_user request, options do |result, response| yield result, response if block_given? @@ -398,8 +398,6 @@ def delete_user request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload list_users(page_size: nil, page_token: nil) # Pass arguments to `list_users` via keyword arguments. Note that at @@ -440,10 +438,12 @@ def list_users request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_users.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.list_users.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @identity_stub.list_users request, options do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @identity_stub, :list_users, "users", request, result, @@ -459,7 +459,11 @@ def list_users request, options = nil # Configuration class for the Identity REST API. # # This class represents the configuration for Identity REST, - # providing control over credentials, timeouts, retry behavior, logging. + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Showcase::V1beta1::Identity::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. @@ -469,13 +473,13 @@ def list_users request, options = nil # # Modify the global config, setting the timeout for # # create_user to 20 seconds, # # and all remaining timeouts to 10 seconds. - # ::Google::Showcase::V1beta1::Identity::Client.configure do |config| + # ::Google::Showcase::V1beta1::Identity::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.create_user.timeout = 20.0 # end # # # Apply the above configuration only to a new client. - # client = ::Google::Showcase::V1beta1::Identity::Client.new do |config| + # client = ::Google::Showcase::V1beta1::Identity::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.create_user.timeout = 20.0 # end @@ -509,6 +513,14 @@ def list_users request, options = nil # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] @@ -527,6 +539,7 @@ class Configuration config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private @@ -556,9 +569,14 @@ def rpcs # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # - # there is one other field (`retry_policy`) that can be set - # but is currently not supported for REST Gapic libraries. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. # class Rpcs ## diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/messaging/rest/client.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/messaging/rest/client.rb index fc2df628e..682583bdf 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/messaging/rest/client.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/messaging/rest/client.rb @@ -163,8 +163,6 @@ def initialize # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload create_room(room: nil) # Pass arguments to `create_room` via keyword arguments. Note that at @@ -200,10 +198,12 @@ def create_room request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_room.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.create_room.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @messaging_stub.create_room request, options do |result, response| yield result, response if block_given? @@ -225,8 +225,6 @@ def create_room request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload get_room(name: nil) # Pass arguments to `get_room` via keyword arguments. Note that at @@ -262,10 +260,12 @@ def get_room request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_room.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.get_room.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @messaging_stub.get_room request, options do |result, response| yield result, response if block_given? @@ -287,8 +287,6 @@ def get_room request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload update_room(room: nil, update_mask: nil) # Pass arguments to `update_room` via keyword arguments. Note that at @@ -327,10 +325,12 @@ def update_room request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_room.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.update_room.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @messaging_stub.update_room request, options do |result, response| yield result, response if block_given? @@ -352,8 +352,6 @@ def update_room request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload delete_room(name: nil) # Pass arguments to `delete_room` via keyword arguments. Note that at @@ -389,10 +387,12 @@ def delete_room request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_room.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.delete_room.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @messaging_stub.delete_room request, options do |result, response| yield result, response if block_given? @@ -414,8 +414,6 @@ def delete_room request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload list_rooms(page_size: nil, page_token: nil) # Pass arguments to `list_rooms` via keyword arguments. Note that at @@ -456,10 +454,12 @@ def list_rooms request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_rooms.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.list_rooms.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @messaging_stub.list_rooms request, options do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @messaging_stub, :list_rooms, "rooms", request, result, @@ -485,8 +485,6 @@ def list_rooms request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload create_blurb(parent: nil, blurb: nil) # Pass arguments to `create_blurb` via keyword arguments. Note that at @@ -525,10 +523,12 @@ def create_blurb request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_blurb.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.create_blurb.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @messaging_stub.create_blurb request, options do |result, response| yield result, response if block_given? @@ -550,8 +550,6 @@ def create_blurb request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload get_blurb(name: nil) # Pass arguments to `get_blurb` via keyword arguments. Note that at @@ -587,10 +585,12 @@ def get_blurb request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_blurb.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.get_blurb.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @messaging_stub.get_blurb request, options do |result, response| yield result, response if block_given? @@ -612,8 +612,6 @@ def get_blurb request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload update_blurb(blurb: nil, update_mask: nil) # Pass arguments to `update_blurb` via keyword arguments. Note that at @@ -652,10 +650,12 @@ def update_blurb request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_blurb.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.update_blurb.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @messaging_stub.update_blurb request, options do |result, response| yield result, response if block_given? @@ -677,8 +677,6 @@ def update_blurb request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload delete_blurb(name: nil) # Pass arguments to `delete_blurb` via keyword arguments. Note that at @@ -714,10 +712,12 @@ def delete_blurb request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_blurb.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.delete_blurb.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @messaging_stub.delete_blurb request, options do |result, response| yield result, response if block_given? @@ -740,8 +740,6 @@ def delete_blurb request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload list_blurbs(parent: nil, page_size: nil, page_token: nil) # Pass arguments to `list_blurbs` via keyword arguments. Note that at @@ -785,10 +783,12 @@ def list_blurbs request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_blurbs.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.list_blurbs.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @messaging_stub.list_blurbs request, options do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @messaging_stub, :list_blurbs, "blurbs", request, result, @@ -814,8 +814,6 @@ def list_blurbs request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload search_blurbs(query: nil, parent: nil, page_size: nil, page_token: nil) # Pass arguments to `search_blurbs` via keyword arguments. Note that at @@ -864,10 +862,12 @@ def search_blurbs request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.search_blurbs.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.search_blurbs.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @messaging_stub.search_blurbs request, options do |result, response| result = ::Gapic::Operation.new result, @operations_client, options: options @@ -882,7 +882,11 @@ def search_blurbs request, options = nil # Configuration class for the Messaging REST API. # # This class represents the configuration for Messaging REST, - # providing control over credentials, timeouts, retry behavior, logging. + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Showcase::V1beta1::Messaging::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. @@ -892,13 +896,13 @@ def search_blurbs request, options = nil # # Modify the global config, setting the timeout for # # create_room to 20 seconds, # # and all remaining timeouts to 10 seconds. - # ::Google::Showcase::V1beta1::Messaging::Client.configure do |config| + # ::Google::Showcase::V1beta1::Messaging::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.create_room.timeout = 20.0 # end # # # Apply the above configuration only to a new client. - # client = ::Google::Showcase::V1beta1::Messaging::Client.new do |config| + # client = ::Google::Showcase::V1beta1::Messaging::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.create_room.timeout = 20.0 # end @@ -932,6 +936,14 @@ def search_blurbs request, options = nil # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] @@ -950,6 +962,7 @@ class Configuration config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private @@ -979,9 +992,14 @@ def rpcs # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # - # there is one other field (`retry_policy`) that can be set - # but is currently not supported for REST Gapic libraries. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. # class Rpcs ## diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/messaging/rest/operations.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/messaging/rest/operations.rb index f1f6e369e..c3c431cd9 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/messaging/rest/operations.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/messaging/rest/operations.rb @@ -122,8 +122,6 @@ def initialize # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) # Pass arguments to `list_operations` via keyword arguments. Note that at @@ -165,10 +163,12 @@ def list_operations request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @operations_stub.list_operations request, options do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, @@ -194,8 +194,6 @@ def list_operations request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload get_operation(name: nil) # Pass arguments to `get_operation` via keyword arguments. Note that at @@ -231,10 +229,12 @@ def get_operation request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @operations_stub.get_operation request, options do |result, response| result = ::Gapic::Operation.new result, @operations_client, options: options @@ -260,8 +260,6 @@ def get_operation request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload delete_operation(name: nil) # Pass arguments to `delete_operation` via keyword arguments. Note that at @@ -297,10 +295,12 @@ def delete_operation request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @operations_stub.delete_operation request, options do |result, response| yield result, response if block_given? @@ -331,8 +331,6 @@ def delete_operation request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload cancel_operation(name: nil) # Pass arguments to `cancel_operation` via keyword arguments. Note that at @@ -368,10 +366,12 @@ def cancel_operation request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @operations_stub.cancel_operation request, options do |result, response| yield result, response if block_given? @@ -385,7 +385,11 @@ def cancel_operation request, options = nil # Configuration class for the Operations REST API. # # This class represents the configuration for Operations REST, - # providing control over credentials, timeouts, retry behavior, logging. + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. @@ -395,13 +399,13 @@ def cancel_operation request, options = nil # # Modify the global config, setting the timeout for # # list_operations to 20 seconds, # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.list_operations.timeout = 20.0 # end # # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.list_operations.timeout = 20.0 # end @@ -435,6 +439,14 @@ def cancel_operation request, options = nil # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] @@ -453,6 +465,7 @@ class Configuration config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private @@ -482,9 +495,14 @@ def rpcs # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # - # there is one other field (`retry_policy`) that can be set - # but is currently not supported for REST Gapic libraries. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. # class Rpcs ## diff --git a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/testing/rest/client.rb b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/testing/rest/client.rb index f63ac0eee..c25496882 100644 --- a/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/testing/rest/client.rb +++ b/shared/output/gapic/templates/showcase/lib/google/showcase/v1beta1/testing/rest/client.rb @@ -148,8 +148,6 @@ def initialize # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload create_session(session: nil) # Pass arguments to `create_session` via keyword arguments. Note that at @@ -187,10 +185,12 @@ def create_session request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_session.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.create_session.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @testing_stub.create_session request, options do |result, response| yield result, response if block_given? @@ -212,8 +212,6 @@ def create_session request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload get_session(name: nil) # Pass arguments to `get_session` via keyword arguments. Note that at @@ -249,10 +247,12 @@ def get_session request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_session.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.get_session.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @testing_stub.get_session request, options do |result, response| yield result, response if block_given? @@ -274,8 +274,6 @@ def get_session request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload list_sessions(page_size: nil, page_token: nil) # Pass arguments to `list_sessions` via keyword arguments. Note that at @@ -313,10 +311,12 @@ def list_sessions request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.list_sessions.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @testing_stub.list_sessions request, options do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @testing_stub, :list_sessions, "sessions", request, result, @@ -340,8 +340,6 @@ def list_sessions request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload delete_session(name: nil) # Pass arguments to `delete_session` via keyword arguments. Note that at @@ -377,10 +375,12 @@ def delete_session request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_session.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.delete_session.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @testing_stub.delete_session request, options do |result, response| yield result, response if block_given? @@ -404,8 +404,6 @@ def delete_session request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload report_session(name: nil) # Pass arguments to `report_session` via keyword arguments. Note that at @@ -441,10 +439,12 @@ def report_session request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.report_session.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.report_session.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @testing_stub.report_session request, options do |result, response| yield result, response if block_given? @@ -466,8 +466,6 @@ def report_session request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload list_tests(parent: nil, page_size: nil, page_token: nil) # Pass arguments to `list_tests` via keyword arguments. Note that at @@ -507,10 +505,12 @@ def list_tests request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_tests.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.list_tests.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @testing_stub.list_tests request, options do |result, response| result = ::Gapic::Rest::PagedEnumerable.new @testing_stub, :list_tests, "tests", request, result, @@ -539,8 +539,6 @@ def list_tests request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload delete_test(name: nil) # Pass arguments to `delete_test` via keyword arguments. Note that at @@ -576,10 +574,12 @@ def delete_test request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_test.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.delete_test.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @testing_stub.delete_test request, options do |result, response| yield result, response if block_given? @@ -604,8 +604,6 @@ def delete_test request, options = nil # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # Note: currently retry functionality is not implemented. While it is possible - # to set it using ::Gapic::CallOptions, it will not be applied # # @overload verify_test(name: nil, answer: nil, answers: nil) # Pass arguments to `verify_test` via keyword arguments. Note that at @@ -645,10 +643,12 @@ def verify_test request, options = nil call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.verify_test.timeout, - metadata: call_metadata + metadata: call_metadata, + retry_policy: @config.rpcs.verify_test.retry_policy options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata + metadata: @config.metadata, + retry_policy: @config.retry_policy @testing_stub.verify_test request, options do |result, response| yield result, response if block_given? @@ -662,7 +662,11 @@ def verify_test request, options = nil # Configuration class for the Testing REST API. # # This class represents the configuration for Testing REST, - # providing control over credentials, timeouts, retry behavior, logging. + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Showcase::V1beta1::Testing::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. @@ -672,13 +676,13 @@ def verify_test request, options = nil # # Modify the global config, setting the timeout for # # create_session to 20 seconds, # # and all remaining timeouts to 10 seconds. - # ::Google::Showcase::V1beta1::Testing::Client.configure do |config| + # ::Google::Showcase::V1beta1::Testing::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.create_session.timeout = 20.0 # end # # # Apply the above configuration only to a new client. - # client = ::Google::Showcase::V1beta1::Testing::Client.new do |config| + # client = ::Google::Showcase::V1beta1::Testing::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.create_session.timeout = 20.0 # end @@ -712,6 +716,14 @@ def verify_test request, options = nil # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] @@ -730,6 +742,7 @@ class Configuration config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private @@ -759,9 +772,14 @@ def rpcs # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # - # there is one other field (`retry_policy`) that can be set - # but is currently not supported for REST Gapic libraries. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. # class Rpcs ##