# frozen_string_literal: true

# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Auto-generated by gapic-generator-ruby. DO NOT EDIT!

require "google/cloud/errors"
require "google/cloud/networkconnectivity/v1/hub_pb"
require "google/cloud/location"
require "google/iam/v1"

module Google
  module Cloud
    module NetworkConnectivity
      module V1
        module HubService
          ##
          # Client for the HubService service.
          #
          # Network Connectivity Center is a hub-and-spoke abstraction for network
          # connectivity management in Google Cloud. It reduces operational complexity
          # through a simple, centralized connectivity management model.
          #
          class Client
            # @private
            API_VERSION = ""

            # @private
            DEFAULT_ENDPOINT_TEMPLATE = "networkconnectivity.$UNIVERSE_DOMAIN$"

            include Paths

            # @private
            attr_reader :hub_service_stub

            ##
            # Configure the HubService Client class.
            #
            # See {::Google::Cloud::NetworkConnectivity::V1::HubService::Client::Configuration}
            # for a description of the configuration fields.
            #
            # @example
            #
            #   # Modify the configuration for all HubService clients
            #   ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.configure do |config|
            #     config.timeout = 10.0
            #   end
            #
            # @yield [config] Configure the Client client.
            # @yieldparam config [Client::Configuration]
            #
            # @return [Client::Configuration]
            #
            def self.configure
              @configure ||= begin
                namespace = ["Google", "Cloud", "NetworkConnectivity", "V1"]
                parent_config = while namespace.any?
                                  parent_name = namespace.join "::"
                                  parent_const = const_get parent_name
                                  break parent_const.configure if parent_const.respond_to? :configure
                                  namespace.pop
                                end
                default_config = Client::Configuration.new parent_config

                default_config.timeout = 60.0
                default_config.retry_policy = {
                  initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
                }

                default_config.rpcs.create_hub.timeout = 60.0

                default_config.rpcs.update_hub.timeout = 60.0

                default_config.rpcs.delete_hub.timeout = 60.0

                default_config.rpcs.create_spoke.timeout = 60.0

                default_config.rpcs.update_spoke.timeout = 60.0

                default_config.rpcs.delete_spoke.timeout = 60.0

                default_config
              end
              yield @configure if block_given?
              @configure
            end

            ##
            # Configure the HubService Client instance.
            #
            # The configuration is set to the derived mode, meaning that values can be changed,
            # but structural changes (adding new fields, etc.) are not allowed. Structural changes
            # should be made on {Client.configure}.
            #
            # See {::Google::Cloud::NetworkConnectivity::V1::HubService::Client::Configuration}
            # for a description of the configuration fields.
            #
            # @yield [config] Configure the Client client.
            # @yieldparam config [Client::Configuration]
            #
            # @return [Client::Configuration]
            #
            def configure
              yield @config if block_given?
              @config
            end

            ##
            # The effective universe domain
            #
            # @return [String]
            #
            def universe_domain
              @hub_service_stub.universe_domain
            end

            ##
            # Create a new HubService client object.
            #
            # @example
            #
            #   # Create a client using the default configuration
            #   client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a client using a custom configuration
            #   client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config|
            #     config.timeout = 10.0
            #   end
            #
            # @yield [config] Configure the HubService client.
            # @yieldparam config [Client::Configuration]
            #
            def initialize
              # These require statements are intentionally placed here to initialize
              # the gRPC module only when it's required.
              # See https://github.com/googleapis/toolkit/issues/446
              require "gapic/grpc"
              require "google/cloud/networkconnectivity/v1/hub_services_pb"

              # Create the configuration object
              @config = Configuration.new Client.configure

              # Yield the configuration if needed
              yield @config if block_given?

              # Create credentials
              credentials = @config.credentials
              # 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.endpoint.nil? ||
                                       (@config.endpoint == Configuration::DEFAULT_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
              end
              @quota_project_id = @config.quota_project
              @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

              @operations_client = Operations.new do |config|
                config.credentials = credentials
                config.quota_project = @quota_project_id
                config.endpoint = @config.endpoint
                config.universe_domain = @config.universe_domain
              end

              @hub_service_stub = ::Gapic::ServiceStub.new(
                ::Google::Cloud::NetworkConnectivity::V1::HubService::Stub,
                credentials: credentials,
                endpoint: @config.endpoint,
                endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
                universe_domain: @config.universe_domain,
                channel_args: @config.channel_args,
                interceptors: @config.interceptors,
                channel_pool_config: @config.channel_pool,
                logger: @config.logger
              )

              @hub_service_stub.stub_logger&.info do |entry|
                entry.set_system_name
                entry.set_service
                entry.message = "Created client for #{entry.service}"
                entry.set_credentials_fields credentials
                entry.set "customEndpoint", @config.endpoint if @config.endpoint
                entry.set "defaultTimeout", @config.timeout if @config.timeout
                entry.set "quotaProject", @quota_project_id if @quota_project_id
              end

              @location_client = Google::Cloud::Location::Locations::Client.new do |config|
                config.credentials = credentials
                config.quota_project = @quota_project_id
                config.endpoint = @hub_service_stub.endpoint
                config.universe_domain = @hub_service_stub.universe_domain
                config.logger = @hub_service_stub.logger if config.respond_to? :logger=
              end

              @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
                config.credentials = credentials
                config.quota_project = @quota_project_id
                config.endpoint = @hub_service_stub.endpoint
                config.universe_domain = @hub_service_stub.universe_domain
                config.logger = @hub_service_stub.logger if config.respond_to? :logger=
              end
            end

            ##
            # Get the associated client for long-running operations.
            #
            # @return [::Google::Cloud::NetworkConnectivity::V1::HubService::Operations]
            #
            attr_reader :operations_client

            ##
            # Get the associated client for mix-in of the Locations.
            #
            # @return [Google::Cloud::Location::Locations::Client]
            #
            attr_reader :location_client

            ##
            # Get the associated client for mix-in of the IAMPolicy.
            #
            # @return [Google::Iam::V1::IAMPolicy::Client]
            #
            attr_reader :iam_policy_client

            ##
            # The logger used for request/response debug logging.
            #
            # @return [Logger]
            #
            def logger
              @hub_service_stub.logger
            end

            # Service calls

            ##
            # Lists the Network Connectivity Center hubs associated with a given project.
            #
            # @overload list_hubs(request, options = nil)
            #   Pass arguments to `list_hubs` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::ListHubsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::ListHubsRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload list_hubs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
            #   Pass arguments to `list_hubs` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource's name.
            #   @param page_size [::Integer]
            #     The maximum number of results per page to return.
            #   @param page_token [::String]
            #     The page token.
            #   @param filter [::String]
            #     An expression that filters the list of results.
            #   @param order_by [::String]
            #     Sort the results by a certain order.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Hub>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Hub>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::ListHubsRequest.new
            #
            #   # Call the list_hubs method.
            #   result = client.list_hubs request
            #
            #   # The returned object is of type Gapic::PagedEnumerable. You can iterate
            #   # over elements, and API calls will be issued to fetch pages as needed.
            #   result.each do |item|
            #     # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::Hub.
            #     p item
            #   end
            #
            def list_hubs request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListHubsRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.list_hubs.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.parent
                header_params["parent"] = request.parent
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.list_hubs.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_hubs.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :list_hubs, request, options: options do |response, operation|
                response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_hubs, request, response, operation, options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Gets details about a Network Connectivity Center hub.
            #
            # @overload get_hub(request, options = nil)
            #   Pass arguments to `get_hub` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::GetHubRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::GetHubRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload get_hub(name: nil)
            #   Pass arguments to `get_hub` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the hub resource to get.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1::Hub]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::NetworkConnectivity::V1::Hub]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::GetHubRequest.new
            #
            #   # Call the get_hub method.
            #   result = client.get_hub request
            #
            #   # The returned object is of type Google::Cloud::NetworkConnectivity::V1::Hub.
            #   p result
            #
            def get_hub request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetHubRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.get_hub.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.name
                header_params["name"] = request.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.get_hub.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_hub.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :get_hub, request, options: options do |response, operation|
                yield response, operation if block_given?
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Creates a new Network Connectivity Center hub in the specified project.
            #
            # @overload create_hub(request, options = nil)
            #   Pass arguments to `create_hub` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::CreateHubRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::CreateHubRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload create_hub(parent: nil, hub_id: nil, hub: nil, request_id: nil)
            #   Pass arguments to `create_hub` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource.
            #   @param hub_id [::String]
            #     Required. A unique identifier for the hub.
            #   @param hub [::Google::Cloud::NetworkConnectivity::V1::Hub, ::Hash]
            #     Required. The initial values for a new hub.
            #   @param request_id [::String]
            #     Optional. A request ID to identify requests. Specify a unique request ID so
            #     that if you must retry your request, the server knows to ignore the request
            #     if it has already been completed. The server guarantees that a request
            #     doesn't result in creation of duplicate commitments for at least 60
            #     minutes.
            #
            #     For example, consider a situation where you make an initial request and
            #     the request times out. If you make the request again with the same request
            #     ID, the server can check to see whether the original operation
            #     was received. If it was, the server ignores the second request. This
            #     behavior prevents clients from mistakenly creating duplicate commitments.
            #
            #     The request ID must be a valid UUID, with the exception that zero UUID is
            #     not supported (00000000-0000-0000-0000-000000000000).
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::Operation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::Operation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::CreateHubRequest.new
            #
            #   # Call the create_hub method.
            #   result = client.create_hub request
            #
            #   # The returned object is of type Gapic::Operation. You can use it to
            #   # check the status of an operation, cancel it, or wait for results.
            #   # Here is how to wait for a response.
            #   result.wait_until_done! timeout: 60
            #   if result.response?
            #     p result.response
            #   else
            #     puts "No response received."
            #   end
            #
            def create_hub request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::CreateHubRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.create_hub.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.parent
                header_params["parent"] = request.parent
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.create_hub.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.create_hub.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :create_hub, request, options: options do |response, operation|
                response = ::Gapic::Operation.new response, @operations_client, options: options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Updates the description and/or labels of a Network Connectivity Center
            # hub.
            #
            # @overload update_hub(request, options = nil)
            #   Pass arguments to `update_hub` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::UpdateHubRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::UpdateHubRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload update_hub(update_mask: nil, hub: nil, request_id: nil)
            #   Pass arguments to `update_hub` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     Optional. In the case of an update to an existing hub, field mask is used
            #     to specify the fields to be overwritten. The fields specified in the
            #     update_mask are relative to the resource, not the full request. A field is
            #     overwritten if it is in the mask. If the user does not provide a mask, then
            #     all fields are overwritten.
            #   @param hub [::Google::Cloud::NetworkConnectivity::V1::Hub, ::Hash]
            #     Required. The state that the hub should be in after the update.
            #   @param request_id [::String]
            #     Optional. A request ID to identify requests. Specify a unique request ID so
            #     that if you must retry your request, the server knows to ignore the request
            #     if it has already been completed. The server guarantees that a request
            #     doesn't result in creation of duplicate commitments for at least 60
            #     minutes.
            #
            #     For example, consider a situation where you make an initial request and
            #     the request times out. If you make the request again with the same request
            #     ID, the server can check to see whether the original operation
            #     was received. If it was, the server ignores the second request. This
            #     behavior prevents clients from mistakenly creating duplicate commitments.
            #
            #     The request ID must be a valid UUID, with the exception that zero UUID is
            #     not supported (00000000-0000-0000-0000-000000000000).
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::Operation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::Operation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::UpdateHubRequest.new
            #
            #   # Call the update_hub method.
            #   result = client.update_hub request
            #
            #   # The returned object is of type Gapic::Operation. You can use it to
            #   # check the status of an operation, cancel it, or wait for results.
            #   # Here is how to wait for a response.
            #   result.wait_until_done! timeout: 60
            #   if result.response?
            #     p result.response
            #   else
            #     puts "No response received."
            #   end
            #
            def update_hub request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::UpdateHubRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.update_hub.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.hub&.name
                header_params["hub.name"] = request.hub.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.update_hub.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.update_hub.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :update_hub, request, options: options do |response, operation|
                response = ::Gapic::Operation.new response, @operations_client, options: options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Deletes a Network Connectivity Center hub.
            #
            # @overload delete_hub(request, options = nil)
            #   Pass arguments to `delete_hub` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::DeleteHubRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::DeleteHubRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload delete_hub(name: nil, request_id: nil)
            #   Pass arguments to `delete_hub` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the hub to delete.
            #   @param request_id [::String]
            #     Optional. A request ID to identify requests. Specify a unique request ID so
            #     that if you must retry your request, the server knows to ignore the request
            #     if it has already been completed. The server guarantees that a request
            #     doesn't result in creation of duplicate commitments for at least 60
            #     minutes.
            #
            #     For example, consider a situation where you make an initial request and
            #     the request times out. If you make the request again with the same request
            #     ID, the server can check to see whether the original operation
            #     was received. If it was, the server ignores the second request. This
            #     behavior prevents clients from mistakenly creating duplicate commitments.
            #
            #     The request ID must be a valid UUID, with the exception that zero UUID is
            #     not supported (00000000-0000-0000-0000-000000000000).
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::Operation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::Operation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::DeleteHubRequest.new
            #
            #   # Call the delete_hub method.
            #   result = client.delete_hub request
            #
            #   # The returned object is of type Gapic::Operation. You can use it to
            #   # check the status of an operation, cancel it, or wait for results.
            #   # Here is how to wait for a response.
            #   result.wait_until_done! timeout: 60
            #   if result.response?
            #     p result.response
            #   else
            #     puts "No response received."
            #   end
            #
            def delete_hub request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::DeleteHubRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.delete_hub.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.name
                header_params["name"] = request.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.delete_hub.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.delete_hub.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :delete_hub, request, options: options do |response, operation|
                response = ::Gapic::Operation.new response, @operations_client, options: options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Lists the Network Connectivity Center spokes associated with a
            # specified hub and location. The list includes both spokes that are attached
            # to the hub and spokes that have been proposed but not yet accepted.
            #
            # @overload list_hub_spokes(request, options = nil)
            #   Pass arguments to `list_hub_spokes` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::ListHubSpokesRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::ListHubSpokesRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload list_hub_spokes(name: nil, spoke_locations: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil)
            #   Pass arguments to `list_hub_spokes` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the hub.
            #   @param spoke_locations [::Array<::String>]
            #     A list of locations.
            #     Specify one of the following: `[global]`, a single region (for
            #     example, `[us-central1]`), or a combination of
            #     values (for example, `[global, us-central1, us-west1]`).
            #     If the spoke_locations field is populated, the list of results
            #     includes only spokes in the specified location.
            #     If the spoke_locations field is not populated, the list of results
            #     includes spokes in all locations.
            #   @param page_size [::Integer]
            #     The maximum number of results to return per page.
            #   @param page_token [::String]
            #     The page token.
            #   @param filter [::String]
            #     An expression that filters the list of results.
            #   @param order_by [::String]
            #     Sort the results by name or create_time.
            #   @param view [::Google::Cloud::NetworkConnectivity::V1::ListHubSpokesRequest::SpokeView]
            #     The view of the spoke to return.
            #     The view that you use determines which spoke fields are included in the
            #     response.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Spoke>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Spoke>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::ListHubSpokesRequest.new
            #
            #   # Call the list_hub_spokes method.
            #   result = client.list_hub_spokes request
            #
            #   # The returned object is of type Gapic::PagedEnumerable. You can iterate
            #   # over elements, and API calls will be issued to fetch pages as needed.
            #   result.each do |item|
            #     # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::Spoke.
            #     p item
            #   end
            #
            def list_hub_spokes request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListHubSpokesRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.list_hub_spokes.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.name
                header_params["name"] = request.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.list_hub_spokes.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_hub_spokes.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :list_hub_spokes, request, options: options do |response, operation|
                response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_hub_spokes, request, response, operation, options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Query the Private Service Connect propagation status of a Network
            # Connectivity Center hub.
            #
            # @overload query_hub_status(request, options = nil)
            #   Pass arguments to `query_hub_status` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::QueryHubStatusRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::QueryHubStatusRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload query_hub_status(name: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, group_by: nil)
            #   Pass arguments to `query_hub_status` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the hub.
            #   @param page_size [::Integer]
            #     Optional. The maximum number of results to return per page.
            #   @param page_token [::String]
            #     Optional. The page token.
            #   @param filter [::String]
            #     Optional. An expression that filters the list of results.
            #     The filter can be used to filter the results by the following fields:
            #       * `psc_propagation_status.source_spoke`
            #       * `psc_propagation_status.source_group`
            #       * `psc_propagation_status.source_forwarding_rule`
            #       * `psc_propagation_status.target_spoke`
            #       * `psc_propagation_status.target_group`
            #       * `psc_propagation_status.code`
            #       * `psc_propagation_status.message`
            #   @param order_by [::String]
            #     Optional. Sort the results in ascending order by the specified fields.
            #     A comma-separated list of any of these fields:
            #       * `psc_propagation_status.source_spoke`
            #       * `psc_propagation_status.source_group`
            #       * `psc_propagation_status.source_forwarding_rule`
            #       * `psc_propagation_status.target_spoke`
            #       * `psc_propagation_status.target_group`
            #       * `psc_propagation_status.code`
            #     If `group_by` is set, the value of the `order_by` field must be the
            #     same as or a subset of the `group_by` field.
            #   @param group_by [::String]
            #     Optional. Aggregate the results by the specified fields.
            #     A comma-separated list of any of these fields:
            #       * `psc_propagation_status.source_spoke`
            #       * `psc_propagation_status.source_group`
            #       * `psc_propagation_status.source_forwarding_rule`
            #       * `psc_propagation_status.target_spoke`
            #       * `psc_propagation_status.target_group`
            #       * `psc_propagation_status.code`
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::HubStatusEntry>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::HubStatusEntry>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::QueryHubStatusRequest.new
            #
            #   # Call the query_hub_status method.
            #   result = client.query_hub_status request
            #
            #   # The returned object is of type Gapic::PagedEnumerable. You can iterate
            #   # over elements, and API calls will be issued to fetch pages as needed.
            #   result.each do |item|
            #     # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::HubStatusEntry.
            #     p item
            #   end
            #
            def query_hub_status request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::QueryHubStatusRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.query_hub_status.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.name
                header_params["name"] = request.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.query_hub_status.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.query_hub_status.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :query_hub_status, request, options: options do |response, operation|
                response = ::Gapic::PagedEnumerable.new @hub_service_stub, :query_hub_status, request, response, operation, options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Lists the Network Connectivity Center spokes in a specified project and
            # location.
            #
            # @overload list_spokes(request, options = nil)
            #   Pass arguments to `list_spokes` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::ListSpokesRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::ListSpokesRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload list_spokes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
            #   Pass arguments to `list_spokes` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource.
            #   @param page_size [::Integer]
            #     The maximum number of results to return per page.
            #   @param page_token [::String]
            #     The page token.
            #   @param filter [::String]
            #     An expression that filters the list of results.
            #   @param order_by [::String]
            #     Sort the results by a certain order.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Spoke>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Spoke>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::ListSpokesRequest.new
            #
            #   # Call the list_spokes method.
            #   result = client.list_spokes request
            #
            #   # The returned object is of type Gapic::PagedEnumerable. You can iterate
            #   # over elements, and API calls will be issued to fetch pages as needed.
            #   result.each do |item|
            #     # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::Spoke.
            #     p item
            #   end
            #
            def list_spokes request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListSpokesRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.list_spokes.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.parent
                header_params["parent"] = request.parent
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.list_spokes.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_spokes.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :list_spokes, request, options: options do |response, operation|
                response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_spokes, request, response, operation, options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Gets details about a Network Connectivity Center spoke.
            #
            # @overload get_spoke(request, options = nil)
            #   Pass arguments to `get_spoke` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::GetSpokeRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::GetSpokeRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload get_spoke(name: nil)
            #   Pass arguments to `get_spoke` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the spoke resource.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1::Spoke]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::NetworkConnectivity::V1::Spoke]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::GetSpokeRequest.new
            #
            #   # Call the get_spoke method.
            #   result = client.get_spoke request
            #
            #   # The returned object is of type Google::Cloud::NetworkConnectivity::V1::Spoke.
            #   p result
            #
            def get_spoke request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetSpokeRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.get_spoke.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.name
                header_params["name"] = request.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.get_spoke.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_spoke.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :get_spoke, request, options: options do |response, operation|
                yield response, operation if block_given?
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Creates a Network Connectivity Center spoke.
            #
            # @overload create_spoke(request, options = nil)
            #   Pass arguments to `create_spoke` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::CreateSpokeRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::CreateSpokeRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload create_spoke(parent: nil, spoke_id: nil, spoke: nil, request_id: nil)
            #   Pass arguments to `create_spoke` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource.
            #   @param spoke_id [::String]
            #     Required. Unique id for the spoke to create.
            #   @param spoke [::Google::Cloud::NetworkConnectivity::V1::Spoke, ::Hash]
            #     Required. The initial values for a new spoke.
            #   @param request_id [::String]
            #     Optional. A request ID to identify requests. Specify a unique request ID so
            #     that if you must retry your request, the server knows to ignore the request
            #     if it has already been completed. The server guarantees that a request
            #     doesn't result in creation of duplicate commitments for at least 60
            #     minutes.
            #
            #     For example, consider a situation where you make an initial request and
            #     the request times out. If you make the request again with the same request
            #     ID, the server can check to see whether the original operation
            #     was received. If it was, the server ignores the second request. This
            #     behavior prevents clients from mistakenly creating duplicate commitments.
            #
            #     The request ID must be a valid UUID, with the exception that zero UUID is
            #     not supported (00000000-0000-0000-0000-000000000000).
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::Operation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::Operation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::CreateSpokeRequest.new
            #
            #   # Call the create_spoke method.
            #   result = client.create_spoke request
            #
            #   # The returned object is of type Gapic::Operation. You can use it to
            #   # check the status of an operation, cancel it, or wait for results.
            #   # Here is how to wait for a response.
            #   result.wait_until_done! timeout: 60
            #   if result.response?
            #     p result.response
            #   else
            #     puts "No response received."
            #   end
            #
            def create_spoke request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::CreateSpokeRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.create_spoke.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.parent
                header_params["parent"] = request.parent
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.create_spoke.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.create_spoke.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :create_spoke, request, options: options do |response, operation|
                response = ::Gapic::Operation.new response, @operations_client, options: options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Updates the parameters of a Network Connectivity Center spoke.
            #
            # @overload update_spoke(request, options = nil)
            #   Pass arguments to `update_spoke` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::UpdateSpokeRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::UpdateSpokeRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload update_spoke(update_mask: nil, spoke: nil, request_id: nil)
            #   Pass arguments to `update_spoke` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     Optional. In the case of an update to an existing spoke, field mask is used
            #     to specify the fields to be overwritten. The fields specified in the
            #     update_mask are relative to the resource, not the full request. A field is
            #     overwritten if it is in the mask. If the user does not provide a mask, then
            #     all fields are overwritten.
            #   @param spoke [::Google::Cloud::NetworkConnectivity::V1::Spoke, ::Hash]
            #     Required. The state that the spoke should be in after the update.
            #   @param request_id [::String]
            #     Optional. A request ID to identify requests. Specify a unique request ID so
            #     that if you must retry your request, the server knows to ignore the request
            #     if it has already been completed. The server guarantees that a request
            #     doesn't result in creation of duplicate commitments for at least 60
            #     minutes.
            #
            #     For example, consider a situation where you make an initial request and
            #     the request times out. If you make the request again with the same request
            #     ID, the server can check to see whether the original operation
            #     was received. If it was, the server ignores the second request. This
            #     behavior prevents clients from mistakenly creating duplicate commitments.
            #
            #     The request ID must be a valid UUID, with the exception that zero UUID is
            #     not supported (00000000-0000-0000-0000-000000000000).
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::Operation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::Operation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::UpdateSpokeRequest.new
            #
            #   # Call the update_spoke method.
            #   result = client.update_spoke request
            #
            #   # The returned object is of type Gapic::Operation. You can use it to
            #   # check the status of an operation, cancel it, or wait for results.
            #   # Here is how to wait for a response.
            #   result.wait_until_done! timeout: 60
            #   if result.response?
            #     p result.response
            #   else
            #     puts "No response received."
            #   end
            #
            def update_spoke request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::UpdateSpokeRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.update_spoke.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.spoke&.name
                header_params["spoke.name"] = request.spoke.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.update_spoke.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.update_spoke.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :update_spoke, request, options: options do |response, operation|
                response = ::Gapic::Operation.new response, @operations_client, options: options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Rejects a Network Connectivity Center spoke from being attached to a hub.
            # If the spoke was previously in the `ACTIVE` state, it
            # transitions to the `INACTIVE` state and is no longer able to
            # connect to other spokes that are attached to the hub.
            #
            # @overload reject_hub_spoke(request, options = nil)
            #   Pass arguments to `reject_hub_spoke` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::RejectHubSpokeRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::RejectHubSpokeRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload reject_hub_spoke(name: nil, spoke_uri: nil, request_id: nil, details: nil)
            #   Pass arguments to `reject_hub_spoke` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the hub from which to reject the spoke.
            #   @param spoke_uri [::String]
            #     Required. The URI of the spoke to reject from the hub.
            #   @param request_id [::String]
            #     Optional. A request ID to identify requests. Specify a unique request ID so
            #     that if you must retry your request, the server knows to ignore the request
            #     if it has already been completed. The server guarantees that a request
            #     doesn't result in creation of duplicate commitments for at least 60
            #     minutes.
            #
            #     For example, consider a situation where you make an initial request and
            #     the request times out. If you make the request again with the same request
            #     ID, the server can check to see whether the original operation
            #     was received. If it was, the server ignores the second request. This
            #     behavior prevents clients from mistakenly creating duplicate commitments.
            #
            #     The request ID must be a valid UUID, with the exception that zero UUID is
            #     not supported (00000000-0000-0000-0000-000000000000).
            #   @param details [::String]
            #     Optional. Additional information provided by the hub administrator.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::Operation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::Operation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::RejectHubSpokeRequest.new
            #
            #   # Call the reject_hub_spoke method.
            #   result = client.reject_hub_spoke request
            #
            #   # The returned object is of type Gapic::Operation. You can use it to
            #   # check the status of an operation, cancel it, or wait for results.
            #   # Here is how to wait for a response.
            #   result.wait_until_done! timeout: 60
            #   if result.response?
            #     p result.response
            #   else
            #     puts "No response received."
            #   end
            #
            def reject_hub_spoke request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::RejectHubSpokeRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.reject_hub_spoke.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.name
                header_params["name"] = request.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.reject_hub_spoke.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.reject_hub_spoke.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :reject_hub_spoke, request, options: options do |response, operation|
                response = ::Gapic::Operation.new response, @operations_client, options: options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Accepts a proposal to attach a Network Connectivity Center spoke
            # to a hub.
            #
            # @overload accept_hub_spoke(request, options = nil)
            #   Pass arguments to `accept_hub_spoke` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::AcceptHubSpokeRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::AcceptHubSpokeRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload accept_hub_spoke(name: nil, spoke_uri: nil, request_id: nil)
            #   Pass arguments to `accept_hub_spoke` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the hub into which to accept the spoke.
            #   @param spoke_uri [::String]
            #     Required. The URI of the spoke to accept into the hub.
            #   @param request_id [::String]
            #     Optional. A request ID to identify requests. Specify a unique request ID so
            #     that if you must retry your request, the server knows to ignore the request
            #     if it has already been completed. The server guarantees that a request
            #     doesn't result in creation of duplicate commitments for at least 60
            #     minutes.
            #
            #     For example, consider a situation where you make an initial request and
            #     the request times out. If you make the request again with the same request
            #     ID, the server can check to see whether the original operation
            #     was received. If it was, the server ignores the second request. This
            #     behavior prevents clients from mistakenly creating duplicate commitments.
            #
            #     The request ID must be a valid UUID, with the exception that zero UUID is
            #     not supported (00000000-0000-0000-0000-000000000000).
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::Operation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::Operation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::AcceptHubSpokeRequest.new
            #
            #   # Call the accept_hub_spoke method.
            #   result = client.accept_hub_spoke request
            #
            #   # The returned object is of type Gapic::Operation. You can use it to
            #   # check the status of an operation, cancel it, or wait for results.
            #   # Here is how to wait for a response.
            #   result.wait_until_done! timeout: 60
            #   if result.response?
            #     p result.response
            #   else
            #     puts "No response received."
            #   end
            #
            def accept_hub_spoke request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::AcceptHubSpokeRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.accept_hub_spoke.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.name
                header_params["name"] = request.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.accept_hub_spoke.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.accept_hub_spoke.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :accept_hub_spoke, request, options: options do |response, operation|
                response = ::Gapic::Operation.new response, @operations_client, options: options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Accepts a proposal to update a Network Connectivity Center spoke in a hub.
            #
            # @overload accept_spoke_update(request, options = nil)
            #   Pass arguments to `accept_spoke_update` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::AcceptSpokeUpdateRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::AcceptSpokeUpdateRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload accept_spoke_update(name: nil, spoke_uri: nil, spoke_etag: nil, request_id: nil)
            #   Pass arguments to `accept_spoke_update` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the hub to accept spoke update.
            #   @param spoke_uri [::String]
            #     Required. The URI of the spoke to accept update.
            #   @param spoke_etag [::String]
            #     Required. The etag of the spoke to accept update.
            #   @param request_id [::String]
            #     Optional. A request ID to identify requests. Specify a unique request ID so
            #     that if you must retry your request, the server knows to ignore the request
            #     if it has already been completed. The server guarantees that a request
            #     doesn't result in creation of duplicate commitments for at least 60
            #     minutes.
            #
            #     For example, consider a situation where you make an initial request and
            #     the request times out. If you make the request again with the same request
            #     ID, the server can check to see whether the original operation
            #     was received. If it was, the server ignores the second request. This
            #     behavior prevents clients from mistakenly creating duplicate commitments.
            #
            #     The request ID must be a valid UUID, with the exception that zero UUID is
            #     not supported (00000000-0000-0000-0000-000000000000).
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::Operation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::Operation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::AcceptSpokeUpdateRequest.new
            #
            #   # Call the accept_spoke_update method.
            #   result = client.accept_spoke_update request
            #
            #   # The returned object is of type Gapic::Operation. You can use it to
            #   # check the status of an operation, cancel it, or wait for results.
            #   # Here is how to wait for a response.
            #   result.wait_until_done! timeout: 60
            #   if result.response?
            #     p result.response
            #   else
            #     puts "No response received."
            #   end
            #
            def accept_spoke_update request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::AcceptSpokeUpdateRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.accept_spoke_update.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.name
                header_params["name"] = request.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.accept_spoke_update.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.accept_spoke_update.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :accept_spoke_update, request, options: options do |response, operation|
                response = ::Gapic::Operation.new response, @operations_client, options: options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Rejects a proposal to update a Network Connectivity Center spoke in a hub.
            #
            # @overload reject_spoke_update(request, options = nil)
            #   Pass arguments to `reject_spoke_update` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::RejectSpokeUpdateRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::RejectSpokeUpdateRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload reject_spoke_update(name: nil, spoke_uri: nil, spoke_etag: nil, details: nil, request_id: nil)
            #   Pass arguments to `reject_spoke_update` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the hub to reject spoke update.
            #   @param spoke_uri [::String]
            #     Required. The URI of the spoke to reject update.
            #   @param spoke_etag [::String]
            #     Required. The etag of the spoke to reject update.
            #   @param details [::String]
            #     Optional. Additional information provided by the hub administrator.
            #   @param request_id [::String]
            #     Optional. A request ID to identify requests. Specify a unique request ID so
            #     that if you must retry your request, the server knows to ignore the request
            #     if it has already been completed. The server guarantees that a request
            #     doesn't result in creation of duplicate commitments for at least 60
            #     minutes.
            #
            #     For example, consider a situation where you make an initial request and
            #     the request times out. If you make the request again with the same request
            #     ID, the server can check to see whether the original operation
            #     was received. If it was, the server ignores the second request. This
            #     behavior prevents clients from mistakenly creating duplicate commitments.
            #
            #     The request ID must be a valid UUID, with the exception that zero UUID is
            #     not supported (00000000-0000-0000-0000-000000000000).
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::Operation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::Operation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::RejectSpokeUpdateRequest.new
            #
            #   # Call the reject_spoke_update method.
            #   result = client.reject_spoke_update request
            #
            #   # The returned object is of type Gapic::Operation. You can use it to
            #   # check the status of an operation, cancel it, or wait for results.
            #   # Here is how to wait for a response.
            #   result.wait_until_done! timeout: 60
            #   if result.response?
            #     p result.response
            #   else
            #     puts "No response received."
            #   end
            #
            def reject_spoke_update request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::RejectSpokeUpdateRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.reject_spoke_update.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.name
                header_params["name"] = request.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.reject_spoke_update.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.reject_spoke_update.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :reject_spoke_update, request, options: options do |response, operation|
                response = ::Gapic::Operation.new response, @operations_client, options: options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Deletes a Network Connectivity Center spoke.
            #
            # @overload delete_spoke(request, options = nil)
            #   Pass arguments to `delete_spoke` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::DeleteSpokeRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::DeleteSpokeRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload delete_spoke(name: nil, request_id: nil)
            #   Pass arguments to `delete_spoke` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the spoke to delete.
            #   @param request_id [::String]
            #     Optional. A request ID to identify requests. Specify a unique request ID so
            #     that if you must retry your request, the server knows to ignore the request
            #     if it has already been completed. The server guarantees that a request
            #     doesn't result in creation of duplicate commitments for at least 60
            #     minutes.
            #
            #     For example, consider a situation where you make an initial request and
            #     the request times out. If you make the request again with the same request
            #     ID, the server can check to see whether the original operation
            #     was received. If it was, the server ignores the second request. This
            #     behavior prevents clients from mistakenly creating duplicate commitments.
            #
            #     The request ID must be a valid UUID, with the exception that zero UUID is
            #     not supported (00000000-0000-0000-0000-000000000000).
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::Operation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::Operation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::DeleteSpokeRequest.new
            #
            #   # Call the delete_spoke method.
            #   result = client.delete_spoke request
            #
            #   # The returned object is of type Gapic::Operation. You can use it to
            #   # check the status of an operation, cancel it, or wait for results.
            #   # Here is how to wait for a response.
            #   result.wait_until_done! timeout: 60
            #   if result.response?
            #     p result.response
            #   else
            #     puts "No response received."
            #   end
            #
            def delete_spoke request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::DeleteSpokeRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.delete_spoke.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.name
                header_params["name"] = request.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.delete_spoke.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.delete_spoke.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :delete_spoke, request, options: options do |response, operation|
                response = ::Gapic::Operation.new response, @operations_client, options: options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Gets details about a Network Connectivity Center route table.
            #
            # @overload get_route_table(request, options = nil)
            #   Pass arguments to `get_route_table` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::GetRouteTableRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::GetRouteTableRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload get_route_table(name: nil)
            #   Pass arguments to `get_route_table` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the route table resource.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1::RouteTable]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::NetworkConnectivity::V1::RouteTable]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::GetRouteTableRequest.new
            #
            #   # Call the get_route_table method.
            #   result = client.get_route_table request
            #
            #   # The returned object is of type Google::Cloud::NetworkConnectivity::V1::RouteTable.
            #   p result
            #
            def get_route_table request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetRouteTableRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.get_route_table.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.name
                header_params["name"] = request.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.get_route_table.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_route_table.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :get_route_table, request, options: options do |response, operation|
                yield response, operation if block_given?
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Gets details about the specified route.
            #
            # @overload get_route(request, options = nil)
            #   Pass arguments to `get_route` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::GetRouteRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::GetRouteRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload get_route(name: nil)
            #   Pass arguments to `get_route` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the route resource.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1::Route]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::NetworkConnectivity::V1::Route]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::GetRouteRequest.new
            #
            #   # Call the get_route method.
            #   result = client.get_route request
            #
            #   # The returned object is of type Google::Cloud::NetworkConnectivity::V1::Route.
            #   p result
            #
            def get_route request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetRouteRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.get_route.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.name
                header_params["name"] = request.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.get_route.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_route.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :get_route, request, options: options do |response, operation|
                yield response, operation if block_given?
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Lists routes in a given route table.
            #
            # @overload list_routes(request, options = nil)
            #   Pass arguments to `list_routes` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::ListRoutesRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::ListRoutesRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload list_routes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
            #   Pass arguments to `list_routes` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource's name.
            #   @param page_size [::Integer]
            #     The maximum number of results to return per page.
            #   @param page_token [::String]
            #     The page token.
            #   @param filter [::String]
            #     An expression that filters the list of results.
            #   @param order_by [::String]
            #     Sort the results by a certain order.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Route>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Route>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::ListRoutesRequest.new
            #
            #   # Call the list_routes method.
            #   result = client.list_routes request
            #
            #   # The returned object is of type Gapic::PagedEnumerable. You can iterate
            #   # over elements, and API calls will be issued to fetch pages as needed.
            #   result.each do |item|
            #     # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::Route.
            #     p item
            #   end
            #
            def list_routes request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListRoutesRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.list_routes.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.parent
                header_params["parent"] = request.parent
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.list_routes.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_routes.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :list_routes, request, options: options do |response, operation|
                response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_routes, request, response, operation, options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Lists route tables in a given hub.
            #
            # @overload list_route_tables(request, options = nil)
            #   Pass arguments to `list_route_tables` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::ListRouteTablesRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::ListRouteTablesRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload list_route_tables(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
            #   Pass arguments to `list_route_tables` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource's name.
            #   @param page_size [::Integer]
            #     The maximum number of results to return per page.
            #   @param page_token [::String]
            #     The page token.
            #   @param filter [::String]
            #     An expression that filters the list of results.
            #   @param order_by [::String]
            #     Sort the results by a certain order.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::RouteTable>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::RouteTable>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::ListRouteTablesRequest.new
            #
            #   # Call the list_route_tables method.
            #   result = client.list_route_tables request
            #
            #   # The returned object is of type Gapic::PagedEnumerable. You can iterate
            #   # over elements, and API calls will be issued to fetch pages as needed.
            #   result.each do |item|
            #     # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::RouteTable.
            #     p item
            #   end
            #
            def list_route_tables request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListRouteTablesRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.list_route_tables.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.parent
                header_params["parent"] = request.parent
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.list_route_tables.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_route_tables.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :list_route_tables, request, options: options do |response, operation|
                response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_route_tables, request, response, operation, options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Gets details about a Network Connectivity Center group.
            #
            # @overload get_group(request, options = nil)
            #   Pass arguments to `get_group` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::GetGroupRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::GetGroupRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload get_group(name: nil)
            #   Pass arguments to `get_group` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the route table resource.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1::Group]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::NetworkConnectivity::V1::Group]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::GetGroupRequest.new
            #
            #   # Call the get_group method.
            #   result = client.get_group request
            #
            #   # The returned object is of type Google::Cloud::NetworkConnectivity::V1::Group.
            #   p result
            #
            def get_group request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetGroupRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.get_group.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.name
                header_params["name"] = request.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.get_group.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_group.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :get_group, request, options: options do |response, operation|
                yield response, operation if block_given?
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Lists groups in a given hub.
            #
            # @overload list_groups(request, options = nil)
            #   Pass arguments to `list_groups` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::ListGroupsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::ListGroupsRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload list_groups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
            #   Pass arguments to `list_groups` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource's name.
            #   @param page_size [::Integer]
            #     The maximum number of results to return per page.
            #   @param page_token [::String]
            #     The page token.
            #   @param filter [::String]
            #     An expression that filters the list of results.
            #   @param order_by [::String]
            #     Sort the results by a certain order.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Group>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Group>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::ListGroupsRequest.new
            #
            #   # Call the list_groups method.
            #   result = client.list_groups request
            #
            #   # The returned object is of type Gapic::PagedEnumerable. You can iterate
            #   # over elements, and API calls will be issued to fetch pages as needed.
            #   result.each do |item|
            #     # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::Group.
            #     p item
            #   end
            #
            def list_groups request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListGroupsRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.list_groups.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.parent
                header_params["parent"] = request.parent
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.list_groups.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_groups.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :list_groups, request, options: options do |response, operation|
                response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_groups, request, response, operation, options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Updates the parameters of a Network Connectivity Center group.
            #
            # @overload update_group(request, options = nil)
            #   Pass arguments to `update_group` via a request object, either of type
            #   {::Google::Cloud::NetworkConnectivity::V1::UpdateGroupRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::NetworkConnectivity::V1::UpdateGroupRequest, ::Hash]
            #     A request object representing the call parameters. Required. To specify no
            #     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.
            #
            # @overload update_group(update_mask: nil, group: nil, request_id: nil)
            #   Pass arguments to `update_group` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     Optional. In the case of an update to an existing group, field mask is used
            #     to specify the fields to be overwritten. The fields specified in the
            #     update_mask are relative to the resource, not the full request. A field is
            #     overwritten if it is in the mask. If the user does not provide a mask, then
            #     all fields are overwritten.
            #   @param group [::Google::Cloud::NetworkConnectivity::V1::Group, ::Hash]
            #     Required. The state that the group should be in after the update.
            #   @param request_id [::String]
            #     Optional. A request ID to identify requests. Specify a unique request ID so
            #     that if you must retry your request, the server knows to ignore the request
            #     if it has already been completed. The server guarantees that a request
            #     doesn't result in creation of duplicate commitments for at least 60
            #     minutes.
            #
            #     For example, consider a situation where you make an initial request and
            #     the request times out. If you make the request again with the same request
            #     ID, the server can check to see whether the original operation
            #     was received. If it was, the server ignores the second request. This
            #     behavior prevents clients from mistakenly creating duplicate commitments.
            #
            #     The request ID must be a valid UUID, with the exception that zero UUID is
            #     not supported (00000000-0000-0000-0000-000000000000).
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::Operation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::Operation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/network_connectivity/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::NetworkConnectivity::V1::UpdateGroupRequest.new
            #
            #   # Call the update_group method.
            #   result = client.update_group request
            #
            #   # The returned object is of type Gapic::Operation. You can use it to
            #   # check the status of an operation, cancel it, or wait for results.
            #   # Here is how to wait for a response.
            #   result.wait_until_done! timeout: 60
            #   if result.response?
            #     p result.response
            #   else
            #     puts "No response received."
            #   end
            #
            def update_group request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::UpdateGroupRequest

              # Converts hash and nil to an options object
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

              # Customize the options with defaults
              metadata = @config.rpcs.update_group.metadata.to_h

              # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
              metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {}
              if request.group&.name
                header_params["group.name"] = request.group.name
              end

              request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
              metadata[:"x-goog-request-params"] ||= request_params_header

              options.apply_defaults timeout:      @config.rpcs.update_group.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.update_group.retry_policy

              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy

              @hub_service_stub.call_rpc :update_group, request, options: options do |response, operation|
                response = ::Gapic::Operation.new response, @operations_client, options: options
                yield response, operation if block_given?
                throw :response, response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end

            ##
            # Configuration class for the HubService API.
            #
            # This class represents the configuration for HubService,
            # 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::NetworkConnectivity::V1::HubService::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.
            #
            # @example
            #
            #   # Modify the global config, setting the timeout for
            #   # list_hubs to 20 seconds,
            #   # and all remaining timeouts to 10 seconds.
            #   ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.configure do |config|
            #     config.timeout = 10.0
            #     config.rpcs.list_hubs.timeout = 20.0
            #   end
            #
            #   # Apply the above configuration only to a new client.
            #   client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config|
            #     config.timeout = 10.0
            #     config.rpcs.list_hubs.timeout = 20.0
            #   end
            #
            # @!attribute [rw] endpoint
            #   A custom service endpoint, as a hostname or hostname:port. The default is
            #   nil, indicating to use the default endpoint in the current universe domain.
            #   @return [::String,nil]
            # @!attribute [rw] credentials
            #   Credentials to send with calls. You may provide any of the following types:
            #    *  (`String`) The path to a service account key file in JSON format
            #    *  (`Hash`) A service account key as a Hash
            #    *  (`Google::Auth::Credentials`) A googleauth credentials object
            #       (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
            #    *  (`Signet::OAuth2::Client`) A signet oauth2 client object
            #       (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
            #    *  (`GRPC::Core::Channel`) a gRPC channel with included credentials
            #    *  (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
            #    *  (`nil`) indicating no credentials
            #
            #   Warning: If you accept a credential configuration (JSON file or Hash) from an
            #   external source for authentication to Google Cloud, you must validate it before
            #   providing it to a Google API client library. Providing an unvalidated credential
            #   configuration to Google APIs can compromise the security of your systems and data.
            #   For more information, refer to [Validate credential configurations from external
            #   sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
            #   @return [::Object]
            # @!attribute [rw] scope
            #   The OAuth scopes
            #   @return [::Array<::String>]
            # @!attribute [rw] lib_name
            #   The library name as recorded in instrumentation and logging
            #   @return [::String]
            # @!attribute [rw] lib_version
            #   The library version as recorded in instrumentation and logging
            #   @return [::String]
            # @!attribute [rw] channel_args
            #   Extra parameters passed to the gRPC channel. Note: this is ignored if a
            #   `GRPC::Core::Channel` object is provided as the credential.
            #   @return [::Hash]
            # @!attribute [rw] interceptors
            #   An array of interceptors that are run before calls are executed.
            #   @return [::Array<::GRPC::ClientInterceptor>]
            # @!attribute [rw] timeout
            #   The call timeout in seconds.
            #   @return [::Numeric]
            # @!attribute [rw] metadata
            #   Additional gRPC 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<String>`) - The error codes that should
            #       trigger a retry.
            #   @return [::Hash]
            # @!attribute [rw] quota_project
            #   A separate project against which to charge quota.
            #   @return [::String]
            # @!attribute [rw] universe_domain
            #   The universe domain within which to make requests. This determines the
            #   default endpoint URL. The default value of nil uses the environment
            #   universe (usually the default "googleapis.com" universe).
            #   @return [::String,nil]
            # @!attribute [rw] logger
            #   A custom logger to use for request/response debug logging, or the value
            #   `:default` (the default) to construct a default logger, or `nil` to
            #   explicitly disable logging.
            #   @return [::Logger,:default,nil]
            #
            class Configuration
              extend ::Gapic::Config

              # @private
              # The endpoint specific to the default "googleapis.com" universe. Deprecated.
              DEFAULT_ENDPOINT = "networkconnectivity.googleapis.com"

              config_attr :endpoint,      nil, ::String, nil
              config_attr :credentials,   nil do |value|
                allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
                allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
                allowed.any? { |klass| klass === value }
              end
              config_attr :scope,         nil, ::String, ::Array, nil
              config_attr :lib_name,      nil, ::String, nil
              config_attr :lib_version,   nil, ::String, nil
              config_attr(:channel_args,  { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
              config_attr :interceptors,  nil, ::Array, 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
              config_attr :universe_domain, nil, ::String, nil
              config_attr :logger, :default, ::Logger, nil, :default

              # @private
              def initialize parent_config = nil
                @parent_config = parent_config unless parent_config.nil?

                yield self if block_given?
              end

              ##
              # Configurations for individual RPCs
              # @return [Rpcs]
              #
              def rpcs
                @rpcs ||= begin
                  parent_rpcs = nil
                  parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
                  Rpcs.new parent_rpcs
                end
              end

              ##
              # Configuration for the channel pool
              # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
              #
              def channel_pool
                @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
              end

              ##
              # Configuration RPC class for the HubService API.
              #
              # Includes fields providing the configuration for each RPC in this service.
              # Each configuration object is of type `Gapic::Config::Method` and includes
              # the following configuration fields:
              #
              #  *  `timeout` (*type:* `Numeric`) - The call timeout in seconds
              #  *  `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC 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<String>`) - The error codes that should
              #         trigger a retry.
              #
              class Rpcs
                ##
                # RPC-specific configuration for `list_hubs`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_hubs
                ##
                # RPC-specific configuration for `get_hub`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_hub
                ##
                # RPC-specific configuration for `create_hub`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_hub
                ##
                # RPC-specific configuration for `update_hub`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_hub
                ##
                # RPC-specific configuration for `delete_hub`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_hub
                ##
                # RPC-specific configuration for `list_hub_spokes`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_hub_spokes
                ##
                # RPC-specific configuration for `query_hub_status`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :query_hub_status
                ##
                # RPC-specific configuration for `list_spokes`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_spokes
                ##
                # RPC-specific configuration for `get_spoke`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_spoke
                ##
                # RPC-specific configuration for `create_spoke`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_spoke
                ##
                # RPC-specific configuration for `update_spoke`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_spoke
                ##
                # RPC-specific configuration for `reject_hub_spoke`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :reject_hub_spoke
                ##
                # RPC-specific configuration for `accept_hub_spoke`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :accept_hub_spoke
                ##
                # RPC-specific configuration for `accept_spoke_update`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :accept_spoke_update
                ##
                # RPC-specific configuration for `reject_spoke_update`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :reject_spoke_update
                ##
                # RPC-specific configuration for `delete_spoke`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_spoke
                ##
                # RPC-specific configuration for `get_route_table`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_route_table
                ##
                # RPC-specific configuration for `get_route`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_route
                ##
                # RPC-specific configuration for `list_routes`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_routes
                ##
                # RPC-specific configuration for `list_route_tables`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_route_tables
                ##
                # RPC-specific configuration for `get_group`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_group
                ##
                # RPC-specific configuration for `list_groups`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_groups
                ##
                # RPC-specific configuration for `update_group`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_group

                # @private
                def initialize parent_rpcs = nil
                  list_hubs_config = parent_rpcs.list_hubs if parent_rpcs.respond_to? :list_hubs
                  @list_hubs = ::Gapic::Config::Method.new list_hubs_config
                  get_hub_config = parent_rpcs.get_hub if parent_rpcs.respond_to? :get_hub
                  @get_hub = ::Gapic::Config::Method.new get_hub_config
                  create_hub_config = parent_rpcs.create_hub if parent_rpcs.respond_to? :create_hub
                  @create_hub = ::Gapic::Config::Method.new create_hub_config
                  update_hub_config = parent_rpcs.update_hub if parent_rpcs.respond_to? :update_hub
                  @update_hub = ::Gapic::Config::Method.new update_hub_config
                  delete_hub_config = parent_rpcs.delete_hub if parent_rpcs.respond_to? :delete_hub
                  @delete_hub = ::Gapic::Config::Method.new delete_hub_config
                  list_hub_spokes_config = parent_rpcs.list_hub_spokes if parent_rpcs.respond_to? :list_hub_spokes
                  @list_hub_spokes = ::Gapic::Config::Method.new list_hub_spokes_config
                  query_hub_status_config = parent_rpcs.query_hub_status if parent_rpcs.respond_to? :query_hub_status
                  @query_hub_status = ::Gapic::Config::Method.new query_hub_status_config
                  list_spokes_config = parent_rpcs.list_spokes if parent_rpcs.respond_to? :list_spokes
                  @list_spokes = ::Gapic::Config::Method.new list_spokes_config
                  get_spoke_config = parent_rpcs.get_spoke if parent_rpcs.respond_to? :get_spoke
                  @get_spoke = ::Gapic::Config::Method.new get_spoke_config
                  create_spoke_config = parent_rpcs.create_spoke if parent_rpcs.respond_to? :create_spoke
                  @create_spoke = ::Gapic::Config::Method.new create_spoke_config
                  update_spoke_config = parent_rpcs.update_spoke if parent_rpcs.respond_to? :update_spoke
                  @update_spoke = ::Gapic::Config::Method.new update_spoke_config
                  reject_hub_spoke_config = parent_rpcs.reject_hub_spoke if parent_rpcs.respond_to? :reject_hub_spoke
                  @reject_hub_spoke = ::Gapic::Config::Method.new reject_hub_spoke_config
                  accept_hub_spoke_config = parent_rpcs.accept_hub_spoke if parent_rpcs.respond_to? :accept_hub_spoke
                  @accept_hub_spoke = ::Gapic::Config::Method.new accept_hub_spoke_config
                  accept_spoke_update_config = parent_rpcs.accept_spoke_update if parent_rpcs.respond_to? :accept_spoke_update
                  @accept_spoke_update = ::Gapic::Config::Method.new accept_spoke_update_config
                  reject_spoke_update_config = parent_rpcs.reject_spoke_update if parent_rpcs.respond_to? :reject_spoke_update
                  @reject_spoke_update = ::Gapic::Config::Method.new reject_spoke_update_config
                  delete_spoke_config = parent_rpcs.delete_spoke if parent_rpcs.respond_to? :delete_spoke
                  @delete_spoke = ::Gapic::Config::Method.new delete_spoke_config
                  get_route_table_config = parent_rpcs.get_route_table if parent_rpcs.respond_to? :get_route_table
                  @get_route_table = ::Gapic::Config::Method.new get_route_table_config
                  get_route_config = parent_rpcs.get_route if parent_rpcs.respond_to? :get_route
                  @get_route = ::Gapic::Config::Method.new get_route_config
                  list_routes_config = parent_rpcs.list_routes if parent_rpcs.respond_to? :list_routes
                  @list_routes = ::Gapic::Config::Method.new list_routes_config
                  list_route_tables_config = parent_rpcs.list_route_tables if parent_rpcs.respond_to? :list_route_tables
                  @list_route_tables = ::Gapic::Config::Method.new list_route_tables_config
                  get_group_config = parent_rpcs.get_group if parent_rpcs.respond_to? :get_group
                  @get_group = ::Gapic::Config::Method.new get_group_config
                  list_groups_config = parent_rpcs.list_groups if parent_rpcs.respond_to? :list_groups
                  @list_groups = ::Gapic::Config::Method.new list_groups_config
                  update_group_config = parent_rpcs.update_group if parent_rpcs.respond_to? :update_group
                  @update_group = ::Gapic::Config::Method.new update_group_config

                  yield self if block_given?
                end
              end
            end
          end
        end
      end
    end
  end
end
