lib/google/cloud/app_engine/v1/firewall/client.rb in google-cloud-app_engine-v1-0.3.2 vs lib/google/cloud/app_engine/v1/firewall/client.rb in google-cloud-app_engine-v1-0.3.3
- old
+ new
@@ -46,18 +46,17 @@
# Configure the Firewall Client class.
#
# See {::Google::Cloud::AppEngine::V1::Firewall::Client::Configuration}
# for a description of the configuration fields.
#
- # ## Example
+ # @example
#
- # To modify the configuration for all Firewall clients:
+ # # Modify the configuration for all Firewall clients
+ # ::Google::Cloud::AppEngine::V1::Firewall::Client.configure do |config|
+ # config.timeout = 10.0
+ # end
#
- # ::Google::Cloud::AppEngine::V1::Firewall::Client.configure do |config|
- # config.timeout = 10.0
- # end
- #
# @yield [config] Configure the Client client.
# @yieldparam config [Client::Configuration]
#
# @return [Client::Configuration]
#
@@ -99,24 +98,20 @@
end
##
# Create a new Firewall client object.
#
- # ## Examples
+ # @example
#
- # To create a new Firewall client with the default
- # configuration:
+ # # Create a client using the default configuration
+ # client = ::Google::Cloud::AppEngine::V1::Firewall::Client.new
#
- # client = ::Google::Cloud::AppEngine::V1::Firewall::Client.new
+ # # Create a client using a custom configuration
+ # client = ::Google::Cloud::AppEngine::V1::Firewall::Client.new do |config|
+ # config.timeout = 10.0
+ # end
#
- # To create a new Firewall client with a custom
- # configuration:
- #
- # client = ::Google::Cloud::AppEngine::V1::Firewall::Client.new do |config|
- # config.timeout = 10.0
- # end
- #
# @yield [config] Configure the Firewall client.
# @yieldparam config [Client::Configuration]
#
def initialize
# These require statements are intentionally placed here to initialize
@@ -131,14 +126,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
@@ -219,11 +213,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.list_ingress_rules.timeout,
metadata: metadata,
retry_policy: @config.rpcs.list_ingress_rules.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@firewall_stub.call_rpc :list_ingress_rules, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @firewall_stub, :list_ingress_rules, request, response, operation, options
yield response, operation if block_given?
@@ -293,11 +289,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.batch_update_ingress_rules.timeout,
metadata: metadata,
retry_policy: @config.rpcs.batch_update_ingress_rules.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@firewall_stub.call_rpc :batch_update_ingress_rules, request, options: options do |response, operation|
yield response, operation if block_given?
return response
@@ -371,11 +369,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.create_ingress_rule.timeout,
metadata: metadata,
retry_policy: @config.rpcs.create_ingress_rule.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@firewall_stub.call_rpc :create_ingress_rule, request, options: options do |response, operation|
yield response, operation if block_given?
return response
@@ -438,11 +438,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.get_ingress_rule.timeout,
metadata: metadata,
retry_policy: @config.rpcs.get_ingress_rule.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@firewall_stub.call_rpc :get_ingress_rule, request, options: options do |response, operation|
yield response, operation if block_given?
return response
@@ -509,11 +511,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.update_ingress_rule.timeout,
metadata: metadata,
retry_policy: @config.rpcs.update_ingress_rule.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@firewall_stub.call_rpc :update_ingress_rule, request, options: options do |response, operation|
yield response, operation if block_given?
return response
@@ -576,11 +580,13 @@
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.delete_ingress_rule.timeout,
metadata: metadata,
retry_policy: @config.rpcs.delete_ingress_rule.retry_policy
- options.apply_defaults metadata: @config.metadata,
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
retry_policy: @config.retry_policy
@firewall_stub.call_rpc :delete_ingress_rule, request, options: options do |response, operation|
yield response, operation if block_given?
return response
@@ -600,25 +606,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_ingress_rules
- # to 20 seconds, and all remaining timeouts to 10 seconds:
+ # # Modify the global config, setting the timeout for
+ # # list_ingress_rules to 20 seconds,
+ # # and all remaining timeouts to 10 seconds.
+ # ::Google::Cloud::AppEngine::V1::Firewall::Client.configure do |config|
+ # config.timeout = 10.0
+ # config.rpcs.list_ingress_rules.timeout = 20.0
+ # end
#
- # ::Google::Cloud::AppEngine::V1::Firewall::Client.configure do |config|
- # config.timeout = 10.0
- # config.rpcs.list_ingress_rules.timeout = 20.0
- # end
- #
- # To apply the above configuration only to a new client:
- #
- # client = ::Google::Cloud::AppEngine::V1::Firewall::Client.new do |config|
- # config.timeout = 10.0
- # config.rpcs.list_ingress_rules.timeout = 20.0
- # end
+ # # Apply the above configuration only to a new client.
+ # client = ::Google::Cloud::AppEngine::V1::Firewall::Client.new do |config|
+ # config.timeout = 10.0
+ # config.rpcs.list_ingress_rules.timeout = 20.0
+ # end
#
# @!attribute [rw] endpoint
# The hostname or hostname:port of the service endpoint.
# Defaults to `"appengine.googleapis.com"`.
# @return [::String]