# 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/pubsublite/v1/admin_pb"

module Google
  module Cloud
    module PubSubLite
      module V1
        module AdminService
          ##
          # Client for the AdminService service.
          #
          # The service that a client application uses to manage topics and
          # subscriptions, such creating, listing, and deleting topics and subscriptions.
          #
          class Client
            include Paths

            # @private
            attr_reader :admin_service_stub

            ##
            # Configure the AdminService Client class.
            #
            # See {::Google::Cloud::PubSubLite::V1::AdminService::Client::Configuration}
            # for a description of the configuration fields.
            #
            # @example
            #
            #   # Modify the configuration for all AdminService clients
            #   ::Google::Cloud::PubSubLite::V1::AdminService::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", "PubSubLite", "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 = 600.0
                default_config.retry_policy = {
                  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14, 10, 13, 2]
                }

                default_config
              end
              yield @configure if block_given?
              @configure
            end

            ##
            # Configure the AdminService 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::PubSubLite::V1::AdminService::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

            ##
            # Create a new AdminService client object.
            #
            # @example
            #
            #   # Create a client using the default configuration
            #   client = ::Google::Cloud::PubSubLite::V1::AdminService::Client.new
            #
            #   # Create a client using a custom configuration
            #   client = ::Google::Cloud::PubSubLite::V1::AdminService::Client.new do |config|
            #     config.timeout = 10.0
            #   end
            #
            # @yield [config] Configure the AdminService 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/pubsublite/v1/admin_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 == Client.configure.endpoint &&
                                       !@config.endpoint.split(".").first.include?("-")
              credentials ||= Credentials.default scope: @config.scope,
                                                  enable_self_signed_jwt: enable_self_signed_jwt
              if credentials.is_a?(::String) || credentials.is_a?(::Hash)
                credentials = Credentials.new credentials, scope: @config.scope
              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.endpoint = @config.endpoint
              end

              @admin_service_stub = ::Gapic::ServiceStub.new(
                ::Google::Cloud::PubSubLite::V1::AdminService::Stub,
                credentials:  credentials,
                endpoint:     @config.endpoint,
                channel_args: @config.channel_args,
                interceptors: @config.interceptors
              )
            end

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

            # Service calls

            ##
            # Creates a new topic.
            #
            # @overload create_topic(request, options = nil)
            #   Pass arguments to `create_topic` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::CreateTopicRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::CreateTopicRequest, ::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_topic(parent: nil, topic: nil, topic_id: nil)
            #   Pass arguments to `create_topic` 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 location in which to create the topic.
            #     Structured like `projects/{project_number}/locations/{location}`.
            #   @param topic [::Google::Cloud::PubSubLite::V1::Topic, ::Hash]
            #     Required. Configuration of the topic to create. Its `name` field is ignored.
            #   @param topic_id [::String]
            #     Required. The ID to use for the topic, which will become the final component of
            #     the topic's name.
            #
            #     This value is structured like: `my-topic-name`.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::PubSubLite::V1::Topic]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::PubSubLite::V1::Topic]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def create_topic request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::CreateTopicRequest

              # 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_topic.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "parent" => request.parent
              }
              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_topic.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.create_topic.retry_policy

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

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

            ##
            # Returns the topic configuration.
            #
            # @overload get_topic(request, options = nil)
            #   Pass arguments to `get_topic` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::GetTopicRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::GetTopicRequest, ::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_topic(name: nil)
            #   Pass arguments to `get_topic` 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 topic whose configuration to return.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::PubSubLite::V1::Topic]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::PubSubLite::V1::Topic]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def get_topic request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::GetTopicRequest

              # 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_topic.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "name" => request.name
              }
              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_topic.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_topic.retry_policy

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

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

            ##
            # Returns the partition information for the requested topic.
            #
            # @overload get_topic_partitions(request, options = nil)
            #   Pass arguments to `get_topic_partitions` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::GetTopicPartitionsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::GetTopicPartitionsRequest, ::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_topic_partitions(name: nil)
            #   Pass arguments to `get_topic_partitions` 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 topic whose partition information to return.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::PubSubLite::V1::TopicPartitions]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::PubSubLite::V1::TopicPartitions]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def get_topic_partitions request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::GetTopicPartitionsRequest

              # 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_topic_partitions.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "name" => request.name
              }
              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_topic_partitions.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_topic_partitions.retry_policy

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

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

            ##
            # Returns the list of topics for the given project.
            #
            # @overload list_topics(request, options = nil)
            #   Pass arguments to `list_topics` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::ListTopicsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::ListTopicsRequest, ::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_topics(parent: nil, page_size: nil, page_token: nil)
            #   Pass arguments to `list_topics` 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 whose topics are to be listed.
            #     Structured like `projects/{project_number}/locations/{location}`.
            #   @param page_size [::Integer]
            #     The maximum number of topics to return. The service may return fewer than
            #     this value.
            #     If unset or zero, all topics for the parent will be returned.
            #   @param page_token [::String]
            #     A page token, received from a previous `ListTopics` call.
            #     Provide this to retrieve the subsequent page.
            #
            #     When paginating, all other parameters provided to `ListTopics` must match
            #     the call that provided the page token.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PubSubLite::V1::Topic>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::PubSubLite::V1::Topic>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def list_topics request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::ListTopicsRequest

              # 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_topics.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "parent" => request.parent
              }
              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_topics.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_topics.retry_policy

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

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

            ##
            # Updates properties of the specified topic.
            #
            # @overload update_topic(request, options = nil)
            #   Pass arguments to `update_topic` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::UpdateTopicRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::UpdateTopicRequest, ::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_topic(topic: nil, update_mask: nil)
            #   Pass arguments to `update_topic` 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 topic [::Google::Cloud::PubSubLite::V1::Topic, ::Hash]
            #     Required. The topic to update. Its `name` field must be populated.
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     Required. A mask specifying the topic fields to change.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::PubSubLite::V1::Topic]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::PubSubLite::V1::Topic]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def update_topic request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::UpdateTopicRequest

              # 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_topic.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "topic.name" => request.topic.name
              }
              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_topic.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.update_topic.retry_policy

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

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

            ##
            # Deletes the specified topic.
            #
            # @overload delete_topic(request, options = nil)
            #   Pass arguments to `delete_topic` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::DeleteTopicRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::DeleteTopicRequest, ::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_topic(name: nil)
            #   Pass arguments to `delete_topic` 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 topic to delete.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Protobuf::Empty]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Protobuf::Empty]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def delete_topic request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::DeleteTopicRequest

              # 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_topic.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "name" => request.name
              }
              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_topic.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.delete_topic.retry_policy

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

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

            ##
            # Lists the subscriptions attached to the specified topic.
            #
            # @overload list_topic_subscriptions(request, options = nil)
            #   Pass arguments to `list_topic_subscriptions` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::ListTopicSubscriptionsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::ListTopicSubscriptionsRequest, ::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_topic_subscriptions(name: nil, page_size: nil, page_token: nil)
            #   Pass arguments to `list_topic_subscriptions` 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 topic whose subscriptions to list.
            #   @param page_size [::Integer]
            #     The maximum number of subscriptions to return. The service may return fewer
            #     than this value.
            #     If unset or zero, all subscriptions for the given topic will be returned.
            #   @param page_token [::String]
            #     A page token, received from a previous `ListTopicSubscriptions` call.
            #     Provide this to retrieve the subsequent page.
            #
            #     When paginating, all other parameters provided to `ListTopicSubscriptions`
            #     must match the call that provided the page token.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::PubSubLite::V1::ListTopicSubscriptionsResponse]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::PubSubLite::V1::ListTopicSubscriptionsResponse]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def list_topic_subscriptions request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::ListTopicSubscriptionsRequest

              # 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_topic_subscriptions.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "name" => request.name
              }
              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_topic_subscriptions.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_topic_subscriptions.retry_policy

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

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

            ##
            # Creates a new subscription.
            #
            # @overload create_subscription(request, options = nil)
            #   Pass arguments to `create_subscription` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::CreateSubscriptionRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::CreateSubscriptionRequest, ::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_subscription(parent: nil, subscription: nil, subscription_id: nil, skip_backlog: nil)
            #   Pass arguments to `create_subscription` 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 location in which to create the subscription.
            #     Structured like `projects/{project_number}/locations/{location}`.
            #   @param subscription [::Google::Cloud::PubSubLite::V1::Subscription, ::Hash]
            #     Required. Configuration of the subscription to create. Its `name` field is ignored.
            #   @param subscription_id [::String]
            #     Required. The ID to use for the subscription, which will become the final component
            #     of the subscription's name.
            #
            #     This value is structured like: `my-sub-name`.
            #   @param skip_backlog [::Boolean]
            #     If true, the newly created subscription will only receive messages
            #     published after the subscription was created. Otherwise, the entire
            #     message backlog will be received on the subscription. Defaults to false.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::PubSubLite::V1::Subscription]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::PubSubLite::V1::Subscription]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def create_subscription request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::CreateSubscriptionRequest

              # 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_subscription.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "parent" => request.parent
              }
              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_subscription.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.create_subscription.retry_policy

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

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

            ##
            # Returns the subscription configuration.
            #
            # @overload get_subscription(request, options = nil)
            #   Pass arguments to `get_subscription` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::GetSubscriptionRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::GetSubscriptionRequest, ::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_subscription(name: nil)
            #   Pass arguments to `get_subscription` 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 subscription whose configuration to return.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::PubSubLite::V1::Subscription]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::PubSubLite::V1::Subscription]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def get_subscription request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::GetSubscriptionRequest

              # 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_subscription.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "name" => request.name
              }
              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_subscription.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_subscription.retry_policy

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

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

            ##
            # Returns the list of subscriptions for the given project.
            #
            # @overload list_subscriptions(request, options = nil)
            #   Pass arguments to `list_subscriptions` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::ListSubscriptionsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::ListSubscriptionsRequest, ::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_subscriptions(parent: nil, page_size: nil, page_token: nil)
            #   Pass arguments to `list_subscriptions` 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 whose subscriptions are to be listed.
            #     Structured like `projects/{project_number}/locations/{location}`.
            #   @param page_size [::Integer]
            #     The maximum number of subscriptions to return. The service may return fewer
            #     than this value.
            #     If unset or zero, all subscriptions for the parent will be returned.
            #   @param page_token [::String]
            #     A page token, received from a previous `ListSubscriptions` call.
            #     Provide this to retrieve the subsequent page.
            #
            #     When paginating, all other parameters provided to `ListSubscriptions` must
            #     match the call that provided the page token.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PubSubLite::V1::Subscription>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::PubSubLite::V1::Subscription>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def list_subscriptions request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::ListSubscriptionsRequest

              # 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_subscriptions.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "parent" => request.parent
              }
              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_subscriptions.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_subscriptions.retry_policy

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

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

            ##
            # Updates properties of the specified subscription.
            #
            # @overload update_subscription(request, options = nil)
            #   Pass arguments to `update_subscription` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::UpdateSubscriptionRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::UpdateSubscriptionRequest, ::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_subscription(subscription: nil, update_mask: nil)
            #   Pass arguments to `update_subscription` 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 subscription [::Google::Cloud::PubSubLite::V1::Subscription, ::Hash]
            #     Required. The subscription to update. Its `name` field must be populated.
            #     Topic field must not be populated.
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     Required. A mask specifying the subscription fields to change.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::PubSubLite::V1::Subscription]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::PubSubLite::V1::Subscription]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def update_subscription request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::UpdateSubscriptionRequest

              # 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_subscription.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "subscription.name" => request.subscription.name
              }
              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_subscription.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.update_subscription.retry_policy

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

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

            ##
            # Deletes the specified subscription.
            #
            # @overload delete_subscription(request, options = nil)
            #   Pass arguments to `delete_subscription` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::DeleteSubscriptionRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::DeleteSubscriptionRequest, ::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_subscription(name: nil)
            #   Pass arguments to `delete_subscription` 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 subscription to delete.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Protobuf::Empty]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Protobuf::Empty]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def delete_subscription request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::DeleteSubscriptionRequest

              # 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_subscription.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "name" => request.name
              }
              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_subscription.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.delete_subscription.retry_policy

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

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

            ##
            # Performs an out-of-band seek for a subscription to a specified target,
            # which may be timestamps or named positions within the message backlog.
            # Seek translates these targets to cursors for each partition and
            # orchestrates subscribers to start consuming messages from these seek
            # cursors.
            #
            # If an operation is returned, the seek has been registered and subscribers
            # will eventually receive messages from the seek cursors (i.e. eventual
            # consistency), as long as they are using a minimum supported client library
            # version and not a system that tracks cursors independently of Pub/Sub Lite
            # (e.g. Apache Beam, Dataflow, Spark). The seek operation will fail for
            # unsupported clients.
            #
            # If clients would like to know when subscribers react to the seek (or not),
            # they can poll the operation. The seek operation will succeed and complete
            # once subscribers are ready to receive messages from the seek cursors for
            # all partitions of the topic. This means that the seek operation will not
            # complete until all subscribers come online.
            #
            # If the previous seek operation has not yet completed, it will be aborted
            # and the new invocation of seek will supersede it.
            #
            # @overload seek_subscription(request, options = nil)
            #   Pass arguments to `seek_subscription` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::SeekSubscriptionRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::SeekSubscriptionRequest, ::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 seek_subscription(name: nil, named_target: nil, time_target: nil)
            #   Pass arguments to `seek_subscription` 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 subscription to seek.
            #   @param named_target [::Google::Cloud::PubSubLite::V1::SeekSubscriptionRequest::NamedTarget]
            #     Seek to a named position with respect to the message backlog.
            #   @param time_target [::Google::Cloud::PubSubLite::V1::TimeTarget, ::Hash]
            #     Seek to the first message whose publish or event time is greater than or
            #     equal to the specified query time. If no such message can be located,
            #     will seek to the end of the message backlog.
            #
            # @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.
            #
            def seek_subscription request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::SeekSubscriptionRequest

              # 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.seek_subscription.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "name" => request.name
              }
              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.seek_subscription.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.seek_subscription.retry_policy

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

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

            ##
            # Creates a new reservation.
            #
            # @overload create_reservation(request, options = nil)
            #   Pass arguments to `create_reservation` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::CreateReservationRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::CreateReservationRequest, ::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_reservation(parent: nil, reservation: nil, reservation_id: nil)
            #   Pass arguments to `create_reservation` 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 location in which to create the reservation.
            #     Structured like `projects/{project_number}/locations/{location}`.
            #   @param reservation [::Google::Cloud::PubSubLite::V1::Reservation, ::Hash]
            #     Required. Configuration of the reservation to create. Its `name` field is ignored.
            #   @param reservation_id [::String]
            #     Required. The ID to use for the reservation, which will become the final component of
            #     the reservation's name.
            #
            #     This value is structured like: `my-reservation-name`.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::PubSubLite::V1::Reservation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::PubSubLite::V1::Reservation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def create_reservation request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::CreateReservationRequest

              # 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_reservation.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "parent" => request.parent
              }
              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_reservation.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.create_reservation.retry_policy

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

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

            ##
            # Returns the reservation configuration.
            #
            # @overload get_reservation(request, options = nil)
            #   Pass arguments to `get_reservation` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::GetReservationRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::GetReservationRequest, ::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_reservation(name: nil)
            #   Pass arguments to `get_reservation` 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 reservation whose configuration to return.
            #     Structured like:
            #     projects/\\{project_number}/locations/\\{location}/reservations/\\{reservation_id}
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::PubSubLite::V1::Reservation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::PubSubLite::V1::Reservation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def get_reservation request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::GetReservationRequest

              # 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_reservation.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "name" => request.name
              }
              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_reservation.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_reservation.retry_policy

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

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

            ##
            # Returns the list of reservations for the given project.
            #
            # @overload list_reservations(request, options = nil)
            #   Pass arguments to `list_reservations` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::ListReservationsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::ListReservationsRequest, ::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_reservations(parent: nil, page_size: nil, page_token: nil)
            #   Pass arguments to `list_reservations` 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 whose reservations are to be listed.
            #     Structured like `projects/{project_number}/locations/{location}`.
            #   @param page_size [::Integer]
            #     The maximum number of reservations to return. The service may return fewer
            #     than this value. If unset or zero, all reservations for the parent will be
            #     returned.
            #   @param page_token [::String]
            #     A page token, received from a previous `ListReservations` call.
            #     Provide this to retrieve the subsequent page.
            #
            #     When paginating, all other parameters provided to `ListReservations` must
            #     match the call that provided the page token.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PubSubLite::V1::Reservation>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::PubSubLite::V1::Reservation>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def list_reservations request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::ListReservationsRequest

              # 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_reservations.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "parent" => request.parent
              }
              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_reservations.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_reservations.retry_policy

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

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

            ##
            # Updates properties of the specified reservation.
            #
            # @overload update_reservation(request, options = nil)
            #   Pass arguments to `update_reservation` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::UpdateReservationRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::UpdateReservationRequest, ::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_reservation(reservation: nil, update_mask: nil)
            #   Pass arguments to `update_reservation` 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 reservation [::Google::Cloud::PubSubLite::V1::Reservation, ::Hash]
            #     Required. The reservation to update. Its `name` field must be populated.
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     Required. A mask specifying the reservation fields to change.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::PubSubLite::V1::Reservation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::PubSubLite::V1::Reservation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def update_reservation request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::UpdateReservationRequest

              # 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_reservation.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "reservation.name" => request.reservation.name
              }
              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_reservation.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.update_reservation.retry_policy

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

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

            ##
            # Deletes the specified reservation.
            #
            # @overload delete_reservation(request, options = nil)
            #   Pass arguments to `delete_reservation` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::DeleteReservationRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::DeleteReservationRequest, ::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_reservation(name: nil)
            #   Pass arguments to `delete_reservation` 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 reservation to delete.
            #     Structured like:
            #     projects/\\{project_number}/locations/\\{location}/reservations/\\{reservation_id}
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Protobuf::Empty]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Protobuf::Empty]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def delete_reservation request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::DeleteReservationRequest

              # 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_reservation.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "name" => request.name
              }
              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_reservation.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.delete_reservation.retry_policy

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

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

            ##
            # Lists the topics attached to the specified reservation.
            #
            # @overload list_reservation_topics(request, options = nil)
            #   Pass arguments to `list_reservation_topics` via a request object, either of type
            #   {::Google::Cloud::PubSubLite::V1::ListReservationTopicsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::PubSubLite::V1::ListReservationTopicsRequest, ::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_reservation_topics(name: nil, page_size: nil, page_token: nil)
            #   Pass arguments to `list_reservation_topics` 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 reservation whose topics to list.
            #     Structured like:
            #     projects/\\{project_number}/locations/\\{location}/reservations/\\{reservation_id}
            #   @param page_size [::Integer]
            #     The maximum number of topics to return. The service may return fewer
            #     than this value.
            #     If unset or zero, all topics for the given reservation will be returned.
            #   @param page_token [::String]
            #     A page token, received from a previous `ListReservationTopics` call.
            #     Provide this to retrieve the subsequent page.
            #
            #     When paginating, all other parameters provided to `ListReservationTopics`
            #     must match the call that provided the page token.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::PubSubLite::V1::ListReservationTopicsResponse]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::PubSubLite::V1::ListReservationTopicsResponse]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def list_reservation_topics request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSubLite::V1::ListReservationTopicsRequest

              # 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_reservation_topics.metadata.to_h

              # Set x-goog-api-client and x-goog-user-project 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::Pubsublite::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

              header_params = {
                "name" => request.name
              }
              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_reservation_topics.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_reservation_topics.retry_policy

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

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

            ##
            # Configuration class for the AdminService API.
            #
            # This class represents the configuration for AdminService,
            # 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::PubSubLite::V1::AdminService::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
            #   # create_topic to 20 seconds,
            #   # and all remaining timeouts to 10 seconds.
            #   ::Google::Cloud::PubSubLite::V1::AdminService::Client.configure do |config|
            #     config.timeout = 10.0
            #     config.rpcs.create_topic.timeout = 20.0
            #   end
            #
            #   # Apply the above configuration only to a new client.
            #   client = ::Google::Cloud::PubSubLite::V1::AdminService::Client.new do |config|
            #     config.timeout = 10.0
            #     config.rpcs.create_topic.timeout = 20.0
            #   end
            #
            # @!attribute [rw] endpoint
            #   The hostname or hostname:port of the service endpoint.
            #   Defaults to `"pubsublite.googleapis.com"`.
            #   @return [::String]
            # @!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://googleapis.dev/ruby/googleauth/latest/index.html))
            #    *  (`Signet::OAuth2::Client`) A signet oauth2 client object
            #       (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
            #    *  (`GRPC::Core::Channel`) a gRPC channel with included credentials
            #    *  (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
            #    *  (`nil`) indicating no 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]
            #
            class Configuration
              extend ::Gapic::Config

              config_attr :endpoint,      "pubsublite.googleapis.com", ::String
              config_attr :credentials,   nil do |value|
                allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
                allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
                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

              # @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 RPC class for the AdminService 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 `create_topic`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_topic
                ##
                # RPC-specific configuration for `get_topic`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_topic
                ##
                # RPC-specific configuration for `get_topic_partitions`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_topic_partitions
                ##
                # RPC-specific configuration for `list_topics`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_topics
                ##
                # RPC-specific configuration for `update_topic`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_topic
                ##
                # RPC-specific configuration for `delete_topic`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_topic
                ##
                # RPC-specific configuration for `list_topic_subscriptions`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_topic_subscriptions
                ##
                # RPC-specific configuration for `create_subscription`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_subscription
                ##
                # RPC-specific configuration for `get_subscription`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_subscription
                ##
                # RPC-specific configuration for `list_subscriptions`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_subscriptions
                ##
                # RPC-specific configuration for `update_subscription`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_subscription
                ##
                # RPC-specific configuration for `delete_subscription`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_subscription
                ##
                # RPC-specific configuration for `seek_subscription`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :seek_subscription
                ##
                # RPC-specific configuration for `create_reservation`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_reservation
                ##
                # RPC-specific configuration for `get_reservation`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_reservation
                ##
                # RPC-specific configuration for `list_reservations`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_reservations
                ##
                # RPC-specific configuration for `update_reservation`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_reservation
                ##
                # RPC-specific configuration for `delete_reservation`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_reservation
                ##
                # RPC-specific configuration for `list_reservation_topics`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_reservation_topics

                # @private
                def initialize parent_rpcs = nil
                  create_topic_config = parent_rpcs.create_topic if parent_rpcs.respond_to? :create_topic
                  @create_topic = ::Gapic::Config::Method.new create_topic_config
                  get_topic_config = parent_rpcs.get_topic if parent_rpcs.respond_to? :get_topic
                  @get_topic = ::Gapic::Config::Method.new get_topic_config
                  get_topic_partitions_config = parent_rpcs.get_topic_partitions if parent_rpcs.respond_to? :get_topic_partitions
                  @get_topic_partitions = ::Gapic::Config::Method.new get_topic_partitions_config
                  list_topics_config = parent_rpcs.list_topics if parent_rpcs.respond_to? :list_topics
                  @list_topics = ::Gapic::Config::Method.new list_topics_config
                  update_topic_config = parent_rpcs.update_topic if parent_rpcs.respond_to? :update_topic
                  @update_topic = ::Gapic::Config::Method.new update_topic_config
                  delete_topic_config = parent_rpcs.delete_topic if parent_rpcs.respond_to? :delete_topic
                  @delete_topic = ::Gapic::Config::Method.new delete_topic_config
                  list_topic_subscriptions_config = parent_rpcs.list_topic_subscriptions if parent_rpcs.respond_to? :list_topic_subscriptions
                  @list_topic_subscriptions = ::Gapic::Config::Method.new list_topic_subscriptions_config
                  create_subscription_config = parent_rpcs.create_subscription if parent_rpcs.respond_to? :create_subscription
                  @create_subscription = ::Gapic::Config::Method.new create_subscription_config
                  get_subscription_config = parent_rpcs.get_subscription if parent_rpcs.respond_to? :get_subscription
                  @get_subscription = ::Gapic::Config::Method.new get_subscription_config
                  list_subscriptions_config = parent_rpcs.list_subscriptions if parent_rpcs.respond_to? :list_subscriptions
                  @list_subscriptions = ::Gapic::Config::Method.new list_subscriptions_config
                  update_subscription_config = parent_rpcs.update_subscription if parent_rpcs.respond_to? :update_subscription
                  @update_subscription = ::Gapic::Config::Method.new update_subscription_config
                  delete_subscription_config = parent_rpcs.delete_subscription if parent_rpcs.respond_to? :delete_subscription
                  @delete_subscription = ::Gapic::Config::Method.new delete_subscription_config
                  seek_subscription_config = parent_rpcs.seek_subscription if parent_rpcs.respond_to? :seek_subscription
                  @seek_subscription = ::Gapic::Config::Method.new seek_subscription_config
                  create_reservation_config = parent_rpcs.create_reservation if parent_rpcs.respond_to? :create_reservation
                  @create_reservation = ::Gapic::Config::Method.new create_reservation_config
                  get_reservation_config = parent_rpcs.get_reservation if parent_rpcs.respond_to? :get_reservation
                  @get_reservation = ::Gapic::Config::Method.new get_reservation_config
                  list_reservations_config = parent_rpcs.list_reservations if parent_rpcs.respond_to? :list_reservations
                  @list_reservations = ::Gapic::Config::Method.new list_reservations_config
                  update_reservation_config = parent_rpcs.update_reservation if parent_rpcs.respond_to? :update_reservation
                  @update_reservation = ::Gapic::Config::Method.new update_reservation_config
                  delete_reservation_config = parent_rpcs.delete_reservation if parent_rpcs.respond_to? :delete_reservation
                  @delete_reservation = ::Gapic::Config::Method.new delete_reservation_config
                  list_reservation_topics_config = parent_rpcs.list_reservation_topics if parent_rpcs.respond_to? :list_reservation_topics
                  @list_reservation_topics = ::Gapic::Config::Method.new list_reservation_topics_config

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