Class: Google::Cloud::DataCatalog::V1::DataCatalog::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/data_catalog/v1/data_catalog/client.rb

Overview

Client for the DataCatalog service.

Data Catalog API service allows you to discover, understand, and manage your data.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#entry_group_path, #entry_path, #location_path, #tag_path, #tag_template_field_enum_value_path, #tag_template_field_path, #tag_template_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new DataCatalog client object.

Examples:


# 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

Yields:

  • (config)

    Configure the DataCatalog client.

Yield Parameters:



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 116

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 == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-")
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

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

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
  end

  @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

Instance Attribute Details

#iam_policy_clientGoogle::Iam::V1::IAMPolicy::Client (readonly)

Get the associated client for mix-in of the IAMPolicy.

Returns:

  • (Google::Iam::V1::IAMPolicy::Client)


176
177
178
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 176

def iam_policy_client
  @iam_policy_client
end

#operations_client::Google::Cloud::DataCatalog::V1::DataCatalog::Operations (readonly)

Get the associated client for long-running operations.



169
170
171
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 169

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the DataCatalog Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all DataCatalog clients
::Google::Cloud::DataCatalog::V1::DataCatalog::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 58

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.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 8, 13]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



95
96
97
98
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 95

def configure
  yield @config if block_given?
  @config
end

#create_entry(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry #create_entry(parent: nil, entry_id: nil, entry: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry

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.

An entry group can have a maximum of 100,000 entries.

Examples:

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

