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

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

Overview

Client for the PolicyTagManager service.

Policy Tag Manager API service allows you to manage your policy tags and taxonomies.

Policy tags are used to tag BigQuery columns and apply additional access control policies. A taxonomy is a hierarchical grouping of policy tags that classify data along a common axis.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#location_path, #policy_tag_path, #taxonomy_path

Constructor Details

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

Create a new PolicyTagManager client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the PolicyTagManager client.

Yield Parameters:



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 129

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/policytagmanager_services_pb"

  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @policy_tag_manager_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Stub,
    credentials: credentials,
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool
  )

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

Instance Attribute Details

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

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

Returns:

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


181
182
183
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 181

def iam_policy_client
  @iam_policy_client
end

Class Method Details

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

Configure the PolicyTagManager Client class.

See Configuration for a description of the configuration fields.

Examples:


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

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 65

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
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

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

Configure the PolicyTagManager 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:



99
100
101
102
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 99

def configure
  yield @config if block_given?
  @config
end

#create_policy_tag(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::PolicyTag #create_policy_tag(parent: nil, policy_tag: nil) ⇒ ::Google::Cloud::DataCatalog::V1::PolicyTag

Creates a policy tag in a taxonomy.

Examples:

Basic example

require "google/cloud/data_catalog/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest.new

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

# The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag.
p result

