# 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/contactcenterinsights/v1/contact_center_insights_pb"

module Google
  module Cloud
    module ContactCenterInsights
      module V1
        module ContactCenterInsights
          ##
          # Client for the ContactCenterInsights service.
          #
          # An API that lets users analyze and explore their business conversation data.
          #
          class Client
            include Paths

            # @private
            attr_reader :contact_center_insights_stub

            ##
            # Configure the ContactCenterInsights Client class.
            #
            # See {::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client::Configuration}
            # for a description of the configuration fields.
            #
            # @example
            #
            #   # Modify the configuration for all ContactCenterInsights clients
            #   ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::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", "ContactCenterInsights", "V1"]
                parent_config = while namespace.any?
                                  parent_name = namespace.join "::"
                                  parent_const = const_get parent_name
                                  break parent_const.configure if parent_const.respond_to? :configure
                                  namespace.pop
                                end
                default_config = Client::Configuration.new parent_config

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

                default_config
              end
              yield @configure if block_given?
              @configure
            end

            ##
            # Configure the ContactCenterInsights 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::ContactCenterInsights::V1::ContactCenterInsights::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 ContactCenterInsights client object.
            #
            # @example
            #
            #   # Create a client using the default configuration
            #   client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
            #
            #   # Create a client using a custom configuration
            #   client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config|
            #     config.timeout = 10.0
            #   end
            #
            # @yield [config] Configure the ContactCenterInsights 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/contactcenterinsights/v1/contact_center_insights_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

              @contact_center_insights_stub = ::Gapic::ServiceStub.new(
                ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::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::ContactCenterInsights::V1::ContactCenterInsights::Operations]
            #
            attr_reader :operations_client

            # Service calls

            ##
            # Creates a conversation.
            #
            # @overload create_conversation(request, options = nil)
            #   Pass arguments to `create_conversation` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::CreateConversationRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::CreateConversationRequest, ::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_conversation(parent: nil, conversation: nil, conversation_id: nil)
            #   Pass arguments to `create_conversation` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource of the conversation.
            #   @param conversation [::Google::Cloud::ContactCenterInsights::V1::Conversation, ::Hash]
            #     Required. The conversation resource to create.
            #   @param conversation_id [::String]
            #     A unique ID for the new conversation. This ID will become the final
            #     component of the conversation's resource name. If no ID is specified, a
            #     server-generated ID will be used.
            #
            #     This value should be 4-32 characters and must match the regular
            #     expression /^[a-z0-9-]\\{4,32}$/. Valid characters are /[a-z][0-9]-/
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::Conversation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::Conversation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def create_conversation request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::CreateConversationRequest

              # 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_conversation.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::ContactCenterInsights::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_conversation.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.create_conversation.retry_policy

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

              @contact_center_insights_stub.call_rpc :create_conversation, 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

            ##
            # Updates a conversation.
            #
            # @overload update_conversation(request, options = nil)
            #   Pass arguments to `update_conversation` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::UpdateConversationRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::UpdateConversationRequest, ::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_conversation(conversation: nil, update_mask: nil)
            #   Pass arguments to `update_conversation` 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 conversation [::Google::Cloud::ContactCenterInsights::V1::Conversation, ::Hash]
            #     Required. The new values for the conversation.
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     The list of fields to be updated.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::Conversation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::Conversation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def update_conversation request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::UpdateConversationRequest

              # 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_conversation.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::ContactCenterInsights::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

              @contact_center_insights_stub.call_rpc :update_conversation, 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

            ##
            # Gets a conversation.
            #
            # @overload get_conversation(request, options = nil)
            #   Pass arguments to `get_conversation` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::GetConversationRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::GetConversationRequest, ::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_conversation(name: nil, view: nil)
            #   Pass arguments to `get_conversation` 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 conversation to get.
            #   @param view [::Google::Cloud::ContactCenterInsights::V1::ConversationView]
            #     The level of details of the conversation. Default is `FULL`.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::Conversation]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::Conversation]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def get_conversation request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::GetConversationRequest

              # 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_conversation.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::ContactCenterInsights::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_conversation.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_conversation.retry_policy

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

              @contact_center_insights_stub.call_rpc :get_conversation, 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 conversations.
            #
            # @overload list_conversations(request, options = nil)
            #   Pass arguments to `list_conversations` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::ListConversationsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::ListConversationsRequest, ::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_conversations(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil)
            #   Pass arguments to `list_conversations` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource of the conversation.
            #   @param page_size [::Integer]
            #     The maximum number of conversations to return in the response. If this
            #     value is zero, the service will select a default size. A call might return
            #     fewer objects than requested. A non-empty `next_page_token` in the response
            #     indicates that more data is available.
            #   @param page_token [::String]
            #     The value returned by the last `ListConversationsResponse`. This value
            #     indicates that this is a continuation of a prior `ListConversations` call
            #     and that the system should return the next page of data.
            #   @param filter [::String]
            #     A filter to reduce results to a specific subset. Useful for querying
            #     conversations with specific properties.
            #   @param view [::Google::Cloud::ContactCenterInsights::V1::ConversationView]
            #     The level of details of the conversation. Default is `BASIC`.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ContactCenterInsights::V1::Conversation>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::ContactCenterInsights::V1::Conversation>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def list_conversations request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::ListConversationsRequest

              # 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_conversations.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::ContactCenterInsights::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_conversations.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_conversations.retry_policy

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

              @contact_center_insights_stub.call_rpc :list_conversations, request, options: options do |response, operation|
                response = ::Gapic::PagedEnumerable.new @contact_center_insights_stub, :list_conversations, 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

            ##
            # Deletes a conversation.
            #
            # @overload delete_conversation(request, options = nil)
            #   Pass arguments to `delete_conversation` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::DeleteConversationRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::DeleteConversationRequest, ::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_conversation(name: nil, force: nil)
            #   Pass arguments to `delete_conversation` 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 conversation to delete.
            #   @param force [::Boolean]
            #     If set to true, all of this conversation's analyses will also be deleted.
            #     Otherwise, the request will only succeed if the conversation has no
            #     analyses.
            #
            # @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_conversation request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::DeleteConversationRequest

              # 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_conversation.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::ContactCenterInsights::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_conversation.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.delete_conversation.retry_policy

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

              @contact_center_insights_stub.call_rpc :delete_conversation, 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 an analysis. The long running operation is done when the analysis
            # has completed.
            #
            # @overload create_analysis(request, options = nil)
            #   Pass arguments to `create_analysis` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::CreateAnalysisRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::CreateAnalysisRequest, ::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_analysis(parent: nil, analysis: nil)
            #   Pass arguments to `create_analysis` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource of the analysis.
            #   @param analysis [::Google::Cloud::ContactCenterInsights::V1::Analysis, ::Hash]
            #     Required. The analysis to create.
            #
            # @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 create_analysis request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::CreateAnalysisRequest

              # 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_analysis.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::ContactCenterInsights::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_analysis.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.create_analysis.retry_policy

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

              @contact_center_insights_stub.call_rpc :create_analysis, 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

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

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::GetAnalysisRequest

              # 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_analysis.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::ContactCenterInsights::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_analysis.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_analysis.retry_policy

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

              @contact_center_insights_stub.call_rpc :get_analysis, 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 analyses.
            #
            # @overload list_analyses(request, options = nil)
            #   Pass arguments to `list_analyses` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::ListAnalysesRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::ListAnalysesRequest, ::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_analyses(parent: nil, page_size: nil, page_token: nil, filter: nil)
            #   Pass arguments to `list_analyses` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource of the analyses.
            #   @param page_size [::Integer]
            #     The maximum number of analyses to return in the response. If this
            #     value is zero, the service will select a default size. A call might return
            #     fewer objects than requested. A non-empty `next_page_token` in the response
            #     indicates that more data is available.
            #   @param page_token [::String]
            #     The value returned by the last `ListAnalysesResponse`; indicates
            #     that this is a continuation of a prior `ListAnalyses` call and
            #     the system should return the next page of data.
            #   @param filter [::String]
            #     A filter to reduce results to a specific subset. Useful for querying
            #     conversations with specific properties.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ContactCenterInsights::V1::Analysis>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::ContactCenterInsights::V1::Analysis>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def list_analyses request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::ListAnalysesRequest

              # 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_analyses.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::ContactCenterInsights::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_analyses.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_analyses.retry_policy

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

              @contact_center_insights_stub.call_rpc :list_analyses, request, options: options do |response, operation|
                response = ::Gapic::PagedEnumerable.new @contact_center_insights_stub, :list_analyses, 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

            ##
            # Deletes an analysis.
            #
            # @overload delete_analysis(request, options = nil)
            #   Pass arguments to `delete_analysis` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::DeleteAnalysisRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::DeleteAnalysisRequest, ::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_analysis(name: nil)
            #   Pass arguments to `delete_analysis` 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 analysis 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_analysis request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::DeleteAnalysisRequest

              # 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_analysis.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::ContactCenterInsights::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_analysis.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.delete_analysis.retry_policy

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

              @contact_center_insights_stub.call_rpc :delete_analysis, 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

            ##
            # Export insights data to a destination defined in the request body.
            #
            # @overload export_insights_data(request, options = nil)
            #   Pass arguments to `export_insights_data` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::ExportInsightsDataRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::ExportInsightsDataRequest, ::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 export_insights_data(big_query_destination: nil, parent: nil, filter: nil, kms_key: nil)
            #   Pass arguments to `export_insights_data` 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 big_query_destination [::Google::Cloud::ContactCenterInsights::V1::ExportInsightsDataRequest::BigQueryDestination, ::Hash]
            #     Specified if sink is a BigQuery table.
            #   @param parent [::String]
            #     Required. The parent resource to export data from.
            #   @param filter [::String]
            #     A filter to reduce results to a specific subset. Useful for exporting
            #     conversations with specific properties.
            #   @param kms_key [::String]
            #     A fully qualified KMS key name for BigQuery tables protected by CMEK.
            #     Format:
            #     projects/\\{project}/locations/\\{location}/keyRings/\\{keyring}/cryptoKeys/\\{key}/cryptoKeyVersions/\\{version}
            #
            # @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 export_insights_data request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::ExportInsightsDataRequest

              # 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.export_insights_data.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::ContactCenterInsights::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.export_insights_data.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.export_insights_data.retry_policy

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

              @contact_center_insights_stub.call_rpc :export_insights_data, 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 an issue model.
            #
            # @overload create_issue_model(request, options = nil)
            #   Pass arguments to `create_issue_model` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::CreateIssueModelRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::CreateIssueModelRequest, ::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_issue_model(parent: nil, issue_model: nil)
            #   Pass arguments to `create_issue_model` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource of the issue model.
            #   @param issue_model [::Google::Cloud::ContactCenterInsights::V1::IssueModel, ::Hash]
            #     Required. The issue model to create.
            #
            # @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 create_issue_model request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::CreateIssueModelRequest

              # 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_issue_model.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::ContactCenterInsights::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_issue_model.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.create_issue_model.retry_policy

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

              @contact_center_insights_stub.call_rpc :create_issue_model, 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

            ##
            # Updates an issue model.
            #
            # @overload update_issue_model(request, options = nil)
            #   Pass arguments to `update_issue_model` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::UpdateIssueModelRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::UpdateIssueModelRequest, ::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_issue_model(issue_model: nil, update_mask: nil)
            #   Pass arguments to `update_issue_model` 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 issue_model [::Google::Cloud::ContactCenterInsights::V1::IssueModel, ::Hash]
            #     Required. The new values for the issue model.
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     The list of fields to be updated.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::IssueModel]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::IssueModel]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def update_issue_model request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::UpdateIssueModelRequest

              # 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_issue_model.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::ContactCenterInsights::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

              @contact_center_insights_stub.call_rpc :update_issue_model, 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

            ##
            # Gets an issue model.
            #
            # @overload get_issue_model(request, options = nil)
            #   Pass arguments to `get_issue_model` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::GetIssueModelRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::GetIssueModelRequest, ::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_issue_model(name: nil)
            #   Pass arguments to `get_issue_model` 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 issue model to get.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::IssueModel]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::IssueModel]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def get_issue_model request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::GetIssueModelRequest

              # 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_issue_model.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::ContactCenterInsights::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_issue_model.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_issue_model.retry_policy

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

              @contact_center_insights_stub.call_rpc :get_issue_model, 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 issue models.
            #
            # @overload list_issue_models(request, options = nil)
            #   Pass arguments to `list_issue_models` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::ListIssueModelsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::ListIssueModelsRequest, ::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_issue_models(parent: nil)
            #   Pass arguments to `list_issue_models` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource of the issue model.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::ListIssueModelsResponse]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::ListIssueModelsResponse]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def list_issue_models request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::ListIssueModelsRequest

              # 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_issue_models.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::ContactCenterInsights::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_issue_models.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_issue_models.retry_policy

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

              @contact_center_insights_stub.call_rpc :list_issue_models, 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 an issue model.
            #
            # @overload delete_issue_model(request, options = nil)
            #   Pass arguments to `delete_issue_model` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::DeleteIssueModelRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::DeleteIssueModelRequest, ::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_issue_model(name: nil)
            #   Pass arguments to `delete_issue_model` 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 issue model to delete.
            #
            # @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 delete_issue_model request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::DeleteIssueModelRequest

              # 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_issue_model.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::ContactCenterInsights::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_issue_model.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.delete_issue_model.retry_policy

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

              @contact_center_insights_stub.call_rpc :delete_issue_model, 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

            ##
            # Deploys an issue model. Returns an error if a model is already deployed.
            # An issue model can only be used in analysis after it has been deployed.
            #
            # @overload deploy_issue_model(request, options = nil)
            #   Pass arguments to `deploy_issue_model` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::DeployIssueModelRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::DeployIssueModelRequest, ::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 deploy_issue_model(name: nil)
            #   Pass arguments to `deploy_issue_model` 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 issue model to deploy.
            #
            # @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 deploy_issue_model request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::DeployIssueModelRequest

              # 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.deploy_issue_model.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::ContactCenterInsights::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.deploy_issue_model.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.deploy_issue_model.retry_policy

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

              @contact_center_insights_stub.call_rpc :deploy_issue_model, 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

            ##
            # Undeploys an issue model.
            # An issue model can not be used in analysis after it has been undeployed.
            #
            # @overload undeploy_issue_model(request, options = nil)
            #   Pass arguments to `undeploy_issue_model` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::UndeployIssueModelRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::UndeployIssueModelRequest, ::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 undeploy_issue_model(name: nil)
            #   Pass arguments to `undeploy_issue_model` 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 issue model to undeploy.
            #
            # @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 undeploy_issue_model request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::UndeployIssueModelRequest

              # 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.undeploy_issue_model.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::ContactCenterInsights::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.undeploy_issue_model.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.undeploy_issue_model.retry_policy

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

              @contact_center_insights_stub.call_rpc :undeploy_issue_model, 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

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

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::GetIssueRequest

              # 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_issue.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::ContactCenterInsights::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_issue.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_issue.retry_policy

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

              @contact_center_insights_stub.call_rpc :get_issue, 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 issues.
            #
            # @overload list_issues(request, options = nil)
            #   Pass arguments to `list_issues` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::ListIssuesRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::ListIssuesRequest, ::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_issues(parent: nil)
            #   Pass arguments to `list_issues` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource of the issue.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::ListIssuesResponse]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::ListIssuesResponse]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def list_issues request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::ListIssuesRequest

              # 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_issues.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::ContactCenterInsights::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_issues.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_issues.retry_policy

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

              @contact_center_insights_stub.call_rpc :list_issues, 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

            ##
            # Updates an issue.
            #
            # @overload update_issue(request, options = nil)
            #   Pass arguments to `update_issue` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::UpdateIssueRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::UpdateIssueRequest, ::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_issue(issue: nil, update_mask: nil)
            #   Pass arguments to `update_issue` 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 issue [::Google::Cloud::ContactCenterInsights::V1::Issue, ::Hash]
            #     Required. The new values for the issue.
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     The list of fields to be updated.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::Issue]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::Issue]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def update_issue request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::UpdateIssueRequest

              # 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_issue.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::ContactCenterInsights::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

              @contact_center_insights_stub.call_rpc :update_issue, 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

            ##
            # Gets an issue model's statistics.
            #
            # @overload calculate_issue_model_stats(request, options = nil)
            #   Pass arguments to `calculate_issue_model_stats` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::CalculateIssueModelStatsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::CalculateIssueModelStatsRequest, ::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 calculate_issue_model_stats(issue_model: nil)
            #   Pass arguments to `calculate_issue_model_stats` 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 issue_model [::String]
            #     Required. The resource name of the issue model to query against.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::CalculateIssueModelStatsResponse]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::CalculateIssueModelStatsResponse]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def calculate_issue_model_stats request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::CalculateIssueModelStatsRequest

              # 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.calculate_issue_model_stats.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::ContactCenterInsights::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

              @contact_center_insights_stub.call_rpc :calculate_issue_model_stats, 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 phrase matcher.
            #
            # @overload create_phrase_matcher(request, options = nil)
            #   Pass arguments to `create_phrase_matcher` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::CreatePhraseMatcherRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::CreatePhraseMatcherRequest, ::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_phrase_matcher(parent: nil, phrase_matcher: nil)
            #   Pass arguments to `create_phrase_matcher` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource of the phrase matcher. Required. The location to create
            #     a phrase matcher for.
            #     Format: `projects/<Project ID>/locations/<Location ID>` or
            #     `projects/<Project Number>/locations/<Location ID>`
            #   @param phrase_matcher [::Google::Cloud::ContactCenterInsights::V1::PhraseMatcher, ::Hash]
            #     Required. The phrase matcher resource to create.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::PhraseMatcher]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::PhraseMatcher]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def create_phrase_matcher request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::CreatePhraseMatcherRequest

              # 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_phrase_matcher.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::ContactCenterInsights::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_phrase_matcher.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.create_phrase_matcher.retry_policy

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

              @contact_center_insights_stub.call_rpc :create_phrase_matcher, 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

            ##
            # Gets a phrase matcher.
            #
            # @overload get_phrase_matcher(request, options = nil)
            #   Pass arguments to `get_phrase_matcher` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::GetPhraseMatcherRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::GetPhraseMatcherRequest, ::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_phrase_matcher(name: nil)
            #   Pass arguments to `get_phrase_matcher` 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 phrase matcher to get.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::PhraseMatcher]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::PhraseMatcher]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def get_phrase_matcher request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::GetPhraseMatcherRequest

              # 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_phrase_matcher.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::ContactCenterInsights::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_phrase_matcher.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_phrase_matcher.retry_policy

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

              @contact_center_insights_stub.call_rpc :get_phrase_matcher, 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 phrase matchers.
            #
            # @overload list_phrase_matchers(request, options = nil)
            #   Pass arguments to `list_phrase_matchers` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::ListPhraseMatchersRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::ListPhraseMatchersRequest, ::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_phrase_matchers(parent: nil, page_size: nil, page_token: nil, filter: nil)
            #   Pass arguments to `list_phrase_matchers` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The parent resource of the phrase matcher.
            #   @param page_size [::Integer]
            #     The maximum number of phrase matchers to return in the response. If this
            #     value is zero, the service will select a default size. A call might return
            #     fewer objects than requested. A non-empty `next_page_token` in the response
            #     indicates that more data is available.
            #   @param page_token [::String]
            #     The value returned by the last `ListPhraseMatchersResponse`. This value
            #     indicates that this is a continuation of a prior `ListPhraseMatchers` call
            #     and that the system should return the next page of data.
            #   @param filter [::String]
            #     A filter to reduce results to a specific subset. Useful for querying
            #     phrase matchers with specific properties.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ContactCenterInsights::V1::PhraseMatcher>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::ContactCenterInsights::V1::PhraseMatcher>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def list_phrase_matchers request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::ListPhraseMatchersRequest

              # 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_phrase_matchers.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::ContactCenterInsights::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_phrase_matchers.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.list_phrase_matchers.retry_policy

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

              @contact_center_insights_stub.call_rpc :list_phrase_matchers, request, options: options do |response, operation|
                response = ::Gapic::PagedEnumerable.new @contact_center_insights_stub, :list_phrase_matchers, 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

            ##
            # Deletes a phrase matcher.
            #
            # @overload delete_phrase_matcher(request, options = nil)
            #   Pass arguments to `delete_phrase_matcher` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::DeletePhraseMatcherRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::DeletePhraseMatcherRequest, ::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_phrase_matcher(name: nil)
            #   Pass arguments to `delete_phrase_matcher` 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 phrase matcher 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_phrase_matcher request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::DeletePhraseMatcherRequest

              # 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_phrase_matcher.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::ContactCenterInsights::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_phrase_matcher.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.delete_phrase_matcher.retry_policy

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

              @contact_center_insights_stub.call_rpc :delete_phrase_matcher, 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

            ##
            # Gets conversation statistics.
            #
            # @overload calculate_stats(request, options = nil)
            #   Pass arguments to `calculate_stats` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::CalculateStatsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::CalculateStatsRequest, ::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 calculate_stats(location: nil, filter: nil)
            #   Pass arguments to `calculate_stats` 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 location [::String]
            #     Required. The location of the conversations.
            #   @param filter [::String]
            #     A filter to reduce results to a specific subset. This field is useful for
            #     getting statistics about conversations with specific properties.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::CalculateStatsResponse]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::CalculateStatsResponse]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def calculate_stats request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::CalculateStatsRequest

              # 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.calculate_stats.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::ContactCenterInsights::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

              @contact_center_insights_stub.call_rpc :calculate_stats, 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

            ##
            # Gets project-level settings.
            #
            # @overload get_settings(request, options = nil)
            #   Pass arguments to `get_settings` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::GetSettingsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::GetSettingsRequest, ::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_settings(name: nil)
            #   Pass arguments to `get_settings` 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 settings resource to get.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::Settings]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::Settings]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def get_settings request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::GetSettingsRequest

              # 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_settings.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::ContactCenterInsights::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_settings.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.get_settings.retry_policy

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

              @contact_center_insights_stub.call_rpc :get_settings, 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

            ##
            # Updates project-level settings.
            #
            # @overload update_settings(request, options = nil)
            #   Pass arguments to `update_settings` via a request object, either of type
            #   {::Google::Cloud::ContactCenterInsights::V1::UpdateSettingsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::ContactCenterInsights::V1::UpdateSettingsRequest, ::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_settings(settings: nil, update_mask: nil)
            #   Pass arguments to `update_settings` 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 settings [::Google::Cloud::ContactCenterInsights::V1::Settings, ::Hash]
            #     Required. The new values for the conversation.
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     Required. The list of fields to be updated.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::Settings]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::ContactCenterInsights::V1::Settings]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            def update_settings request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::UpdateSettingsRequest

              # 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_settings.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::ContactCenterInsights::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

              @contact_center_insights_stub.call_rpc :update_settings, 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 ContactCenterInsights API.
            #
            # This class represents the configuration for ContactCenterInsights,
            # 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::ContactCenterInsights::V1::ContactCenterInsights::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_conversation to 20 seconds,
            #   # and all remaining timeouts to 10 seconds.
            #   ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.configure do |config|
            #     config.timeout = 10.0
            #     config.rpcs.create_conversation.timeout = 20.0
            #   end
            #
            #   # Apply the above configuration only to a new client.
            #   client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config|
            #     config.timeout = 10.0
            #     config.rpcs.create_conversation.timeout = 20.0
            #   end
            #
            # @!attribute [rw] endpoint
            #   The hostname or hostname:port of the service endpoint.
            #   Defaults to `"contactcenterinsights.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,      "contactcenterinsights.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 ContactCenterInsights 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_conversation`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_conversation
                ##
                # RPC-specific configuration for `update_conversation`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_conversation
                ##
                # RPC-specific configuration for `get_conversation`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_conversation
                ##
                # RPC-specific configuration for `list_conversations`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_conversations
                ##
                # RPC-specific configuration for `delete_conversation`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_conversation
                ##
                # RPC-specific configuration for `create_analysis`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_analysis
                ##
                # RPC-specific configuration for `get_analysis`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_analysis
                ##
                # RPC-specific configuration for `list_analyses`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_analyses
                ##
                # RPC-specific configuration for `delete_analysis`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_analysis
                ##
                # RPC-specific configuration for `export_insights_data`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :export_insights_data
                ##
                # RPC-specific configuration for `create_issue_model`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_issue_model
                ##
                # RPC-specific configuration for `update_issue_model`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_issue_model
                ##
                # RPC-specific configuration for `get_issue_model`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_issue_model
                ##
                # RPC-specific configuration for `list_issue_models`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_issue_models
                ##
                # RPC-specific configuration for `delete_issue_model`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_issue_model
                ##
                # RPC-specific configuration for `deploy_issue_model`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :deploy_issue_model
                ##
                # RPC-specific configuration for `undeploy_issue_model`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :undeploy_issue_model
                ##
                # RPC-specific configuration for `get_issue`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_issue
                ##
                # RPC-specific configuration for `list_issues`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_issues
                ##
                # RPC-specific configuration for `update_issue`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_issue
                ##
                # RPC-specific configuration for `calculate_issue_model_stats`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :calculate_issue_model_stats
                ##
                # RPC-specific configuration for `create_phrase_matcher`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_phrase_matcher
                ##
                # RPC-specific configuration for `get_phrase_matcher`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_phrase_matcher
                ##
                # RPC-specific configuration for `list_phrase_matchers`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_phrase_matchers
                ##
                # RPC-specific configuration for `delete_phrase_matcher`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_phrase_matcher
                ##
                # RPC-specific configuration for `calculate_stats`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :calculate_stats
                ##
                # RPC-specific configuration for `get_settings`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_settings
                ##
                # RPC-specific configuration for `update_settings`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_settings

                # @private
                def initialize parent_rpcs = nil
                  create_conversation_config = parent_rpcs.create_conversation if parent_rpcs.respond_to? :create_conversation
                  @create_conversation = ::Gapic::Config::Method.new create_conversation_config
                  update_conversation_config = parent_rpcs.update_conversation if parent_rpcs.respond_to? :update_conversation
                  @update_conversation = ::Gapic::Config::Method.new update_conversation_config
                  get_conversation_config = parent_rpcs.get_conversation if parent_rpcs.respond_to? :get_conversation
                  @get_conversation = ::Gapic::Config::Method.new get_conversation_config
                  list_conversations_config = parent_rpcs.list_conversations if parent_rpcs.respond_to? :list_conversations
                  @list_conversations = ::Gapic::Config::Method.new list_conversations_config
                  delete_conversation_config = parent_rpcs.delete_conversation if parent_rpcs.respond_to? :delete_conversation
                  @delete_conversation = ::Gapic::Config::Method.new delete_conversation_config
                  create_analysis_config = parent_rpcs.create_analysis if parent_rpcs.respond_to? :create_analysis
                  @create_analysis = ::Gapic::Config::Method.new create_analysis_config
                  get_analysis_config = parent_rpcs.get_analysis if parent_rpcs.respond_to? :get_analysis
                  @get_analysis = ::Gapic::Config::Method.new get_analysis_config
                  list_analyses_config = parent_rpcs.list_analyses if parent_rpcs.respond_to? :list_analyses
                  @list_analyses = ::Gapic::Config::Method.new list_analyses_config
                  delete_analysis_config = parent_rpcs.delete_analysis if parent_rpcs.respond_to? :delete_analysis
                  @delete_analysis = ::Gapic::Config::Method.new delete_analysis_config
                  export_insights_data_config = parent_rpcs.export_insights_data if parent_rpcs.respond_to? :export_insights_data
                  @export_insights_data = ::Gapic::Config::Method.new export_insights_data_config
                  create_issue_model_config = parent_rpcs.create_issue_model if parent_rpcs.respond_to? :create_issue_model
                  @create_issue_model = ::Gapic::Config::Method.new create_issue_model_config
                  update_issue_model_config = parent_rpcs.update_issue_model if parent_rpcs.respond_to? :update_issue_model
                  @update_issue_model = ::Gapic::Config::Method.new update_issue_model_config
                  get_issue_model_config = parent_rpcs.get_issue_model if parent_rpcs.respond_to? :get_issue_model
                  @get_issue_model = ::Gapic::Config::Method.new get_issue_model_config
                  list_issue_models_config = parent_rpcs.list_issue_models if parent_rpcs.respond_to? :list_issue_models
                  @list_issue_models = ::Gapic::Config::Method.new list_issue_models_config
                  delete_issue_model_config = parent_rpcs.delete_issue_model if parent_rpcs.respond_to? :delete_issue_model
                  @delete_issue_model = ::Gapic::Config::Method.new delete_issue_model_config
                  deploy_issue_model_config = parent_rpcs.deploy_issue_model if parent_rpcs.respond_to? :deploy_issue_model
                  @deploy_issue_model = ::Gapic::Config::Method.new deploy_issue_model_config
                  undeploy_issue_model_config = parent_rpcs.undeploy_issue_model if parent_rpcs.respond_to? :undeploy_issue_model
                  @undeploy_issue_model = ::Gapic::Config::Method.new undeploy_issue_model_config
                  get_issue_config = parent_rpcs.get_issue if parent_rpcs.respond_to? :get_issue
                  @get_issue = ::Gapic::Config::Method.new get_issue_config
                  list_issues_config = parent_rpcs.list_issues if parent_rpcs.respond_to? :list_issues
                  @list_issues = ::Gapic::Config::Method.new list_issues_config
                  update_issue_config = parent_rpcs.update_issue if parent_rpcs.respond_to? :update_issue
                  @update_issue = ::Gapic::Config::Method.new update_issue_config
                  calculate_issue_model_stats_config = parent_rpcs.calculate_issue_model_stats if parent_rpcs.respond_to? :calculate_issue_model_stats
                  @calculate_issue_model_stats = ::Gapic::Config::Method.new calculate_issue_model_stats_config
                  create_phrase_matcher_config = parent_rpcs.create_phrase_matcher if parent_rpcs.respond_to? :create_phrase_matcher
                  @create_phrase_matcher = ::Gapic::Config::Method.new create_phrase_matcher_config
                  get_phrase_matcher_config = parent_rpcs.get_phrase_matcher if parent_rpcs.respond_to? :get_phrase_matcher
                  @get_phrase_matcher = ::Gapic::Config::Method.new get_phrase_matcher_config
                  list_phrase_matchers_config = parent_rpcs.list_phrase_matchers if parent_rpcs.respond_to? :list_phrase_matchers
                  @list_phrase_matchers = ::Gapic::Config::Method.new list_phrase_matchers_config
                  delete_phrase_matcher_config = parent_rpcs.delete_phrase_matcher if parent_rpcs.respond_to? :delete_phrase_matcher
                  @delete_phrase_matcher = ::Gapic::Config::Method.new delete_phrase_matcher_config
                  calculate_stats_config = parent_rpcs.calculate_stats if parent_rpcs.respond_to? :calculate_stats
                  @calculate_stats = ::Gapic::Config::Method.new calculate_stats_config
                  get_settings_config = parent_rpcs.get_settings if parent_rpcs.respond_to? :get_settings
                  @get_settings = ::Gapic::Config::Method.new get_settings_config
                  update_settings_config = parent_rpcs.update_settings if parent_rpcs.respond_to? :update_settings
                  @update_settings = ::Gapic::Config::Method.new update_settings_config

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