google-cloud-data_catalog-v1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +24 -0
  6. data/lib/google-cloud-data_catalog-v1.rb +1 -0
  7. data/lib/google/cloud/common_resources_pb.rb +15 -0
  8. data/lib/google/cloud/data_catalog/v1.rb +19 -0
  9. data/lib/google/cloud/data_catalog/v1/data_catalog.rb +20 -0
  10. data/lib/google/cloud/data_catalog/v1/data_catalog/client.rb +2639 -0
  11. data/lib/google/cloud/data_catalog/v1/data_catalog/credentials.rb +51 -0
  12. data/lib/google/cloud/data_catalog/v1/data_catalog/paths.rb +136 -0
  13. data/lib/google/cloud/data_catalog/v1/version.rb +28 -0
  14. data/lib/google/cloud/datacatalog/v1/common_pb.rb +24 -0
  15. data/lib/google/cloud/datacatalog/v1/datacatalog_pb.rb +226 -0
  16. data/lib/google/cloud/datacatalog/v1/datacatalog_services_pb.rb +222 -0
  17. data/lib/google/cloud/datacatalog/v1/gcs_fileset_spec_pb.rb +31 -0
  18. data/lib/google/cloud/datacatalog/v1/schema_pb.rb +31 -0
  19. data/lib/google/cloud/datacatalog/v1/search_pb.rb +39 -0
  20. data/lib/google/cloud/datacatalog/v1/table_spec_pb.rb +48 -0
  21. data/lib/google/cloud/datacatalog/v1/tags_pb.rb +84 -0
  22. data/lib/google/cloud/datacatalog/v1/timestamps_pb.rb +26 -0
  23. data/proto_docs/README.md +4 -0
  24. data/proto_docs/google/api/field_behavior.rb +59 -0
  25. data/proto_docs/google/api/resource.rb +247 -0
  26. data/proto_docs/google/cloud/datacatalog/v1/common.rb +39 -0
  27. data/proto_docs/google/cloud/datacatalog/v1/datacatalog.rb +748 -0
  28. data/proto_docs/google/cloud/datacatalog/v1/gcs_fileset_spec.rb +79 -0
  29. data/proto_docs/google/cloud/datacatalog/v1/schema.rb +60 -0
  30. data/proto_docs/google/cloud/datacatalog/v1/search.rb +80 -0
  31. data/proto_docs/google/cloud/datacatalog/v1/table_spec.rb +98 -0
  32. data/proto_docs/google/cloud/datacatalog/v1/tags.rb +238 -0
  33. data/proto_docs/google/cloud/datacatalog/v1/timestamps.rb +42 -0
  34. data/proto_docs/google/iam/v1/iam_policy.rb +79 -0
  35. data/proto_docs/google/iam/v1/policy.rb +156 -0
  36. data/proto_docs/google/protobuf/empty.rb +36 -0
  37. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  38. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  39. metadata +207 -0
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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/data_catalog/v1/data_catalog/client"
20
+ require "google/cloud/data_catalog/v1/data_catalog/credentials"
@@ -0,0 +1,2639 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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/errors"
24
+ require "google/cloud/data_catalog/v1/version"
25
+ require "google/cloud/datacatalog/v1/datacatalog_pb"
26
+ require "google/cloud/data_catalog/v1/data_catalog/credentials"
27
+ require "google/cloud/data_catalog/v1/data_catalog/paths"
28
+
29
+ module Google
30
+ module Cloud
31
+ module DataCatalog
32
+ module V1
33
+ module DataCatalog
34
+ ##
35
+ # Client for the DataCatalog service.
36
+ #
37
+ # Data Catalog API service allows clients to discover, understand, and manage
38
+ # their data.
39
+ #
40
+ class Client
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :data_catalog_stub
45
+
46
+ ##
47
+ # Configure the DataCatalog Client class.
48
+ #
49
+ # See {Google::Cloud::DataCatalog::V1::DataCatalog::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # ## Example
53
+ #
54
+ # To modify the configuration for all DataCatalog clients:
55
+ #
56
+ # Google::Cloud::DataCatalog::V1::DataCatalog::Client.configure do |config|
57
+ # config.timeout = 10_000
58
+ # end
59
+ #
60
+ # @yield [config] Configure the Client client.
61
+ # @yieldparam config [Client::Configuration]
62
+ #
63
+ # @return [Client::Configuration]
64
+ #
65
+ def self.configure
66
+ @configure ||= begin
67
+ namespace = ["Google", "Cloud", "DataCatalog", "V1"]
68
+ parent_config = while namespace.any?
69
+ parent_name = namespace.join "::"
70
+ parent_const = const_get parent_name
71
+ break parent_const.configure if parent_const&.respond_to? :configure
72
+ namespace.pop
73
+ end
74
+ default_config = Client::Configuration.new parent_config
75
+
76
+ default_config.timeout = 60.0
77
+
78
+ default_config.rpcs.search_catalog.timeout = 60.0
79
+ default_config.rpcs.search_catalog.retry_policy = {
80
+ initial_delay: 0.1,
81
+ max_delay: 60.0,
82
+ multiplier: 1.3,
83
+ retry_codes: ["UNAVAILABLE"]
84
+ }
85
+
86
+ default_config.rpcs.get_entry_group.timeout = 60.0
87
+ default_config.rpcs.get_entry_group.retry_policy = {
88
+ initial_delay: 0.1,
89
+ max_delay: 60.0,
90
+ multiplier: 1.3,
91
+ retry_codes: ["UNAVAILABLE"]
92
+ }
93
+
94
+ default_config.rpcs.list_entry_groups.timeout = 60.0
95
+ default_config.rpcs.list_entry_groups.retry_policy = {
96
+ initial_delay: 0.1,
97
+ max_delay: 60.0,
98
+ multiplier: 1.3,
99
+ retry_codes: ["UNAVAILABLE"]
100
+ }
101
+
102
+ default_config.rpcs.get_entry.timeout = 60.0
103
+ default_config.rpcs.get_entry.retry_policy = {
104
+ initial_delay: 0.1,
105
+ max_delay: 60.0,
106
+ multiplier: 1.3,
107
+ retry_codes: ["UNAVAILABLE"]
108
+ }
109
+
110
+ default_config.rpcs.lookup_entry.timeout = 60.0
111
+ default_config.rpcs.lookup_entry.retry_policy = {
112
+ initial_delay: 0.1,
113
+ max_delay: 60.0,
114
+ multiplier: 1.3,
115
+ retry_codes: ["UNAVAILABLE"]
116
+ }
117
+
118
+ default_config.rpcs.list_entries.timeout = 60.0
119
+ default_config.rpcs.list_entries.retry_policy = {
120
+ initial_delay: 0.1,
121
+ max_delay: 60.0,
122
+ multiplier: 1.3,
123
+ retry_codes: ["UNAVAILABLE"]
124
+ }
125
+
126
+ default_config.rpcs.list_tags.timeout = 60.0
127
+ default_config.rpcs.list_tags.retry_policy = {
128
+ initial_delay: 0.1,
129
+ max_delay: 60.0,
130
+ multiplier: 1.3,
131
+ retry_codes: ["UNAVAILABLE"]
132
+ }
133
+
134
+ default_config.rpcs.get_iam_policy.timeout = 60.0
135
+ default_config.rpcs.get_iam_policy.retry_policy = {
136
+ initial_delay: 0.1,
137
+ max_delay: 60.0,
138
+ multiplier: 1.3,
139
+ retry_codes: ["UNAVAILABLE"]
140
+ }
141
+
142
+ default_config
143
+ end
144
+ yield @configure if block_given?
145
+ @configure
146
+ end
147
+
148
+ ##
149
+ # Configure the DataCatalog Client instance.
150
+ #
151
+ # The configuration is set to the derived mode, meaning that values can be changed,
152
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
153
+ # should be made on {Client.configure}.
154
+ #
155
+ # See {Google::Cloud::DataCatalog::V1::DataCatalog::Client::Configuration}
156
+ # for a description of the configuration fields.
157
+ #
158
+ # @yield [config] Configure the Client client.
159
+ # @yieldparam config [Client::Configuration]
160
+ #
161
+ # @return [Client::Configuration]
162
+ #
163
+ def configure
164
+ yield @config if block_given?
165
+ @config
166
+ end
167
+
168
+ ##
169
+ # Create a new DataCatalog client object.
170
+ #
171
+ # ## Examples
172
+ #
173
+ # To create a new DataCatalog client with the default
174
+ # configuration:
175
+ #
176
+ # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new
177
+ #
178
+ # To create a new DataCatalog client with a custom
179
+ # configuration:
180
+ #
181
+ # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config|
182
+ # config.timeout = 10_000
183
+ # end
184
+ #
185
+ # @yield [config] Configure the DataCatalog client.
186
+ # @yieldparam config [Client::Configuration]
187
+ #
188
+ def initialize
189
+ # These require statements are intentionally placed here to initialize
190
+ # the gRPC module only when it's required.
191
+ # See https://github.com/googleapis/toolkit/issues/446
192
+ require "gapic/grpc"
193
+ require "google/cloud/datacatalog/v1/datacatalog_services_pb"
194
+
195
+ # Create the configuration object
196
+ @config = Configuration.new Client.configure
197
+
198
+ # Yield the configuration if needed
199
+ yield @config if block_given?
200
+
201
+ # Create credentials
202
+ credentials = @config.credentials
203
+ credentials ||= Credentials.default scope: @config.scope
204
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
205
+ credentials = Credentials.new credentials, scope: @config.scope
206
+ end
207
+ @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
208
+
209
+ @data_catalog_stub = Gapic::ServiceStub.new(
210
+ Google::Cloud::DataCatalog::V1::DataCatalog::Stub,
211
+ credentials: credentials,
212
+ endpoint: @config.endpoint,
213
+ channel_args: @config.channel_args,
214
+ interceptors: @config.interceptors
215
+ )
216
+ end
217
+
218
+ # Service calls
219
+
220
+ ##
221
+ # Searches Data Catalog for multiple resources like entries, tags that
222
+ # match a query.
223
+ #
224
+ # This is a custom method
225
+ # (https://cloud.google.com/apis/design/custom_methods) and does not return
226
+ # the complete resource, only the resource identifier and high level
227
+ # fields. Clients can subsequentally call `Get` methods.
228
+ #
229
+ # Note that Data Catalog search queries do not guarantee full recall. Query
230
+ # results that match your query may not be returned, even in subsequent
231
+ # result pages. Also note that results returned (and not returned) can vary
232
+ # across repeated search queries.
233
+ #
234
+ # See [Data Catalog Search
235
+ # Syntax](/data-catalog/docs/how-to/search-reference) for more information.
236
+ #
237
+ # @overload search_catalog(request, options = nil)
238
+ # @param request [Google::Cloud::DataCatalog::V1::SearchCatalogRequest | Hash]
239
+ # Searches Data Catalog for multiple resources like entries, tags that
240
+ # match a query.
241
+ #
242
+ # This is a custom method
243
+ # (https://cloud.google.com/apis/design/custom_methods) and does not return
244
+ # the complete resource, only the resource identifier and high level
245
+ # fields. Clients can subsequentally call `Get` methods.
246
+ #
247
+ # Note that Data Catalog search queries do not guarantee full recall. Query
248
+ # results that match your query may not be returned, even in subsequent
249
+ # result pages. Also note that results returned (and not returned) can vary
250
+ # across repeated search queries.
251
+ #
252
+ # See [Data Catalog Search
253
+ # Syntax](/data-catalog/docs/how-to/search-reference) for more information.
254
+ # @param options [Gapic::CallOptions, Hash]
255
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
256
+ #
257
+ # @overload search_catalog(scope: nil, query: nil, page_size: nil, page_token: nil, order_by: nil)
258
+ # @param scope [Google::Cloud::DataCatalog::V1::SearchCatalogRequest::Scope | Hash]
259
+ # Required. The scope of this search request. A `scope` that has empty
260
+ # `include_org_ids`, `include_project_ids` AND false
261
+ # `include_gcp_public_datasets` is considered invalid. Data Catalog will
262
+ # return an error in such a case.
263
+ # @param query [String]
264
+ # Required. The query string in search query syntax. The query must be non-empty.
265
+ #
266
+ # Query strings can be simple as "x" or more qualified as:
267
+ #
268
+ # * name:x
269
+ # * column:x
270
+ # * description:y
271
+ #
272
+ # Note: Query tokens need to have a minimum of 3 characters for substring
273
+ # matching to work correctly. See [Data Catalog Search
274
+ # Syntax](/data-catalog/docs/how-to/search-reference) for more information.
275
+ # @param page_size [Integer]
276
+ # Number of results in the search page. If <=0 then defaults to 10. Max limit
277
+ # for page_size is 1000. Throws an invalid argument for page_size > 1000.
278
+ # @param page_token [String]
279
+ # Optional. Pagination token returned in an earlier
280
+ # {Google::Cloud::DataCatalog::V1::SearchCatalogResponse#next_page_token SearchCatalogResponse.next_page_token}, which
281
+ # indicates that this is a continuation of a prior
282
+ # {Google::Cloud::DataCatalog::V1::DataCatalog::Client#search_catalog SearchCatalogRequest}
283
+ # call, and that the system should return the next page of data. If empty,
284
+ # the first page is returned.
285
+ # @param order_by [String]
286
+ # Specifies the ordering of results, currently supported case-sensitive
287
+ # choices are:
288
+ #
289
+ # * `relevance`, only supports descending
290
+ # * `last_modified_timestamp [asc|desc]`, defaults to descending if not
291
+ # specified
292
+ #
293
+ # If not specified, defaults to `relevance` descending.
294
+ #
295
+ #
296
+ # @yield [response, operation] Access the result along with the RPC operation
297
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::DataCatalog::V1::SearchCatalogResult>]
298
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
299
+ #
300
+ # @return [Gapic::PagedEnumerable<Google::Cloud::DataCatalog::V1::SearchCatalogResult>]
301
+ #
302
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
303
+ #
304
+ def search_catalog request, options = nil
305
+ raise ArgumentError, "request must be provided" if request.nil?
306
+
307
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::SearchCatalogRequest
308
+
309
+ # Converts hash and nil to an options object
310
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
311
+
312
+ # Customize the options with defaults
313
+ metadata = @config.rpcs.search_catalog.metadata.to_h
314
+
315
+ # Set x-goog-api-client and x-goog-user-project headers
316
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
317
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
318
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
319
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
320
+
321
+ options.apply_defaults timeout: @config.rpcs.search_catalog.timeout,
322
+ metadata: metadata,
323
+ retry_policy: @config.rpcs.search_catalog.retry_policy
324
+ options.apply_defaults metadata: @config.metadata,
325
+ retry_policy: @config.retry_policy
326
+
327
+ @data_catalog_stub.call_rpc :search_catalog, request, options: options do |response, operation|
328
+ response = Gapic::PagedEnumerable.new @data_catalog_stub, :search_catalog, request, response, operation, options
329
+ yield response, operation if block_given?
330
+ return response
331
+ end
332
+ rescue GRPC::BadStatus => e
333
+ raise Google::Cloud::Error.from_error(e)
334
+ end
335
+
336
+ ##
337
+ # Creates an EntryGroup.
338
+ #
339
+ # An entry group contains logically related entries together with Cloud
340
+ # Identity and Access Management policies that specify the users who can
341
+ # create, edit, and view entries within the entry group.
342
+ #
343
+ # Data Catalog automatically creates an entry group for BigQuery entries
344
+ # ("@bigquery") and Pub/Sub topics ("@pubsub"). Users create their own entry
345
+ # group to contain Cloud Storage fileset entries or custom type entries,
346
+ # and the IAM policies associated with those entries. Entry groups, like
347
+ # entries, can be searched.
348
+ #
349
+ # A maximum of 10,000 entry groups may be created per organization across all
350
+ # locations.
351
+ #
352
+ # Users should enable the Data Catalog API in the project identified by
353
+ # the `parent` parameter (see [Data Catalog Resource Project]
354
+ # (/data-catalog/docs/concepts/resource-project) for more information).
355
+ #
356
+ # @overload create_entry_group(request, options = nil)
357
+ # @param request [Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest | Hash]
358
+ # Creates an EntryGroup.
359
+ #
360
+ # An entry group contains logically related entries together with Cloud
361
+ # Identity and Access Management policies that specify the users who can
362
+ # create, edit, and view entries within the entry group.
363
+ #
364
+ # Data Catalog automatically creates an entry group for BigQuery entries
365
+ # ("@bigquery") and Pub/Sub topics ("@pubsub"). Users create their own entry
366
+ # group to contain Cloud Storage fileset entries or custom type entries,
367
+ # and the IAM policies associated with those entries. Entry groups, like
368
+ # entries, can be searched.
369
+ #
370
+ # A maximum of 10,000 entry groups may be created per organization across all
371
+ # locations.
372
+ #
373
+ # Users should enable the Data Catalog API in the project identified by
374
+ # the `parent` parameter (see [Data Catalog Resource Project]
375
+ # (/data-catalog/docs/concepts/resource-project) for more information).
376
+ # @param options [Gapic::CallOptions, Hash]
377
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
378
+ #
379
+ # @overload create_entry_group(parent: nil, entry_group_id: nil, entry_group: nil)
380
+ # @param parent [String]
381
+ # Required. The name of the project this entry group is in. Example:
382
+ #
383
+ # * projects/\\{project_id}/locations/\\{location}
384
+ #
385
+ # Note that this EntryGroup and its child resources may not actually be
386
+ # stored in the location in this name.
387
+ # @param entry_group_id [String]
388
+ # Required. The id of the entry group to create.
389
+ # The id must begin with a letter or underscore, contain only English
390
+ # letters, numbers and underscores, and be at most 64 characters.
391
+ # @param entry_group [Google::Cloud::DataCatalog::V1::EntryGroup | Hash]
392
+ # The entry group to create. Defaults to an empty entry group.
393
+ #
394
+ #
395
+ # @yield [response, operation] Access the result along with the RPC operation
396
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::EntryGroup]
397
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
398
+ #
399
+ # @return [Google::Cloud::DataCatalog::V1::EntryGroup]
400
+ #
401
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
402
+ #
403
+ def create_entry_group request, options = nil
404
+ raise ArgumentError, "request must be provided" if request.nil?
405
+
406
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest
407
+
408
+ # Converts hash and nil to an options object
409
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
410
+
411
+ # Customize the options with defaults
412
+ metadata = @config.rpcs.create_entry_group.metadata.to_h
413
+
414
+ # Set x-goog-api-client and x-goog-user-project headers
415
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
416
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
417
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
418
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
419
+
420
+ header_params = {
421
+ "parent" => request.parent
422
+ }
423
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
424
+ metadata[:"x-goog-request-params"] ||= request_params_header
425
+
426
+ options.apply_defaults timeout: @config.rpcs.create_entry_group.timeout,
427
+ metadata: metadata,
428
+ retry_policy: @config.rpcs.create_entry_group.retry_policy
429
+ options.apply_defaults metadata: @config.metadata,
430
+ retry_policy: @config.retry_policy
431
+
432
+ @data_catalog_stub.call_rpc :create_entry_group, request, options: options do |response, operation|
433
+ yield response, operation if block_given?
434
+ return response
435
+ end
436
+ rescue GRPC::BadStatus => e
437
+ raise Google::Cloud::Error.from_error(e)
438
+ end
439
+
440
+ ##
441
+ # Gets an EntryGroup.
442
+ #
443
+ # @overload get_entry_group(request, options = nil)
444
+ # @param request [Google::Cloud::DataCatalog::V1::GetEntryGroupRequest | Hash]
445
+ # Gets an EntryGroup.
446
+ # @param options [Gapic::CallOptions, Hash]
447
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
448
+ #
449
+ # @overload get_entry_group(name: nil, read_mask: nil)
450
+ # @param name [String]
451
+ # Required. The name of the entry group. For example,
452
+ # `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`.
453
+ # @param read_mask [Google::Protobuf::FieldMask | Hash]
454
+ # The fields to return. If not set or empty, all fields are returned.
455
+ #
456
+ #
457
+ # @yield [response, operation] Access the result along with the RPC operation
458
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::EntryGroup]
459
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
460
+ #
461
+ # @return [Google::Cloud::DataCatalog::V1::EntryGroup]
462
+ #
463
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
464
+ #
465
+ def get_entry_group request, options = nil
466
+ raise ArgumentError, "request must be provided" if request.nil?
467
+
468
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::GetEntryGroupRequest
469
+
470
+ # Converts hash and nil to an options object
471
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
472
+
473
+ # Customize the options with defaults
474
+ metadata = @config.rpcs.get_entry_group.metadata.to_h
475
+
476
+ # Set x-goog-api-client and x-goog-user-project headers
477
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
478
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
479
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
480
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
481
+
482
+ header_params = {
483
+ "name" => request.name
484
+ }
485
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
486
+ metadata[:"x-goog-request-params"] ||= request_params_header
487
+
488
+ options.apply_defaults timeout: @config.rpcs.get_entry_group.timeout,
489
+ metadata: metadata,
490
+ retry_policy: @config.rpcs.get_entry_group.retry_policy
491
+ options.apply_defaults metadata: @config.metadata,
492
+ retry_policy: @config.retry_policy
493
+
494
+ @data_catalog_stub.call_rpc :get_entry_group, request, options: options do |response, operation|
495
+ yield response, operation if block_given?
496
+ return response
497
+ end
498
+ rescue GRPC::BadStatus => e
499
+ raise Google::Cloud::Error.from_error(e)
500
+ end
501
+
502
+ ##
503
+ # Updates an EntryGroup. The user should enable the Data Catalog API in the
504
+ # project identified by the `entry_group.name` parameter (see [Data Catalog
505
+ # Resource Project] (/data-catalog/docs/concepts/resource-project) for more
506
+ # information).
507
+ #
508
+ # @overload update_entry_group(request, options = nil)
509
+ # @param request [Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest | Hash]
510
+ # Updates an EntryGroup. The user should enable the Data Catalog API in the
511
+ # project identified by the `entry_group.name` parameter (see [Data Catalog
512
+ # Resource Project] (/data-catalog/docs/concepts/resource-project) for more
513
+ # information).
514
+ # @param options [Gapic::CallOptions, Hash]
515
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
516
+ #
517
+ # @overload update_entry_group(entry_group: nil, update_mask: nil)
518
+ # @param entry_group [Google::Cloud::DataCatalog::V1::EntryGroup | Hash]
519
+ # Required. The updated entry group. "name" field must be set.
520
+ # @param update_mask [Google::Protobuf::FieldMask | Hash]
521
+ # The fields to update on the entry group. If absent or empty, all modifiable
522
+ # fields are updated.
523
+ #
524
+ #
525
+ # @yield [response, operation] Access the result along with the RPC operation
526
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::EntryGroup]
527
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
528
+ #
529
+ # @return [Google::Cloud::DataCatalog::V1::EntryGroup]
530
+ #
531
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
532
+ #
533
+ def update_entry_group request, options = nil
534
+ raise ArgumentError, "request must be provided" if request.nil?
535
+
536
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest
537
+
538
+ # Converts hash and nil to an options object
539
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
540
+
541
+ # Customize the options with defaults
542
+ metadata = @config.rpcs.update_entry_group.metadata.to_h
543
+
544
+ # Set x-goog-api-client and x-goog-user-project headers
545
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
546
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
547
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
548
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
549
+
550
+ header_params = {
551
+ "entry_group.name" => request.entry_group.name
552
+ }
553
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
554
+ metadata[:"x-goog-request-params"] ||= request_params_header
555
+
556
+ options.apply_defaults timeout: @config.rpcs.update_entry_group.timeout,
557
+ metadata: metadata,
558
+ retry_policy: @config.rpcs.update_entry_group.retry_policy
559
+ options.apply_defaults metadata: @config.metadata,
560
+ retry_policy: @config.retry_policy
561
+
562
+ @data_catalog_stub.call_rpc :update_entry_group, request, options: options do |response, operation|
563
+ yield response, operation if block_given?
564
+ return response
565
+ end
566
+ rescue GRPC::BadStatus => e
567
+ raise Google::Cloud::Error.from_error(e)
568
+ end
569
+
570
+ ##
571
+ # Deletes an EntryGroup. Only entry groups that do not contain entries can be
572
+ # deleted. Users should enable the Data Catalog API in the project
573
+ # identified by the `name` parameter (see [Data Catalog Resource Project]
574
+ # (/data-catalog/docs/concepts/resource-project) for more information).
575
+ #
576
+ # @overload delete_entry_group(request, options = nil)
577
+ # @param request [Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest | Hash]
578
+ # Deletes an EntryGroup. Only entry groups that do not contain entries can be
579
+ # deleted. Users should enable the Data Catalog API in the project
580
+ # identified by the `name` parameter (see [Data Catalog Resource Project]
581
+ # (/data-catalog/docs/concepts/resource-project) for more information).
582
+ # @param options [Gapic::CallOptions, Hash]
583
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
584
+ #
585
+ # @overload delete_entry_group(name: nil, force: nil)
586
+ # @param name [String]
587
+ # Required. The name of the entry group. For example,
588
+ # `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`.
589
+ # @param force [Boolean]
590
+ # Optional. If true, deletes all entries in the entry group.
591
+ #
592
+ #
593
+ # @yield [response, operation] Access the result along with the RPC operation
594
+ # @yieldparam response [Google::Protobuf::Empty]
595
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
596
+ #
597
+ # @return [Google::Protobuf::Empty]
598
+ #
599
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
600
+ #
601
+ def delete_entry_group request, options = nil
602
+ raise ArgumentError, "request must be provided" if request.nil?
603
+
604
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest
605
+
606
+ # Converts hash and nil to an options object
607
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
608
+
609
+ # Customize the options with defaults
610
+ metadata = @config.rpcs.delete_entry_group.metadata.to_h
611
+
612
+ # Set x-goog-api-client and x-goog-user-project headers
613
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
614
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
615
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
616
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
617
+
618
+ header_params = {
619
+ "name" => request.name
620
+ }
621
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
622
+ metadata[:"x-goog-request-params"] ||= request_params_header
623
+
624
+ options.apply_defaults timeout: @config.rpcs.delete_entry_group.timeout,
625
+ metadata: metadata,
626
+ retry_policy: @config.rpcs.delete_entry_group.retry_policy
627
+ options.apply_defaults metadata: @config.metadata,
628
+ retry_policy: @config.retry_policy
629
+
630
+ @data_catalog_stub.call_rpc :delete_entry_group, request, options: options do |response, operation|
631
+ yield response, operation if block_given?
632
+ return response
633
+ end
634
+ rescue GRPC::BadStatus => e
635
+ raise Google::Cloud::Error.from_error(e)
636
+ end
637
+
638
+ ##
639
+ # Lists entry groups.
640
+ #
641
+ # @overload list_entry_groups(request, options = nil)
642
+ # @param request [Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest | Hash]
643
+ # Lists entry groups.
644
+ # @param options [Gapic::CallOptions, Hash]
645
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
646
+ #
647
+ # @overload list_entry_groups(parent: nil, page_size: nil, page_token: nil)
648
+ # @param parent [String]
649
+ # Required. The name of the location that contains the entry groups, which can be
650
+ # provided in URL format. Example:
651
+ #
652
+ # * projects/\\{project_id}/locations/\\{location}
653
+ # @param page_size [Integer]
654
+ # Optional. The maximum number of items to return. Default is 10. Max limit is 1000.
655
+ # Throws an invalid argument for `page_size > 1000`.
656
+ # @param page_token [String]
657
+ # Optional. Token that specifies which page is requested. If empty, the first page is
658
+ # returned.
659
+ #
660
+ #
661
+ # @yield [response, operation] Access the result along with the RPC operation
662
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::DataCatalog::V1::EntryGroup>]
663
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
664
+ #
665
+ # @return [Gapic::PagedEnumerable<Google::Cloud::DataCatalog::V1::EntryGroup>]
666
+ #
667
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
668
+ #
669
+ def list_entry_groups request, options = nil
670
+ raise ArgumentError, "request must be provided" if request.nil?
671
+
672
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest
673
+
674
+ # Converts hash and nil to an options object
675
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
676
+
677
+ # Customize the options with defaults
678
+ metadata = @config.rpcs.list_entry_groups.metadata.to_h
679
+
680
+ # Set x-goog-api-client and x-goog-user-project headers
681
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
682
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
683
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
684
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
685
+
686
+ header_params = {
687
+ "parent" => request.parent
688
+ }
689
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
690
+ metadata[:"x-goog-request-params"] ||= request_params_header
691
+
692
+ options.apply_defaults timeout: @config.rpcs.list_entry_groups.timeout,
693
+ metadata: metadata,
694
+ retry_policy: @config.rpcs.list_entry_groups.retry_policy
695
+ options.apply_defaults metadata: @config.metadata,
696
+ retry_policy: @config.retry_policy
697
+
698
+ @data_catalog_stub.call_rpc :list_entry_groups, request, options: options do |response, operation|
699
+ response = Gapic::PagedEnumerable.new @data_catalog_stub, :list_entry_groups, request, response, operation, options
700
+ yield response, operation if block_given?
701
+ return response
702
+ end
703
+ rescue GRPC::BadStatus => e
704
+ raise Google::Cloud::Error.from_error(e)
705
+ end
706
+
707
+ ##
708
+ # Creates an entry. Only entries of 'FILESET' type or user-specified type can
709
+ # be created.
710
+ #
711
+ # Users should enable the Data Catalog API in the project identified by
712
+ # the `parent` parameter (see [Data Catalog Resource Project]
713
+ # (/data-catalog/docs/concepts/resource-project) for more information).
714
+ #
715
+ # A maximum of 100,000 entries may be created per entry group.
716
+ #
717
+ # @overload create_entry(request, options = nil)
718
+ # @param request [Google::Cloud::DataCatalog::V1::CreateEntryRequest | Hash]
719
+ # Creates an entry. Only entries of 'FILESET' type or user-specified type can
720
+ # be created.
721
+ #
722
+ # Users should enable the Data Catalog API in the project identified by
723
+ # the `parent` parameter (see [Data Catalog Resource Project]
724
+ # (/data-catalog/docs/concepts/resource-project) for more information).
725
+ #
726
+ # A maximum of 100,000 entries may be created per entry group.
727
+ # @param options [Gapic::CallOptions, Hash]
728
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
729
+ #
730
+ # @overload create_entry(parent: nil, entry_id: nil, entry: nil)
731
+ # @param parent [String]
732
+ # Required. The name of the entry group this entry is in. Example:
733
+ #
734
+ # * projects/\\{project_id}/locations/\\{location}/entryGroups/\\{entry_group_id}
735
+ #
736
+ # Note that this Entry and its child resources may not actually be stored in
737
+ # the location in this name.
738
+ # @param entry_id [String]
739
+ # Required. The id of the entry to create.
740
+ # @param entry [Google::Cloud::DataCatalog::V1::Entry | Hash]
741
+ # Required. The entry to create.
742
+ #
743
+ #
744
+ # @yield [response, operation] Access the result along with the RPC operation
745
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::Entry]
746
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
747
+ #
748
+ # @return [Google::Cloud::DataCatalog::V1::Entry]
749
+ #
750
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
751
+ #
752
+ def create_entry request, options = nil
753
+ raise ArgumentError, "request must be provided" if request.nil?
754
+
755
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::CreateEntryRequest
756
+
757
+ # Converts hash and nil to an options object
758
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
759
+
760
+ # Customize the options with defaults
761
+ metadata = @config.rpcs.create_entry.metadata.to_h
762
+
763
+ # Set x-goog-api-client and x-goog-user-project headers
764
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
765
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
766
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
767
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
768
+
769
+ header_params = {
770
+ "parent" => request.parent
771
+ }
772
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
773
+ metadata[:"x-goog-request-params"] ||= request_params_header
774
+
775
+ options.apply_defaults timeout: @config.rpcs.create_entry.timeout,
776
+ metadata: metadata,
777
+ retry_policy: @config.rpcs.create_entry.retry_policy
778
+ options.apply_defaults metadata: @config.metadata,
779
+ retry_policy: @config.retry_policy
780
+
781
+ @data_catalog_stub.call_rpc :create_entry, request, options: options do |response, operation|
782
+ yield response, operation if block_given?
783
+ return response
784
+ end
785
+ rescue GRPC::BadStatus => e
786
+ raise Google::Cloud::Error.from_error(e)
787
+ end
788
+
789
+ ##
790
+ # Updates an existing entry.
791
+ # Users should enable the Data Catalog API in the project identified by
792
+ # the `entry.name` parameter (see [Data Catalog Resource Project]
793
+ # (/data-catalog/docs/concepts/resource-project) for more information).
794
+ #
795
+ # @overload update_entry(request, options = nil)
796
+ # @param request [Google::Cloud::DataCatalog::V1::UpdateEntryRequest | Hash]
797
+ # Updates an existing entry.
798
+ # Users should enable the Data Catalog API in the project identified by
799
+ # the `entry.name` parameter (see [Data Catalog Resource Project]
800
+ # (/data-catalog/docs/concepts/resource-project) for more information).
801
+ # @param options [Gapic::CallOptions, Hash]
802
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
803
+ #
804
+ # @overload update_entry(entry: nil, update_mask: nil)
805
+ # @param entry [Google::Cloud::DataCatalog::V1::Entry | Hash]
806
+ # Required. The updated entry. The "name" field must be set.
807
+ # @param update_mask [Google::Protobuf::FieldMask | Hash]
808
+ # The fields to update on the entry. If absent or empty, all modifiable
809
+ # fields are updated.
810
+ #
811
+ # The following fields are modifiable:
812
+ # * For entries with type `DATA_STREAM`:
813
+ # * `schema`
814
+ # * For entries with type `FILESET`
815
+ # * `schema`
816
+ # * `display_name`
817
+ # * `description`
818
+ # * `gcs_fileset_spec`
819
+ # * `gcs_fileset_spec.file_patterns`
820
+ # * For entries with `user_specified_type`
821
+ # * `schema`
822
+ # * `display_name`
823
+ # * `description`
824
+ # * user_specified_type
825
+ # * user_specified_system
826
+ # * linked_resource
827
+ # * source_system_timestamps
828
+ #
829
+ #
830
+ # @yield [response, operation] Access the result along with the RPC operation
831
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::Entry]
832
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
833
+ #
834
+ # @return [Google::Cloud::DataCatalog::V1::Entry]
835
+ #
836
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
837
+ #
838
+ def update_entry request, options = nil
839
+ raise ArgumentError, "request must be provided" if request.nil?
840
+
841
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::UpdateEntryRequest
842
+
843
+ # Converts hash and nil to an options object
844
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
845
+
846
+ # Customize the options with defaults
847
+ metadata = @config.rpcs.update_entry.metadata.to_h
848
+
849
+ # Set x-goog-api-client and x-goog-user-project headers
850
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
851
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
852
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
853
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
854
+
855
+ header_params = {
856
+ "entry.name" => request.entry.name
857
+ }
858
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
859
+ metadata[:"x-goog-request-params"] ||= request_params_header
860
+
861
+ options.apply_defaults timeout: @config.rpcs.update_entry.timeout,
862
+ metadata: metadata,
863
+ retry_policy: @config.rpcs.update_entry.retry_policy
864
+ options.apply_defaults metadata: @config.metadata,
865
+ retry_policy: @config.retry_policy
866
+
867
+ @data_catalog_stub.call_rpc :update_entry, request, options: options do |response, operation|
868
+ yield response, operation if block_given?
869
+ return response
870
+ end
871
+ rescue GRPC::BadStatus => e
872
+ raise Google::Cloud::Error.from_error(e)
873
+ end
874
+
875
+ ##
876
+ # Deletes an existing entry. Only entries created through
877
+ # {Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry CreateEntry}
878
+ # method can be deleted.
879
+ # Users should enable the Data Catalog API in the project identified by
880
+ # the `name` parameter (see [Data Catalog Resource Project]
881
+ # (/data-catalog/docs/concepts/resource-project) for more information).
882
+ #
883
+ # @overload delete_entry(request, options = nil)
884
+ # @param request [Google::Cloud::DataCatalog::V1::DeleteEntryRequest | Hash]
885
+ # Deletes an existing entry. Only entries created through
886
+ # {Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry CreateEntry}
887
+ # method can be deleted.
888
+ # Users should enable the Data Catalog API in the project identified by
889
+ # the `name` parameter (see [Data Catalog Resource Project]
890
+ # (/data-catalog/docs/concepts/resource-project) for more information).
891
+ # @param options [Gapic::CallOptions, Hash]
892
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
893
+ #
894
+ # @overload delete_entry(name: nil)
895
+ # @param name [String]
896
+ # Required. The name of the entry. Example:
897
+ #
898
+ # * projects/\\{project_id}/locations/\\{location}/entryGroups/\\{entry_group_id}/entries/\\{entry_id}
899
+ #
900
+ #
901
+ # @yield [response, operation] Access the result along with the RPC operation
902
+ # @yieldparam response [Google::Protobuf::Empty]
903
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
904
+ #
905
+ # @return [Google::Protobuf::Empty]
906
+ #
907
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
908
+ #
909
+ def delete_entry request, options = nil
910
+ raise ArgumentError, "request must be provided" if request.nil?
911
+
912
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::DeleteEntryRequest
913
+
914
+ # Converts hash and nil to an options object
915
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
916
+
917
+ # Customize the options with defaults
918
+ metadata = @config.rpcs.delete_entry.metadata.to_h
919
+
920
+ # Set x-goog-api-client and x-goog-user-project headers
921
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
922
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
923
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
924
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
925
+
926
+ header_params = {
927
+ "name" => request.name
928
+ }
929
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
930
+ metadata[:"x-goog-request-params"] ||= request_params_header
931
+
932
+ options.apply_defaults timeout: @config.rpcs.delete_entry.timeout,
933
+ metadata: metadata,
934
+ retry_policy: @config.rpcs.delete_entry.retry_policy
935
+ options.apply_defaults metadata: @config.metadata,
936
+ retry_policy: @config.retry_policy
937
+
938
+ @data_catalog_stub.call_rpc :delete_entry, request, options: options do |response, operation|
939
+ yield response, operation if block_given?
940
+ return response
941
+ end
942
+ rescue GRPC::BadStatus => e
943
+ raise Google::Cloud::Error.from_error(e)
944
+ end
945
+
946
+ ##
947
+ # Gets an entry.
948
+ #
949
+ # @overload get_entry(request, options = nil)
950
+ # @param request [Google::Cloud::DataCatalog::V1::GetEntryRequest | Hash]
951
+ # Gets an entry.
952
+ # @param options [Gapic::CallOptions, Hash]
953
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
954
+ #
955
+ # @overload get_entry(name: nil)
956
+ # @param name [String]
957
+ # Required. The name of the entry. Example:
958
+ #
959
+ # * projects/\\{project_id}/locations/\\{location}/entryGroups/\\{entry_group_id}/entries/\\{entry_id}
960
+ #
961
+ #
962
+ # @yield [response, operation] Access the result along with the RPC operation
963
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::Entry]
964
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
965
+ #
966
+ # @return [Google::Cloud::DataCatalog::V1::Entry]
967
+ #
968
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
969
+ #
970
+ def get_entry request, options = nil
971
+ raise ArgumentError, "request must be provided" if request.nil?
972
+
973
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::GetEntryRequest
974
+
975
+ # Converts hash and nil to an options object
976
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
977
+
978
+ # Customize the options with defaults
979
+ metadata = @config.rpcs.get_entry.metadata.to_h
980
+
981
+ # Set x-goog-api-client and x-goog-user-project headers
982
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
983
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
984
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
985
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
986
+
987
+ header_params = {
988
+ "name" => request.name
989
+ }
990
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
991
+ metadata[:"x-goog-request-params"] ||= request_params_header
992
+
993
+ options.apply_defaults timeout: @config.rpcs.get_entry.timeout,
994
+ metadata: metadata,
995
+ retry_policy: @config.rpcs.get_entry.retry_policy
996
+ options.apply_defaults metadata: @config.metadata,
997
+ retry_policy: @config.retry_policy
998
+
999
+ @data_catalog_stub.call_rpc :get_entry, request, options: options do |response, operation|
1000
+ yield response, operation if block_given?
1001
+ return response
1002
+ end
1003
+ rescue GRPC::BadStatus => e
1004
+ raise Google::Cloud::Error.from_error(e)
1005
+ end
1006
+
1007
+ ##
1008
+ # Get an entry by target resource name. This method allows clients to use
1009
+ # the resource name from the source Google Cloud Platform service to get the
1010
+ # Data Catalog Entry.
1011
+ #
1012
+ # @overload lookup_entry(request, options = nil)
1013
+ # @param request [Google::Cloud::DataCatalog::V1::LookupEntryRequest | Hash]
1014
+ # Get an entry by target resource name. This method allows clients to use
1015
+ # the resource name from the source Google Cloud Platform service to get the
1016
+ # Data Catalog Entry.
1017
+ # @param options [Gapic::CallOptions, Hash]
1018
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1019
+ #
1020
+ # @overload lookup_entry(linked_resource: nil, sql_resource: nil)
1021
+ # @param linked_resource [String]
1022
+ # The full name of the Google Cloud Platform resource the Data Catalog
1023
+ # entry represents. See:
1024
+ # https://cloud.google.com/apis/design/resource_names#full_resource_name.
1025
+ # Full names are case-sensitive.
1026
+ #
1027
+ # Examples:
1028
+ #
1029
+ # * //bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId
1030
+ # * //pubsub.googleapis.com/projects/projectId/topics/topicId
1031
+ # @param sql_resource [String]
1032
+ # The SQL name of the entry. SQL names are case-sensitive.
1033
+ #
1034
+ # Examples:
1035
+ #
1036
+ # * `cloud_pubsub.project_id.topic_id`
1037
+ # * ``pubsub.project_id.`topic.id.with.dots` ``
1038
+ # * `bigquery.table.project_id.dataset_id.table_id`
1039
+ # * `bigquery.dataset.project_id.dataset_id`
1040
+ # * `datacatalog.entry.project_id.location_id.entry_group_id.entry_id`
1041
+ #
1042
+ # `*_id`s shoud satisfy the standard SQL rules for identifiers.
1043
+ # https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical.
1044
+ #
1045
+ #
1046
+ # @yield [response, operation] Access the result along with the RPC operation
1047
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::Entry]
1048
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1049
+ #
1050
+ # @return [Google::Cloud::DataCatalog::V1::Entry]
1051
+ #
1052
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1053
+ #
1054
+ def lookup_entry request, options = nil
1055
+ raise ArgumentError, "request must be provided" if request.nil?
1056
+
1057
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::LookupEntryRequest
1058
+
1059
+ # Converts hash and nil to an options object
1060
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1061
+
1062
+ # Customize the options with defaults
1063
+ metadata = @config.rpcs.lookup_entry.metadata.to_h
1064
+
1065
+ # Set x-goog-api-client and x-goog-user-project headers
1066
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1067
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1068
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1069
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1070
+
1071
+ options.apply_defaults timeout: @config.rpcs.lookup_entry.timeout,
1072
+ metadata: metadata,
1073
+ retry_policy: @config.rpcs.lookup_entry.retry_policy
1074
+ options.apply_defaults metadata: @config.metadata,
1075
+ retry_policy: @config.retry_policy
1076
+
1077
+ @data_catalog_stub.call_rpc :lookup_entry, request, options: options do |response, operation|
1078
+ yield response, operation if block_given?
1079
+ return response
1080
+ end
1081
+ rescue GRPC::BadStatus => e
1082
+ raise Google::Cloud::Error.from_error(e)
1083
+ end
1084
+
1085
+ ##
1086
+ # Lists entries.
1087
+ #
1088
+ # @overload list_entries(request, options = nil)
1089
+ # @param request [Google::Cloud::DataCatalog::V1::ListEntriesRequest | Hash]
1090
+ # Lists entries.
1091
+ # @param options [Gapic::CallOptions, Hash]
1092
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1093
+ #
1094
+ # @overload list_entries(parent: nil, page_size: nil, page_token: nil, read_mask: nil)
1095
+ # @param parent [String]
1096
+ # Required. The name of the entry group that contains the entries, which can
1097
+ # be provided in URL format. Example:
1098
+ #
1099
+ # * projects/\\{project_id}/locations/\\{location}/entryGroups/\\{entry_group_id}
1100
+ # @param page_size [Integer]
1101
+ # The maximum number of items to return. Default is 10. Max limit is 1000.
1102
+ # Throws an invalid argument for `page_size > 1000`.
1103
+ # @param page_token [String]
1104
+ # Token that specifies which page is requested. If empty, the first page is
1105
+ # returned.
1106
+ # @param read_mask [Google::Protobuf::FieldMask | Hash]
1107
+ # The fields to return for each Entry. If not set or empty, all
1108
+ # fields are returned.
1109
+ # For example, setting read_mask to contain only one path "name" will cause
1110
+ # ListEntries to return a list of Entries with only "name" field.
1111
+ #
1112
+ #
1113
+ # @yield [response, operation] Access the result along with the RPC operation
1114
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::DataCatalog::V1::Entry>]
1115
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1116
+ #
1117
+ # @return [Gapic::PagedEnumerable<Google::Cloud::DataCatalog::V1::Entry>]
1118
+ #
1119
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1120
+ #
1121
+ def list_entries request, options = nil
1122
+ raise ArgumentError, "request must be provided" if request.nil?
1123
+
1124
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::ListEntriesRequest
1125
+
1126
+ # Converts hash and nil to an options object
1127
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1128
+
1129
+ # Customize the options with defaults
1130
+ metadata = @config.rpcs.list_entries.metadata.to_h
1131
+
1132
+ # Set x-goog-api-client and x-goog-user-project headers
1133
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1134
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1135
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1136
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1137
+
1138
+ header_params = {
1139
+ "parent" => request.parent
1140
+ }
1141
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1142
+ metadata[:"x-goog-request-params"] ||= request_params_header
1143
+
1144
+ options.apply_defaults timeout: @config.rpcs.list_entries.timeout,
1145
+ metadata: metadata,
1146
+ retry_policy: @config.rpcs.list_entries.retry_policy
1147
+ options.apply_defaults metadata: @config.metadata,
1148
+ retry_policy: @config.retry_policy
1149
+
1150
+ @data_catalog_stub.call_rpc :list_entries, request, options: options do |response, operation|
1151
+ response = Gapic::PagedEnumerable.new @data_catalog_stub, :list_entries, request, response, operation, options
1152
+ yield response, operation if block_given?
1153
+ return response
1154
+ end
1155
+ rescue GRPC::BadStatus => e
1156
+ raise Google::Cloud::Error.from_error(e)
1157
+ end
1158
+
1159
+ ##
1160
+ # Creates a tag template. The user should enable the Data Catalog API in
1161
+ # the project identified by the `parent` parameter (see [Data Catalog
1162
+ # Resource Project](/data-catalog/docs/concepts/resource-project) for more
1163
+ # information).
1164
+ #
1165
+ # @overload create_tag_template(request, options = nil)
1166
+ # @param request [Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest | Hash]
1167
+ # Creates a tag template. The user should enable the Data Catalog API in
1168
+ # the project identified by the `parent` parameter (see [Data Catalog
1169
+ # Resource Project](/data-catalog/docs/concepts/resource-project) for more
1170
+ # information).
1171
+ # @param options [Gapic::CallOptions, Hash]
1172
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1173
+ #
1174
+ # @overload create_tag_template(parent: nil, tag_template_id: nil, tag_template: nil)
1175
+ # @param parent [String]
1176
+ # Required. The name of the project and the template location
1177
+ # [region](/compute/docs/regions-zones/#available).
1178
+ # NOTE: Currently, only the `us-central1 region` is supported.
1179
+ #
1180
+ # Example:
1181
+ #
1182
+ # * projects/\\{project_id}/locations/us-central1
1183
+ # @param tag_template_id [String]
1184
+ # Required. The id of the tag template to create.
1185
+ # @param tag_template [Google::Cloud::DataCatalog::V1::TagTemplate | Hash]
1186
+ # Required. The tag template to create.
1187
+ #
1188
+ #
1189
+ # @yield [response, operation] Access the result along with the RPC operation
1190
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::TagTemplate]
1191
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1192
+ #
1193
+ # @return [Google::Cloud::DataCatalog::V1::TagTemplate]
1194
+ #
1195
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1196
+ #
1197
+ def create_tag_template request, options = nil
1198
+ raise ArgumentError, "request must be provided" if request.nil?
1199
+
1200
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest
1201
+
1202
+ # Converts hash and nil to an options object
1203
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1204
+
1205
+ # Customize the options with defaults
1206
+ metadata = @config.rpcs.create_tag_template.metadata.to_h
1207
+
1208
+ # Set x-goog-api-client and x-goog-user-project headers
1209
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1210
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1211
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1212
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1213
+
1214
+ header_params = {
1215
+ "parent" => request.parent
1216
+ }
1217
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1218
+ metadata[:"x-goog-request-params"] ||= request_params_header
1219
+
1220
+ options.apply_defaults timeout: @config.rpcs.create_tag_template.timeout,
1221
+ metadata: metadata,
1222
+ retry_policy: @config.rpcs.create_tag_template.retry_policy
1223
+ options.apply_defaults metadata: @config.metadata,
1224
+ retry_policy: @config.retry_policy
1225
+
1226
+ @data_catalog_stub.call_rpc :create_tag_template, request, options: options do |response, operation|
1227
+ yield response, operation if block_given?
1228
+ return response
1229
+ end
1230
+ rescue GRPC::BadStatus => e
1231
+ raise Google::Cloud::Error.from_error(e)
1232
+ end
1233
+
1234
+ ##
1235
+ # Gets a tag template.
1236
+ #
1237
+ # @overload get_tag_template(request, options = nil)
1238
+ # @param request [Google::Cloud::DataCatalog::V1::GetTagTemplateRequest | Hash]
1239
+ # Gets a tag template.
1240
+ # @param options [Gapic::CallOptions, Hash]
1241
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1242
+ #
1243
+ # @overload get_tag_template(name: nil)
1244
+ # @param name [String]
1245
+ # Required. The name of the tag template. Example:
1246
+ #
1247
+ # * projects/\\{project_id}/locations/\\{location}/tagTemplates/\\{tag_template_id}
1248
+ #
1249
+ #
1250
+ # @yield [response, operation] Access the result along with the RPC operation
1251
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::TagTemplate]
1252
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1253
+ #
1254
+ # @return [Google::Cloud::DataCatalog::V1::TagTemplate]
1255
+ #
1256
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1257
+ #
1258
+ def get_tag_template request, options = nil
1259
+ raise ArgumentError, "request must be provided" if request.nil?
1260
+
1261
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::GetTagTemplateRequest
1262
+
1263
+ # Converts hash and nil to an options object
1264
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1265
+
1266
+ # Customize the options with defaults
1267
+ metadata = @config.rpcs.get_tag_template.metadata.to_h
1268
+
1269
+ # Set x-goog-api-client and x-goog-user-project headers
1270
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1271
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1272
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1273
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1274
+
1275
+ header_params = {
1276
+ "name" => request.name
1277
+ }
1278
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1279
+ metadata[:"x-goog-request-params"] ||= request_params_header
1280
+
1281
+ options.apply_defaults timeout: @config.rpcs.get_tag_template.timeout,
1282
+ metadata: metadata,
1283
+ retry_policy: @config.rpcs.get_tag_template.retry_policy
1284
+ options.apply_defaults metadata: @config.metadata,
1285
+ retry_policy: @config.retry_policy
1286
+
1287
+ @data_catalog_stub.call_rpc :get_tag_template, request, options: options do |response, operation|
1288
+ yield response, operation if block_given?
1289
+ return response
1290
+ end
1291
+ rescue GRPC::BadStatus => e
1292
+ raise Google::Cloud::Error.from_error(e)
1293
+ end
1294
+
1295
+ ##
1296
+ # Updates a tag template. This method cannot be used to update the fields of
1297
+ # a template. The tag template fields are represented as separate resources
1298
+ # and should be updated using their own create/update/delete methods.
1299
+ # Users should enable the Data Catalog API in the project identified by
1300
+ # the `tag_template.name` parameter (see [Data Catalog Resource Project]
1301
+ # (/data-catalog/docs/concepts/resource-project) for more information).
1302
+ #
1303
+ # @overload update_tag_template(request, options = nil)
1304
+ # @param request [Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest | Hash]
1305
+ # Updates a tag template. This method cannot be used to update the fields of
1306
+ # a template. The tag template fields are represented as separate resources
1307
+ # and should be updated using their own create/update/delete methods.
1308
+ # Users should enable the Data Catalog API in the project identified by
1309
+ # the `tag_template.name` parameter (see [Data Catalog Resource Project]
1310
+ # (/data-catalog/docs/concepts/resource-project) for more information).
1311
+ # @param options [Gapic::CallOptions, Hash]
1312
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1313
+ #
1314
+ # @overload update_tag_template(tag_template: nil, update_mask: nil)
1315
+ # @param tag_template [Google::Cloud::DataCatalog::V1::TagTemplate | Hash]
1316
+ # Required. The template to update. The "name" field must be set.
1317
+ # @param update_mask [Google::Protobuf::FieldMask | Hash]
1318
+ # The field mask specifies the parts of the template to overwrite.
1319
+ #
1320
+ # Allowed fields:
1321
+ #
1322
+ # * `display_name`
1323
+ #
1324
+ # If absent or empty, all of the allowed fields above will be updated.
1325
+ #
1326
+ #
1327
+ # @yield [response, operation] Access the result along with the RPC operation
1328
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::TagTemplate]
1329
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1330
+ #
1331
+ # @return [Google::Cloud::DataCatalog::V1::TagTemplate]
1332
+ #
1333
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1334
+ #
1335
+ def update_tag_template request, options = nil
1336
+ raise ArgumentError, "request must be provided" if request.nil?
1337
+
1338
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest
1339
+
1340
+ # Converts hash and nil to an options object
1341
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1342
+
1343
+ # Customize the options with defaults
1344
+ metadata = @config.rpcs.update_tag_template.metadata.to_h
1345
+
1346
+ # Set x-goog-api-client and x-goog-user-project headers
1347
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1348
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1349
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1350
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1351
+
1352
+ header_params = {
1353
+ "tag_template.name" => request.tag_template.name
1354
+ }
1355
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1356
+ metadata[:"x-goog-request-params"] ||= request_params_header
1357
+
1358
+ options.apply_defaults timeout: @config.rpcs.update_tag_template.timeout,
1359
+ metadata: metadata,
1360
+ retry_policy: @config.rpcs.update_tag_template.retry_policy
1361
+ options.apply_defaults metadata: @config.metadata,
1362
+ retry_policy: @config.retry_policy
1363
+
1364
+ @data_catalog_stub.call_rpc :update_tag_template, request, options: options do |response, operation|
1365
+ yield response, operation if block_given?
1366
+ return response
1367
+ end
1368
+ rescue GRPC::BadStatus => e
1369
+ raise Google::Cloud::Error.from_error(e)
1370
+ end
1371
+
1372
+ ##
1373
+ # Deletes a tag template and all tags using the template.
1374
+ # Users should enable the Data Catalog API in the project identified by
1375
+ # the `name` parameter (see [Data Catalog Resource Project]
1376
+ # (/data-catalog/docs/concepts/resource-project) for more information).
1377
+ #
1378
+ # @overload delete_tag_template(request, options = nil)
1379
+ # @param request [Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest | Hash]
1380
+ # Deletes a tag template and all tags using the template.
1381
+ # Users should enable the Data Catalog API in the project identified by
1382
+ # the `name` parameter (see [Data Catalog Resource Project]
1383
+ # (/data-catalog/docs/concepts/resource-project) for more information).
1384
+ # @param options [Gapic::CallOptions, Hash]
1385
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1386
+ #
1387
+ # @overload delete_tag_template(name: nil, force: nil)
1388
+ # @param name [String]
1389
+ # Required. The name of the tag template to delete. Example:
1390
+ #
1391
+ # * projects/\\{project_id}/locations/\\{location}/tagTemplates/\\{tag_template_id}
1392
+ # @param force [Boolean]
1393
+ # Required. Currently, this field must always be set to `true`.
1394
+ # This confirms the deletion of any possible tags using this template.
1395
+ # `force = false` will be supported in the future.
1396
+ #
1397
+ #
1398
+ # @yield [response, operation] Access the result along with the RPC operation
1399
+ # @yieldparam response [Google::Protobuf::Empty]
1400
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1401
+ #
1402
+ # @return [Google::Protobuf::Empty]
1403
+ #
1404
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1405
+ #
1406
+ def delete_tag_template request, options = nil
1407
+ raise ArgumentError, "request must be provided" if request.nil?
1408
+
1409
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest
1410
+
1411
+ # Converts hash and nil to an options object
1412
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1413
+
1414
+ # Customize the options with defaults
1415
+ metadata = @config.rpcs.delete_tag_template.metadata.to_h
1416
+
1417
+ # Set x-goog-api-client and x-goog-user-project headers
1418
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1419
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1420
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1421
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1422
+
1423
+ header_params = {
1424
+ "name" => request.name
1425
+ }
1426
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1427
+ metadata[:"x-goog-request-params"] ||= request_params_header
1428
+
1429
+ options.apply_defaults timeout: @config.rpcs.delete_tag_template.timeout,
1430
+ metadata: metadata,
1431
+ retry_policy: @config.rpcs.delete_tag_template.retry_policy
1432
+ options.apply_defaults metadata: @config.metadata,
1433
+ retry_policy: @config.retry_policy
1434
+
1435
+ @data_catalog_stub.call_rpc :delete_tag_template, request, options: options do |response, operation|
1436
+ yield response, operation if block_given?
1437
+ return response
1438
+ end
1439
+ rescue GRPC::BadStatus => e
1440
+ raise Google::Cloud::Error.from_error(e)
1441
+ end
1442
+
1443
+ ##
1444
+ # Creates a field in a tag template. The user should enable the Data Catalog
1445
+ # API in the project identified by the `parent` parameter (see
1446
+ # [Data Catalog Resource
1447
+ # Project](/data-catalog/docs/concepts/resource-project) for more
1448
+ # information).
1449
+ #
1450
+ # @overload create_tag_template_field(request, options = nil)
1451
+ # @param request [Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest | Hash]
1452
+ # Creates a field in a tag template. The user should enable the Data Catalog
1453
+ # API in the project identified by the `parent` parameter (see
1454
+ # [Data Catalog Resource
1455
+ # Project](/data-catalog/docs/concepts/resource-project) for more
1456
+ # information).
1457
+ # @param options [Gapic::CallOptions, Hash]
1458
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1459
+ #
1460
+ # @overload create_tag_template_field(parent: nil, tag_template_field_id: nil, tag_template_field: nil)
1461
+ # @param parent [String]
1462
+ # Required. The name of the project and the template location
1463
+ # [region](/compute/docs/regions-zones/#available).
1464
+ # NOTE: Currently, only the `us-central1 region` is supported.
1465
+ #
1466
+ # Example:
1467
+ #
1468
+ # * projects/\\{project_id}/locations/us-central1/tagTemplates/\\{tag_template_id}
1469
+ # @param tag_template_field_id [String]
1470
+ # Required. The ID of the tag template field to create.
1471
+ # Field ids can contain letters (both uppercase and lowercase), numbers
1472
+ # (0-9), underscores (_) and dashes (-). Field IDs must be at least 1
1473
+ # character long and at most 128 characters long. Field IDs must also be
1474
+ # unique within their template.
1475
+ # @param tag_template_field [Google::Cloud::DataCatalog::V1::TagTemplateField | Hash]
1476
+ # Required. The tag template field to create.
1477
+ #
1478
+ #
1479
+ # @yield [response, operation] Access the result along with the RPC operation
1480
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::TagTemplateField]
1481
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1482
+ #
1483
+ # @return [Google::Cloud::DataCatalog::V1::TagTemplateField]
1484
+ #
1485
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1486
+ #
1487
+ def create_tag_template_field request, options = nil
1488
+ raise ArgumentError, "request must be provided" if request.nil?
1489
+
1490
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest
1491
+
1492
+ # Converts hash and nil to an options object
1493
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1494
+
1495
+ # Customize the options with defaults
1496
+ metadata = @config.rpcs.create_tag_template_field.metadata.to_h
1497
+
1498
+ # Set x-goog-api-client and x-goog-user-project headers
1499
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1500
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1501
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1502
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1503
+
1504
+ header_params = {
1505
+ "parent" => request.parent
1506
+ }
1507
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1508
+ metadata[:"x-goog-request-params"] ||= request_params_header
1509
+
1510
+ options.apply_defaults timeout: @config.rpcs.create_tag_template_field.timeout,
1511
+ metadata: metadata,
1512
+ retry_policy: @config.rpcs.create_tag_template_field.retry_policy
1513
+ options.apply_defaults metadata: @config.metadata,
1514
+ retry_policy: @config.retry_policy
1515
+
1516
+ @data_catalog_stub.call_rpc :create_tag_template_field, request, options: options do |response, operation|
1517
+ yield response, operation if block_given?
1518
+ return response
1519
+ end
1520
+ rescue GRPC::BadStatus => e
1521
+ raise Google::Cloud::Error.from_error(e)
1522
+ end
1523
+
1524
+ ##
1525
+ # Updates a field in a tag template. This method cannot be used to update the
1526
+ # field type. Users should enable the Data Catalog API in the project
1527
+ # identified by the `name` parameter (see [Data Catalog Resource Project]
1528
+ # (/data-catalog/docs/concepts/resource-project) for more information).
1529
+ #
1530
+ # @overload update_tag_template_field(request, options = nil)
1531
+ # @param request [Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest | Hash]
1532
+ # Updates a field in a tag template. This method cannot be used to update the
1533
+ # field type. Users should enable the Data Catalog API in the project
1534
+ # identified by the `name` parameter (see [Data Catalog Resource Project]
1535
+ # (/data-catalog/docs/concepts/resource-project) for more information).
1536
+ # @param options [Gapic::CallOptions, Hash]
1537
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1538
+ #
1539
+ # @overload update_tag_template_field(name: nil, tag_template_field: nil, update_mask: nil)
1540
+ # @param name [String]
1541
+ # Required. The name of the tag template field. Example:
1542
+ #
1543
+ # * projects/\\{project_id}/locations/\\{location}/tagTemplates/\\{tag_template_id}/fields/\\{tag_template_field_id}
1544
+ # @param tag_template_field [Google::Cloud::DataCatalog::V1::TagTemplateField | Hash]
1545
+ # Required. The template to update.
1546
+ # @param update_mask [Google::Protobuf::FieldMask | Hash]
1547
+ # Optional. The field mask specifies the parts of the template to be updated.
1548
+ # Allowed fields:
1549
+ #
1550
+ # * `display_name`
1551
+ # * `type.enum_type`
1552
+ # * `is_required`
1553
+ #
1554
+ # If `update_mask` is not set or empty, all of the allowed fields above will
1555
+ # be updated.
1556
+ #
1557
+ # When updating an enum type, the provided values will be merged with the
1558
+ # existing values. Therefore, enum values can only be added, existing enum
1559
+ # values cannot be deleted nor renamed. Updating a template field from
1560
+ # optional to required is NOT allowed.
1561
+ #
1562
+ #
1563
+ # @yield [response, operation] Access the result along with the RPC operation
1564
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::TagTemplateField]
1565
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1566
+ #
1567
+ # @return [Google::Cloud::DataCatalog::V1::TagTemplateField]
1568
+ #
1569
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1570
+ #
1571
+ def update_tag_template_field request, options = nil
1572
+ raise ArgumentError, "request must be provided" if request.nil?
1573
+
1574
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest
1575
+
1576
+ # Converts hash and nil to an options object
1577
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1578
+
1579
+ # Customize the options with defaults
1580
+ metadata = @config.rpcs.update_tag_template_field.metadata.to_h
1581
+
1582
+ # Set x-goog-api-client and x-goog-user-project headers
1583
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1584
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1585
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1586
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1587
+
1588
+ header_params = {
1589
+ "name" => request.name
1590
+ }
1591
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1592
+ metadata[:"x-goog-request-params"] ||= request_params_header
1593
+
1594
+ options.apply_defaults timeout: @config.rpcs.update_tag_template_field.timeout,
1595
+ metadata: metadata,
1596
+ retry_policy: @config.rpcs.update_tag_template_field.retry_policy
1597
+ options.apply_defaults metadata: @config.metadata,
1598
+ retry_policy: @config.retry_policy
1599
+
1600
+ @data_catalog_stub.call_rpc :update_tag_template_field, request, options: options do |response, operation|
1601
+ yield response, operation if block_given?
1602
+ return response
1603
+ end
1604
+ rescue GRPC::BadStatus => e
1605
+ raise Google::Cloud::Error.from_error(e)
1606
+ end
1607
+
1608
+ ##
1609
+ # Renames a field in a tag template. The user should enable the Data Catalog
1610
+ # API in the project identified by the `name` parameter (see [Data Catalog
1611
+ # Resource Project](/data-catalog/docs/concepts/resource-project) for more
1612
+ # information).
1613
+ #
1614
+ # @overload rename_tag_template_field(request, options = nil)
1615
+ # @param request [Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest | Hash]
1616
+ # Renames a field in a tag template. The user should enable the Data Catalog
1617
+ # API in the project identified by the `name` parameter (see [Data Catalog
1618
+ # Resource Project](/data-catalog/docs/concepts/resource-project) for more
1619
+ # information).
1620
+ # @param options [Gapic::CallOptions, Hash]
1621
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1622
+ #
1623
+ # @overload rename_tag_template_field(name: nil, new_tag_template_field_id: nil)
1624
+ # @param name [String]
1625
+ # Required. The name of the tag template. Example:
1626
+ #
1627
+ # * projects/\\{project_id}/locations/\\{location}/tagTemplates/\\{tag_template_id}/fields/\\{tag_template_field_id}
1628
+ # @param new_tag_template_field_id [String]
1629
+ # Required. The new ID of this tag template field. For example, `my_new_field`.
1630
+ #
1631
+ #
1632
+ # @yield [response, operation] Access the result along with the RPC operation
1633
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::TagTemplateField]
1634
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1635
+ #
1636
+ # @return [Google::Cloud::DataCatalog::V1::TagTemplateField]
1637
+ #
1638
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1639
+ #
1640
+ def rename_tag_template_field request, options = nil
1641
+ raise ArgumentError, "request must be provided" if request.nil?
1642
+
1643
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest
1644
+
1645
+ # Converts hash and nil to an options object
1646
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1647
+
1648
+ # Customize the options with defaults
1649
+ metadata = @config.rpcs.rename_tag_template_field.metadata.to_h
1650
+
1651
+ # Set x-goog-api-client and x-goog-user-project headers
1652
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1653
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1654
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1655
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1656
+
1657
+ header_params = {
1658
+ "name" => request.name
1659
+ }
1660
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1661
+ metadata[:"x-goog-request-params"] ||= request_params_header
1662
+
1663
+ options.apply_defaults timeout: @config.rpcs.rename_tag_template_field.timeout,
1664
+ metadata: metadata,
1665
+ retry_policy: @config.rpcs.rename_tag_template_field.retry_policy
1666
+ options.apply_defaults metadata: @config.metadata,
1667
+ retry_policy: @config.retry_policy
1668
+
1669
+ @data_catalog_stub.call_rpc :rename_tag_template_field, request, options: options do |response, operation|
1670
+ yield response, operation if block_given?
1671
+ return response
1672
+ end
1673
+ rescue GRPC::BadStatus => e
1674
+ raise Google::Cloud::Error.from_error(e)
1675
+ end
1676
+
1677
+ ##
1678
+ # Deletes a field in a tag template and all uses of that field.
1679
+ # Users should enable the Data Catalog API in the project identified by
1680
+ # the `name` parameter (see [Data Catalog Resource Project]
1681
+ # (/data-catalog/docs/concepts/resource-project) for more information).
1682
+ #
1683
+ # @overload delete_tag_template_field(request, options = nil)
1684
+ # @param request [Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest | Hash]
1685
+ # Deletes a field in a tag template and all uses of that field.
1686
+ # Users should enable the Data Catalog API in the project identified by
1687
+ # the `name` parameter (see [Data Catalog Resource Project]
1688
+ # (/data-catalog/docs/concepts/resource-project) for more information).
1689
+ # @param options [Gapic::CallOptions, Hash]
1690
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1691
+ #
1692
+ # @overload delete_tag_template_field(name: nil, force: nil)
1693
+ # @param name [String]
1694
+ # Required. The name of the tag template field to delete. Example:
1695
+ #
1696
+ # * projects/\\{project_id}/locations/\\{location}/tagTemplates/\\{tag_template_id}/fields/\\{tag_template_field_id}
1697
+ # @param force [Boolean]
1698
+ # Required. Currently, this field must always be set to `true`.
1699
+ # This confirms the deletion of this field from any tags using this field.
1700
+ # `force = false` will be supported in the future.
1701
+ #
1702
+ #
1703
+ # @yield [response, operation] Access the result along with the RPC operation
1704
+ # @yieldparam response [Google::Protobuf::Empty]
1705
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1706
+ #
1707
+ # @return [Google::Protobuf::Empty]
1708
+ #
1709
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1710
+ #
1711
+ def delete_tag_template_field request, options = nil
1712
+ raise ArgumentError, "request must be provided" if request.nil?
1713
+
1714
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest
1715
+
1716
+ # Converts hash and nil to an options object
1717
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1718
+
1719
+ # Customize the options with defaults
1720
+ metadata = @config.rpcs.delete_tag_template_field.metadata.to_h
1721
+
1722
+ # Set x-goog-api-client and x-goog-user-project headers
1723
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1724
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1725
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1726
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1727
+
1728
+ header_params = {
1729
+ "name" => request.name
1730
+ }
1731
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1732
+ metadata[:"x-goog-request-params"] ||= request_params_header
1733
+
1734
+ options.apply_defaults timeout: @config.rpcs.delete_tag_template_field.timeout,
1735
+ metadata: metadata,
1736
+ retry_policy: @config.rpcs.delete_tag_template_field.retry_policy
1737
+ options.apply_defaults metadata: @config.metadata,
1738
+ retry_policy: @config.retry_policy
1739
+
1740
+ @data_catalog_stub.call_rpc :delete_tag_template_field, request, options: options do |response, operation|
1741
+ yield response, operation if block_given?
1742
+ return response
1743
+ end
1744
+ rescue GRPC::BadStatus => e
1745
+ raise Google::Cloud::Error.from_error(e)
1746
+ end
1747
+
1748
+ ##
1749
+ # Creates a tag on an {Google::Cloud::DataCatalog::V1::Entry Entry}.
1750
+ # Note: The project identified by the `parent` parameter for the
1751
+ # [tag](/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters)
1752
+ # and the
1753
+ # [tag
1754
+ # template](/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters)
1755
+ # used to create the tag must be from the same organization.
1756
+ #
1757
+ # @overload create_tag(request, options = nil)
1758
+ # @param request [Google::Cloud::DataCatalog::V1::CreateTagRequest | Hash]
1759
+ # Creates a tag on an {Google::Cloud::DataCatalog::V1::Entry Entry}.
1760
+ # Note: The project identified by the `parent` parameter for the
1761
+ # [tag](/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters)
1762
+ # and the
1763
+ # [tag
1764
+ # template](/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters)
1765
+ # used to create the tag must be from the same organization.
1766
+ # @param options [Gapic::CallOptions, Hash]
1767
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1768
+ #
1769
+ # @overload create_tag(parent: nil, tag: nil)
1770
+ # @param parent [String]
1771
+ # Required. The name of the resource to attach this tag to. Tags can be attached to
1772
+ # Entries. Example:
1773
+ #
1774
+ # * projects/\\{project_id}/locations/\\{location}/entryGroups/\\{entry_group_id}/entries/\\{entry_id}
1775
+ #
1776
+ # Note that this Tag and its child resources may not actually be stored in
1777
+ # the location in this name.
1778
+ # @param tag [Google::Cloud::DataCatalog::V1::Tag | Hash]
1779
+ # Required. The tag to create.
1780
+ #
1781
+ #
1782
+ # @yield [response, operation] Access the result along with the RPC operation
1783
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::Tag]
1784
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1785
+ #
1786
+ # @return [Google::Cloud::DataCatalog::V1::Tag]
1787
+ #
1788
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1789
+ #
1790
+ def create_tag request, options = nil
1791
+ raise ArgumentError, "request must be provided" if request.nil?
1792
+
1793
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::CreateTagRequest
1794
+
1795
+ # Converts hash and nil to an options object
1796
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1797
+
1798
+ # Customize the options with defaults
1799
+ metadata = @config.rpcs.create_tag.metadata.to_h
1800
+
1801
+ # Set x-goog-api-client and x-goog-user-project headers
1802
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1803
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1804
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1805
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1806
+
1807
+ header_params = {
1808
+ "parent" => request.parent
1809
+ }
1810
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1811
+ metadata[:"x-goog-request-params"] ||= request_params_header
1812
+
1813
+ options.apply_defaults timeout: @config.rpcs.create_tag.timeout,
1814
+ metadata: metadata,
1815
+ retry_policy: @config.rpcs.create_tag.retry_policy
1816
+ options.apply_defaults metadata: @config.metadata,
1817
+ retry_policy: @config.retry_policy
1818
+
1819
+ @data_catalog_stub.call_rpc :create_tag, request, options: options do |response, operation|
1820
+ yield response, operation if block_given?
1821
+ return response
1822
+ end
1823
+ rescue GRPC::BadStatus => e
1824
+ raise Google::Cloud::Error.from_error(e)
1825
+ end
1826
+
1827
+ ##
1828
+ # Updates an existing tag.
1829
+ #
1830
+ # @overload update_tag(request, options = nil)
1831
+ # @param request [Google::Cloud::DataCatalog::V1::UpdateTagRequest | Hash]
1832
+ # Updates an existing tag.
1833
+ # @param options [Gapic::CallOptions, Hash]
1834
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1835
+ #
1836
+ # @overload update_tag(tag: nil, update_mask: nil)
1837
+ # @param tag [Google::Cloud::DataCatalog::V1::Tag | Hash]
1838
+ # Required. The updated tag. The "name" field must be set.
1839
+ # @param update_mask [Google::Protobuf::FieldMask | Hash]
1840
+ # The fields to update on the Tag. If absent or empty, all modifiable fields
1841
+ # are updated. Currently the only modifiable field is the field `fields`.
1842
+ #
1843
+ #
1844
+ # @yield [response, operation] Access the result along with the RPC operation
1845
+ # @yieldparam response [Google::Cloud::DataCatalog::V1::Tag]
1846
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1847
+ #
1848
+ # @return [Google::Cloud::DataCatalog::V1::Tag]
1849
+ #
1850
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1851
+ #
1852
+ def update_tag request, options = nil
1853
+ raise ArgumentError, "request must be provided" if request.nil?
1854
+
1855
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::UpdateTagRequest
1856
+
1857
+ # Converts hash and nil to an options object
1858
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1859
+
1860
+ # Customize the options with defaults
1861
+ metadata = @config.rpcs.update_tag.metadata.to_h
1862
+
1863
+ # Set x-goog-api-client and x-goog-user-project headers
1864
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1865
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1866
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1867
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1868
+
1869
+ header_params = {
1870
+ "tag.name" => request.tag.name
1871
+ }
1872
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1873
+ metadata[:"x-goog-request-params"] ||= request_params_header
1874
+
1875
+ options.apply_defaults timeout: @config.rpcs.update_tag.timeout,
1876
+ metadata: metadata,
1877
+ retry_policy: @config.rpcs.update_tag.retry_policy
1878
+ options.apply_defaults metadata: @config.metadata,
1879
+ retry_policy: @config.retry_policy
1880
+
1881
+ @data_catalog_stub.call_rpc :update_tag, request, options: options do |response, operation|
1882
+ yield response, operation if block_given?
1883
+ return response
1884
+ end
1885
+ rescue GRPC::BadStatus => e
1886
+ raise Google::Cloud::Error.from_error(e)
1887
+ end
1888
+
1889
+ ##
1890
+ # Deletes a tag.
1891
+ #
1892
+ # @overload delete_tag(request, options = nil)
1893
+ # @param request [Google::Cloud::DataCatalog::V1::DeleteTagRequest | Hash]
1894
+ # Deletes a tag.
1895
+ # @param options [Gapic::CallOptions, Hash]
1896
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1897
+ #
1898
+ # @overload delete_tag(name: nil)
1899
+ # @param name [String]
1900
+ # Required. The name of the tag to delete. Example:
1901
+ #
1902
+ # * projects/\\{project_id}/locations/\\{location}/entryGroups/\\{entry_group_id}/entries/\\{entry_id}/tags/\\{tag_id}
1903
+ #
1904
+ #
1905
+ # @yield [response, operation] Access the result along with the RPC operation
1906
+ # @yieldparam response [Google::Protobuf::Empty]
1907
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1908
+ #
1909
+ # @return [Google::Protobuf::Empty]
1910
+ #
1911
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1912
+ #
1913
+ def delete_tag request, options = nil
1914
+ raise ArgumentError, "request must be provided" if request.nil?
1915
+
1916
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::DeleteTagRequest
1917
+
1918
+ # Converts hash and nil to an options object
1919
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1920
+
1921
+ # Customize the options with defaults
1922
+ metadata = @config.rpcs.delete_tag.metadata.to_h
1923
+
1924
+ # Set x-goog-api-client and x-goog-user-project headers
1925
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1926
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1927
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1928
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1929
+
1930
+ header_params = {
1931
+ "name" => request.name
1932
+ }
1933
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1934
+ metadata[:"x-goog-request-params"] ||= request_params_header
1935
+
1936
+ options.apply_defaults timeout: @config.rpcs.delete_tag.timeout,
1937
+ metadata: metadata,
1938
+ retry_policy: @config.rpcs.delete_tag.retry_policy
1939
+ options.apply_defaults metadata: @config.metadata,
1940
+ retry_policy: @config.retry_policy
1941
+
1942
+ @data_catalog_stub.call_rpc :delete_tag, request, options: options do |response, operation|
1943
+ yield response, operation if block_given?
1944
+ return response
1945
+ end
1946
+ rescue GRPC::BadStatus => e
1947
+ raise Google::Cloud::Error.from_error(e)
1948
+ end
1949
+
1950
+ ##
1951
+ # Lists the tags on an {Google::Cloud::DataCatalog::V1::Entry Entry}.
1952
+ #
1953
+ # @overload list_tags(request, options = nil)
1954
+ # @param request [Google::Cloud::DataCatalog::V1::ListTagsRequest | Hash]
1955
+ # Lists the tags on an {Google::Cloud::DataCatalog::V1::Entry Entry}.
1956
+ # @param options [Gapic::CallOptions, Hash]
1957
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1958
+ #
1959
+ # @overload list_tags(parent: nil, page_size: nil, page_token: nil)
1960
+ # @param parent [String]
1961
+ # Required. The name of the Data Catalog resource to list the tags of. The resource
1962
+ # could be an {Google::Cloud::DataCatalog::V1::Entry Entry} or an
1963
+ # {Google::Cloud::DataCatalog::V1::EntryGroup EntryGroup}.
1964
+ #
1965
+ # Examples:
1966
+ #
1967
+ # * projects/\\{project_id}/locations/\\{location}/entryGroups/\\{entry_group_id}
1968
+ # * projects/\\{project_id}/locations/\\{location}/entryGroups/\\{entry_group_id}/entries/\\{entry_id}
1969
+ # @param page_size [Integer]
1970
+ # The maximum number of tags to return. Default is 10. Max limit is 1000.
1971
+ # @param page_token [String]
1972
+ # Token that specifies which page is requested. If empty, the first page is
1973
+ # returned.
1974
+ #
1975
+ #
1976
+ # @yield [response, operation] Access the result along with the RPC operation
1977
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::DataCatalog::V1::Tag>]
1978
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1979
+ #
1980
+ # @return [Gapic::PagedEnumerable<Google::Cloud::DataCatalog::V1::Tag>]
1981
+ #
1982
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1983
+ #
1984
+ def list_tags request, options = nil
1985
+ raise ArgumentError, "request must be provided" if request.nil?
1986
+
1987
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::DataCatalog::V1::ListTagsRequest
1988
+
1989
+ # Converts hash and nil to an options object
1990
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1991
+
1992
+ # Customize the options with defaults
1993
+ metadata = @config.rpcs.list_tags.metadata.to_h
1994
+
1995
+ # Set x-goog-api-client and x-goog-user-project headers
1996
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1997
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1998
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
1999
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2000
+
2001
+ header_params = {
2002
+ "parent" => request.parent
2003
+ }
2004
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2005
+ metadata[:"x-goog-request-params"] ||= request_params_header
2006
+
2007
+ options.apply_defaults timeout: @config.rpcs.list_tags.timeout,
2008
+ metadata: metadata,
2009
+ retry_policy: @config.rpcs.list_tags.retry_policy
2010
+ options.apply_defaults metadata: @config.metadata,
2011
+ retry_policy: @config.retry_policy
2012
+
2013
+ @data_catalog_stub.call_rpc :list_tags, request, options: options do |response, operation|
2014
+ response = Gapic::PagedEnumerable.new @data_catalog_stub, :list_tags, request, response, operation, options
2015
+ yield response, operation if block_given?
2016
+ return response
2017
+ end
2018
+ rescue GRPC::BadStatus => e
2019
+ raise Google::Cloud::Error.from_error(e)
2020
+ end
2021
+
2022
+ ##
2023
+ # Sets the access control policy for a resource. Replaces any existing
2024
+ # policy.
2025
+ # Supported resources are:
2026
+ # - Tag templates.
2027
+ # - Entries.
2028
+ # - Entry groups.
2029
+ # Note, this method cannot be used to manage policies for BigQuery, Pub/Sub
2030
+ # and any external Google Cloud Platform resources synced to Data Catalog.
2031
+ #
2032
+ # Callers must have following Google IAM permission
2033
+ # - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag
2034
+ # templates.
2035
+ # - `datacatalog.entries.setIamPolicy` to set policies on entries.
2036
+ # - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups.
2037
+ #
2038
+ # @overload set_iam_policy(request, options = nil)
2039
+ # @param request [Google::Iam::V1::SetIamPolicyRequest | Hash]
2040
+ # Sets the access control policy for a resource. Replaces any existing
2041
+ # policy.
2042
+ # Supported resources are:
2043
+ # - Tag templates.
2044
+ # - Entries.
2045
+ # - Entry groups.
2046
+ # Note, this method cannot be used to manage policies for BigQuery, Pub/Sub
2047
+ # and any external Google Cloud Platform resources synced to Data Catalog.
2048
+ #
2049
+ # Callers must have following Google IAM permission
2050
+ # - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag
2051
+ # templates.
2052
+ # - `datacatalog.entries.setIamPolicy` to set policies on entries.
2053
+ # - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups.
2054
+ # @param options [Gapic::CallOptions, Hash]
2055
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2056
+ #
2057
+ # @overload set_iam_policy(resource: nil, policy: nil)
2058
+ # @param resource [String]
2059
+ # REQUIRED: The resource for which the policy is being specified.
2060
+ # `resource` is usually specified as a path. For example, a Project
2061
+ # resource is specified as `projects/{project}`.
2062
+ # @param policy [Google::Iam::V1::Policy | Hash]
2063
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
2064
+ # the policy is limited to a few 10s of KB. An empty policy is a
2065
+ # valid policy but certain Cloud Platform services (such as Projects)
2066
+ # might reject them.
2067
+ #
2068
+ #
2069
+ # @yield [response, operation] Access the result along with the RPC operation
2070
+ # @yieldparam response [Google::Iam::V1::Policy]
2071
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2072
+ #
2073
+ # @return [Google::Iam::V1::Policy]
2074
+ #
2075
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2076
+ #
2077
+ def set_iam_policy request, options = nil
2078
+ raise ArgumentError, "request must be provided" if request.nil?
2079
+
2080
+ request = Gapic::Protobuf.coerce request, to: Google::Iam::V1::SetIamPolicyRequest
2081
+
2082
+ # Converts hash and nil to an options object
2083
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2084
+
2085
+ # Customize the options with defaults
2086
+ metadata = @config.rpcs.set_iam_policy.metadata.to_h
2087
+
2088
+ # Set x-goog-api-client and x-goog-user-project headers
2089
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2090
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2091
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
2092
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2093
+
2094
+ header_params = {
2095
+ "resource" => request.resource
2096
+ }
2097
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2098
+ metadata[:"x-goog-request-params"] ||= request_params_header
2099
+
2100
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
2101
+ metadata: metadata,
2102
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
2103
+ options.apply_defaults metadata: @config.metadata,
2104
+ retry_policy: @config.retry_policy
2105
+
2106
+ @data_catalog_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
2107
+ yield response, operation if block_given?
2108
+ return response
2109
+ end
2110
+ rescue GRPC::BadStatus => e
2111
+ raise Google::Cloud::Error.from_error(e)
2112
+ end
2113
+
2114
+ ##
2115
+ # Gets the access control policy for a resource. A `NOT_FOUND` error
2116
+ # is returned if the resource does not exist. An empty policy is returned
2117
+ # if the resource exists but does not have a policy set on it.
2118
+ #
2119
+ # Supported resources are:
2120
+ # - Tag templates.
2121
+ # - Entries.
2122
+ # - Entry groups.
2123
+ # Note, this method cannot be used to manage policies for BigQuery, Pub/Sub
2124
+ # and any external Google Cloud Platform resources synced to Data Catalog.
2125
+ #
2126
+ # Callers must have following Google IAM permission
2127
+ # - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag
2128
+ # templates.
2129
+ # - `datacatalog.entries.getIamPolicy` to get policies on entries.
2130
+ # - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups.
2131
+ #
2132
+ # @overload get_iam_policy(request, options = nil)
2133
+ # @param request [Google::Iam::V1::GetIamPolicyRequest | Hash]
2134
+ # Gets the access control policy for a resource. A `NOT_FOUND` error
2135
+ # is returned if the resource does not exist. An empty policy is returned
2136
+ # if the resource exists but does not have a policy set on it.
2137
+ #
2138
+ # Supported resources are:
2139
+ # - Tag templates.
2140
+ # - Entries.
2141
+ # - Entry groups.
2142
+ # Note, this method cannot be used to manage policies for BigQuery, Pub/Sub
2143
+ # and any external Google Cloud Platform resources synced to Data Catalog.
2144
+ #
2145
+ # Callers must have following Google IAM permission
2146
+ # - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag
2147
+ # templates.
2148
+ # - `datacatalog.entries.getIamPolicy` to get policies on entries.
2149
+ # - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups.
2150
+ # @param options [Gapic::CallOptions, Hash]
2151
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2152
+ #
2153
+ # @overload get_iam_policy(resource: nil)
2154
+ # @param resource [String]
2155
+ # REQUIRED: The resource for which the policy is being requested.
2156
+ # `resource` is usually specified as a path. For example, a Project
2157
+ # resource is specified as `projects/{project}`.
2158
+ #
2159
+ #
2160
+ # @yield [response, operation] Access the result along with the RPC operation
2161
+ # @yieldparam response [Google::Iam::V1::Policy]
2162
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2163
+ #
2164
+ # @return [Google::Iam::V1::Policy]
2165
+ #
2166
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2167
+ #
2168
+ def get_iam_policy request, options = nil
2169
+ raise ArgumentError, "request must be provided" if request.nil?
2170
+
2171
+ request = Gapic::Protobuf.coerce request, to: Google::Iam::V1::GetIamPolicyRequest
2172
+
2173
+ # Converts hash and nil to an options object
2174
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2175
+
2176
+ # Customize the options with defaults
2177
+ metadata = @config.rpcs.get_iam_policy.metadata.to_h
2178
+
2179
+ # Set x-goog-api-client and x-goog-user-project headers
2180
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2181
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2182
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
2183
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2184
+
2185
+ header_params = {
2186
+ "resource" => request.resource
2187
+ }
2188
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2189
+ metadata[:"x-goog-request-params"] ||= request_params_header
2190
+
2191
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
2192
+ metadata: metadata,
2193
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
2194
+ options.apply_defaults metadata: @config.metadata,
2195
+ retry_policy: @config.retry_policy
2196
+
2197
+ @data_catalog_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
2198
+ yield response, operation if block_given?
2199
+ return response
2200
+ end
2201
+ rescue GRPC::BadStatus => e
2202
+ raise Google::Cloud::Error.from_error(e)
2203
+ end
2204
+
2205
+ ##
2206
+ # Returns the caller's permissions on a resource.
2207
+ # If the resource does not exist, an empty set of permissions is returned
2208
+ # (We don't return a `NOT_FOUND` error).
2209
+ #
2210
+ # Supported resources are:
2211
+ # - Tag templates.
2212
+ # - Entries.
2213
+ # - Entry groups.
2214
+ # Note, this method cannot be used to manage policies for BigQuery, Pub/Sub
2215
+ # and any external Google Cloud Platform resources synced to Data Catalog.
2216
+ #
2217
+ # A caller is not required to have Google IAM permission to make this
2218
+ # request.
2219
+ #
2220
+ # @overload test_iam_permissions(request, options = nil)
2221
+ # @param request [Google::Iam::V1::TestIamPermissionsRequest | Hash]
2222
+ # Returns the caller's permissions on a resource.
2223
+ # If the resource does not exist, an empty set of permissions is returned
2224
+ # (We don't return a `NOT_FOUND` error).
2225
+ #
2226
+ # Supported resources are:
2227
+ # - Tag templates.
2228
+ # - Entries.
2229
+ # - Entry groups.
2230
+ # Note, this method cannot be used to manage policies for BigQuery, Pub/Sub
2231
+ # and any external Google Cloud Platform resources synced to Data Catalog.
2232
+ #
2233
+ # A caller is not required to have Google IAM permission to make this
2234
+ # request.
2235
+ # @param options [Gapic::CallOptions, Hash]
2236
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2237
+ #
2238
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
2239
+ # @param resource [String]
2240
+ # REQUIRED: The resource for which the policy detail is being requested.
2241
+ # `resource` is usually specified as a path. For example, a Project
2242
+ # resource is specified as `projects/{project}`.
2243
+ # @param permissions [Array<String>]
2244
+ # The set of permissions to check for the `resource`. Permissions with
2245
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
2246
+ # information see
2247
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
2248
+ #
2249
+ #
2250
+ # @yield [response, operation] Access the result along with the RPC operation
2251
+ # @yieldparam response [Google::Iam::V1::TestIamPermissionsResponse]
2252
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2253
+ #
2254
+ # @return [Google::Iam::V1::TestIamPermissionsResponse]
2255
+ #
2256
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2257
+ #
2258
+ def test_iam_permissions request, options = nil
2259
+ raise ArgumentError, "request must be provided" if request.nil?
2260
+
2261
+ request = Gapic::Protobuf.coerce request, to: Google::Iam::V1::TestIamPermissionsRequest
2262
+
2263
+ # Converts hash and nil to an options object
2264
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2265
+
2266
+ # Customize the options with defaults
2267
+ metadata = @config.rpcs.test_iam_permissions.metadata.to_h
2268
+
2269
+ # Set x-goog-api-client and x-goog-user-project headers
2270
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2271
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2272
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION
2273
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2274
+
2275
+ header_params = {
2276
+ "resource" => request.resource
2277
+ }
2278
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2279
+ metadata[:"x-goog-request-params"] ||= request_params_header
2280
+
2281
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
2282
+ metadata: metadata,
2283
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
2284
+ options.apply_defaults metadata: @config.metadata,
2285
+ retry_policy: @config.retry_policy
2286
+
2287
+ @data_catalog_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
2288
+ yield response, operation if block_given?
2289
+ return response
2290
+ end
2291
+ rescue GRPC::BadStatus => e
2292
+ raise Google::Cloud::Error.from_error(e)
2293
+ end
2294
+
2295
+ ##
2296
+ # Configuration class for the DataCatalog API.
2297
+ #
2298
+ # This class represents the configuration for DataCatalog,
2299
+ # providing control over timeouts, retry behavior, logging, transport
2300
+ # parameters, and other low-level controls. Certain parameters can also be
2301
+ # applied individually to specific RPCs. See
2302
+ # {Google::Cloud::DataCatalog::V1::DataCatalog::Client::Configuration::Rpcs}
2303
+ # for a list of RPCs that can be configured independently.
2304
+ #
2305
+ # Configuration can be applied globally to all clients, or to a single client
2306
+ # on construction.
2307
+ #
2308
+ # # Examples
2309
+ #
2310
+ # To modify the global config, setting the timeout for search_catalog
2311
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
2312
+ #
2313
+ # Google::Cloud::DataCatalog::V1::DataCatalog::Client.configure do |config|
2314
+ # config.timeout = 10_000
2315
+ # config.rpcs.search_catalog.timeout = 20_000
2316
+ # end
2317
+ #
2318
+ # To apply the above configuration only to a new client:
2319
+ #
2320
+ # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config|
2321
+ # config.timeout = 10_000
2322
+ # config.rpcs.search_catalog.timeout = 20_000
2323
+ # end
2324
+ #
2325
+ # @!attribute [rw] endpoint
2326
+ # The hostname or hostname:port of the service endpoint.
2327
+ # Defaults to `"datacatalog.googleapis.com"`.
2328
+ # @return [String]
2329
+ # @!attribute [rw] credentials
2330
+ # Credentials to send with calls. You may provide any of the following types:
2331
+ # * (`String`) The path to a service account key file in JSON format
2332
+ # * (`Hash`) A service account key as a Hash
2333
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2334
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2335
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2336
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2337
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2338
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2339
+ # * (`nil`) indicating no credentials
2340
+ # @return [Object]
2341
+ # @!attribute [rw] scope
2342
+ # The OAuth scopes
2343
+ # @return [Array<String>]
2344
+ # @!attribute [rw] lib_name
2345
+ # The library name as recorded in instrumentation and logging
2346
+ # @return [String]
2347
+ # @!attribute [rw] lib_version
2348
+ # The library version as recorded in instrumentation and logging
2349
+ # @return [String]
2350
+ # @!attribute [rw] channel_args
2351
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
2352
+ # `GRPC::Core::Channel` object is provided as the credential.
2353
+ # @return [Hash]
2354
+ # @!attribute [rw] interceptors
2355
+ # An array of interceptors that are run before calls are executed.
2356
+ # @return [Array<GRPC::ClientInterceptor>]
2357
+ # @!attribute [rw] timeout
2358
+ # The call timeout in milliseconds.
2359
+ # @return [Numeric]
2360
+ # @!attribute [rw] metadata
2361
+ # Additional gRPC headers to be sent with the call.
2362
+ # @return [Hash{Symbol=>String}]
2363
+ # @!attribute [rw] retry_policy
2364
+ # The retry policy. The value is a hash with the following keys:
2365
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2366
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2367
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2368
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2369
+ # trigger a retry.
2370
+ # @return [Hash]
2371
+ #
2372
+ class Configuration
2373
+ extend Gapic::Config
2374
+
2375
+ config_attr :endpoint, "datacatalog.googleapis.com", String
2376
+ config_attr :credentials, nil do |value|
2377
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2378
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
2379
+ allowed.any? { |klass| klass === value }
2380
+ end
2381
+ config_attr :scope, nil, String, Array, nil
2382
+ config_attr :lib_name, nil, String, nil
2383
+ config_attr :lib_version, nil, String, nil
2384
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
2385
+ config_attr :interceptors, nil, Array, nil
2386
+ config_attr :timeout, nil, Numeric, nil
2387
+ config_attr :metadata, nil, Hash, nil
2388
+ config_attr :retry_policy, nil, Hash, Proc, nil
2389
+
2390
+ # @private
2391
+ def initialize parent_config = nil
2392
+ @parent_config = parent_config unless parent_config.nil?
2393
+
2394
+ yield self if block_given?
2395
+ end
2396
+
2397
+ ##
2398
+ # Configurations for individual RPCs
2399
+ # @return [Rpcs]
2400
+ #
2401
+ def rpcs
2402
+ @rpcs ||= begin
2403
+ parent_rpcs = nil
2404
+ parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
2405
+ Rpcs.new parent_rpcs
2406
+ end
2407
+ end
2408
+
2409
+ ##
2410
+ # Configuration RPC class for the DataCatalog API.
2411
+ #
2412
+ # Includes fields providing the configuration for each RPC in this service.
2413
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2414
+ # the following configuration fields:
2415
+ #
2416
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
2417
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
2418
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2419
+ # include the following keys:
2420
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2421
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2422
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2423
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2424
+ # trigger a retry.
2425
+ #
2426
+ class Rpcs
2427
+ ##
2428
+ # RPC-specific configuration for `search_catalog`
2429
+ # @return [Gapic::Config::Method]
2430
+ #
2431
+ attr_reader :search_catalog
2432
+ ##
2433
+ # RPC-specific configuration for `create_entry_group`
2434
+ # @return [Gapic::Config::Method]
2435
+ #
2436
+ attr_reader :create_entry_group
2437
+ ##
2438
+ # RPC-specific configuration for `get_entry_group`
2439
+ # @return [Gapic::Config::Method]
2440
+ #
2441
+ attr_reader :get_entry_group
2442
+ ##
2443
+ # RPC-specific configuration for `update_entry_group`
2444
+ # @return [Gapic::Config::Method]
2445
+ #
2446
+ attr_reader :update_entry_group
2447
+ ##
2448
+ # RPC-specific configuration for `delete_entry_group`
2449
+ # @return [Gapic::Config::Method]
2450
+ #
2451
+ attr_reader :delete_entry_group
2452
+ ##
2453
+ # RPC-specific configuration for `list_entry_groups`
2454
+ # @return [Gapic::Config::Method]
2455
+ #
2456
+ attr_reader :list_entry_groups
2457
+ ##
2458
+ # RPC-specific configuration for `create_entry`
2459
+ # @return [Gapic::Config::Method]
2460
+ #
2461
+ attr_reader :create_entry
2462
+ ##
2463
+ # RPC-specific configuration for `update_entry`
2464
+ # @return [Gapic::Config::Method]
2465
+ #
2466
+ attr_reader :update_entry
2467
+ ##
2468
+ # RPC-specific configuration for `delete_entry`
2469
+ # @return [Gapic::Config::Method]
2470
+ #
2471
+ attr_reader :delete_entry
2472
+ ##
2473
+ # RPC-specific configuration for `get_entry`
2474
+ # @return [Gapic::Config::Method]
2475
+ #
2476
+ attr_reader :get_entry
2477
+ ##
2478
+ # RPC-specific configuration for `lookup_entry`
2479
+ # @return [Gapic::Config::Method]
2480
+ #
2481
+ attr_reader :lookup_entry
2482
+ ##
2483
+ # RPC-specific configuration for `list_entries`
2484
+ # @return [Gapic::Config::Method]
2485
+ #
2486
+ attr_reader :list_entries
2487
+ ##
2488
+ # RPC-specific configuration for `create_tag_template`
2489
+ # @return [Gapic::Config::Method]
2490
+ #
2491
+ attr_reader :create_tag_template
2492
+ ##
2493
+ # RPC-specific configuration for `get_tag_template`
2494
+ # @return [Gapic::Config::Method]
2495
+ #
2496
+ attr_reader :get_tag_template
2497
+ ##
2498
+ # RPC-specific configuration for `update_tag_template`
2499
+ # @return [Gapic::Config::Method]
2500
+ #
2501
+ attr_reader :update_tag_template
2502
+ ##
2503
+ # RPC-specific configuration for `delete_tag_template`
2504
+ # @return [Gapic::Config::Method]
2505
+ #
2506
+ attr_reader :delete_tag_template
2507
+ ##
2508
+ # RPC-specific configuration for `create_tag_template_field`
2509
+ # @return [Gapic::Config::Method]
2510
+ #
2511
+ attr_reader :create_tag_template_field
2512
+ ##
2513
+ # RPC-specific configuration for `update_tag_template_field`
2514
+ # @return [Gapic::Config::Method]
2515
+ #
2516
+ attr_reader :update_tag_template_field
2517
+ ##
2518
+ # RPC-specific configuration for `rename_tag_template_field`
2519
+ # @return [Gapic::Config::Method]
2520
+ #
2521
+ attr_reader :rename_tag_template_field
2522
+ ##
2523
+ # RPC-specific configuration for `delete_tag_template_field`
2524
+ # @return [Gapic::Config::Method]
2525
+ #
2526
+ attr_reader :delete_tag_template_field
2527
+ ##
2528
+ # RPC-specific configuration for `create_tag`
2529
+ # @return [Gapic::Config::Method]
2530
+ #
2531
+ attr_reader :create_tag
2532
+ ##
2533
+ # RPC-specific configuration for `update_tag`
2534
+ # @return [Gapic::Config::Method]
2535
+ #
2536
+ attr_reader :update_tag
2537
+ ##
2538
+ # RPC-specific configuration for `delete_tag`
2539
+ # @return [Gapic::Config::Method]
2540
+ #
2541
+ attr_reader :delete_tag
2542
+ ##
2543
+ # RPC-specific configuration for `list_tags`
2544
+ # @return [Gapic::Config::Method]
2545
+ #
2546
+ attr_reader :list_tags
2547
+ ##
2548
+ # RPC-specific configuration for `set_iam_policy`
2549
+ # @return [Gapic::Config::Method]
2550
+ #
2551
+ attr_reader :set_iam_policy
2552
+ ##
2553
+ # RPC-specific configuration for `get_iam_policy`
2554
+ # @return [Gapic::Config::Method]
2555
+ #
2556
+ attr_reader :get_iam_policy
2557
+ ##
2558
+ # RPC-specific configuration for `test_iam_permissions`
2559
+ # @return [Gapic::Config::Method]
2560
+ #
2561
+ attr_reader :test_iam_permissions
2562
+
2563
+ # @private
2564
+ def initialize parent_rpcs = nil
2565
+ search_catalog_config = parent_rpcs&.search_catalog if parent_rpcs&.respond_to? :search_catalog
2566
+ @search_catalog = Gapic::Config::Method.new search_catalog_config
2567
+ create_entry_group_config = parent_rpcs&.create_entry_group if parent_rpcs&.respond_to? :create_entry_group
2568
+ @create_entry_group = Gapic::Config::Method.new create_entry_group_config
2569
+ get_entry_group_config = parent_rpcs&.get_entry_group if parent_rpcs&.respond_to? :get_entry_group
2570
+ @get_entry_group = Gapic::Config::Method.new get_entry_group_config
2571
+ update_entry_group_config = parent_rpcs&.update_entry_group if parent_rpcs&.respond_to? :update_entry_group
2572
+ @update_entry_group = Gapic::Config::Method.new update_entry_group_config
2573
+ delete_entry_group_config = parent_rpcs&.delete_entry_group if parent_rpcs&.respond_to? :delete_entry_group
2574
+ @delete_entry_group = Gapic::Config::Method.new delete_entry_group_config
2575
+ list_entry_groups_config = parent_rpcs&.list_entry_groups if parent_rpcs&.respond_to? :list_entry_groups
2576
+ @list_entry_groups = Gapic::Config::Method.new list_entry_groups_config
2577
+ create_entry_config = parent_rpcs&.create_entry if parent_rpcs&.respond_to? :create_entry
2578
+ @create_entry = Gapic::Config::Method.new create_entry_config
2579
+ update_entry_config = parent_rpcs&.update_entry if parent_rpcs&.respond_to? :update_entry
2580
+ @update_entry = Gapic::Config::Method.new update_entry_config
2581
+ delete_entry_config = parent_rpcs&.delete_entry if parent_rpcs&.respond_to? :delete_entry
2582
+ @delete_entry = Gapic::Config::Method.new delete_entry_config
2583
+ get_entry_config = parent_rpcs&.get_entry if parent_rpcs&.respond_to? :get_entry
2584
+ @get_entry = Gapic::Config::Method.new get_entry_config
2585
+ lookup_entry_config = parent_rpcs&.lookup_entry if parent_rpcs&.respond_to? :lookup_entry
2586
+ @lookup_entry = Gapic::Config::Method.new lookup_entry_config
2587
+ list_entries_config = parent_rpcs&.list_entries if parent_rpcs&.respond_to? :list_entries
2588
+ @list_entries = Gapic::Config::Method.new list_entries_config
2589
+ create_tag_template_config = parent_rpcs&.create_tag_template if parent_rpcs&.respond_to? :create_tag_template
2590
+ @create_tag_template = Gapic::Config::Method.new create_tag_template_config
2591
+ get_tag_template_config = parent_rpcs&.get_tag_template if parent_rpcs&.respond_to? :get_tag_template
2592
+ @get_tag_template = Gapic::Config::Method.new get_tag_template_config
2593
+ update_tag_template_config = parent_rpcs&.update_tag_template if parent_rpcs&.respond_to? :update_tag_template
2594
+ @update_tag_template = Gapic::Config::Method.new update_tag_template_config
2595
+ delete_tag_template_config = parent_rpcs&.delete_tag_template if parent_rpcs&.respond_to? :delete_tag_template
2596
+ @delete_tag_template = Gapic::Config::Method.new delete_tag_template_config
2597
+ create_tag_template_field_config = parent_rpcs&.create_tag_template_field if parent_rpcs&.respond_to? :create_tag_template_field
2598
+ @create_tag_template_field = Gapic::Config::Method.new create_tag_template_field_config
2599
+ update_tag_template_field_config = parent_rpcs&.update_tag_template_field if parent_rpcs&.respond_to? :update_tag_template_field
2600
+ @update_tag_template_field = Gapic::Config::Method.new update_tag_template_field_config
2601
+ rename_tag_template_field_config = parent_rpcs&.rename_tag_template_field if parent_rpcs&.respond_to? :rename_tag_template_field
2602
+ @rename_tag_template_field = Gapic::Config::Method.new rename_tag_template_field_config
2603
+ delete_tag_template_field_config = parent_rpcs&.delete_tag_template_field if parent_rpcs&.respond_to? :delete_tag_template_field
2604
+ @delete_tag_template_field = Gapic::Config::Method.new delete_tag_template_field_config
2605
+ create_tag_config = parent_rpcs&.create_tag if parent_rpcs&.respond_to? :create_tag
2606
+ @create_tag = Gapic::Config::Method.new create_tag_config
2607
+ update_tag_config = parent_rpcs&.update_tag if parent_rpcs&.respond_to? :update_tag
2608
+ @update_tag = Gapic::Config::Method.new update_tag_config
2609
+ delete_tag_config = parent_rpcs&.delete_tag if parent_rpcs&.respond_to? :delete_tag
2610
+ @delete_tag = Gapic::Config::Method.new delete_tag_config
2611
+ list_tags_config = parent_rpcs&.list_tags if parent_rpcs&.respond_to? :list_tags
2612
+ @list_tags = Gapic::Config::Method.new list_tags_config
2613
+ set_iam_policy_config = parent_rpcs&.set_iam_policy if parent_rpcs&.respond_to? :set_iam_policy
2614
+ @set_iam_policy = Gapic::Config::Method.new set_iam_policy_config
2615
+ get_iam_policy_config = parent_rpcs&.get_iam_policy if parent_rpcs&.respond_to? :get_iam_policy
2616
+ @get_iam_policy = Gapic::Config::Method.new get_iam_policy_config
2617
+ test_iam_permissions_config = parent_rpcs&.test_iam_permissions if parent_rpcs&.respond_to? :test_iam_permissions
2618
+ @test_iam_permissions = Gapic::Config::Method.new test_iam_permissions_config
2619
+
2620
+ yield self if block_given?
2621
+ end
2622
+ end
2623
+ end
2624
+ end
2625
+ end
2626
+ end
2627
+ end
2628
+ end
2629
+ end
2630
+
2631
+ # rubocop:disable Lint/HandleExceptions
2632
+
2633
+ # Once client is loaded, load helpers.rb if it exists.
2634
+ begin
2635
+ require "google/cloud/data_catalog/v1/data_catalog/helpers"
2636
+ rescue LoadError
2637
+ end
2638
+
2639
+ # rubocop:enable Lint/HandleExceptions