Overloads:

  • #create_entry(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry

    Pass arguments to create_entry via a request object, either of type CreateEntryRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_entry(parent: nil, entry_id: nil, entry: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      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.

    • entry_id (::String) (defaults to: nil)

      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.

    • entry (::Google::Cloud::DataCatalog::V1::Entry, ::Hash) (defaults to: nil)

      Required. The entry to create.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 881

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
   = @config.rpcs.create_entry..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#create_entry_group(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryGroup #create_entry_group(parent: nil, entry_group_id: nil, entry_group: nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryGroup

Creates an entry group.

An entry group contains logically related entries together with Cloud Identity and Access Management 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.

Examples:

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

Overloads:

  • #create_entry_group(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryGroup

    Pass arguments to create_entry_group via a request object, either of type CreateEntryGroupRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_entry_group(parent: nil, entry_group_id: nil, entry_group: nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryGroup

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      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.

    • entry_group_id (::String) (defaults to: nil)

      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.

    • entry_group (::Google::Cloud::DataCatalog::V1::EntryGroup, ::Hash) (defaults to: nil)

      The entry group to create. Defaults to empty.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 400

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
   = @config.rpcs.create_entry_group..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#create_tag(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Tag #create_tag(parent: nil, tag: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Tag

Creates a tag and assigns it to:

  • An Entry if the method name is projects.locations.entryGroups.entries.tags.create.
  • Or EntryGroupif the method name is projects.locations.entryGroups.tags.create.

Note: The project identified by the parent parameter for the tag and the tag template used to create the tag must be in the same organization.

Examples:

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

Overloads:

  • #create_tag(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Tag

    Pass arguments to create_tag via a request object, either of type CreateTagRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_tag(parent: nil, tag: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Tag

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      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.

    • tag (::Google::Cloud::DataCatalog::V1::Tag, ::Hash) (defaults to: nil)

      Required. The tag to create.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2568

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
   = @config.rpcs.create_tag..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#create_tag_template(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplate #create_tag_template(parent: nil, tag_template_id: nil, tag_template: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplate

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.

Examples:

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

Overloads:

  • #create_tag_template(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplate

    Pass arguments to create_tag_template via a request object, either of type CreateTagTemplateRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_tag_template(parent: nil, tag_template_id: nil, tag_template: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplate

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the project and the template location region.

    • tag_template_id (::String) (defaults to: nil)

      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.

    • tag_template (::Google::Cloud::DataCatalog::V1::TagTemplate, ::Hash) (defaults to: nil)

      Required. The tag template to create.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1695

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
   = @config.rpcs.create_tag_template..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#create_tag_template_field(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField #create_tag_template_field(parent: nil, tag_template_field_id: nil, tag_template_field: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField

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.

Examples:

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

Overloads:

  • #create_tag_template_field(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField

    Pass arguments to create_tag_template_field via a request object, either of type CreateTagTemplateFieldRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_tag_template_field(parent: nil, tag_template_field_id: nil, tag_template_field: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the project and the template location region.

    • tag_template_field_id (::String) (defaults to: nil)

      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.

    • tag_template_field (::Google::Cloud::DataCatalog::V1::TagTemplateField, ::Hash) (defaults to: nil)

      Required. The tag template field to create.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2077

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
   = @config.rpcs.create_tag_template_field..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#delete_entry(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_entry(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes an existing entry.

You can delete only the entries created by the 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.

Examples:

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

Overloads:

  • #delete_entry(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_entry via a request object, either of type Google::Cloud::DataCatalog::V1::DeleteEntryRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_entry(name: nil) ⇒ ::Google::Protobuf::Empty

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the entry to delete.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1095

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
   = @config.rpcs.delete_entry..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#delete_entry_group(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_entry_group(name: nil, force: nil) ⇒ ::Google::Protobuf::Empty

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.

Examples:

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

Overloads:

  • #delete_entry_group(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_entry_group via a request object, either of type Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_entry_group(name: nil, force: nil) ⇒ ::Google::Protobuf::Empty

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the entry group to delete.

    • force (::Boolean) (defaults to: nil)

      Optional. If true, deletes all entries in the entry group.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 675

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
   = @config.rpcs.delete_entry_group..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#delete_tag(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_tag(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes a tag.

Examples:

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

Overloads:

  • #delete_tag(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_tag via a request object, either of type Google::Cloud::DataCatalog::V1::DeleteTagRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_tag(name: nil) ⇒ ::Google::Protobuf::Empty

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the tag to delete.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2745

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
   = @config.rpcs.delete_tag..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#delete_tag_template(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_tag_template(name: nil, force: nil) ⇒ ::Google::Protobuf::Empty

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.

Examples:

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

Overloads:

  • #delete_tag_template(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_tag_template via a request object, either of type Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_tag_template(name: nil, force: nil) ⇒ ::Google::Protobuf::Empty

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the tag template to delete.

    • force (::Boolean) (defaults to: nil)

      Required. If true, deletes all tags that use this template.

      Currently, true is the only supported value.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1976

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
   = @config.rpcs.delete_tag_template..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#delete_tag_template_field(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_tag_template_field(name: nil, force: nil) ⇒ ::Google::Protobuf::Empty

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.

Examples:

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

Overloads:

  • #delete_tag_template_field(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_tag_template_field via a request object, either of type Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_tag_template_field(name: nil, force: nil) ⇒ ::Google::Protobuf::Empty

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the tag template field to delete.

    • force (::Boolean) (defaults to: nil)

      Required. If true, deletes this field from any tags that use it.

      Currently, true is the only supported value.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2464

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
   = @config.rpcs.delete_tag_template_field..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#get_entry(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry #get_entry(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry

Gets an entry.

Examples:

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

Overloads:

  • #get_entry(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry

    Pass arguments to get_entry via a request object, either of type GetEntryRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_entry(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the entry to get.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1180

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
   = @config.rpcs.get_entry..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#get_entry_group(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryGroup #get_entry_group(name: nil, read_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryGroup

Gets an entry group.

Examples:

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

Overloads:

  • #get_entry_group(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryGroup

    Pass arguments to get_entry_group via a request object, either of type GetEntryGroupRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_entry_group(name: nil, read_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryGroup

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the entry group to get.

    • read_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      The fields to return. If empty or omitted, all fields are returned.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 487

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
   = @config.rpcs.get_entry_group..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy

Gets the access control policy for a resource.

May return:

  • ANOT_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.

Examples:

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

Overloads:

  • #get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to get_iam_policy via a request object, either of type Iam::V1::GetIamPolicyRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy

    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).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

    • options (::Google::Iam::V1::GetPolicyOptions, ::Hash) (defaults to: nil)

      OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Google::Iam::V1::Policy)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Google::Iam::V1::Policy)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 3356

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
   = @config.rpcs.get_iam_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#get_tag_template(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplate #get_tag_template(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplate

Gets a tag template.

Examples:

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

Overloads:

  • #get_tag_template(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplate

    Pass arguments to get_tag_template via a request object, either of type GetTagTemplateRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_tag_template(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplate

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the tag template to get.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1780

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
   = @config.rpcs.get_tag_template..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#import_entries(request, options = nil) ⇒ ::Gapic::Operation #import_entries(parent: nil, gcs_bucket_path: nil, job_id: nil) ⇒ ::Gapic::Operation

Imports entries from a source, such as data previously dumped into a Cloud Storage bucket, into Data Catalog. Import of entries is a sync operation that reconciles the state of the third-party system with the Data Catalog.

ImportEntries accepts source data snapshots of a third-party system. Snapshot should be delivered as a .wire or base65-encoded .txt file containing a sequence of Protocol Buffer messages of DumpItem type.

ImportEntries returns a [long-running operation] [google.longrunning.Operation] resource that can be queried with Operations.GetOperation to return ImportEntriesMetadata and an ImportEntriesResponse message.

Examples:

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::ImportEntriesRequest.new

# Call the import_entries method.
result = client.import_entries request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #import_entries(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to import_entries via a request object, either of type ImportEntriesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1::ImportEntriesRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #import_entries(parent: nil, gcs_bucket_path: nil, job_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to import_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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Target entry group for ingested entries.

    • gcs_bucket_path (::String) (defaults to: nil)

      Path to a Cloud Storage bucket that contains a dump ready for ingestion.

    • job_id (::String) (defaults to: nil)

      Optional. (Optional) Dataplex task job id, if specified will be used as part of ImportEntries LRO ID

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 3574

def import_entries request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

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

  # 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
   = @config.rpcs.import_entries..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

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

#list_entries(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Entry> #list_entries(parent: nil, page_size: nil, page_token: nil, read_mask: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Entry>

Lists entries.

Note: Currently, this method can list only custom entries. To get a list of both custom and automatically created entries, use SearchCatalog.

Examples:

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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::DataCatalog::V1::Entry.
  p item
end

Overloads:

  • #list_entries(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Entry>

    Pass arguments to list_entries via a request object, either of type ListEntriesRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_entries(parent: nil, page_size: nil, page_token: nil, read_mask: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Entry>

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the entry group that contains the entries to list.

      Can be provided in URL format.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of items to return. Default is 10. Maximum limit is

      1. Throws an invalid argument if page_size is more than 1000.
    • page_token (::String) (defaults to: nil)

      Pagination token that specifies the next page to return. If empty, the first page is returned.

    • read_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1413

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
   = @config.rpcs.list_entries..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#list_entry_groups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::EntryGroup> #list_entry_groups(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::EntryGroup>

Lists entry groups.

Examples:

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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::DataCatalog::V1::EntryGroup.
  p item
end

Overloads:

  • #list_entry_groups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::EntryGroup>

    Pass arguments to list_entry_groups via a request object, either of type ListEntryGroupsRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_entry_groups(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::EntryGroup>

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the location that contains the entry groups to list.

      Can be provided as a URL.

    • page_size (::Integer) (defaults to: nil)

      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.

    • page_token (::String) (defaults to: nil)

      Optional. Pagination token that specifies the next page to return. If empty, returns the first page.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 774

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
   = @config.rpcs.list_entry_groups..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#list_tags(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Tag> #list_tags(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Tag>

Lists tags assigned to an Entry. The columns in the response are lowercased.

Examples:

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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::DataCatalog::V1::Tag.
  p item
end

Overloads:

  • #list_tags(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Tag>

    Pass arguments to list_tags via a request object, either of type ListTagsRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_tags(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Tag>

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the Data Catalog resource to list the tags of.

      The resource can be an Entry or an EntryGroup (without /entries/{entries} at the end).

    • page_size (::Integer) (defaults to: nil)

      The maximum number of tags to return. Default is 10. Maximum limit is 1000.

    • page_token (::String) (defaults to: nil)

      Pagination token that specifies the next page to return. If empty, the first page is returned.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2845

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
   = @config.rpcs.list_tags..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#lookup_entry(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry #lookup_entry(linked_resource: nil, sql_resource: nil, fully_qualified_name: nil, project: nil, location: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry

Gets an entry by its target resource name.

The resource name comes from the source Google Cloud Platform service.

Examples:

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

Overloads:

  • #lookup_entry(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry

    Pass arguments to lookup_entry via a request object, either of type LookupEntryRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #lookup_entry(linked_resource: nil, sql_resource: nil, fully_qualified_name: nil, project: nil, location: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry

    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).

    Parameters:

    • linked_resource (::String) (defaults to: nil)

      The full name of the Google Cloud Platform resource the Data Catalog entry represents. For more information, see 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}
    • sql_resource (::String) (defaults to: nil)

      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.

    • fully_qualified_name (::String) (defaults to: nil)

      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}

    • project (::String) (defaults to: nil)

      Project where the lookup should be performed. Required to lookup entry that is not a part of DPMS or DATAPLEX integrated_system using its fully_qualified_name. Ignored in other cases.

    • location (::String) (defaults to: nil)

      Location where the lookup should be performed. Required to lookup entry that is not a part of DPMS or DATAPLEX integrated_system using its fully_qualified_name. Ignored in other cases.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1314

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
   = @config.rpcs.lookup_entry..to_h

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#modify_entry_contacts(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Contacts #modify_entry_contacts(name: nil, contacts: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Contacts

Modifies contacts, part of the business context of an Entry.

To call this method, you must have the datacatalog.entries.updateContacts IAM permission on the corresponding project.

Examples:

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

Overloads:

  • #modify_entry_contacts(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Contacts

    Pass arguments to modify_entry_contacts via a request object, either of type ModifyEntryContactsRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #modify_entry_contacts(name: nil, contacts: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Contacts

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The full resource name of the entry.

    • contacts (::Google::Cloud::DataCatalog::V1::Contacts, ::Hash) (defaults to: nil)

      Required. The new value for the Contacts.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1596

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
   = @config.rpcs.modify_entry_contacts..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#modify_entry_overview(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryOverview #modify_entry_overview(name: nil, entry_overview: nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryOverview

Modifies entry overview, part of the business context of an Entry.

To call this method, you must have the datacatalog.entries.updateOverview IAM permission on the corresponding project.

Examples:

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

Overloads:

  • #modify_entry_overview(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryOverview

    Pass arguments to modify_entry_overview via a request object, either of type ModifyEntryOverviewRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #modify_entry_overview(name: nil, entry_overview: nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryOverview

    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).

    Parameters:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1505

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
   = @config.rpcs.modify_entry_overview..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#reconcile_tags(request, options = nil) ⇒ ::Gapic::Operation #reconcile_tags(parent: nil, tag_template: nil, force_delete_missing: nil, tags: nil) ⇒ ::Gapic::Operation

ReconcileTags creates or updates a list of tags on the entry. If the ReconcileTagsRequest.force_delete_missing parameter is set, the operation deletes tags not included in the input tag list.

ReconcileTags returns a [long-running operation] [google.longrunning.Operation] resource that can be queried with Operations.GetOperation to return [ReconcileTagsMetadata] [google.cloud.datacatalog.v1.ReconcileTagsMetadata] and a [ReconcileTagsResponse] [google.cloud.datacatalog.v1.ReconcileTagsResponse] message.

Examples:

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::ReconcileTagsRequest.new

# Call the reconcile_tags method.
result = client.reconcile_tags request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #reconcile_tags(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to reconcile_tags via a request object, either of type ReconcileTagsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #reconcile_tags(parent: nil, tag_template: nil, force_delete_missing: nil, tags: nil) ⇒ ::Gapic::Operation

    Pass arguments to reconcile_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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Name of Entry to be tagged.

    • tag_template (::String) (defaults to: nil)

      Required. The name of the tag template, which is used for reconciliation.

    • force_delete_missing (::Boolean) (defaults to: nil)

      If set to true, deletes entry tags related to a tag template not listed in the tags source from an entry. If set to false, unlisted tags are retained.

    • tags (::Array<::Google::Cloud::DataCatalog::V1::Tag, ::Hash>) (defaults to: nil)

      A list of tags to apply to an entry. A tag can specify a tag template, which must be the template specified in the ReconcileTagsRequest. The sole entry and each of its columns must be mentioned at most once.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2961

def reconcile_tags request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

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

  # 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
   = @config.rpcs.reconcile_tags..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

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

#rename_tag_template_field(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField #rename_tag_template_field(name: nil, new_tag_template_field_id: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField

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.

Examples:

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

Overloads:

  • #rename_tag_template_field(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField

    Pass arguments to rename_tag_template_field via a request object, either of type RenameTagTemplateFieldRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #rename_tag_template_field(name: nil, new_tag_template_field_id: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the tag template field.

    • new_tag_template_field_id (::String) (defaults to: nil)

      Required. The new ID of this tag template field. For example, my_new_field.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2280

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
   = @config.rpcs.rename_tag_template_field..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#rename_tag_template_field_enum_value(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField #rename_tag_template_field_enum_value(name: nil, new_enum_value_display_name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField

Renames an enum value in a tag template.

Within a single enum field, enum values must be unique.

Examples:

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

Overloads:

  • #rename_tag_template_field_enum_value(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField

    Pass arguments to rename_tag_template_field_enum_value via a request object, either of type RenameTagTemplateFieldEnumValueRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #rename_tag_template_field_enum_value(name: nil, new_enum_value_display_name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the enum field value.

    • new_enum_value_display_name (::String) (defaults to: nil)

      Required. The new display name of the enum value. For example, my_new_enum_value.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2370

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
   = @config.rpcs.rename_tag_template_field_enum_value..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#search_catalog(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::SearchCatalogResult> #search_catalog(scope: nil, query: nil, page_size: nil, page_token: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::SearchCatalogResult>

Searches Data Catalog for multiple resources like entries and tags that match a query.

This is a Custom Method 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.

Examples:

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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::DataCatalog::V1::SearchCatalogResult.
  p item
end

Overloads:

  • #search_catalog(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::SearchCatalogResult>

    Pass arguments to search_catalog via a request object, either of type SearchCatalogRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #search_catalog(scope: nil, query: nil, page_size: nil, page_token: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::SearchCatalogResult>

    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).

    Parameters:

    • scope (::Google::Cloud::DataCatalog::V1::SearchCatalogRequest::Scope, ::Hash) (defaults to: nil)

      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.

    • query (::String) (defaults to: nil)

      Optional. The query string with a minimum of 3 characters and specific syntax. For more information, see Data Catalog search syntax.

      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
    • page_size (::Integer) (defaults to: nil)

      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.

    • page_token (::String) (defaults to: nil)

      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 SearchCatalogResponse.next_page_token field of the response to a previous SearchCatalogRequest call.

    • order_by (::String) (defaults to: nil)

      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.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 284

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
   = @config.rpcs.search_catalog..to_h

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy

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.

Examples:

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

Overloads:

  • #set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to set_iam_policy via a request object, either of type Iam::V1::SetIamPolicyRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy

    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).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

    • policy (::Google::Iam::V1::Policy, ::Hash) (defaults to: nil)

      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.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used:

      paths: "bindings, etag"

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Google::Iam::V1::Policy)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Google::Iam::V1::Policy)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 3247

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
   = @config.rpcs.set_iam_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#star_entry(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::StarEntryResponse #star_entry(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::StarEntryResponse

