# frozen_string_literal: true

# Copyright 2020 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/datacatalog/v1/datacatalog_pb"

module Google
  module Cloud
    module DataCatalog
      module V1
        module DataCatalog
          ##
          # Client for the DataCatalog service.
          #
          # Data Catalog API service allows you to discover, understand, and manage
          # your data.
          #
          class Client
            include Paths

            # @private
            attr_reader :data_catalog_stub

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

                default_config.rpcs.get_entry_group.timeout = 60.0
                default_config.rpcs.get_entry_group.retry_policy = {
                  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
                }

                default_config.rpcs.list_entry_groups.timeout = 60.0
                default_config.rpcs.list_entry_groups.retry_policy = {
                  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
                }

                default_config.rpcs.get_entry.timeout = 60.0
                default_config.rpcs.get_entry.retry_policy = {
                  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
                }

                default_config.rpcs.lookup_entry.timeout = 60.0
                default_config.rpcs.lookup_entry.retry_policy = {
                  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
                }

                default_config.rpcs.list_entries.timeout = 60.0
                default_config.rpcs.list_entries.retry_policy = {
                  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
                }

                default_config.rpcs.list_tags.timeout = 60.0
                default_config.rpcs.list_tags.retry_policy = {
                  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
                }

                default_config.rpcs.get_iam_policy.timeout = 60.0
                default_config.rpcs.get_iam_policy.retry_policy = {
                  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
                }

                default_config
              end
              yield @configure if block_given?
              @configure
            end

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

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

            # Service calls

            ##
            # Searches Data Catalog for multiple resources like entries and tags that
            # match a query.
            #
            # This is a [Custom Method]
            # (https://cloud.google.com/apis/design/custom_methods) that doesn't return
            # all information on a resource, only its ID and high level fields. To get
            # more information, you can subsequently call specific get methods.
            #
            # Note: Data Catalog search queries don't guarantee full recall. Results
            # that match your query might not be returned, even in subsequent
            # result pages. Additionally, returned (and not returned) results can vary
            # if you repeat search queries.
            #
            # For more information, see [Data Catalog search syntax]
            # (https://cloud.google.com/data-catalog/docs/how-to/search-reference).
            #
            # @overload search_catalog(request, options = nil)
            #   Pass arguments to `search_catalog` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::SearchCatalogRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::SearchCatalogRequest, ::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 search_catalog(scope: nil, query: nil, page_size: nil, page_token: nil, order_by: nil)
            #   Pass arguments to `search_catalog` 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 scope [::Google::Cloud::DataCatalog::V1::SearchCatalogRequest::Scope, ::Hash]
            #     Required. The scope of this search request.
            #
            #     The `scope` is invalid if `include_org_ids`, `include_project_ids` are
            #     empty AND `include_gcp_public_datasets` is set to `false`. In this case,
            #     the request returns an error.
            #   @param query [::String]
            #     Optional. The query string with a minimum of 3 characters and specific syntax.
            #     For more information, see
            #     [Data Catalog search
            #     syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference).
            #
            #     An empty query string returns all data assets (in the specified scope)
            #     that you have access to.
            #
            #     A query string can be a simple `xyz` or qualified by predicates:
            #
            #     * `name:x`
            #     * `column:y`
            #     * `description:z`
            #   @param page_size [::Integer]
            #     Number of results to return in a single search page.
            #
            #     Can't be negative or 0, defaults to 10 in this case.
            #     The maximum number is 1000. If exceeded, throws an "invalid argument"
            #     exception.
            #   @param page_token [::String]
            #     Optional. Pagination token that, if specified, returns the next page of search
            #     results. If empty, returns the first page.
            #
            #     This token is returned in the {::Google::Cloud::DataCatalog::V1::SearchCatalogResponse#next_page_token SearchCatalogResponse.next_page_token}
            #     field of the response to a previous
            #     {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#search_catalog SearchCatalogRequest}
            #     call.
            #   @param order_by [::String]
            #     Specifies the order of results.
            #
            #     Currently supported case-sensitive values are:
            #
            #     * `relevance` that can only be descending
            #     * `last_modified_timestamp [asc|desc]` with descending (`desc`) as default
            #     * `default` that can only be descending
            #
            #     If this parameter is omitted, it defaults to the descending `relevance`.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::SearchCatalogResult>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::SearchCatalogResult>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::SearchCatalogRequest.new
            #
            #   # Call the search_catalog method.
            #   result = client.search_catalog request
            #
            #   # The returned object is of type Gapic::PagedEnumerable. You can
            #   # iterate over all elements by calling #each, and the enumerable
            #   # will lazily make API calls to fetch subsequent pages. Other
            #   # methods are also available for managing paging directly.
            #   result.each do |response|
            #     # Each element is of type ::Google::Cloud::DataCatalog::V1::SearchCatalogResult.
            #     p response
            #   end
            #
            def search_catalog request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::SearchCatalogRequest

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

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

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

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

            ##
            # Creates an entry group.
            #
            # An entry group contains logically related entries together with [Cloud
            # Identity and Access Management](/data-catalog/docs/concepts/iam) policies.
            # These policies specify users who can create, edit, and view entries
            # within entry groups.
            #
            # Data Catalog automatically creates entry groups with names that start with
            # the `@` symbol for the following resources:
            #
            # * BigQuery entries (`@bigquery`)
            # * Pub/Sub topics (`@pubsub`)
            # * Dataproc Metastore services (`@dataproc_metastore_{SERVICE_NAME_HASH}`)
            #
            # You can create your own entry groups for Cloud Storage fileset entries
            # and custom entries together with the corresponding IAM policies.
            # User-created entry groups can't contain the `@` symbol, it is reserved
            # for automatically created groups.
            #
            # Entry groups, like entries, can be searched.
            #
            # A maximum of 10,000 entry groups may be created per organization across all
            # locations.
            #
            # You must enable the Data Catalog API in the project identified by
            # the `parent` parameter. For more information, see [Data Catalog resource
            # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project).
            #
            # @overload create_entry_group(request, options = nil)
            #   Pass arguments to `create_entry_group` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest, ::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_entry_group(parent: nil, entry_group_id: nil, entry_group: nil)
            #   Pass arguments to `create_entry_group` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The names of the project and location that the new entry group belongs to.
            #
            #     Note: The entry group itself and its child resources might not be
            #     stored in the location specified in its name.
            #   @param entry_group_id [::String]
            #     Required. The ID of the entry group to create.
            #
            #     The ID must contain only letters (a-z, A-Z), numbers (0-9),
            #     underscores (_), and must start with a letter or underscore.
            #     The maximum size is 64 bytes when encoded in UTF-8.
            #   @param entry_group [::Google::Cloud::DataCatalog::V1::EntryGroup, ::Hash]
            #     The entry group to create. Defaults to empty.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::EntryGroup]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::EntryGroup]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest.new
            #
            #   # Call the create_entry_group method.
            #   result = client.create_entry_group request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup.
            #   p result
            #
            def create_entry_group request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :create_entry_group, 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 entry group.
            #
            # @overload get_entry_group(request, options = nil)
            #   Pass arguments to `get_entry_group` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest, ::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_entry_group(name: nil, read_mask: nil)
            #   Pass arguments to `get_entry_group` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the entry group to get.
            #   @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     The fields to return. If empty or omitted, all fields are returned.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::EntryGroup]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::EntryGroup]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::GetEntryGroupRequest.new
            #
            #   # Call the get_entry_group method.
            #   result = client.get_entry_group request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup.
            #   p result
            #
            def get_entry_group request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :get_entry_group, 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 entry group.
            #
            # You must enable the Data Catalog API in the project identified by
            # the `entry_group.name` parameter. For more information, see [Data Catalog
            # resource
            # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project).
            #
            # @overload update_entry_group(request, options = nil)
            #   Pass arguments to `update_entry_group` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest, ::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_entry_group(entry_group: nil, update_mask: nil)
            #   Pass arguments to `update_entry_group` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param entry_group [::Google::Cloud::DataCatalog::V1::EntryGroup, ::Hash]
            #     Required. Updates for the entry group. The `name` field must be set.
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     Names of fields whose values to overwrite on an entry group.
            #
            #     If this parameter is absent or empty, all modifiable fields
            #     are overwritten. If such fields are non-required and omitted in the
            #     request body, their values are emptied.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::EntryGroup]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::EntryGroup]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest.new
            #
            #   # Call the update_entry_group method.
            #   result = client.update_entry_group request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup.
            #   p result
            #
            def update_entry_group request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :update_entry_group, 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 entry group.
            #
            # You must enable the Data Catalog API in the project
            # identified by the `name` parameter. For more information, see [Data Catalog
            # resource
            # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project).
            #
            # @overload delete_entry_group(request, options = nil)
            #   Pass arguments to `delete_entry_group` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest, ::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_entry_group(name: nil, force: nil)
            #   Pass arguments to `delete_entry_group` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param name [::String]
            #     Required. The name of the entry group to delete.
            #   @param force [::Boolean]
            #     Optional. If true, deletes all entries in the entry group.
            #
            # @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.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest.new
            #
            #   # Call the delete_entry_group method.
            #   result = client.delete_entry_group request
            #
            #   # The returned object is of type Google::Protobuf::Empty.
            #   p result
            #
            def delete_entry_group request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :delete_entry_group, 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 entry groups.
            #
            # @overload list_entry_groups(request, options = nil)
            #   Pass arguments to `list_entry_groups` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest, ::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_entry_groups(parent: nil, page_size: nil, page_token: nil)
            #   Pass arguments to `list_entry_groups` via keyword arguments. Note that at
            #   least one keyword argument is required. To specify no parameters, or to keep all
            #   the default parameter values, pass an empty Hash as a request object (see above).
            #
            #   @param parent [::String]
            #     Required. The name of the location that contains the entry groups to list.
            #
            #     Can be provided as a URL.
            #   @param page_size [::Integer]
            #     Optional. The maximum number of items to return.
            #
            #     Default is 10. Maximum limit is 1000.
            #     Throws an invalid argument if `page_size` is greater than 1000.
            #   @param page_token [::String]
            #     Optional. Pagination token that specifies the next page to return.
            #     If empty, returns the first page.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::EntryGroup>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::EntryGroup>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest.new
            #
            #   # Call the list_entry_groups method.
            #   result = client.list_entry_groups request
            #
            #   # The returned object is of type Gapic::PagedEnumerable. You can
            #   # iterate over all elements by calling #each, and the enumerable
            #   # will lazily make API calls to fetch subsequent pages. Other
            #   # methods are also available for managing paging directly.
            #   result.each do |response|
            #     # Each element is of type ::Google::Cloud::DataCatalog::V1::EntryGroup.
            #     p response
            #   end
            #
            def list_entry_groups request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest

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

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

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

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

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

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

            ##
            # Creates an entry.
            #
            # You can create entries only with 'FILESET', 'CLUSTER', 'DATA_STREAM',
            # or custom types. Data Catalog automatically creates entries with other
            # types during metadata ingestion from integrated systems.
            #
            # You must enable the Data Catalog API in the project identified by
            # the `parent` parameter. For more information, see [Data Catalog resource
            # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project).
            #
            # An entry group can have a maximum of 100,000 entries.
            #
            # @overload create_entry(request, options = nil)
            #   Pass arguments to `create_entry` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::CreateEntryRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::CreateEntryRequest, ::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_entry(parent: nil, entry_id: nil, entry: nil)
            #   Pass arguments to `create_entry` 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 name of the entry group this entry belongs to.
            #
            #     Note: The entry itself and its child resources might not be stored in
            #     the location specified in its name.
            #   @param entry_id [::String]
            #     Required. The ID of the entry to create.
            #
            #     The ID must contain only letters (a-z, A-Z), numbers (0-9),
            #     and underscores (_).
            #     The maximum size is 64 bytes when encoded in UTF-8.
            #   @param entry [::Google::Cloud::DataCatalog::V1::Entry, ::Hash]
            #     Required. The entry to create.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::Entry]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::Entry]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::CreateEntryRequest.new
            #
            #   # Call the create_entry method.
            #   result = client.create_entry request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::Entry.
            #   p result
            #
            def create_entry request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateEntryRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :create_entry, 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 existing entry.
            #
            # You must enable the Data Catalog API in the project identified by
            # the `entry.name` parameter. For more information, see [Data Catalog
            # resource
            # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project).
            #
            # @overload update_entry(request, options = nil)
            #   Pass arguments to `update_entry` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::UpdateEntryRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::UpdateEntryRequest, ::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_entry(entry: nil, update_mask: nil)
            #   Pass arguments to `update_entry` 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 entry [::Google::Cloud::DataCatalog::V1::Entry, ::Hash]
            #     Required. Updates for the entry. The `name` field must be set.
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     Names of fields whose values to overwrite on an entry.
            #
            #     If this parameter is absent or empty, all modifiable fields
            #     are overwritten. If such fields are non-required and omitted in the
            #     request body, their values are emptied.
            #
            #     You can modify only the fields listed below.
            #
            #     For entries with type `DATA_STREAM`:
            #
            #     * `schema`
            #
            #     For entries with type `FILESET`:
            #
            #     * `schema`
            #     * `display_name`
            #     * `description`
            #     * `gcs_fileset_spec`
            #     * `gcs_fileset_spec.file_patterns`
            #
            #     For entries with `user_specified_type`:
            #
            #     * `schema`
            #     * `display_name`
            #     * `description`
            #     * `user_specified_type`
            #     * `user_specified_system`
            #     * `linked_resource`
            #     * `source_system_timestamps`
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::Entry]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::Entry]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::UpdateEntryRequest.new
            #
            #   # Call the update_entry method.
            #   result = client.update_entry request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::Entry.
            #   p result
            #
            def update_entry request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateEntryRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :update_entry, 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 existing entry.
            #
            # You can delete only the entries created by the
            # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry CreateEntry}
            # method.
            #
            # You must enable the Data Catalog API in the project identified by
            # the `name` parameter. For more information, see [Data Catalog
            # resource
            # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project).
            #
            # @overload delete_entry(request, options = nil)
            #   Pass arguments to `delete_entry` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::DeleteEntryRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::DeleteEntryRequest, ::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_entry(name: nil)
            #   Pass arguments to `delete_entry` 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 entry 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.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::DeleteEntryRequest.new
            #
            #   # Call the delete_entry method.
            #   result = client.delete_entry request
            #
            #   # The returned object is of type Google::Protobuf::Empty.
            #   p result
            #
            def delete_entry request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteEntryRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :delete_entry, 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 entry.
            #
            # @overload get_entry(request, options = nil)
            #   Pass arguments to `get_entry` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::GetEntryRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::GetEntryRequest, ::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_entry(name: nil)
            #   Pass arguments to `get_entry` 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 entry to get.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::Entry]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::Entry]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::GetEntryRequest.new
            #
            #   # Call the get_entry method.
            #   result = client.get_entry request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::Entry.
            #   p result
            #
            def get_entry request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetEntryRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :get_entry, 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 entry by its target resource name.
            #
            # The resource name comes from the source Google Cloud Platform service.
            #
            # @overload lookup_entry(request, options = nil)
            #   Pass arguments to `lookup_entry` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::LookupEntryRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::LookupEntryRequest, ::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 lookup_entry(linked_resource: nil, sql_resource: nil, fully_qualified_name: nil)
            #   Pass arguments to `lookup_entry` 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 linked_resource [::String]
            #     The full name of the Google Cloud Platform resource the Data Catalog
            #     entry represents. For more information, see [Full Resource Name]
            #     (https://cloud.google.com/apis/design/resource_names#full_resource_name).
            #
            #     Full names are case-sensitive. For example:
            #
            #      * `//bigquery.googleapis.com/projects/{PROJECT_ID}/datasets/{DATASET_ID}/tables/{TABLE_ID}`
            #      * `//pubsub.googleapis.com/projects/{PROJECT_ID}/topics/{TOPIC_ID}`
            #   @param sql_resource [::String]
            #     The SQL name of the entry. SQL names are case-sensitive.
            #
            #     Examples:
            #
            #     * `pubsub.topic.{PROJECT_ID}.{TOPIC_ID}`
            #     * `pubsub.topic.{PROJECT_ID}.`\``{TOPIC.ID.SEPARATED.WITH.DOTS}`\`
            #     * `bigquery.table.{PROJECT_ID}.{DATASET_ID}.{TABLE_ID}`
            #     * `bigquery.dataset.{PROJECT_ID}.{DATASET_ID}`
            #     * `datacatalog.entry.{PROJECT_ID}.{LOCATION_ID}.{ENTRY_GROUP_ID}.{ENTRY_ID}`
            #
            #     Identifiers (`*_ID`) should comply with the
            #     [Lexical structure in Standard SQL]
            #     (https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical).
            #   @param fully_qualified_name [::String]
            #     Fully qualified name (FQN) of the resource.
            #
            #     FQNs take two forms:
            #
            #     * For non-regionalized resources:
            #
            #       `{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}`
            #
            #     * For regionalized resources:
            #
            #       `{SYSTEM}:{PROJECT}.{LOCATION_ID}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}`
            #
            #     Example for a DPMS table:
            #
            #     `dataproc_metastore:{PROJECT_ID}.{LOCATION_ID}.{INSTANCE_ID}.{DATABASE_ID}.{TABLE_ID}`
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::Entry]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::Entry]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::LookupEntryRequest.new
            #
            #   # Call the lookup_entry method.
            #   result = client.lookup_entry request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::Entry.
            #   p result
            #
            def lookup_entry request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::LookupEntryRequest

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

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

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

              @data_catalog_stub.call_rpc :lookup_entry, 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 entries.
            #
            # Note: Currently, this method can list only custom entries.
            # To get a list of both custom and automatically created entries, use
            # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#search_catalog SearchCatalog}.
            #
            # @overload list_entries(request, options = nil)
            #   Pass arguments to `list_entries` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::ListEntriesRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::ListEntriesRequest, ::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_entries(parent: nil, page_size: nil, page_token: nil, read_mask: nil)
            #   Pass arguments to `list_entries` 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 name of the entry group that contains the entries to list.
            #
            #     Can be provided in URL format.
            #   @param page_size [::Integer]
            #     The maximum number of items to return. Default is 10. Maximum limit is
            #     1000. Throws an invalid argument if `page_size` is more than 1000.
            #   @param page_token [::String]
            #     Pagination token that specifies the next page to return. If empty, the
            #     first page is returned.
            #   @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     The fields to return for each entry. If empty or omitted, all
            #     fields are returned.
            #
            #     For example, to return a list of entries with only the `name` field,
            #     set `read_mask` to only one path with the `name` value.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Entry>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Entry>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::ListEntriesRequest.new
            #
            #   # Call the list_entries method.
            #   result = client.list_entries request
            #
            #   # The returned object is of type Gapic::PagedEnumerable. You can
            #   # iterate over all elements by calling #each, and the enumerable
            #   # will lazily make API calls to fetch subsequent pages. Other
            #   # methods are also available for managing paging directly.
            #   result.each do |response|
            #     # Each element is of type ::Google::Cloud::DataCatalog::V1::Entry.
            #     p response
            #   end
            #
            def list_entries request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListEntriesRequest

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

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

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

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

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

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

            ##
            # Modifies entry overview, part of the business context of an
            # {::Google::Cloud::DataCatalog::V1::Entry Entry}.
            #
            # To call this method, you must have the `datacatalog.entries.updateOverview`
            # IAM permission on the corresponding project.
            #
            # @overload modify_entry_overview(request, options = nil)
            #   Pass arguments to `modify_entry_overview` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest, ::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 modify_entry_overview(name: nil, entry_overview: nil)
            #   Pass arguments to `modify_entry_overview` 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 full resource name of the entry.
            #   @param entry_overview [::Google::Cloud::DataCatalog::V1::EntryOverview, ::Hash]
            #     Required. The new value for the Entry Overview.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::EntryOverview]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::EntryOverview]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest.new
            #
            #   # Call the modify_entry_overview method.
            #   result = client.modify_entry_overview request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::EntryOverview.
            #   p result
            #
            def modify_entry_overview request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :modify_entry_overview, 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

            ##
            # Modifies contacts, part of the business context of an
            # {::Google::Cloud::DataCatalog::V1::Entry Entry}.
            #
            # To call this method, you must have the `datacatalog.entries.updateContacts`
            # IAM permission on the corresponding project.
            #
            # @overload modify_entry_contacts(request, options = nil)
            #   Pass arguments to `modify_entry_contacts` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest, ::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 modify_entry_contacts(name: nil, contacts: nil)
            #   Pass arguments to `modify_entry_contacts` 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 full resource name of the entry.
            #   @param contacts [::Google::Cloud::DataCatalog::V1::Contacts, ::Hash]
            #     Required. The new value for the Contacts.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::Contacts]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::Contacts]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest.new
            #
            #   # Call the modify_entry_contacts method.
            #   result = client.modify_entry_contacts request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::Contacts.
            #   p result
            #
            def modify_entry_contacts request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :modify_entry_contacts, 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 tag template.
            #
            # You must enable the Data Catalog API in the project identified by the
            # `parent` parameter.
            # For more information, see [Data Catalog resource project]
            # (https://cloud.google.com/data-catalog/docs/concepts/resource-project).
            #
            # @overload create_tag_template(request, options = nil)
            #   Pass arguments to `create_tag_template` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest, ::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_tag_template(parent: nil, tag_template_id: nil, tag_template: nil)
            #   Pass arguments to `create_tag_template` 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 name of the project and the template location
            #     [region](https://cloud.google.com/data-catalog/docs/concepts/regions).
            #   @param tag_template_id [::String]
            #     Required. The ID of the tag template to create.
            #
            #     The ID must contain only lowercase letters (a-z), numbers (0-9),
            #     or underscores (_), and must start with a letter or underscore.
            #     The maximum size is 64 bytes when encoded in UTF-8.
            #   @param tag_template [::Google::Cloud::DataCatalog::V1::TagTemplate, ::Hash]
            #     Required. The tag template to create.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplate]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::TagTemplate]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest.new
            #
            #   # Call the create_tag_template method.
            #   result = client.create_tag_template request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate.
            #   p result
            #
            def create_tag_template request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :create_tag_template, 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 tag template.
            #
            # @overload get_tag_template(request, options = nil)
            #   Pass arguments to `get_tag_template` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest, ::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_tag_template(name: nil)
            #   Pass arguments to `get_tag_template` 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 tag template to get.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplate]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::TagTemplate]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::GetTagTemplateRequest.new
            #
            #   # Call the get_tag_template method.
            #   result = client.get_tag_template request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate.
            #   p result
            #
            def get_tag_template request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :get_tag_template, 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 tag template.
            #
            # You can't update template fields with this method. These fields are
            # separate resources with their own create, update, and delete methods.
            #
            # You must enable the Data Catalog API in the project identified by
            # the `tag_template.name` parameter. For more information, see [Data Catalog
            # resource
            # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project).
            #
            # @overload update_tag_template(request, options = nil)
            #   Pass arguments to `update_tag_template` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest, ::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_tag_template(tag_template: nil, update_mask: nil)
            #   Pass arguments to `update_tag_template` 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 tag_template [::Google::Cloud::DataCatalog::V1::TagTemplate, ::Hash]
            #     Required. The template to update. The `name` field must be set.
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     Names of fields whose values to overwrite on a tag template. Currently,
            #     only `display_name` and `is_publicly_readable` can be overwritten.
            #
            #     If this parameter is absent or empty, all modifiable fields
            #     are overwritten. If such fields are non-required and omitted in the
            #     request body, their values are emptied.
            #
            #     Note: Updating the `is_publicly_readable` field may require up to 12
            #     hours to take effect in search results.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplate]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::TagTemplate]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest.new
            #
            #   # Call the update_tag_template method.
            #   result = client.update_tag_template request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate.
            #   p result
            #
            def update_tag_template request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :update_tag_template, 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 a tag template and all tags that use it.
            #
            # You must enable the Data Catalog API in the project identified by
            # the `name` parameter. For more information, see [Data Catalog resource
            # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project).
            #
            # @overload delete_tag_template(request, options = nil)
            #   Pass arguments to `delete_tag_template` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest, ::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_tag_template(name: nil, force: nil)
            #   Pass arguments to `delete_tag_template` 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 tag template to delete.
            #   @param force [::Boolean]
            #     Required. If true, deletes all tags that use this template.
            #
            #     Currently, `true` is the only supported value.
            #
            # @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.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest.new
            #
            #   # Call the delete_tag_template method.
            #   result = client.delete_tag_template request
            #
            #   # The returned object is of type Google::Protobuf::Empty.
            #   p result
            #
            def delete_tag_template request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :delete_tag_template, 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 field in a tag template.
            #
            # You must enable the Data Catalog API in the project identified by
            # the `parent` parameter. For more information, see [Data Catalog resource
            # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project).
            #
            # @overload create_tag_template_field(request, options = nil)
            #   Pass arguments to `create_tag_template_field` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest, ::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_tag_template_field(parent: nil, tag_template_field_id: nil, tag_template_field: nil)
            #   Pass arguments to `create_tag_template_field` 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 name of the project and the template location
            #     [region](https://cloud.google.com/data-catalog/docs/concepts/regions).
            #   @param tag_template_field_id [::String]
            #     Required. The ID of the tag template field to create.
            #
            #     Note: Adding a required field to an existing template is *not* allowed.
            #
            #     Field IDs can contain letters (both uppercase and lowercase), numbers
            #     (0-9), underscores (_) and dashes (-). Field IDs must be at least 1
            #     character long and at most 128 characters long. Field IDs must also be
            #     unique within their template.
            #   @param tag_template_field [::Google::Cloud::DataCatalog::V1::TagTemplateField, ::Hash]
            #     Required. The tag template field to create.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplateField]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest.new
            #
            #   # Call the create_tag_template_field method.
            #   result = client.create_tag_template_field request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField.
            #   p result
            #
            def create_tag_template_field request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :create_tag_template_field, 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 field in a tag template.
            #
            # You can't update the field type with this method.
            #
            # You must enable the Data Catalog API in the project
            # identified by the `name` parameter. For more information, see [Data Catalog
            # resource
            # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project).
            #
            # @overload update_tag_template_field(request, options = nil)
            #   Pass arguments to `update_tag_template_field` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest, ::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_tag_template_field(name: nil, tag_template_field: nil, update_mask: nil)
            #   Pass arguments to `update_tag_template_field` 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 tag template field.
            #   @param tag_template_field [::Google::Cloud::DataCatalog::V1::TagTemplateField, ::Hash]
            #     Required. The template to update.
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     Optional. Names of fields whose values to overwrite on an individual field of a tag
            #     template. The following fields are modifiable:
            #
            #     * `display_name`
            #     * `type.enum_type`
            #     * `is_required`
            #
            #     If this parameter is absent or empty, all modifiable fields
            #     are overwritten. If such fields are non-required and omitted in the request
            #     body, their values are emptied with one exception: when updating an enum
            #     type, the provided values are merged with the existing values. Therefore,
            #     enum values can only be added, existing enum values cannot be deleted or
            #     renamed.
            #
            #     Additionally, updating a template field from optional to required is
            #     *not* allowed.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplateField]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest.new
            #
            #   # Call the update_tag_template_field method.
            #   result = client.update_tag_template_field request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField.
            #   p result
            #
            def update_tag_template_field request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :update_tag_template_field, 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

            ##
            # Renames a field in a tag template.
            #
            # You must enable the Data Catalog API in the project identified by the
            # `name` parameter. For more information, see [Data Catalog resource project]
            # (https://cloud.google.com/data-catalog/docs/concepts/resource-project).
            #
            # @overload rename_tag_template_field(request, options = nil)
            #   Pass arguments to `rename_tag_template_field` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest, ::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 rename_tag_template_field(name: nil, new_tag_template_field_id: nil)
            #   Pass arguments to `rename_tag_template_field` 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 tag template field.
            #   @param new_tag_template_field_id [::String]
            #     Required. The new ID of this tag template field. For example, `my_new_field`.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplateField]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest.new
            #
            #   # Call the rename_tag_template_field method.
            #   result = client.rename_tag_template_field request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField.
            #   p result
            #
            def rename_tag_template_field request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :rename_tag_template_field, 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

            ##
            # Renames an enum value in a tag template.
            #
            # Within a single enum field, enum values must be unique.
            #
            # @overload rename_tag_template_field_enum_value(request, options = nil)
            #   Pass arguments to `rename_tag_template_field_enum_value` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest, ::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 rename_tag_template_field_enum_value(name: nil, new_enum_value_display_name: nil)
            #   Pass arguments to `rename_tag_template_field_enum_value` 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 enum field value.
            #   @param new_enum_value_display_name [::String]
            #     Required. The new display name of the enum value. For example, `my_new_enum_value`.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplateField]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest.new
            #
            #   # Call the rename_tag_template_field_enum_value method.
            #   result = client.rename_tag_template_field_enum_value request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField.
            #   p result
            #
            def rename_tag_template_field_enum_value request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :rename_tag_template_field_enum_value, 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 a field in a tag template and all uses of this field from the tags
            # based on this template.
            #
            # You must enable the Data Catalog API in the project identified by
            # the `name` parameter. For more information, see [Data Catalog resource
            # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project).
            #
            # @overload delete_tag_template_field(request, options = nil)
            #   Pass arguments to `delete_tag_template_field` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest, ::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_tag_template_field(name: nil, force: nil)
            #   Pass arguments to `delete_tag_template_field` 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 tag template field to delete.
            #   @param force [::Boolean]
            #     Required. If true, deletes this field from any tags that use it.
            #
            #     Currently, `true` is the only supported value.
            #
            # @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.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest.new
            #
            #   # Call the delete_tag_template_field method.
            #   result = client.delete_tag_template_field request
            #
            #   # The returned object is of type Google::Protobuf::Empty.
            #   p result
            #
            def delete_tag_template_field request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :delete_tag_template_field, 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 tag and assigns it to:
            #
            # * An {::Google::Cloud::DataCatalog::V1::Entry Entry} if the method name is
            #   `projects.locations.entryGroups.entries.tags.create`.
            # * Or {::Google::Cloud::DataCatalog::V1::EntryGroup EntryGroup}if the method
            #   name is `projects.locations.entryGroups.tags.create`.
            #
            # Note: The project identified by the `parent` parameter for the [tag]
            # (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters)
            # and the [tag template]
            # (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters)
            # used to create the tag must be in the same organization.
            #
            # @overload create_tag(request, options = nil)
            #   Pass arguments to `create_tag` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::CreateTagRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::CreateTagRequest, ::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_tag(parent: nil, tag: nil)
            #   Pass arguments to `create_tag` 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 name of the resource to attach this tag to.
            #
            #     Tags can be attached to entries or entry groups. An entry can have up to
            #     1000 attached tags.
            #
            #     Note: The tag and its child resources might not be stored in
            #     the location specified in its name.
            #   @param tag [::Google::Cloud::DataCatalog::V1::Tag, ::Hash]
            #     Required. The tag to create.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::Tag]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::Tag]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::CreateTagRequest.new
            #
            #   # Call the create_tag method.
            #   result = client.create_tag request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::Tag.
            #   p result
            #
            def create_tag request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateTagRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :create_tag, 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 existing tag.
            #
            # @overload update_tag(request, options = nil)
            #   Pass arguments to `update_tag` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::UpdateTagRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::UpdateTagRequest, ::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_tag(tag: nil, update_mask: nil)
            #   Pass arguments to `update_tag` 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 tag [::Google::Cloud::DataCatalog::V1::Tag, ::Hash]
            #     Required. The updated tag. The "name" field must be set.
            #   @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
            #     Names of fields whose values to overwrite on a tag. Currently, a tag has
            #     the only modifiable field with the name `fields`.
            #
            #     In general, if this parameter is absent or empty, all modifiable fields
            #     are overwritten. If such fields are non-required and omitted in the
            #     request body, their values are emptied.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::Tag]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::Tag]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::UpdateTagRequest.new
            #
            #   # Call the update_tag method.
            #   result = client.update_tag request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::Tag.
            #   p result
            #
            def update_tag request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateTagRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :update_tag, 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 a tag.
            #
            # @overload delete_tag(request, options = nil)
            #   Pass arguments to `delete_tag` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::DeleteTagRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::DeleteTagRequest, ::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_tag(name: nil)
            #   Pass arguments to `delete_tag` 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 tag 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.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::DeleteTagRequest.new
            #
            #   # Call the delete_tag method.
            #   result = client.delete_tag request
            #
            #   # The returned object is of type Google::Protobuf::Empty.
            #   p result
            #
            def delete_tag request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteTagRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :delete_tag, 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 tags assigned to an {::Google::Cloud::DataCatalog::V1::Entry Entry}.
            # The {::Google::Cloud::DataCatalog::V1::Tag#column columns} in the response are
            # lowercased.
            #
            # @overload list_tags(request, options = nil)
            #   Pass arguments to `list_tags` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::ListTagsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::ListTagsRequest, ::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_tags(parent: nil, page_size: nil, page_token: nil)
            #   Pass arguments to `list_tags` 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 name of the Data Catalog resource to list the tags of.
            #
            #     The resource can be an {::Google::Cloud::DataCatalog::V1::Entry Entry}
            #     or an {::Google::Cloud::DataCatalog::V1::EntryGroup EntryGroup}
            #     (without `/entries/{entries}` at the end).
            #   @param page_size [::Integer]
            #     The maximum number of tags to return. Default is 10. Maximum limit is 1000.
            #   @param page_token [::String]
            #     Pagination token that specifies the next page to return. If empty, the
            #     first page is returned.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Tag>]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Tag>]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::ListTagsRequest.new
            #
            #   # Call the list_tags method.
            #   result = client.list_tags request
            #
            #   # The returned object is of type Gapic::PagedEnumerable. You can
            #   # iterate over all elements by calling #each, and the enumerable
            #   # will lazily make API calls to fetch subsequent pages. Other
            #   # methods are also available for managing paging directly.
            #   result.each do |response|
            #     # Each element is of type ::Google::Cloud::DataCatalog::V1::Tag.
            #     p response
            #   end
            #
            def list_tags request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListTagsRequest

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

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

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

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

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

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

            ##
            # Marks an {::Google::Cloud::DataCatalog::V1::Entry Entry} as starred by
            # the current user. Starring information is private to each user.
            #
            # @overload star_entry(request, options = nil)
            #   Pass arguments to `star_entry` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::StarEntryRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::StarEntryRequest, ::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 star_entry(name: nil)
            #   Pass arguments to `star_entry` 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 entry to mark as starred.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::StarEntryResponse]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::StarEntryResponse]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::StarEntryRequest.new
            #
            #   # Call the star_entry method.
            #   result = client.star_entry request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::StarEntryResponse.
            #   p result
            #
            def star_entry request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::StarEntryRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :star_entry, 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

            ##
            # Marks an {::Google::Cloud::DataCatalog::V1::Entry Entry} as NOT starred by
            # the current user. Starring information is private to each user.
            #
            # @overload unstar_entry(request, options = nil)
            #   Pass arguments to `unstar_entry` via a request object, either of type
            #   {::Google::Cloud::DataCatalog::V1::UnstarEntryRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Cloud::DataCatalog::V1::UnstarEntryRequest, ::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 unstar_entry(name: nil)
            #   Pass arguments to `unstar_entry` 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 entry to mark as **not** starred.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Cloud::DataCatalog::V1::UnstarEntryResponse]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Cloud::DataCatalog::V1::UnstarEntryResponse]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Cloud::DataCatalog::V1::UnstarEntryRequest.new
            #
            #   # Call the unstar_entry method.
            #   result = client.unstar_entry request
            #
            #   # The returned object is of type Google::Cloud::DataCatalog::V1::UnstarEntryResponse.
            #   p result
            #
            def unstar_entry request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UnstarEntryRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :unstar_entry, 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

            ##
            # Sets an access control policy for a resource. Replaces any existing
            # policy.
            #
            # Supported resources are:
            #
            # - Tag templates
            # - Entry groups
            #
            # Note: This method sets policies only within Data Catalog and can't be
            # used to manage policies in BigQuery, Pub/Sub, Dataproc Metastore, and any
            # external Google Cloud Platform resources synced with the Data Catalog.
            #
            # To call this method, you must have the following Google IAM permissions:
            #
            # - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag
            #   templates.
            # - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups.
            #
            # @overload set_iam_policy(request, options = nil)
            #   Pass arguments to `set_iam_policy` via a request object, either of type
            #   {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Iam::V1::SetIamPolicyRequest, ::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 set_iam_policy(resource: nil, policy: nil)
            #   Pass arguments to `set_iam_policy` 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 resource [::String]
            #     REQUIRED: The resource for which the policy is being specified.
            #     See the operation documentation for the appropriate value for this field.
            #   @param policy [::Google::Iam::V1::Policy, ::Hash]
            #     REQUIRED: The complete policy to be applied to the `resource`. The size of
            #     the policy is limited to a few 10s of KB. An empty policy is a
            #     valid policy but certain Cloud Platform services (such as Projects)
            #     might reject them.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Iam::V1::Policy]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Iam::V1::Policy]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Iam::V1::SetIamPolicyRequest.new
            #
            #   # Call the set_iam_policy method.
            #   result = client.set_iam_policy request
            #
            #   # The returned object is of type Google::Iam::V1::Policy.
            #   p result
            #
            def set_iam_policy request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :set_iam_policy, 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 the access control policy for a resource.
            #
            # May return:
            #
            # * A`NOT_FOUND` error if the resource doesn't exist or you don't have the
            #   permission to view it.
            # * An empty policy if the resource exists but doesn't have a set policy.
            #
            # Supported resources are:
            #
            # - Tag templates
            # - Entry groups
            #
            # Note: This method doesn't get policies from Google Cloud Platform
            # resources ingested into Data Catalog.
            #
            # To call this method, you must have the following Google IAM permissions:
            #
            # - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag
            #   templates.
            # - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups.
            #
            # @overload get_iam_policy(request, options = nil)
            #   Pass arguments to `get_iam_policy` via a request object, either of type
            #   {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Iam::V1::GetIamPolicyRequest, ::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_iam_policy(resource: nil, options: nil)
            #   Pass arguments to `get_iam_policy` 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 resource [::String]
            #     REQUIRED: The resource for which the policy is being requested.
            #     See the operation documentation for the appropriate value for this field.
            #   @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
            #     OPTIONAL: A `GetPolicyOptions` object for specifying options to
            #     `GetIamPolicy`. This field is only used by Cloud IAM.
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Iam::V1::Policy]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Iam::V1::Policy]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Iam::V1::GetIamPolicyRequest.new
            #
            #   # Call the get_iam_policy method.
            #   result = client.get_iam_policy request
            #
            #   # The returned object is of type Google::Iam::V1::Policy.
            #   p result
            #
            def get_iam_policy request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :get_iam_policy, 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 your permissions on a resource.
            #
            # Returns an empty set of permissions if the resource doesn't exist.
            #
            # Supported resources are:
            #
            # - Tag templates
            # - Entry groups
            #
            # Note: This method gets policies only within Data Catalog and can't be
            # used to get policies from BigQuery, Pub/Sub, Dataproc Metastore, and any
            # external Google Cloud Platform resources ingested into Data Catalog.
            #
            # No Google IAM permissions are required to call this method.
            #
            # @overload test_iam_permissions(request, options = nil)
            #   Pass arguments to `test_iam_permissions` via a request object, either of type
            #   {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
            #
            #   @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::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 test_iam_permissions(resource: nil, permissions: nil)
            #   Pass arguments to `test_iam_permissions` 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 resource [::String]
            #     REQUIRED: The resource for which the policy detail is being requested.
            #     See the operation documentation for the appropriate value for this field.
            #   @param permissions [::Array<::String>]
            #     The set of permissions to check for the `resource`. Permissions with
            #     wildcards (such as '*' or 'storage.*') are not allowed. For more
            #     information see
            #     [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
            #
            # @yield [response, operation] Access the result along with the RPC operation
            # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
            # @yieldparam operation [::GRPC::ActiveCall::Operation]
            #
            # @return [::Google::Iam::V1::TestIamPermissionsResponse]
            #
            # @raise [::Google::Cloud::Error] if the RPC is aborted.
            #
            # @example Basic example
            #   require "google/cloud/data_catalog/v1"
            #
            #   # Create a client object. The client can be reused for multiple calls.
            #   client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
            #
            #   # Create a request. To set request fields, pass in keyword arguments.
            #   request = Google::Iam::V1::TestIamPermissionsRequest.new
            #
            #   # Call the test_iam_permissions method.
            #   result = client.test_iam_permissions request
            #
            #   # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
            #   p result
            #
            def test_iam_permissions request, options = nil
              raise ::ArgumentError, "request must be provided" if request.nil?

              request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest

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

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

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

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

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

              @data_catalog_stub.call_rpc :test_iam_permissions, 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 DataCatalog API.
            #
            # This class represents the configuration for DataCatalog,
            # 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::DataCatalog::V1::DataCatalog::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
            #   # search_catalog to 20 seconds,
            #   # and all remaining timeouts to 10 seconds.
            #   ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.configure do |config|
            #     config.timeout = 10.0
            #     config.rpcs.search_catalog.timeout = 20.0
            #   end
            #
            #   # Apply the above configuration only to a new client.
            #   client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config|
            #     config.timeout = 10.0
            #     config.rpcs.search_catalog.timeout = 20.0
            #   end
            #
            # @!attribute [rw] endpoint
            #   The hostname or hostname:port of the service endpoint.
            #   Defaults to `"datacatalog.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,      "datacatalog.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 DataCatalog 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 `search_catalog`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :search_catalog
                ##
                # RPC-specific configuration for `create_entry_group`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_entry_group
                ##
                # RPC-specific configuration for `get_entry_group`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_entry_group
                ##
                # RPC-specific configuration for `update_entry_group`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_entry_group
                ##
                # RPC-specific configuration for `delete_entry_group`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_entry_group
                ##
                # RPC-specific configuration for `list_entry_groups`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_entry_groups
                ##
                # RPC-specific configuration for `create_entry`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_entry
                ##
                # RPC-specific configuration for `update_entry`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_entry
                ##
                # RPC-specific configuration for `delete_entry`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_entry
                ##
                # RPC-specific configuration for `get_entry`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_entry
                ##
                # RPC-specific configuration for `lookup_entry`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :lookup_entry
                ##
                # RPC-specific configuration for `list_entries`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_entries
                ##
                # RPC-specific configuration for `modify_entry_overview`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :modify_entry_overview
                ##
                # RPC-specific configuration for `modify_entry_contacts`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :modify_entry_contacts
                ##
                # RPC-specific configuration for `create_tag_template`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_tag_template
                ##
                # RPC-specific configuration for `get_tag_template`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_tag_template
                ##
                # RPC-specific configuration for `update_tag_template`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_tag_template
                ##
                # RPC-specific configuration for `delete_tag_template`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_tag_template
                ##
                # RPC-specific configuration for `create_tag_template_field`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_tag_template_field
                ##
                # RPC-specific configuration for `update_tag_template_field`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_tag_template_field
                ##
                # RPC-specific configuration for `rename_tag_template_field`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :rename_tag_template_field
                ##
                # RPC-specific configuration for `rename_tag_template_field_enum_value`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :rename_tag_template_field_enum_value
                ##
                # RPC-specific configuration for `delete_tag_template_field`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_tag_template_field
                ##
                # RPC-specific configuration for `create_tag`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :create_tag
                ##
                # RPC-specific configuration for `update_tag`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :update_tag
                ##
                # RPC-specific configuration for `delete_tag`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :delete_tag
                ##
                # RPC-specific configuration for `list_tags`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :list_tags
                ##
                # RPC-specific configuration for `star_entry`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :star_entry
                ##
                # RPC-specific configuration for `unstar_entry`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :unstar_entry
                ##
                # RPC-specific configuration for `set_iam_policy`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :set_iam_policy
                ##
                # RPC-specific configuration for `get_iam_policy`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :get_iam_policy
                ##
                # RPC-specific configuration for `test_iam_permissions`
                # @return [::Gapic::Config::Method]
                #
                attr_reader :test_iam_permissions

                # @private
                def initialize parent_rpcs = nil
                  search_catalog_config = parent_rpcs.search_catalog if parent_rpcs.respond_to? :search_catalog
                  @search_catalog = ::Gapic::Config::Method.new search_catalog_config
                  create_entry_group_config = parent_rpcs.create_entry_group if parent_rpcs.respond_to? :create_entry_group
                  @create_entry_group = ::Gapic::Config::Method.new create_entry_group_config
                  get_entry_group_config = parent_rpcs.get_entry_group if parent_rpcs.respond_to? :get_entry_group
                  @get_entry_group = ::Gapic::Config::Method.new get_entry_group_config
                  update_entry_group_config = parent_rpcs.update_entry_group if parent_rpcs.respond_to? :update_entry_group
                  @update_entry_group = ::Gapic::Config::Method.new update_entry_group_config
                  delete_entry_group_config = parent_rpcs.delete_entry_group if parent_rpcs.respond_to? :delete_entry_group
                  @delete_entry_group = ::Gapic::Config::Method.new delete_entry_group_config
                  list_entry_groups_config = parent_rpcs.list_entry_groups if parent_rpcs.respond_to? :list_entry_groups
                  @list_entry_groups = ::Gapic::Config::Method.new list_entry_groups_config
                  create_entry_config = parent_rpcs.create_entry if parent_rpcs.respond_to? :create_entry
                  @create_entry = ::Gapic::Config::Method.new create_entry_config
                  update_entry_config = parent_rpcs.update_entry if parent_rpcs.respond_to? :update_entry
                  @update_entry = ::Gapic::Config::Method.new update_entry_config
                  delete_entry_config = parent_rpcs.delete_entry if parent_rpcs.respond_to? :delete_entry
                  @delete_entry = ::Gapic::Config::Method.new delete_entry_config
                  get_entry_config = parent_rpcs.get_entry if parent_rpcs.respond_to? :get_entry
                  @get_entry = ::Gapic::Config::Method.new get_entry_config
                  lookup_entry_config = parent_rpcs.lookup_entry if parent_rpcs.respond_to? :lookup_entry
                  @lookup_entry = ::Gapic::Config::Method.new lookup_entry_config
                  list_entries_config = parent_rpcs.list_entries if parent_rpcs.respond_to? :list_entries
                  @list_entries = ::Gapic::Config::Method.new list_entries_config
                  modify_entry_overview_config = parent_rpcs.modify_entry_overview if parent_rpcs.respond_to? :modify_entry_overview
                  @modify_entry_overview = ::Gapic::Config::Method.new modify_entry_overview_config
                  modify_entry_contacts_config = parent_rpcs.modify_entry_contacts if parent_rpcs.respond_to? :modify_entry_contacts
                  @modify_entry_contacts = ::Gapic::Config::Method.new modify_entry_contacts_config
                  create_tag_template_config = parent_rpcs.create_tag_template if parent_rpcs.respond_to? :create_tag_template
                  @create_tag_template = ::Gapic::Config::Method.new create_tag_template_config
                  get_tag_template_config = parent_rpcs.get_tag_template if parent_rpcs.respond_to? :get_tag_template
                  @get_tag_template = ::Gapic::Config::Method.new get_tag_template_config
                  update_tag_template_config = parent_rpcs.update_tag_template if parent_rpcs.respond_to? :update_tag_template
                  @update_tag_template = ::Gapic::Config::Method.new update_tag_template_config
                  delete_tag_template_config = parent_rpcs.delete_tag_template if parent_rpcs.respond_to? :delete_tag_template
                  @delete_tag_template = ::Gapic::Config::Method.new delete_tag_template_config
                  create_tag_template_field_config = parent_rpcs.create_tag_template_field if parent_rpcs.respond_to? :create_tag_template_field
                  @create_tag_template_field = ::Gapic::Config::Method.new create_tag_template_field_config
                  update_tag_template_field_config = parent_rpcs.update_tag_template_field if parent_rpcs.respond_to? :update_tag_template_field
                  @update_tag_template_field = ::Gapic::Config::Method.new update_tag_template_field_config
                  rename_tag_template_field_config = parent_rpcs.rename_tag_template_field if parent_rpcs.respond_to? :rename_tag_template_field
                  @rename_tag_template_field = ::Gapic::Config::Method.new rename_tag_template_field_config
                  rename_tag_template_field_enum_value_config = parent_rpcs.rename_tag_template_field_enum_value if parent_rpcs.respond_to? :rename_tag_template_field_enum_value
                  @rename_tag_template_field_enum_value = ::Gapic::Config::Method.new rename_tag_template_field_enum_value_config
                  delete_tag_template_field_config = parent_rpcs.delete_tag_template_field if parent_rpcs.respond_to? :delete_tag_template_field
                  @delete_tag_template_field = ::Gapic::Config::Method.new delete_tag_template_field_config
                  create_tag_config = parent_rpcs.create_tag if parent_rpcs.respond_to? :create_tag
                  @create_tag = ::Gapic::Config::Method.new create_tag_config
                  update_tag_config = parent_rpcs.update_tag if parent_rpcs.respond_to? :update_tag
                  @update_tag = ::Gapic::Config::Method.new update_tag_config
                  delete_tag_config = parent_rpcs.delete_tag if parent_rpcs.respond_to? :delete_tag
                  @delete_tag = ::Gapic::Config::Method.new delete_tag_config
                  list_tags_config = parent_rpcs.list_tags if parent_rpcs.respond_to? :list_tags
                  @list_tags = ::Gapic::Config::Method.new list_tags_config
                  star_entry_config = parent_rpcs.star_entry if parent_rpcs.respond_to? :star_entry
                  @star_entry = ::Gapic::Config::Method.new star_entry_config
                  unstar_entry_config = parent_rpcs.unstar_entry if parent_rpcs.respond_to? :unstar_entry
                  @unstar_entry = ::Gapic::Config::Method.new unstar_entry_config
                  set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
                  @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
                  get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
                  @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
                  test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
                  @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config

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