google-cloud-data_catalog-v1 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/data_catalog/v1/data_catalog/client.rb +276 -13
  4. data/lib/google/cloud/data_catalog/v1/data_catalog/operations.rb +768 -0
  5. data/lib/google/cloud/data_catalog/v1/data_catalog/rest/client.rb +216 -13
  6. data/lib/google/cloud/data_catalog/v1/data_catalog/rest/operations.rb +792 -0
  7. data/lib/google/cloud/data_catalog/v1/data_catalog/rest/service_stub.rb +120 -0
  8. data/lib/google/cloud/data_catalog/v1/data_catalog/rest.rb +1 -0
  9. data/lib/google/cloud/data_catalog/v1/data_catalog.rb +1 -0
  10. data/lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb +6 -3
  11. data/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb +6 -3
  12. data/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/client.rb +6 -4
  13. data/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/client.rb +6 -4
  14. data/lib/google/cloud/data_catalog/v1/version.rb +1 -1
  15. data/lib/google/cloud/datacatalog/v1/common_pb.rb +8 -0
  16. data/lib/google/cloud/datacatalog/v1/datacatalog_pb.rb +90 -0
  17. data/lib/google/cloud/datacatalog/v1/datacatalog_services_pb.rb +33 -0
  18. data/lib/google/cloud/datacatalog/v1/dump_content_pb.rb +35 -0
  19. data/lib/google/cloud/datacatalog/v1/policytagmanager_pb.rb +8 -0
  20. data/lib/google/cloud/datacatalog/v1/schema_pb.rb +28 -0
  21. data/lib/google/cloud/datacatalog/v1/usage_pb.rb +6 -0
  22. data/proto_docs/google/api/client.rb +9 -3
  23. data/proto_docs/google/cloud/datacatalog/v1/common.rb +19 -0
  24. data/proto_docs/google/cloud/datacatalog/v1/datacatalog.rb +283 -21
  25. data/proto_docs/google/cloud/datacatalog/v1/dump_content.rb +53 -0
  26. data/proto_docs/google/cloud/datacatalog/v1/gcs_fileset_spec.rb +2 -1
  27. data/proto_docs/google/cloud/datacatalog/v1/policytagmanager.rb +23 -2
  28. data/proto_docs/google/cloud/datacatalog/v1/policytagmanagerserialization.rb +6 -3
  29. data/proto_docs/google/cloud/datacatalog/v1/schema.rb +68 -3
  30. data/proto_docs/google/cloud/datacatalog/v1/search.rb +2 -2
  31. data/proto_docs/google/cloud/datacatalog/v1/table_spec.rb +5 -5
  32. data/proto_docs/google/cloud/datacatalog/v1/tags.rb +11 -8
  33. data/proto_docs/google/cloud/datacatalog/v1/usage.rb +30 -1
  34. data/proto_docs/google/longrunning/operations.rb +164 -0
  35. data/proto_docs/google/protobuf/any.rb +141 -0
  36. data/proto_docs/google/rpc/status.rb +48 -0
  37. metadata +9 -2
@@ -110,6 +110,11 @@ module Google
110
110
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
111
111
  }
112
112
 
113
+ default_config.rpcs.import_entries.timeout = 60.0
114
+ default_config.rpcs.import_entries.retry_policy = {
115
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
116
+ }
117
+
113
118
  default_config
114
119
  end
115
120
  yield @configure if block_given?
@@ -174,6 +179,12 @@ module Google
174
179
  @quota_project_id = @config.quota_project
175
180
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
176
181
 
182
+ @operations_client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Operations.new do |config|
183
+ config.credentials = credentials
184
+ config.quota_project = @quota_project_id
185
+ config.endpoint = @config.endpoint
186
+ end
187
+
177
188
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
178
189
  config.credentials = credentials
179
190
  config.quota_project = @quota_project_id
@@ -183,6 +194,13 @@ module Google
183
194
  @data_catalog_stub = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
184
195
  end
185
196
 
197
+ ##
198
+ # Get the associated client for long-running operations.
199
+ #
200
+ # @return [::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Operations]
201
+ #
202
+ attr_reader :operations_client
203
+
186
204
  ##
187
205
  # Get the associated client for mix-in of the IAMPolicy.
188
206
  #
@@ -231,9 +249,8 @@ module Google
231
249
  # empty AND `include_gcp_public_datasets` is set to `false`. In this case,
232
250
  # the request returns an error.
233
251
  # @param query [::String]
234
- # Optional. The query string with a minimum of 3 characters and specific syntax.
235
- # For more information, see
236
- # [Data Catalog search
252
+ # Optional. The query string with a minimum of 3 characters and specific
253
+ # syntax. For more information, see [Data Catalog search
237
254
  # syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference).
238
255
  #
