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 clients to discover, understand, and manage their data.

Defined Under Namespace

Classes: Configuration

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

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

Constructor Details

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

Create a new DataCatalog client object.

Examples

To create a new DataCatalog client with the default configuration:

client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new

To create a new DataCatalog client with 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:



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 181

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 scope and endpoint are unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.scope == Client.configure.scope &&
                           @config.endpoint == Client.configure.endpoint &&
                           !@config.endpoint.split(".").first.include?("-")
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(String) || credentials.is_a?(Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

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

Class Method Details

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

Configure the DataCatalog Client class.

See Configuration for a description of the configuration fields.

Example

To 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# 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.rpcs.search_catalog.timeout = 60.0
    default_config.rpcs.search_catalog.retry_policy = {
      initial_delay: 0.1,
  max_delay: 60.0,
  multiplier: 1.3,
  retry_codes: [14]
    }

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

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

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

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

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

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

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

    default_config
  end
  yield @configure if block_given?
  @configure
end

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:



156
157
158
159
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 156

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. Only entries of 'FILESET' type or user-specified type can be created.

Users should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

A maximum of 100,000 entries may be created per entry group.

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 is in. Example:

      • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}

      Note that this Entry and its child resources may not actually be stored in the location in this name.

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

      Required. The id of the entry to create.

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



764
765
766
767
768
769
770
771
772
773
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
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 764

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 = {
    "parent" => request.parent
  }
  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 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 EntryGroup.

An entry group contains logically related entries together with Cloud Identity and Access Management policies that specify the users who can create, edit, and view entries within the entry group.

Data Catalog automatically creates an entry group for BigQuery entries ("@bigquery") and Pub/Sub topics ("@pubsub"). Users create their own entry group to contain Cloud Storage fileset entries or custom type entries, and the IAM policies associated with those entries. Entry groups, like entries, can be searched.

A maximum of 10,000 entry groups may be created per organization across all locations.

Users should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

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 name of the project this entry group is in. Example:

      • projects/{project_id}/locations/{location}

      Note that this EntryGroup and its child resources may not actually be stored in the location in this name.

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

      Required. The id of the entry group to create. The id must begin with a letter or underscore, contain only English letters, numbers and underscores, and be at most 64 characters.

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

      The entry group to create. Defaults to an empty 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.



390
391
392
393
394
395
396
397
398
399
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
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 390

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 = {
    "parent" => request.parent
  }
  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 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 on an Entry. Note: The project identified by the parent parameter for the tag and the tag template used to create the tag must be from the same organization.

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. Example:

      • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}

      Note that this Tag and its child resources may not actually be stored in the location in this 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.



1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1867

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 = {
    "parent" => request.parent
  }
  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 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. The user should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

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.

      Example:

      • projects/{project_id}/locations/us-central1
    • tag_template_id (::String) (defaults to: nil)

      Required. The id of the tag template to create.

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



1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1240

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 = {
    "parent" => request.parent
  }
  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 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. The user should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project for more information).

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.

      Example:

      • projects/{project_id}/locations/us-central1/tagTemplates/{tag_template_id}
    • tag_template_field_id (::String) (defaults to: nil)

      Required. The ID of the tag template field to create. 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.



1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1547

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 = {
    "parent" => request.parent
  }
  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 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. Only entries created through CreateEntry method can be deleted. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

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. Example:

      • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 929

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 = {
    "name" => request.name
  }
  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 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 EntryGroup. Only entry groups that do not contain entries can be deleted. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

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. For example, projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}.

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



605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 605

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 = {
    "name" => request.name
  }
  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 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.

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. Example:

      • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2004

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 = {
    "name" => request.name
  }
  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 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 using the template. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

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. Example:

      • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}
    • force (::Boolean) (defaults to: nil)

      Required. Currently, this field must always be set to true. This confirms the deletion of any possible tags using this template. force = false will be supported in the future.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1464

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 = {
    "name" => request.name
  }
  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 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 that field. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

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. Example:

      • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
    • force (::Boolean) (defaults to: nil)

      Required. Currently, this field must always be set to true. This confirms the deletion of this field from any tags using this field. force = false will be supported in the future.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
1820
1821
1822
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1787

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 = {
    "name" => request.name
  }
  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 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.

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. Example:

      • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



997
998
999
1000
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
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 997

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 = {
    "name" => request.name
  }
  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 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 EntryGroup.

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. For example, projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}.

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

      The fields to return. If not set or empty, 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.



459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 459

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 = {
    "name" => request.name
  }
  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 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. A NOT_FOUND error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it.

Supported resources are:

  • Tag templates.
  • Entries.
  • Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog.

Callers must have following Google IAM permission

  • datacatalog.tagTemplates.getIamPolicy to get policies on tag templates.
  • datacatalog.entries.getIamPolicy to get policies on entries.
  • datacatalog.entryGroups.getIamPolicy to get policies on entry groups.

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. This field is only used by Cloud IAM.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2253

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 = {
    "resource" => request.resource
  }
  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 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.

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. Example:

      • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1308
1309
1310
1311
1312
1313
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
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1308

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 = {
    "name" => request.name
  }
  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 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

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

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, which can be provided in URL format. Example:

      • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}
    • page_size (::Integer) (defaults to: nil)

      The maximum number of items to return. Default is 10. Max limit is 1000. Throws an invalid argument for page_size > 1000.

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

      Token that specifies which page is requested. If empty, the first page is returned.

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

      The fields to return for each Entry. If not set or empty, all fields are returned. For example, setting read_mask to contain only one path "name" will cause ListEntries to return a list of Entries with only "name" field.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1160

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 = {
    "parent" => request.parent
  }
  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 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.

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, which can be provided in URL format. Example:

      • projects/{project_id}/locations/{location}
    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of items to return. Default is 10. Max limit is 1000. Throws an invalid argument for page_size > 1000.

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

      Optional. Token that specifies which page is requested. 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.



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
715
716
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 680

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 = {
    "parent" => request.parent
  }
  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 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 the tags on an Entry.

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 could be an Entry or an EntryGroup.

      Examples:

      • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}
      • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}
    • page_size (::Integer) (defaults to: nil)

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

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

      Token that specifies which page is requested. 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.



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
2117
2118
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2082

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 = {
    "parent" => request.parent
  }
  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 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) ⇒ ::Google::Cloud::DataCatalog::V1::Entry