Marks an Entry as starred by the current user. Starring information is private to each user.

Examples:

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

Overloads:

  • #star_entry(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::StarEntryResponse

    Pass arguments to star_entry via a request object, either of type StarEntryRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #star_entry(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::StarEntryResponse

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the entry to mark as starred.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 3048

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
   = @config.rpcs.star_entry..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

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.

Examples:

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

Overloads:

  • #test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

    Pass arguments to test_iam_permissions via a request object, either of type Iam::V1::TestIamPermissionsRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

    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).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

    • permissions (::Array<::String>) (defaults to: nil)

      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.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Google::Iam::V1::TestIamPermissionsResponse)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Google::Iam::V1::TestIamPermissionsResponse)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 3460

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
   = @config.rpcs.test_iam_permissions..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#unstar_entry(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::UnstarEntryResponse #unstar_entry(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::UnstarEntryResponse

Marks an Entry as NOT starred by the current user. Starring information is private to each user.

Examples:

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

Overloads:

  • #unstar_entry(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::UnstarEntryResponse

    Pass arguments to unstar_entry via a request object, either of type UnstarEntryRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #unstar_entry(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::UnstarEntryResponse

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the entry to mark as not starred.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 3134

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
   = @config.rpcs.unstar_entry..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#update_entry(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry #update_entry(entry: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry

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.