239
256
  # An empty query string returns all data assets (in the specified scope)
@@ -251,10 +268,11 @@ module Google
251
268
  # The maximum number is 1000. If exceeded, throws an "invalid argument"
252
269
  # exception.
253
270
  # @param page_token [::String]
254
- # Optional. Pagination token that, if specified, returns the next page of search
255
- # results. If empty, returns the first page.
271
+ # Optional. Pagination token that, if specified, returns the next page of
272
+ # search results. If empty, returns the first page.
256
273
  #
257
- # This token is returned in the {::Google::Cloud::DataCatalog::V1::SearchCatalogResponse#next_page_token SearchCatalogResponse.next_page_token}
274
+ # This token is returned in the
275
+ # {::Google::Cloud::DataCatalog::V1::SearchCatalogResponse#next_page_token SearchCatalogResponse.next_page_token}
258
276
  # field of the response to a previous
259
277
  # {::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client#search_catalog SearchCatalogRequest}
260
278
  # call.
@@ -355,7 +373,8 @@ module Google
355
373
  # the default parameter values, pass an empty Hash as a request object (see above).
356
374
  #
357
375
  # @param parent [::String]
358
- # Required. The names of the project and location that the new entry group belongs to.
376
+ # Required. The names of the project and location that the new entry group
377
+ # belongs to.
359
378
  #
360
379
  # Note: The entry group itself and its child resources might not be
361
380
  # stored in the location specified in its name.
@@ -1715,8 +1734,8 @@ module Google
1715
1734
  # @param tag_template_field [::Google::Cloud::DataCatalog::V1::TagTemplateField, ::Hash]
1716
1735
  # Required. The template to update.
1717
1736
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1718
- # Optional. Names of fields whose values to overwrite on an individual field of a tag
1719
- # template. The following fields are modifiable:
1737
+ # Optional. Names of fields whose values to overwrite on an individual field
1738
+ # of a tag template. The following fields are modifiable:
1720
1739
  #
1721
1740
  # * `display_name`
1722
1741
  # * `type.enum_type`
@@ -1798,7 +1817,8 @@ module Google
1798
1817
  # @param name [::String]
1799
1818
  # Required. The name of the tag template field.
1800
1819
  # @param new_tag_template_field_id [::String]
1801
- # Required. The new ID of this tag template field. For example, `my_new_field`.
1820
+ # Required. The new ID of this tag template field. For example,
1821
+ # `my_new_field`.
1802
1822
  # @yield [result, operation] Access the result along with the TransportOperation object
1803
1823
  # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplateField]
1804
1824
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1864,7 +1884,8 @@ module Google
1864
1884
  # @param name [::String]
1865
1885
  # Required. The name of the enum field value.
1866
1886
  # @param new_enum_value_display_name [::String]
1867
- # Required. The new display name of the enum value. For example, `my_new_enum_value`.
1887
+ # Required. The new display name of the enum value. For example,
1888
+ # `my_new_enum_value`.
1868
1889
  # @yield [result, operation] Access the result along with the TransportOperation object
1869
1890
  # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplateField]
1870
1891
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -2264,6 +2285,92 @@ module Google
2264
2285
  raise ::Google::Cloud::Error.from_error(e)
2265
2286
  end
2266
2287
 
