google-cloud-data_catalog-v1 0.5.0 → 0.7.3

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