lib/google/cloud/dataflow/v1beta3/metrics/client.rb in google-cloud-dataflow-v1beta3-0.1.1 vs lib/google/cloud/dataflow/v1beta3/metrics/client.rb in google-cloud-dataflow-v1beta3-0.1.2

- old
+ new

@@ -38,18 +38,17 @@ # Configure the Metrics Client class. # # See {::Google::Cloud::Dataflow::V1beta3::Metrics::Client::Configuration} # for a description of the configuration fields. # - # ## Example + # @example # - # To modify the configuration for all Metrics clients: + # # Modify the configuration for all Metrics clients + # ::Google::Cloud::Dataflow::V1beta3::Metrics::Client.configure do |config| + # config.timeout = 10.0 + # end # - # ::Google::Cloud::Dataflow::V1beta3::Metrics::Client.configure do |config| - # config.timeout = 10.0 - # end - # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # @@ -93,24 +92,20 @@ end ## # Create a new Metrics client object. # - # ## Examples + # @example # - # To create a new Metrics client with the default - # configuration: + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataflow::V1beta3::Metrics::Client.new # - # client = ::Google::Cloud::Dataflow::V1beta3::Metrics::Client.new + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataflow::V1beta3::Metrics::Client.new do |config| + # config.timeout = 10.0 + # end # - # To create a new Metrics client with a custom - # configuration: - # - # client = ::Google::Cloud::Dataflow::V1beta3::Metrics::Client.new do |config| - # config.timeout = 10.0 - # end - # # @yield [config] Configure the Metrics client. # @yieldparam config [Client::Configuration] # def initialize # These require statements are intentionally placed here to initialize @@ -125,14 +120,13 @@ # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials - # Use self-signed JWT if the scope and endpoint are unchanged from default, + # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.scope == Client.configure.scope && - @config.endpoint == Client.configure.endpoint && + enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint && !@config.endpoint.split(".").first.include?("-") credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope @@ -213,11 +207,13 @@ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_job_metrics.timeout, metadata: metadata, retry_policy: @config.rpcs.get_job_metrics.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @metrics_stub.call_rpc :get_job_metrics, request, options: options do |response, operation| yield response, operation if block_given? return response @@ -289,11 +285,13 @@ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_job_execution_details.timeout, metadata: metadata, retry_policy: @config.rpcs.get_job_execution_details.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @metrics_stub.call_rpc :get_job_execution_details, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @metrics_stub, :get_job_execution_details, request, response, operation, options yield response, operation if block_given? @@ -373,11 +371,13 @@ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_stage_execution_details.timeout, metadata: metadata, retry_policy: @config.rpcs.get_stage_execution_details.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @metrics_stub.call_rpc :get_stage_execution_details, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @metrics_stub, :get_stage_execution_details, request, response, operation, options yield response, operation if block_given? @@ -398,25 +398,24 @@ # 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. # - # # Examples + # @example # - # To modify the global config, setting the timeout for get_job_metrics - # to 20 seconds, and all remaining timeouts to 10 seconds: + # # Modify the global config, setting the timeout for + # # get_job_metrics to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataflow::V1beta3::Metrics::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_job_metrics.timeout = 20.0 + # end # - # ::Google::Cloud::Dataflow::V1beta3::Metrics::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_job_metrics.timeout = 20.0 - # end - # - # To apply the above configuration only to a new client: - # - # client = ::Google::Cloud::Dataflow::V1beta3::Metrics::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_job_metrics.timeout = 20.0 - # end + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataflow::V1beta3::Metrics::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_job_metrics.timeout = 20.0 + # end # # @!attribute [rw] endpoint # The hostname or hostname:port of the service endpoint. # Defaults to `"dataflow.googleapis.com"`. # @return [::String]