lib/google/cloud/domains/v1beta1/domains/client.rb in google-cloud-domains-v1beta1-0.2.2 vs lib/google/cloud/domains/v1beta1/domains/client.rb in google-cloud-domains-v1beta1-0.2.3
- old
+ new
@@ -39,18 +39,17 @@
# Configure the Domains Client class.
#
# See {::Google::Cloud::Domains::V1beta1::Domains::Client::Configuration}
# for a description of the configuration fields.
#
- # ## Example
+ # @example
#
- # To modify the configuration for all Domains clients:
+ # # Modify the configuration for all Domains clients
+ # ::Google::Cloud::Domains::V1beta1::Domains::Client.configure do |config|
+ # config.timeout = 10.0
+ # end
#
- # ::Google::Cloud::Domains::V1beta1::Domains::Client.configure do |config|
- # config.timeout = 10.0
- # end
- #
# @yield [config] Configure the Client client.
# @yieldparam config [Client::Configuration]
#
# @return [Client::Configuration]
#
@@ -92,24 +91,20 @@
end
##
# Create a new Domains client object.
#
- # ## Examples
+ # @example
#
- # To create a new Domains client with the default
- # configuration:
+ # # Create a client using the default configuration
+ # client = ::Google::Cloud::Domains::V1beta1::Domains::Client.new
#
- # client = ::Google::Cloud::Domains::V1beta1::Domains::Client.new
+ # # Create a client using a custom configuration
+ # client = ::Google::Cloud::Domains::V1beta1::Domains::Client.new do |config|
+ # config.timeout = 10.0
+ # end
#
- # To create a new Domains client with a custom
- # configuration:
- #
- # client = ::Google::Cloud::Domains::V1beta1::Domains::Client.new do |config|
- # config.timeout = 10.0
- # end
- #
# @yield [config] Configure the Domains client.
# @yieldparam config [Client::Configuration]
#
def initialize
# These require statements are intentionally placed here to initialize
@@ -124,14 +119,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
@@ -221,11 +215,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.search_domains.timeout,
metadata: metadata,
retry_policy: @config.rpcs.search_domains.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@domains_stub.call_rpc :search_domains, request, options: options do |response, operation|
yield response, operation if block_given?
return response
@@ -290,11 +286,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.retrieve_register_parameters.timeout,
metadata: metadata,
retry_policy: @config.rpcs.retrieve_register_parameters.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@domains_stub.call_rpc :retrieve_register_parameters, request, options: options do |response, operation|
yield response, operation if block_given?
return response
@@ -386,11 +384,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.register_domain.timeout,
metadata: metadata,
retry_policy: @config.rpcs.register_domain.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@domains_stub.call_rpc :register_domain, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
@@ -476,11 +476,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.list_registrations.timeout,
metadata: metadata,
retry_policy: @config.rpcs.list_registrations.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@domains_stub.call_rpc :list_registrations, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @domains_stub, :list_registrations, request, response, operation, options
yield response, operation if block_given?
@@ -544,11 +546,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.get_registration.timeout,
metadata: metadata,
retry_policy: @config.rpcs.get_registration.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@domains_stub.call_rpc :get_registration, request, options: options do |response, operation|
yield response, operation if block_given?
return response
@@ -619,11 +623,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.update_registration.timeout,
metadata: metadata,
retry_policy: @config.rpcs.update_registration.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@domains_stub.call_rpc :update_registration, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
@@ -693,11 +699,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.configure_management_settings.timeout,
metadata: metadata,
retry_policy: @config.rpcs.configure_management_settings.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@domains_stub.call_rpc :configure_management_settings, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
@@ -775,11 +783,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.configure_dns_settings.timeout,
metadata: metadata,
retry_policy: @config.rpcs.configure_dns_settings.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@domains_stub.call_rpc :configure_dns_settings, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
@@ -855,11 +865,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.configure_contact_settings.timeout,
metadata: metadata,
retry_policy: @config.rpcs.configure_contact_settings.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@domains_stub.call_rpc :configure_contact_settings, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
@@ -936,11 +948,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.export_registration.timeout,
metadata: metadata,
retry_policy: @config.rpcs.export_registration.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@domains_stub.call_rpc :export_registration, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
@@ -1009,11 +1023,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.delete_registration.timeout,
metadata: metadata,
retry_policy: @config.rpcs.delete_registration.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@domains_stub.call_rpc :delete_registration, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
@@ -1081,11 +1097,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.retrieve_authorization_code.timeout,
metadata: metadata,
retry_policy: @config.rpcs.retrieve_authorization_code.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@domains_stub.call_rpc :retrieve_authorization_code, request, options: options do |response, operation|
yield response, operation if block_given?
return response
@@ -1151,11 +1169,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.reset_authorization_code.timeout,
metadata: metadata,
retry_policy: @config.rpcs.reset_authorization_code.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@domains_stub.call_rpc :reset_authorization_code, request, options: options do |response, operation|
yield response, operation if block_given?
return response
@@ -1175,25 +1195,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 search_domains
- # to 20 seconds, and all remaining timeouts to 10 seconds:
+ # # Modify the global config, setting the timeout for
+ # # search_domains to 20 seconds,
+ # # and all remaining timeouts to 10 seconds.
+ # ::Google::Cloud::Domains::V1beta1::Domains::Client.configure do |config|
+ # config.timeout = 10.0
+ # config.rpcs.search_domains.timeout = 20.0
+ # end
#
- # ::Google::Cloud::Domains::V1beta1::Domains::Client.configure do |config|
- # config.timeout = 10.0
- # config.rpcs.search_domains.timeout = 20.0
- # end
- #
- # To apply the above configuration only to a new client:
- #
- # client = ::Google::Cloud::Domains::V1beta1::Domains::Client.new do |config|
- # config.timeout = 10.0
- # config.rpcs.search_domains.timeout = 20.0
- # end
+ # # Apply the above configuration only to a new client.
+ # client = ::Google::Cloud::Domains::V1beta1::Domains::Client.new do |config|
+ # config.timeout = 10.0
+ # config.rpcs.search_domains.timeout = 20.0
+ # end
#
# @!attribute [rw] endpoint
# The hostname or hostname:port of the service endpoint.
# Defaults to `"domains.googleapis.com"`.
# @return [::String]