Overloads:

  • #create_policy_tag(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::PolicyTag

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest, ::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_policy_tag(parent: nil, policy_tag: nil) ⇒ ::Google::Cloud::DataCatalog::V1::PolicyTag

    Pass arguments to create_policy_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. Resource name of the taxonomy that the policy tag will belong to.

    • policy_tag (::Google::Cloud::DataCatalog::V1::PolicyTag, ::Hash) (defaults to: nil)

      The policy 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.



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
717
718
719
720
721
722
723
724
725
726
727
728
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 689

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

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

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

  @policy_tag_manager_stub.call_rpc :create_policy_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_taxonomy(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Taxonomy #create_taxonomy(parent: nil, taxonomy: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Taxonomy

Creates a taxonomy in a specified project.

The taxonomy is initially empty, that is, it doesn't contain policy tags.

Examples:

Basic example

require "google/cloud/data_catalog/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest.new

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

# The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy.
p result

Overloads:

  • #create_taxonomy(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Taxonomy

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest, ::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_taxonomy(parent: nil, taxonomy: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Taxonomy

    Pass arguments to create_taxonomy 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. Resource name of the project that the taxonomy will belong to.

    • taxonomy (::Google::Cloud::DataCatalog::V1::Taxonomy, ::Hash) (defaults to: nil)

      The taxonomy 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.



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 233

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

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

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

  @policy_tag_manager_stub.call_rpc :create_taxonomy, 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_policy_tag(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_policy_tag(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes a policy tag together with the following:

  • All of its descendant policy tags, if any
  • Policies associated with the policy tag and its descendants
  • References from BigQuery table schema of the policy tag and its descendants

Examples:

Basic example

require "google/cloud/data_catalog/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest.new

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

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest, ::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_policy_tag(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_policy_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. Resource name of the policy tag to delete.

      Note: All of its descendant policy tags are also deleted.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 781

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

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

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

  @policy_tag_manager_stub.call_rpc :delete_policy_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_taxonomy(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_taxonomy(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes a taxonomy, including all policy tags in this taxonomy, their associated policies, and the policy tags references from BigQuery columns.

Examples:

Basic example

require "google/cloud/data_catalog/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest.new

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

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest, ::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_taxonomy(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_taxonomy 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. Resource name of the taxonomy to delete.

      Note: All policy tags in this taxonomy are also deleted.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 322

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

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

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

  @policy_tag_manager_stub.call_rpc :delete_taxonomy, 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 IAM policy for a policy tag or a taxonomy.

Examples:

Basic example

require "google/cloud/data_catalog/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::GetIamPolicyRequest.new

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

# The returned object is of type Google::Iam::V1::Policy.
p result

Overloads:

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

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

    Parameters:

    • request (::Google::Iam::V1::GetIamPolicyRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

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

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

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

    Pass arguments to get_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

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

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

      OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

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

Returns:

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

Raises:

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

    if the RPC is aborted.



1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
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
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 1148

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

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

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_iam_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

  @policy_tag_manager_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_policy_tag(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::PolicyTag #get_policy_tag(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::PolicyTag

Gets a policy tag.

Examples:

Basic example

require "google/cloud/data_catalog/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1::GetPolicyTagRequest.new

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

# The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag.
p result

Overloads:

  • #get_policy_tag(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::PolicyTag

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest, ::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_policy_tag(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::PolicyTag

    Pass arguments to get_policy_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. Resource name of the policy tag.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 1059

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

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

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

  @policy_tag_manager_stub.call_rpc :get_policy_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

#get_taxonomy(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Taxonomy #get_taxonomy(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Taxonomy

Gets a taxonomy.

Examples:

Basic example

require "google/cloud/data_catalog/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1::GetTaxonomyRequest.new

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

# The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy.
p result

Overloads:

  • #get_taxonomy(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Taxonomy

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest, ::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_taxonomy(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Taxonomy

    Pass arguments to get_taxonomy 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. Resource name of the taxonomy to get.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



602
603
604
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
641
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 602

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

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

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

  @policy_tag_manager_stub.call_rpc :get_taxonomy, 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_policy_tags(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::PolicyTag> #list_policy_tags(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::PolicyTag>

Lists all policy tags in a taxonomy.

Examples:

Basic example

require "google/cloud/data_catalog/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::DataCatalog::V1::PolicyTag.
  p item
end

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest, ::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_policy_tags(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::PolicyTag>

    Pass arguments to list_policy_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. Resource name of the taxonomy to list the policy tags of.

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

      The maximum number of items to return. Must be a value between 1 and 1000 inclusively. If not set, defaults to 50.

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

      The pagination token of the next results page. If not set, returns the first page.

      The token is returned in the response to a previous list request.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 973

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

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

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

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

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

Lists all taxonomies in a project in a particular location that you have a permission to view.

Examples:

Basic example

require "google/cloud/data_catalog/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::DataCatalog::V1::Taxonomy.
  p item
end

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest, ::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_taxonomies(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Taxonomy>

    Pass arguments to list_taxonomies 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. Resource name of the project to list the taxonomies of.

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

      The maximum number of items to return. Must be a value between 1 and 1000 inclusively. If not set, defaults to 50.

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

      The pagination token of the next results page. If not set, the first page is returned.

      The token is returned in the response to a previous list request.

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

      Supported field for filter is 'service' and value is 'dataplex'. Eg: service=dataplex.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
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
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 516

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

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

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

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

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

Sets the IAM policy for a policy tag or a taxonomy.

Examples:

Basic example

require "google/cloud/data_catalog/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::SetIamPolicyRequest.new

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

# The returned object is of type Google::Iam::V1::Policy.
p result

Overloads:

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

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

    Parameters:

    • request (::Google::Iam::V1::SetIamPolicyRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

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

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

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

    Pass arguments to set_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

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

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

      REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

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

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

      paths: "bindings, etag"

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

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

Returns:

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

Raises:

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

    if the RPC is aborted.



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
1276
1277
1278
1279
1280
1281
1282
1283
1284
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 1245

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

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

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.set_iam_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

  @policy_tag_manager_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 your permissions on a specified policy tag or taxonomy.

Examples:

Basic example

require "google/cloud/data_catalog/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::TestIamPermissionsRequest.new

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

# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
p result

Overloads:

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

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

    Parameters:

    • request (::Google::Iam::V1::TestIamPermissionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

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

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

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

    Pass arguments to test_iam_permissions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

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

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

      The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

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

Returns:

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

Raises:

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

    if the RPC is aborted.



1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 1337

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

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

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.test_iam_permissions..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

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

#universe_domainString

The effective universe domain

Returns:

  • (String)


109
110
111
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 109

def universe_domain
  @policy_tag_manager_stub.universe_domain
end

#update_policy_tag(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::PolicyTag #update_policy_tag(policy_tag: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::PolicyTag

Updates a policy tag, including its display name, description, and parent policy tag.

Examples:

Basic example

require "google/cloud/data_catalog/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest.new

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

# The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag.
p result

Overloads:

  • #update_policy_tag(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::PolicyTag

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest, ::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_policy_tag(policy_tag: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::PolicyTag

    Pass arguments to update_policy_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:

    • policy_tag (::Google::Cloud::DataCatalog::V1::PolicyTag, ::Hash) (defaults to: nil)

      The policy tag to update. You can update only its description, display name, and parent policy tag fields.

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

      Specifies the fields to update.

      You can update only display name, description, and parent policy tag. If not set, defaults to all updatable fields. For more information, see FieldMask.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 875

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

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

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

  @policy_tag_manager_stub.call_rpc :update_policy_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_taxonomy(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Taxonomy #update_taxonomy(taxonomy: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Taxonomy

Updates a taxonomy, including its display name, description, and activated policy types.

Examples:

Basic example

require "google/cloud/data_catalog/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest.new

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

# The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy.
p result

Overloads:

  • #update_taxonomy(request, options = nil) ⇒ ::Google::Cloud::DataCatalog::V1::Taxonomy

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest, ::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_taxonomy(taxonomy: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1::Taxonomy

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



415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb', line 415

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

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

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

  @policy_tag_manager_stub.call_rpc :update_taxonomy, 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