Examples:

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

Overloads:

  • #update_entry(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry

    Pass arguments to update_entry via a request object, either of type UpdateEntryRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_entry(entry: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Entry

    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).

    Parameters:

    • entry (::Google::Cloud::DataCatalog::V1::Entry, ::Hash) (defaults to: nil)

      Required. Updates for the entry. The name field must be set.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1001

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
   = @config.rpcs.update_entry..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#update_entry_group(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryGroup #update_entry_group(entry_group: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryGroup

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.

Examples:

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

Overloads:

  • #update_entry_group(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryGroup

    Pass arguments to update_entry_group via a request object, either of type UpdateEntryGroupRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_entry_group(entry_group: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::EntryGroup

    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).

    Parameters:

    • entry_group (::Google::Cloud::DataCatalog::V1::EntryGroup, ::Hash) (defaults to: nil)

      Required. Updates for the entry group. The name field must be set.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 583

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
   = @config.rpcs.update_entry_group..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#update_tag(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Tag #update_tag(tag: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Tag

Updates an existing tag.

Examples:

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

Overloads:

  • #update_tag(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Tag

    Pass arguments to update_tag via a request object, either of type UpdateTagRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_tag(tag: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Tag

    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).

    Parameters:

    • tag (::Google::Cloud::DataCatalog::V1::Tag, ::Hash) (defaults to: nil)

      Required. The updated tag. The "name" field must be set.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2660

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
   = @config.rpcs.update_tag..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#update_tag_template(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplate #update_tag_template(tag_template: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplate

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.

Examples:

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

Overloads:

  • #update_tag_template(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplate

    Pass arguments to update_tag_template via a request object, either of type UpdateTagTemplateRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_tag_template(tag_template: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplate

    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).

    Parameters:

    • tag_template (::Google::Cloud::DataCatalog::V1::TagTemplate, ::Hash) (defaults to: nil)

      Required. The template to update. The name field must be set.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1883

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
   = @config.rpcs.update_tag_template..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#update_tag_template_field(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField #update_tag_template_field(name: nil, tag_template_field: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField

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.

Examples:

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

Overloads:

  • #update_tag_template_field(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField

    Pass arguments to update_tag_template_field via a request object, either of type UpdateTagTemplateFieldRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_tag_template_field(name: nil, tag_template_field: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::TagTemplateField

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the tag template field.

    • tag_template_field (::Google::Cloud::DataCatalog::V1::TagTemplateField, ::Hash) (defaults to: nil)

      Required. The template to update.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2188

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
   = @config.rpcs.update_tag_template_field..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"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("&")
  [:"x-goog-request-params"] ||= request_params_header

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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