2288
+ ##
2289
+ # `ReconcileTags` creates or updates a list of tags on the entry.
2290
+ # If the
2291
+ # {::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest#force_delete_missing ReconcileTagsRequest.force_delete_missing}
2292
+ # parameter is set, the operation deletes tags not included in the input tag
2293
+ # list.
2294
+ #
2295
+ # `ReconcileTags` returns a [long-running operation]
2296
+ # [google.longrunning.Operation] resource that can be queried with
2297
+ # Operations.GetOperation
2298
+ # to return [ReconcileTagsMetadata]
2299
+ # [google.cloud.datacatalog.v1.ReconcileTagsMetadata] and
2300
+ # a [ReconcileTagsResponse]
2301
+ # [google.cloud.datacatalog.v1.ReconcileTagsResponse] message.
2302
+ #
2303
+ # @overload reconcile_tags(request, options = nil)
2304
+ # Pass arguments to `reconcile_tags` via a request object, either of type
2305
+ # {::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest} or an equivalent Hash.
2306
+ #
2307
+ # @param request [::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest, ::Hash]
2308
+ # A request object representing the call parameters. Required. To specify no
2309
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2310
+ # @param options [::Gapic::CallOptions, ::Hash]
2311
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2312
+ #
2313
+ # @overload reconcile_tags(parent: nil, tag_template: nil, force_delete_missing: nil, tags: nil)
2314
+ # Pass arguments to `reconcile_tags` via keyword arguments. Note that at
2315
+ # least one keyword argument is required. To specify no parameters, or to keep all
2316
+ # the default parameter values, pass an empty Hash as a request object (see above).
2317
+ #
2318
+ # @param parent [::String]
2319
+ # Required. Name of {::Google::Cloud::DataCatalog::V1::Entry Entry} to be tagged.
2320
+ # @param tag_template [::String]
2321
+ # Required. The name of the tag template, which is used for reconciliation.
2322
+ # @param force_delete_missing [::Boolean]
2323
+ # If set to `true`, deletes entry tags related to a tag template
2324
+ # not listed in the tags source from an entry. If set to `false`,
2325
+ # unlisted tags are retained.
2326
+ # @param tags [::Array<::Google::Cloud::DataCatalog::V1::Tag, ::Hash>]
2327
+ # A list of tags to apply to an entry. A tag can specify a
2328
+ # tag template, which must be the template specified in the
2329
+ # `ReconcileTagsRequest`.
2330
+ # The sole entry and each of its columns must be mentioned at most once.
2331
+ # @yield [result, operation] Access the result along with the TransportOperation object
2332
+ # @yieldparam result [::Gapic::Operation]
2333
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2334
+ #
2335
+ # @return [::Gapic::Operation]
2336
+ #
2337
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2338
+ def reconcile_tags request, options = nil
2339
+ raise ::ArgumentError, "request must be provided" if request.nil?
2340
+
2341
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest
2342
+
2343
+ # Converts hash and nil to an options object
2344
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2345
+
2346
+ # Customize the options with defaults
2347
+ call_metadata = @config.rpcs.reconcile_tags.metadata.to_h
2348
+
2349
+ # Set x-goog-api-client and x-goog-user-project headers
2350
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2351
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2352
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
2353
+ transports_version_send: [:rest]
2354
+
2355
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2356
+
2357
+ options.apply_defaults timeout: @config.rpcs.reconcile_tags.timeout,
2358
+ metadata: call_metadata,
2359
+ retry_policy: @config.rpcs.reconcile_tags.retry_policy
2360
+
2361
+ options.apply_defaults timeout: @config.timeout,
2362
+ metadata: @config.metadata,
2363
+ retry_policy: @config.retry_policy
2364
+
2365
+ @data_catalog_stub.reconcile_tags request, options do |result, operation|
2366
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2367
+ yield result, operation if block_given?
2368
+ return result
2369
+ end
2370
+ rescue ::Gapic::Rest::Error => e
2371
+ raise ::Google::Cloud::Error.from_error(e)
2372
+ end
2373
+
2267
2374
  ##
2268
2375
  # Marks an {::Google::Cloud::DataCatalog::V1::Entry Entry} as starred by
2269
2376
  # the current user. Starring information is private to each user.
@@ -2647,6 +2754,88 @@ module Google
2647
2754
  raise ::Google::Cloud::Error.from_error(e)
2648
2755
  end
2649
2756
 
2757
+ ##
2758
+ # Imports entries from a source, such as data previously dumped into a
2759
+ # Cloud Storage bucket, into Data Catalog. Import of entries
2760
+ # is a sync operation that reconciles the state of the third-party system
2761
+ # with the Data Catalog.
2762
+ #
2763
+ # `ImportEntries` accepts source data snapshots of a third-party system.
2764
+ # Snapshot should be delivered as a .wire or base65-encoded .txt file
2765
+ # containing a sequence of Protocol Buffer messages of
2766
+ # {::Google::Cloud::DataCatalog::V1::DumpItem DumpItem} type.
2767
+ #
2768
+ # `ImportEntries` returns a [long-running operation]
2769
+ # [google.longrunning.Operation] resource that can be queried with
2770
+ # Operations.GetOperation
2771
+ # to return
2772
+ # {::Google::Cloud::DataCatalog::V1::ImportEntriesMetadata ImportEntriesMetadata}
2773
+ # and an
2774
+ # {::Google::Cloud::DataCatalog::V1::ImportEntriesResponse ImportEntriesResponse}
2775
+ # message.
2776
+ #
2777
+ # @overload import_entries(request, options = nil)
2778
+ # Pass arguments to `import_entries` via a request object, either of type
2779
+ # {::Google::Cloud::DataCatalog::V1::ImportEntriesRequest} or an equivalent Hash.
2780
+ #
2781
+ # @param request [::Google::Cloud::DataCatalog::V1::ImportEntriesRequest, ::Hash]
2782
+ # A request object representing the call parameters. Required. To specify no
2783
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2784
+ # @param options [::Gapic::CallOptions, ::Hash]
2785
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2786
+ #
2787
+ # @overload import_entries(parent: nil, gcs_bucket_path: nil)
2788
+ # Pass arguments to `import_entries` via keyword arguments. Note that at
2789
+ # least one keyword argument is required. To specify no parameters, or to keep all
2790
+ # the default parameter values, pass an empty Hash as a request object (see above).
2791
+ #
2792
+ # @param parent [::String]
2793
+ # Required. Target entry group for ingested entries.
2794
+ # @param gcs_bucket_path [::String]
2795
+ # Path to a Cloud Storage bucket that contains a dump ready for ingestion.
2796
+ # @yield [result, operation] Access the result along with the TransportOperation object
2797
+ # @yieldparam result [::Gapic::Operation]
2798
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2799
+ #
2800
+ # @return [::Gapic::Operation]
2801
+ #
2802
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2803
+ def import_entries request, options = nil
2804
+ raise ::ArgumentError, "request must be provided" if request.nil?
2805
+
2806
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ImportEntriesRequest
2807
+
2808
+ # Converts hash and nil to an options object
2809
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2810
+
2811
+ # Customize the options with defaults
2812
+ call_metadata = @config.rpcs.import_entries.metadata.to_h
2813
+
2814
+ # Set x-goog-api-client and x-goog-user-project headers
2815
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2816
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2817
+ gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION,
2818
+ transports_version_send: [:rest]
2819
+
2820
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2821
+
2822
+ options.apply_defaults timeout: @config.rpcs.import_entries.timeout,
2823
+ metadata: call_metadata,
2824
+ retry_policy: @config.rpcs.import_entries.retry_policy
2825
+
2826
+ options.apply_defaults timeout: @config.timeout,
2827
+ metadata: @config.metadata,
2828
+ retry_policy: @config.retry_policy
2829
+
2830
+ @data_catalog_stub.import_entries request, options do |result, operation|
2831
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2832
+ yield result, operation if block_given?
2833
+ return result
2834
+ end
2835
+ rescue ::Gapic::Rest::Error => e
2836
+ raise ::Google::Cloud::Error.from_error(e)
2837
+ end
2838
+
2650
2839
  ##
