lib/google/cloud/gaming/v1/realms_service/client.rb in google-cloud-gaming-v1-0.3.2 vs lib/google/cloud/gaming/v1/realms_service/client.rb in google-cloud-gaming-v1-0.3.3

- old
+ new

@@ -40,18 +40,17 @@ # Configure the RealmsService Client class. # # See {::Google::Cloud::Gaming::V1::RealmsService::Client::Configuration} # for a description of the configuration fields. # - # ## Example + # @example # - # To modify the configuration for all RealmsService clients: + # # Modify the configuration for all RealmsService clients + # ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config| + # config.timeout = 10.0 + # end # - # ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config| - # config.timeout = 10.0 - # end - # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # @@ -114,24 +113,20 @@ end ## # Create a new RealmsService client object. # - # ## Examples + # @example # - # To create a new RealmsService client with the default - # configuration: + # # Create a client using the default configuration + # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new # - # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new + # # Create a client using a custom configuration + # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config| + # config.timeout = 10.0 + # end # - # To create a new RealmsService client with a custom - # configuration: - # - # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config| - # config.timeout = 10.0 - # end - # # @yield [config] Configure the RealmsService client. # @yieldparam config [Client::Configuration] # def initialize # These require statements are intentionally placed here to initialize @@ -146,14 +141,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 @@ -252,11 +246,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_realms.timeout, metadata: metadata, retry_policy: @config.rpcs.list_realms.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @realms_service_stub.call_rpc :list_realms, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @realms_service_stub, :list_realms, request, response, operation, options yield response, operation if block_given? @@ -320,11 +316,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_realm.timeout, metadata: metadata, retry_policy: @config.rpcs.get_realm.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @realms_service_stub.call_rpc :get_realm, request, options: options do |response, operation| yield response, operation if block_given? return response @@ -391,11 +389,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_realm.timeout, metadata: metadata, retry_policy: @config.rpcs.create_realm.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @realms_service_stub.call_rpc :create_realm, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? @@ -459,11 +459,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_realm.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_realm.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @realms_service_stub.call_rpc :delete_realm, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? @@ -534,11 +536,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_realm.timeout, metadata: metadata, retry_policy: @config.rpcs.update_realm.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @realms_service_stub.call_rpc :update_realm, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? @@ -611,11 +615,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.preview_realm_update.timeout, metadata: metadata, retry_policy: @config.rpcs.preview_realm_update.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @realms_service_stub.call_rpc :preview_realm_update, request, options: options do |response, operation| yield response, operation if block_given? return response @@ -635,25 +641,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 list_realms - # to 20 seconds, and all remaining timeouts to 10 seconds: + # # Modify the global config, setting the timeout for + # # list_realms to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_realms.timeout = 20.0 + # end # - # ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_realms.timeout = 20.0 - # end - # - # To apply the above configuration only to a new client: - # - # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_realms.timeout = 20.0 - # end + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_realms.timeout = 20.0 + # end # # @!attribute [rw] endpoint # The hostname or hostname:port of the service endpoint. # Defaults to `"gameservices.googleapis.com"`. # @return [::String]