google-cloud-data_catalog-v1beta1 0.a → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +149 -0
- data/README.md +144 -8
- data/lib/google/cloud/data_catalog/v1beta1/data_catalog/client.rb +3303 -0
- data/lib/google/cloud/data_catalog/v1beta1/data_catalog/credentials.rb +47 -0
- data/lib/google/cloud/data_catalog/v1beta1/data_catalog/paths.rb +176 -0
- data/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest/client.rb +3093 -0
- data/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest/service_stub.rb +1782 -0
- data/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest.rb +53 -0
- data/lib/google/cloud/data_catalog/v1beta1/data_catalog.rb +56 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/client.rb +1590 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/credentials.rb +47 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/paths.rb +90 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb +1470 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/service_stub.rb +846 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest.rb +53 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager.rb +56 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/client.rb +522 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/credentials.rb +47 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/paths.rb +69 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest/client.rb +479 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest/service_stub.rb +167 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest.rb +53 -0
- data/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization.rb +56 -0
- data/lib/google/cloud/data_catalog/v1beta1/rest.rb +39 -0
- data/lib/google/cloud/data_catalog/v1beta1/version.rb +7 -2
- data/lib/google/cloud/data_catalog/v1beta1.rb +47 -0
- data/lib/google/cloud/datacatalog/v1beta1/common_pb.rb +43 -0
- data/lib/google/cloud/datacatalog/v1beta1/datacatalog_pb.rb +99 -0
- data/lib/google/cloud/datacatalog/v1beta1/datacatalog_services_pb.rb +229 -0
- data/lib/google/cloud/datacatalog/v1beta1/gcs_fileset_spec_pb.rb +47 -0
- data/lib/google/cloud/datacatalog/v1beta1/policytagmanager_pb.rb +70 -0
- data/lib/google/cloud/datacatalog/v1beta1/policytagmanager_services_pb.rb +73 -0
- data/lib/google/cloud/datacatalog/v1beta1/policytagmanagerserialization_pb.rb +55 -0
- data/lib/google/cloud/datacatalog/v1beta1/policytagmanagerserialization_services_pb.rb +55 -0
- data/lib/google/cloud/datacatalog/v1beta1/schema_pb.rb +45 -0
- data/lib/google/cloud/datacatalog/v1beta1/search_pb.rb +47 -0
- data/lib/google/cloud/datacatalog/v1beta1/table_spec_pb.rb +49 -0
- data/lib/google/cloud/datacatalog/v1beta1/tags_pb.rb +55 -0
- data/lib/google/cloud/datacatalog/v1beta1/timestamps_pb.rb +46 -0
- data/lib/google/cloud/datacatalog/v1beta1/usage_pb.rb +46 -0
- data/lib/google-cloud-data_catalog-v1beta1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +381 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/datacatalog/v1beta1/common.rb +52 -0
- data/proto_docs/google/cloud/datacatalog/v1beta1/datacatalog.rb +830 -0
- data/proto_docs/google/cloud/datacatalog/v1beta1/gcs_fileset_spec.rb +81 -0
- data/proto_docs/google/cloud/datacatalog/v1beta1/policytagmanager.rb +300 -0
- data/proto_docs/google/cloud/datacatalog/v1beta1/policytagmanagerserialization.rb +131 -0
- data/proto_docs/google/cloud/datacatalog/v1beta1/schema.rb +61 -0
- data/proto_docs/google/cloud/datacatalog/v1beta1/search.rb +75 -0
- data/proto_docs/google/cloud/datacatalog/v1beta1/table_spec.rb +102 -0
- data/proto_docs/google/cloud/datacatalog/v1beta1/tags.rb +242 -0
- data/proto_docs/google/cloud/datacatalog/v1beta1/timestamps.rb +42 -0
- data/proto_docs/google/cloud/datacatalog/v1beta1/usage.rb +74 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/type/expr.rb +75 -0
- metadata +242 -13
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/rest"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/data_catalog/v1beta1/version"
|
24
|
+
|
25
|
+
require "google/cloud/data_catalog/v1beta1/policy_tag_manager/credentials"
|
26
|
+
require "google/cloud/data_catalog/v1beta1/policy_tag_manager/paths"
|
27
|
+
require "google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module DataCatalog
|
32
|
+
module V1beta1
|
33
|
+
##
|
34
|
+
# The policy tag manager API service allows clients to manage their taxonomies
|
35
|
+
# and policy tags.
|
36
|
+
#
|
37
|
+
# To load this service and instantiate a REST client:
|
38
|
+
#
|
39
|
+
# require "google/cloud/data_catalog/v1beta1/policy_tag_manager/rest"
|
40
|
+
# client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Rest::Client.new
|
41
|
+
#
|
42
|
+
module PolicyTagManager
|
43
|
+
# Client for the REST transport
|
44
|
+
module Rest
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
53
|
+
require "google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/data_catalog/v1beta1/version"
|
24
|
+
|
25
|
+
require "google/cloud/data_catalog/v1beta1/policy_tag_manager/credentials"
|
26
|
+
require "google/cloud/data_catalog/v1beta1/policy_tag_manager/paths"
|
27
|
+
require "google/cloud/data_catalog/v1beta1/policy_tag_manager/client"
|
28
|
+
require "google/cloud/data_catalog/v1beta1/policy_tag_manager/rest"
|
29
|
+
|
30
|
+
module Google
|
31
|
+
module Cloud
|
32
|
+
module DataCatalog
|
33
|
+
module V1beta1
|
34
|
+
##
|
35
|
+
# The policy tag manager API service allows clients to manage their taxonomies
|
36
|
+
# and policy tags.
|
37
|
+
#
|
38
|
+
# @example Load this service and instantiate a gRPC client
|
39
|
+
#
|
40
|
+
# require "google/cloud/data_catalog/v1beta1/policy_tag_manager"
|
41
|
+
# client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new
|
42
|
+
#
|
43
|
+
# @example Load this service and instantiate a REST client
|
44
|
+
#
|
45
|
+
# require "google/cloud/data_catalog/v1beta1/policy_tag_manager/rest"
|
46
|
+
# client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Rest::Client.new
|
47
|
+
#
|
48
|
+
module PolicyTagManager
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
helper_path = ::File.join __dir__, "policy_tag_manager", "helpers.rb"
|
56
|
+
require "google/cloud/data_catalog/v1beta1/policy_tag_manager/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,522 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/datacatalog/v1beta1/policytagmanagerserialization_pb"
|
21
|
+
require "google/iam/v1"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module DataCatalog
|
26
|
+
module V1beta1
|
27
|
+
module PolicyTagManagerSerialization
|
28
|
+
##
|
29
|
+
# Client for the PolicyTagManagerSerialization service.
|
30
|
+
#
|
31
|
+
# Policy tag manager serialization API service allows clients to manipulate
|
32
|
+
# their taxonomies and policy tags data with serialized format.
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
include Paths
|
36
|
+
|
37
|
+
# @private
|
38
|
+
attr_reader :policy_tag_manager_serialization_stub
|
39
|
+
|
40
|
+
##
|
41
|
+
# Configure the PolicyTagManagerSerialization Client class.
|
42
|
+
#
|
43
|
+
# See {::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client::Configuration}
|
44
|
+
# for a description of the configuration fields.
|
45
|
+
#
|
46
|
+
# @example
|
47
|
+
#
|
48
|
+
# # Modify the configuration for all PolicyTagManagerSerialization clients
|
49
|
+
# ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.configure do |config|
|
50
|
+
# config.timeout = 10.0
|
51
|
+
# end
|
52
|
+
#
|
53
|
+
# @yield [config] Configure the Client client.
|
54
|
+
# @yieldparam config [Client::Configuration]
|
55
|
+
#
|
56
|
+
# @return [Client::Configuration]
|
57
|
+
#
|
58
|
+
def self.configure
|
59
|
+
@configure ||= begin
|
60
|
+
namespace = ["Google", "Cloud", "DataCatalog", "V1beta1"]
|
61
|
+
parent_config = while namespace.any?
|
62
|
+
parent_name = namespace.join "::"
|
63
|
+
parent_const = const_get parent_name
|
64
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
65
|
+
namespace.pop
|
66
|
+
end
|
67
|
+
default_config = Client::Configuration.new parent_config
|
68
|
+
|
69
|
+
default_config.timeout = 60.0
|
70
|
+
|
71
|
+
default_config
|
72
|
+
end
|
73
|
+
yield @configure if block_given?
|
74
|
+
@configure
|
75
|
+
end
|
76
|
+
|
77
|
+
##
|
78
|
+
# Configure the PolicyTagManagerSerialization Client instance.
|
79
|
+
#
|
80
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
81
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
82
|
+
# should be made on {Client.configure}.
|
83
|
+
#
|
84
|
+
# See {::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client::Configuration}
|
85
|
+
# for a description of the configuration fields.
|
86
|
+
#
|
87
|
+
# @yield [config] Configure the Client client.
|
88
|
+
# @yieldparam config [Client::Configuration]
|
89
|
+
#
|
90
|
+
# @return [Client::Configuration]
|
91
|
+
#
|
92
|
+
def configure
|
93
|
+
yield @config if block_given?
|
94
|
+
@config
|
95
|
+
end
|
96
|
+
|
97
|
+
##
|
98
|
+
# Create a new PolicyTagManagerSerialization client object.
|
99
|
+
#
|
100
|
+
# @example
|
101
|
+
#
|
102
|
+
# # Create a client using the default configuration
|
103
|
+
# client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.new
|
104
|
+
#
|
105
|
+
# # Create a client using a custom configuration
|
106
|
+
# client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.new do |config|
|
107
|
+
# config.timeout = 10.0
|
108
|
+
# end
|
109
|
+
#
|
110
|
+
# @yield [config] Configure the PolicyTagManagerSerialization client.
|
111
|
+
# @yieldparam config [Client::Configuration]
|
112
|
+
#
|
113
|
+
def initialize
|
114
|
+
# These require statements are intentionally placed here to initialize
|
115
|
+
# the gRPC module only when it's required.
|
116
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
117
|
+
require "gapic/grpc"
|
118
|
+
require "google/cloud/datacatalog/v1beta1/policytagmanagerserialization_services_pb"
|
119
|
+
|
120
|
+
# Create the configuration object
|
121
|
+
@config = Configuration.new Client.configure
|
122
|
+
|
123
|
+
# Yield the configuration if needed
|
124
|
+
yield @config if block_given?
|
125
|
+
|
126
|
+
# Create credentials
|
127
|
+
credentials = @config.credentials
|
128
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
129
|
+
# but only if the default endpoint does not have a region prefix.
|
130
|
+
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
131
|
+
!@config.endpoint.split(".").first.include?("-")
|
132
|
+
credentials ||= Credentials.default scope: @config.scope,
|
133
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
134
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
135
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
136
|
+
end
|
137
|
+
@quota_project_id = @config.quota_project
|
138
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
139
|
+
|
140
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
141
|
+
config.credentials = credentials
|
142
|
+
config.quota_project = @quota_project_id
|
143
|
+
config.endpoint = @config.endpoint
|
144
|
+
end
|
145
|
+
|
146
|
+
@policy_tag_manager_serialization_stub = ::Gapic::ServiceStub.new(
|
147
|
+
::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Stub,
|
148
|
+
credentials: credentials,
|
149
|
+
endpoint: @config.endpoint,
|
150
|
+
channel_args: @config.channel_args,
|
151
|
+
interceptors: @config.interceptors,
|
152
|
+
channel_pool_config: @config.channel_pool
|
153
|
+
)
|
154
|
+
end
|
155
|
+
|
156
|
+
##
|
157
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
158
|
+
#
|
159
|
+
# @return [Google::Iam::V1::IAMPolicy::Client]
|
160
|
+
#
|
161
|
+
attr_reader :iam_policy_client
|
162
|
+
|
163
|
+
# Service calls
|
164
|
+
|
165
|
+
##
|
166
|
+
# Imports all taxonomies and their policy tags to a project as new
|
167
|
+
# taxonomies.
|
168
|
+
#
|
169
|
+
# This method provides a bulk taxonomy / policy tag creation using nested
|
170
|
+
# proto structure.
|
171
|
+
#
|
172
|
+
# @overload import_taxonomies(request, options = nil)
|
173
|
+
# Pass arguments to `import_taxonomies` via a request object, either of type
|
174
|
+
# {::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest} or an equivalent Hash.
|
175
|
+
#
|
176
|
+
# @param request [::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest, ::Hash]
|
177
|
+
# A request object representing the call parameters. Required. To specify no
|
178
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
179
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
180
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
181
|
+
#
|
182
|
+
# @overload import_taxonomies(parent: nil, inline_source: nil)
|
183
|
+
# Pass arguments to `import_taxonomies` via keyword arguments. Note that at
|
184
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
185
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
186
|
+
#
|
187
|
+
# @param parent [::String]
|
188
|
+
# Required. Resource name of project that the imported taxonomies will belong
|
189
|
+
# to.
|
190
|
+
# @param inline_source [::Google::Cloud::DataCatalog::V1beta1::InlineSource, ::Hash]
|
191
|
+
# Inline source used for taxonomies to be imported.
|
192
|
+
#
|
193
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
194
|
+
# @yieldparam response [::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesResponse]
|
195
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
196
|
+
#
|
197
|
+
# @return [::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesResponse]
|
198
|
+
#
|
199
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
200
|
+
#
|
201
|
+
# @example Basic example
|
202
|
+
# require "google/cloud/data_catalog/v1beta1"
|
203
|
+
#
|
204
|
+
# # Create a client object. The client can be reused for multiple calls.
|
205
|
+
# client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.new
|
206
|
+
#
|
207
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
208
|
+
# request = Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest.new
|
209
|
+
#
|
210
|
+
# # Call the import_taxonomies method.
|
211
|
+
# result = client.import_taxonomies request
|
212
|
+
#
|
213
|
+
# # The returned object is of type Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesResponse.
|
214
|
+
# p result
|
215
|
+
#
|
216
|
+
def import_taxonomies request, options = nil
|
217
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
218
|
+
|
219
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::ImportTaxonomiesRequest
|
220
|
+
|
221
|
+
# Converts hash and nil to an options object
|
222
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
223
|
+
|
224
|
+
# Customize the options with defaults
|
225
|
+
metadata = @config.rpcs.import_taxonomies.metadata.to_h
|
226
|
+
|
227
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
228
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
229
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
230
|
+
gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
|
231
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
232
|
+
|
233
|
+
header_params = {}
|
234
|
+
if request.parent
|
235
|
+
header_params["parent"] = request.parent
|
236
|
+
end
|
237
|
+
|
238
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
239
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
240
|
+
|
241
|
+
options.apply_defaults timeout: @config.rpcs.import_taxonomies.timeout,
|
242
|
+
metadata: metadata,
|
243
|
+
retry_policy: @config.rpcs.import_taxonomies.retry_policy
|
244
|
+
|
245
|
+
options.apply_defaults timeout: @config.timeout,
|
246
|
+
metadata: @config.metadata,
|
247
|
+
retry_policy: @config.retry_policy
|
248
|
+
|
249
|
+
@policy_tag_manager_serialization_stub.call_rpc :import_taxonomies, request, options: options do |response, operation|
|
250
|
+
yield response, operation if block_given?
|
251
|
+
return response
|
252
|
+
end
|
253
|
+
rescue ::GRPC::BadStatus => e
|
254
|
+
raise ::Google::Cloud::Error.from_error(e)
|
255
|
+
end
|
256
|
+
|
257
|
+
##
|
258
|
+
# Exports all taxonomies and their policy tags in a project.
|
259
|
+
#
|
260
|
+
# This method generates SerializedTaxonomy protos with nested policy tags
|
261
|
+
# that can be used as an input for future ImportTaxonomies calls.
|
262
|
+
#
|
263
|
+
# @overload export_taxonomies(request, options = nil)
|
264
|
+
# Pass arguments to `export_taxonomies` via a request object, either of type
|
265
|
+
# {::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest} or an equivalent Hash.
|
266
|
+
#
|
267
|
+
# @param request [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest, ::Hash]
|
268
|
+
# A request object representing the call parameters. Required. To specify no
|
269
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
270
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
271
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
272
|
+
#
|
273
|
+
# @overload export_taxonomies(parent: nil, taxonomies: nil, serialized_taxonomies: nil)
|
274
|
+
# Pass arguments to `export_taxonomies` via keyword arguments. Note that at
|
275
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
276
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
277
|
+
#
|
278
|
+
# @param parent [::String]
|
279
|
+
# Required. Resource name of the project that taxonomies to be exported
|
280
|
+
# will share.
|
281
|
+
# @param taxonomies [::Array<::String>]
|
282
|
+
# Required. Resource names of the taxonomies to be exported.
|
283
|
+
# @param serialized_taxonomies [::Boolean]
|
284
|
+
# Export taxonomies as serialized taxonomies.
|
285
|
+
#
|
286
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
287
|
+
# @yieldparam response [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse]
|
288
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
289
|
+
#
|
290
|
+
# @return [::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse]
|
291
|
+
#
|
292
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
293
|
+
#
|
294
|
+
# @example Basic example
|
295
|
+
# require "google/cloud/data_catalog/v1beta1"
|
296
|
+
#
|
297
|
+
# # Create a client object. The client can be reused for multiple calls.
|
298
|
+
# client = Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.new
|
299
|
+
#
|
300
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
301
|
+
# request = Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest.new
|
302
|
+
#
|
303
|
+
# # Call the export_taxonomies method.
|
304
|
+
# result = client.export_taxonomies request
|
305
|
+
#
|
306
|
+
# # The returned object is of type Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesResponse.
|
307
|
+
# p result
|
308
|
+
#
|
309
|
+
def export_taxonomies request, options = nil
|
310
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
311
|
+
|
312
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1beta1::ExportTaxonomiesRequest
|
313
|
+
|
314
|
+
# Converts hash and nil to an options object
|
315
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
316
|
+
|
317
|
+
# Customize the options with defaults
|
318
|
+
metadata = @config.rpcs.export_taxonomies.metadata.to_h
|
319
|
+
|
320
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
321
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
322
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
323
|
+
gapic_version: ::Google::Cloud::DataCatalog::V1beta1::VERSION
|
324
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
325
|
+
|
326
|
+
header_params = {}
|
327
|
+
if request.parent
|
328
|
+
header_params["parent"] = request.parent
|
329
|
+
end
|
330
|
+
|
331
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
332
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
333
|
+
|
334
|
+
options.apply_defaults timeout: @config.rpcs.export_taxonomies.timeout,
|
335
|
+
metadata: metadata,
|
336
|
+
retry_policy: @config.rpcs.export_taxonomies.retry_policy
|
337
|
+
|
338
|
+
options.apply_defaults timeout: @config.timeout,
|
339
|
+
metadata: @config.metadata,
|
340
|
+
retry_policy: @config.retry_policy
|
341
|
+
|
342
|
+
@policy_tag_manager_serialization_stub.call_rpc :export_taxonomies, request, options: options do |response, operation|
|
343
|
+
yield response, operation if block_given?
|
344
|
+
return response
|
345
|
+
end
|
346
|
+
rescue ::GRPC::BadStatus => e
|
347
|
+
raise ::Google::Cloud::Error.from_error(e)
|
348
|
+
end
|
349
|
+
|
350
|
+
##
|
351
|
+
# Configuration class for the PolicyTagManagerSerialization API.
|
352
|
+
#
|
353
|
+
# This class represents the configuration for PolicyTagManagerSerialization,
|
354
|
+
# providing control over timeouts, retry behavior, logging, transport
|
355
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
356
|
+
# applied individually to specific RPCs. See
|
357
|
+
# {::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client::Configuration::Rpcs}
|
358
|
+
# for a list of RPCs that can be configured independently.
|
359
|
+
#
|
360
|
+
# Configuration can be applied globally to all clients, or to a single client
|
361
|
+
# on construction.
|
362
|
+
#
|
363
|
+
# @example
|
364
|
+
#
|
365
|
+
# # Modify the global config, setting the timeout for
|
366
|
+
# # import_taxonomies to 20 seconds,
|
367
|
+
# # and all remaining timeouts to 10 seconds.
|
368
|
+
# ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.configure do |config|
|
369
|
+
# config.timeout = 10.0
|
370
|
+
# config.rpcs.import_taxonomies.timeout = 20.0
|
371
|
+
# end
|
372
|
+
#
|
373
|
+
# # Apply the above configuration only to a new client.
|
374
|
+
# client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.new do |config|
|
375
|
+
# config.timeout = 10.0
|
376
|
+
# config.rpcs.import_taxonomies.timeout = 20.0
|
377
|
+
# end
|
378
|
+
#
|
379
|
+
# @!attribute [rw] endpoint
|
380
|
+
# The hostname or hostname:port of the service endpoint.
|
381
|
+
# Defaults to `"datacatalog.googleapis.com"`.
|
382
|
+
# @return [::String]
|
383
|
+
# @!attribute [rw] credentials
|
384
|
+
# Credentials to send with calls. You may provide any of the following types:
|
385
|
+
# * (`String`) The path to a service account key file in JSON format
|
386
|
+
# * (`Hash`) A service account key as a Hash
|
387
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
388
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
389
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
390
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
391
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
392
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
393
|
+
# * (`nil`) indicating no credentials
|
394
|
+
# @return [::Object]
|
395
|
+
# @!attribute [rw] scope
|
396
|
+
# The OAuth scopes
|
397
|
+
# @return [::Array<::String>]
|
398
|
+
# @!attribute [rw] lib_name
|
399
|
+
# The library name as recorded in instrumentation and logging
|
400
|
+
# @return [::String]
|
401
|
+
# @!attribute [rw] lib_version
|
402
|
+
# The library version as recorded in instrumentation and logging
|
403
|
+
# @return [::String]
|
404
|
+
# @!attribute [rw] channel_args
|
405
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
406
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
407
|
+
# @return [::Hash]
|
408
|
+
# @!attribute [rw] interceptors
|
409
|
+
# An array of interceptors that are run before calls are executed.
|
410
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
411
|
+
# @!attribute [rw] timeout
|
412
|
+
# The call timeout in seconds.
|
413
|
+
# @return [::Numeric]
|
414
|
+
# @!attribute [rw] metadata
|
415
|
+
# Additional gRPC headers to be sent with the call.
|
416
|
+
# @return [::Hash{::Symbol=>::String}]
|
417
|
+
# @!attribute [rw] retry_policy
|
418
|
+
# The retry policy. The value is a hash with the following keys:
|
419
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
420
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
421
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
422
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
423
|
+
# trigger a retry.
|
424
|
+
# @return [::Hash]
|
425
|
+
# @!attribute [rw] quota_project
|
426
|
+
# A separate project against which to charge quota.
|
427
|
+
# @return [::String]
|
428
|
+
#
|
429
|
+
class Configuration
|
430
|
+
extend ::Gapic::Config
|
431
|
+
|
432
|
+
DEFAULT_ENDPOINT = "datacatalog.googleapis.com"
|
433
|
+
|
434
|
+
config_attr :endpoint, DEFAULT_ENDPOINT, ::String
|
435
|
+
config_attr :credentials, nil do |value|
|
436
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
437
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
438
|
+
allowed.any? { |klass| klass === value }
|
439
|
+
end
|
440
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
441
|
+
config_attr :lib_name, nil, ::String, nil
|
442
|
+
config_attr :lib_version, nil, ::String, nil
|
443
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
444
|
+
config_attr :interceptors, nil, ::Array, nil
|
445
|
+
config_attr :timeout, nil, ::Numeric, nil
|
446
|
+
config_attr :metadata, nil, ::Hash, nil
|
447
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
448
|
+
config_attr :quota_project, nil, ::String, nil
|
449
|
+
|
450
|
+
# @private
|
451
|
+
def initialize parent_config = nil
|
452
|
+
@parent_config = parent_config unless parent_config.nil?
|
453
|
+
|
454
|
+
yield self if block_given?
|
455
|
+
end
|
456
|
+
|
457
|
+
##
|
458
|
+
# Configurations for individual RPCs
|
459
|
+
# @return [Rpcs]
|
460
|
+
#
|
461
|
+
def rpcs
|
462
|
+
@rpcs ||= begin
|
463
|
+
parent_rpcs = nil
|
464
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
465
|
+
Rpcs.new parent_rpcs
|
466
|
+
end
|
467
|
+
end
|
468
|
+
|
469
|
+
##
|
470
|
+
# Configuration for the channel pool
|
471
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
472
|
+
#
|
473
|
+
def channel_pool
|
474
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
475
|
+
end
|
476
|
+
|
477
|
+
##
|
478
|
+
# Configuration RPC class for the PolicyTagManagerSerialization API.
|
479
|
+
#
|
480
|
+
# Includes fields providing the configuration for each RPC in this service.
|
481
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
482
|
+
# the following configuration fields:
|
483
|
+
#
|
484
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
485
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
486
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
487
|
+
# include the following keys:
|
488
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
489
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
490
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
491
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
492
|
+
# trigger a retry.
|
493
|
+
#
|
494
|
+
class Rpcs
|
495
|
+
##
|
496
|
+
# RPC-specific configuration for `import_taxonomies`
|
497
|
+
# @return [::Gapic::Config::Method]
|
498
|
+
#
|
499
|
+
attr_reader :import_taxonomies
|
500
|
+
##
|
501
|
+
# RPC-specific configuration for `export_taxonomies`
|
502
|
+
# @return [::Gapic::Config::Method]
|
503
|
+
#
|
504
|
+
attr_reader :export_taxonomies
|
505
|
+
|
506
|
+
# @private
|
507
|
+
def initialize parent_rpcs = nil
|
508
|
+
import_taxonomies_config = parent_rpcs.import_taxonomies if parent_rpcs.respond_to? :import_taxonomies
|
509
|
+
@import_taxonomies = ::Gapic::Config::Method.new import_taxonomies_config
|
510
|
+
export_taxonomies_config = parent_rpcs.export_taxonomies if parent_rpcs.respond_to? :export_taxonomies
|
511
|
+
@export_taxonomies = ::Gapic::Config::Method.new export_taxonomies_config
|
512
|
+
|
513
|
+
yield self if block_given?
|
514
|
+
end
|
515
|
+
end
|
516
|
+
end
|
517
|
+
end
|
518
|
+
end
|
519
|
+
end
|
520
|
+
end
|
521
|
+
end
|
522
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "googleauth"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module DataCatalog
|
24
|
+
module V1beta1
|
25
|
+
module PolicyTagManagerSerialization
|
26
|
+
# Credentials for the PolicyTagManagerSerialization API.
|
27
|
+
class Credentials < ::Google::Auth::Credentials
|
28
|
+
self.scope = [
|
29
|
+
"https://www.googleapis.com/auth/cloud-platform"
|
30
|
+
]
|
31
|
+
self.env_vars = [
|
32
|
+
"GOOGLE_CLOUD_CREDENTIALS",
|
33
|
+
"GOOGLE_CLOUD_KEYFILE",
|
34
|
+
"GCLOUD_KEYFILE",
|
35
|
+
"GOOGLE_CLOUD_CREDENTIALS_JSON",
|
36
|
+
"GOOGLE_CLOUD_KEYFILE_JSON",
|
37
|
+
"GCLOUD_KEYFILE_JSON"
|
38
|
+
]
|
39
|
+
self.paths = [
|
40
|
+
"~/.config/google_cloud/application_default_credentials.json"
|
41
|
+
]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|