2651
2840
  # Configuration class for the DataCatalog REST API.
2652
2841
  #
@@ -2685,9 +2874,9 @@ module Google
2685
2874
  # * (`String`) The path to a service account key file in JSON format
2686
2875
  # * (`Hash`) A service account key as a Hash
2687
2876
  # * (`Google::Auth::Credentials`) A googleauth credentials object
2688
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2877
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2689
2878
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2690
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2879
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2691
2880
  # * (`nil`) indicating no credentials
2692
2881
  # @return [::Object]
2693
2882
  # @!attribute [rw] scope
@@ -2906,6 +3095,11 @@ module Google
2906
3095
  #
2907
3096
  attr_reader :list_tags
2908
3097
  ##
3098
+ # RPC-specific configuration for `reconcile_tags`
3099
+ # @return [::Gapic::Config::Method]
3100
+ #
3101
+ attr_reader :reconcile_tags
3102
+ ##
2909
3103
  # RPC-specific configuration for `star_entry`
2910
3104
  # @return [::Gapic::Config::Method]
2911
3105
  #
@@ -2930,6 +3124,11 @@ module Google
2930
3124
  # @return [::Gapic::Config::Method]
2931
3125
  #
2932
3126
  attr_reader :test_iam_permissions
3127
+ ##
3128
+ # RPC-specific configuration for `import_entries`
3129
+ # @return [::Gapic::Config::Method]
3130
+ #
3131
+ attr_reader :import_entries
2933
3132
 
2934
3133
  # @private
2935
3134
  def initialize parent_rpcs = nil
@@ -2987,6 +3186,8 @@ module Google
2987
3186
  @delete_tag = ::Gapic::Config::Method.new delete_tag_config
2988
3187
  list_tags_config = parent_rpcs.list_tags if parent_rpcs.respond_to? :list_tags
2989
3188
  @list_tags = ::Gapic::Config::Method.new list_tags_config
3189
+ reconcile_tags_config = parent_rpcs.reconcile_tags if parent_rpcs.respond_to? :reconcile_tags
3190
+ @reconcile_tags = ::Gapic::Config::Method.new reconcile_tags_config
2990
3191
  star_entry_config = parent_rpcs.star_entry if parent_rpcs.respond_to? :star_entry
2991
3192
  @star_entry = ::Gapic::Config::Method.new star_entry_config
2992
3193
  unstar_entry_config = parent_rpcs.unstar_entry if parent_rpcs.respond_to? :unstar_entry
@@ -2997,6 +3198,8 @@ module Google
2997
3198
  @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
2998
3199
  test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
2999
3200
  @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
3201
+ import_entries_config = parent_rpcs.import_entries if parent_rpcs.respond_to? :import_entries
3202
+ @import_entries = ::Gapic::Config::Method.new import_entries_config
3000
3203
 
3001
3204
  yield self if block_given?
3002
3205
  end