Get an entry by target resource name. This method allows clients to use the resource name from the source Google Cloud Platform service to get the Data Catalog Entry.

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) ⇒ ::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. See: https://cloud.google.com/apis/design/resource_names#full_resource_name. Full names are case-sensitive.

      Examples:

      • //bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId
      • //pubsub.googleapis.com/projects/projectId/topics/topicId
    • sql_resource (::String) (defaults to: nil)

      The SQL name of the entry. SQL names are case-sensitive.

      Examples:

      • pubsub.project_id.topic_id
      • pubsub.project_id.`topic.id.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

      *_ids shoud satisfy the standard SQL rules for identifiers. https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1086

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

#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. The user should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

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. Example:

      • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
    • 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.



1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1711

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 = {
    "name" => request.name
  }
  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 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

#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, tags that match a query.

This is a custom method (https://cloud.google.com/apis/design/custom_methods) and does not return the complete resource, only the resource identifier and high level fields. Clients can subsequentally call Get methods.

Note that Data Catalog search queries do not guarantee full recall. Query results that match your query may not be returned, even in subsequent result pages. Also note that results returned (and not returned) can vary across repeated search queries.

See Data Catalog Search Syntax for more information.

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. A scope that has empty include_org_ids, include_project_ids AND false include_gcp_public_datasets is considered invalid. Data Catalog will return an error in such a case.

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

      Required. The query string in search query syntax. The query must be non-empty.

      Query strings can be simple as "x" or more qualified as:

      • name:x
      • column:x
      • description:y

      Note: Query tokens need to have a minimum of 3 characters for substring matching to work correctly. See Data Catalog Search Syntax for more information.

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

      Number of results in the search page. If <=0 then defaults to 10. Max limit for page_size is 1000. Throws an invalid argument for page_size > 1000.

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

      Optional. Pagination token returned in an earlier SearchCatalogResponse.next_page_token, which indicates that this is a continuation of a prior SearchCatalogRequest call, and that the system should return the next page of data. If empty, the first page is returned.

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

      Specifies the ordering of results, currently supported case-sensitive choices are:

      • relevance, only supports descending
      • last_modified_timestamp [asc|desc], defaults to descending if not specified

      If not specified, defaults to relevance descending.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 300

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 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) ⇒ ::Google::Iam::V1::Policy

Sets the access control policy for a resource. Replaces any existing policy. Supported resources are:

  • Tag templates.
  • Entries.
  • Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog.

Callers must have following Google IAM permission

  • datacatalog.tagTemplates.setIamPolicy to set policies on tag templates.
  • datacatalog.entries.setIamPolicy to set policies on entries.
  • datacatalog.entryGroups.setIamPolicy to set policies on entry groups.

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

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2168

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 = {
    "resource" => request.resource
  }
  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 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

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

Returns the caller's permissions on a resource. If the resource does not exist, an empty set of permissions is returned (We don't return a NOT_FOUND error).

Supported resources are:

  • Tag templates.
  • Entries.
  • Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog.

A caller is not required to have Google IAM permission to make this request.

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:

Returns:

Raises:

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

    if the RPC is aborted.



2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 2337

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 = {
    "resource" => request.resource
  }
  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 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

#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. Users should enable the Data Catalog API in the project identified by the entry.name parameter (see Data Catalog Resource Project for more information).

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. The updated entry. The "name" field must be set.

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

      The fields to update on the entry. If absent or empty, all modifiable fields are updated.

      The following fields are modifiable:

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



855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 855

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 = {
    "entry.name" => request.entry.name
  }
  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 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 EntryGroup. The user should enable the Data Catalog API in the project identified by the entry_group.name parameter (see Data Catalog Resource Project for more information).

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:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 532

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 = {
    "entry_group.name" => request.entry_group.name
  }
  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 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.

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)

      The fields to update on the Tag. If absent or empty, all modifiable fields are updated. Currently the only modifiable field is the field fields.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1936

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 = {
    "tag.name" => request.tag.name
  }
  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 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. This method cannot be used to update the fields of a template. The tag template fields are represented as separate resources and should be updated using their own create/update/delete methods. Users should enable the Data Catalog API in the project identified by the tag_template.name parameter (see Data Catalog Resource Project for more information).

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)

      The field mask specifies the parts of the template to overwrite.

      Allowed fields:

      • display_name

      If absent or empty, all of the allowed fields above will be updated.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1388

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 = {
    "tag_template.name" => request.tag_template.name
  }
  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 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. This method cannot be used to update the field type. Users should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project for more information).

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. Example:

      • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
    • 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. The field mask specifies the parts of the template to be updated. Allowed fields:

      • display_name
      • type.enum_type
      • is_required

      If update_mask is not set or empty, all of the allowed fields above will be updated.

      When updating an enum type, the provided values will be merged with the existing values. Therefore, enum values can only be added, existing enum values cannot be deleted nor renamed. 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.



1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
# File 'lib/google/cloud/data_catalog/v1/data_catalog/client.rb', line 1636

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 = {
    "name" => request.name
  }
  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 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