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

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

Overview

REST 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 REST client object.

Examples:


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

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

Yields:

  • (config)

    Configure the PolicyTagManager client.

Yield Parameters:



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
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 131

def initialize
  # 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 = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials
  )

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::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::Rest::Client (readonly)

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

Returns:

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


174
175
176
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 174

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::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



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

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:



101
102
103
104
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 101

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

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 646

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.create_policy_tag request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



225
226
227
228
229
230
231
232
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
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 225

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.create_taxonomy request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 731

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.delete_policy_tag request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 307

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.delete_taxonomy request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Google::Iam::V1::Policy)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

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

Raises:

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

    if the REST call is aborted.



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
1099
1100
1101
1102
1103
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 1070

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_iam_policy request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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
1014
1015
1016
1017
1018
1019
1020
1021
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 988

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_policy_tag request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 566

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_taxonomy request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 909

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_policy_tags request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @policy_tag_manager_stub, :list_policy_tags, "policy_tags", request, result, options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_taxonomies(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Taxonomy> #list_taxonomies(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::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::Rest::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::Rest::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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_taxonomies request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @policy_tag_manager_stub, :list_taxonomies, "taxonomies", request, result, options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Google::Iam::V1::Policy)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

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

Raises:

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

    if the REST call 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
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 1160

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.set_iam_policy request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Google::Iam::V1::TestIamPermissionsResponse)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

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

Raises:

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

    if the REST call 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
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 1245

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.test_iam_permissions request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


111
112
113
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 111

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

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 818

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.update_policy_tag request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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
426
# File 'lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb', line 393

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.update_taxonomy request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end