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

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

Overview

REST client for the PolicyTagManager service.

The policy tag manager API service allows clients to manage their taxonomies and policy tags.

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::V1beta1::PolicyTagManager::Rest::Client.new

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

Yields:

  • (config)

    Configure the PolicyTagManager client.

Yield Parameters:



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 127

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::V1beta1::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)


170
171
172
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 170

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

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



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

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "DataCatalog", "V1beta1"]
    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:



97
98
99
100
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 97

def configure
  yield @config if block_given?
  @config
end

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

Creates a policy tag in the specified taxonomy.

Examples:

Basic example

require "google/cloud/data_catalog/v1beta1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1beta1::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::V1beta1::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::V1beta1::PolicyTag, ::Hash) (defaults to: nil)

      The policy tag to be created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 634

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::V1beta1::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::V1beta1::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::V1beta1::Taxonomy #create_taxonomy(parent: nil, taxonomy: nil) ⇒ ::Google::Cloud::DataCatalog::V1beta1::Taxonomy

Creates a taxonomy in the specified project.

Examples:

Basic example

require "google/cloud/data_catalog/v1beta1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1beta1::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::V1beta1::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:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



219
220
221
222
223
224
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
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 219

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::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::V1beta1::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. Also deletes all of its descendant policy tags.

Examples:

Basic example

require "google/cloud/data_catalog/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1beta1::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::V1beta1::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 be deleted. All of its descendant policy tags will also be 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.



713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 713

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::V1beta1::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::V1beta1::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. This operation will also delete all policy tags in this taxonomy along with their associated policies.

Examples:

Basic example

require "google/cloud/data_catalog/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1beta1::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::V1beta1::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 be deleted. All policy tags in this taxonomy will also be 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.



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

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::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::V1beta1::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 taxonomy or a policy tag.

Examples:

Basic example

require "google/cloud/data_catalog/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1beta1::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.



1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 1049

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::V1beta1::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::V1beta1::PolicyTag #get_policy_tag(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1beta1::PolicyTag

Gets a policy tag.

Examples:

Basic example

require "google/cloud/data_catalog/v1beta1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1beta1::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::V1beta1::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 requested 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.



967
968
969
970
971
972
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
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 967

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::V1beta1::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::V1beta1::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::V1beta1::Taxonomy #get_taxonomy(name: nil) ⇒ ::Google::Cloud::DataCatalog::V1beta1::Taxonomy

Gets a taxonomy.

Examples:

Basic example

require "google/cloud/data_catalog/v1beta1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1beta1::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::V1beta1::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 requested taxonomy.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 554

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

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

Lists all policy tags in a taxonomy.

Examples:

Basic example

require "google/cloud/data_catalog/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1beta1::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::V1beta1::PolicyTag.
  p item
end

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1beta1::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::V1beta1::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. If not set, defaults to 50.

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

      The next_page_token value returned from a previous List request, if any. If not set, defaults to an empty string.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 888

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

Lists all taxonomies in a project in a particular location that the caller has permission to view.

Examples:

Basic example

require "google/cloud/data_catalog/v1beta1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataCatalog::V1beta1::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::V1beta1::Taxonomy.
  p item
end

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::DataCatalog::V1beta1::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::V1beta1::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. If not set, defaults to 50.

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

      The next_page_token value returned from a previous list request, if any. If not set, defaults to an empty string.

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



475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 475

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::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::V1beta1::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 taxonomy or a policy tag.

Examples:

Basic example

require "google/cloud/data_catalog/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1beta1::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.



1139
1140
1141
1142
1143
1144
1145
1146
1147
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
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 1139

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::V1beta1::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 the permissions that a caller has on the specified taxonomy or policy tag.

Examples:

Basic example

require "google/cloud/data_catalog/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataCatalog::V1beta1::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.



1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 1224

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::V1beta1::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)


107
108
109
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 107

def universe_domain
  @policy_tag_manager_stub.universe_domain
end

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

Updates a policy tag.

Examples:

Basic example

require "google/cloud/data_catalog/v1beta1"

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

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

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

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

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 800

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::V1beta1::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::V1beta1::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::V1beta1::Taxonomy #update_taxonomy(taxonomy: nil, update_mask: nil) ⇒ ::Google::Cloud::DataCatalog::V1beta1::Taxonomy

Updates a taxonomy.

Examples:

Basic example

require "google/cloud/data_catalog/v1beta1"

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

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

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

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

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb', line 383

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::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::V1beta1::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