google-cloud-metastore-v1 0.1.2 → 0.2.2

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.
@@ -28,8 +28,8 @@ module Google
28
28
  # Client for the DataprocMetastore service.
29
29
  #
30
30
  # Configures and manages metastore services.
31
- # Metastore services are fully managed, highly available, auto-scaled,
32
- # auto-healing, OSS-native deployments of technical metadata management
31
+ # Metastore services are fully managed, highly available, autoscaled,
32
+ # autohealing, OSS-native deployments of technical metadata management
33
33
  # software. Each metastore service exposes a network endpoint through which
34
34
  # metadata queries are served. Metadata queries can originate from a variety
35
35
  # of sources, including Apache Hive, Apache Presto, and Apache Spark.
@@ -57,13 +57,12 @@ module Google
57
57
  # See {::Google::Cloud::Metastore::V1::DataprocMetastore::Client::Configuration}
58
58
  # for a description of the configuration fields.
59
59
  #
60
- # ## Example
60
+ # @example
61
61
  #
62
- # To modify the configuration for all DataprocMetastore clients:
63
- #
64
- # ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.configure do |config|
65
- # config.timeout = 10.0
66
- # end
62
+ # # Modify the configuration for all DataprocMetastore clients
63
+ # ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.configure do |config|
64
+ # config.timeout = 10.0
65
+ # end
67
66
  #
68
67
  # @yield [config] Configure the Client client.
69
68
  # @yieldparam config [Client::Configuration]
@@ -98,6 +97,12 @@ module Google
98
97
 
99
98
  default_config.rpcs.export_metadata.timeout = 60.0
100
99
 
100
+ default_config.rpcs.restore_service.timeout = 60.0
101
+
102
+ default_config.rpcs.create_backup.timeout = 60.0
103
+
104
+ default_config.rpcs.delete_backup.timeout = 60.0
105
+
101
106
  default_config
102
107
  end
103
108
  yield @configure if block_given?
@@ -127,19 +132,15 @@ module Google
127
132
  ##
128
133
  # Create a new DataprocMetastore client object.
129
134
  #
130
- # ## Examples
135
+ # @example
131
136
  #
132
- # To create a new DataprocMetastore client with the default
133
- # configuration:
137
+ # # Create a client using the default configuration
138
+ # client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
134
139
  #
135
- # client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
136
- #
137
- # To create a new DataprocMetastore client with a custom
138
- # configuration:
139
- #
140
- # client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config|
141
- # config.timeout = 10.0
142
- # end
140
+ # # Create a client using a custom configuration
141
+ # client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config|
142
+ # config.timeout = 10.0
143
+ # end
143
144
  #
144
145
  # @yield [config] Configure the DataprocMetastore client.
145
146
  # @yieldparam config [Client::Configuration]
@@ -159,10 +160,9 @@ module Google
159
160
 
160
161
  # Create credentials
161
162
  credentials = @config.credentials
162
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
163
+ # Use self-signed JWT if the endpoint is unchanged from default,
163
164
  # but only if the default endpoint does not have a region prefix.
164
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
165
- @config.endpoint == Client.configure.endpoint &&
165
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
166
166
  !@config.endpoint.split(".").first.include?("-")
167
167
  credentials ||= Credentials.default scope: @config.scope,
168
168
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -174,6 +174,7 @@ module Google
174
174
 
175
175
  @operations_client = Operations.new do |config|
176
176
  config.credentials = credentials
177
+ config.quota_project = @quota_project_id
177
178
  config.endpoint = @config.endpoint
178
179
  end
179
180
 
@@ -246,6 +247,27 @@ module Google
246
247
  #
247
248
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
248
249
  #
250
+ # @example Basic example
251
+ # require "google/cloud/metastore/v1"
252
+ #
253
+ # # Create a client object. The client can be reused for multiple calls.
254
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
255
+ #
256
+ # # Create a request. To set request fields, pass in keyword arguments.
257
+ # request = Google::Cloud::Metastore::V1::ListServicesRequest.new
258
+ #
259
+ # # Call the list_services method.
260
+ # result = client.list_services request
261
+ #
262
+ # # The returned object is of type Gapic::PagedEnumerable. You can
263
+ # # iterate over all elements by calling #each, and the enumerable
264
+ # # will lazily make API calls to fetch subsequent pages. Other
265
+ # # methods are also available for managing paging directly.
266
+ # result.each do |response|
267
+ # # Each element is of type ::Google::Cloud::Metastore::V1::Service.
268
+ # p response
269
+ # end
270
+ #
249
271
  def list_services request, options = nil
250
272
  raise ::ArgumentError, "request must be provided" if request.nil?
251
273
 
@@ -263,16 +285,20 @@ module Google
263
285
  gapic_version: ::Google::Cloud::Metastore::V1::VERSION
264
286
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
265
287
 
266
- header_params = {
267
- "parent" => request.parent
268
- }
288
+ header_params = {}
289
+ if request.parent
290
+ header_params["parent"] = request.parent
291
+ end
292
+
269
293
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
270
294
  metadata[:"x-goog-request-params"] ||= request_params_header
271
295
 
272
296
  options.apply_defaults timeout: @config.rpcs.list_services.timeout,
273
297
  metadata: metadata,
274
298
  retry_policy: @config.rpcs.list_services.retry_policy
275
- options.apply_defaults metadata: @config.metadata,
299
+
300
+ options.apply_defaults timeout: @config.timeout,
301
+ metadata: @config.metadata,
276
302
  retry_policy: @config.retry_policy
277
303
 
278
304
  @dataproc_metastore_stub.call_rpc :list_services, request, options: options do |response, operation|
@@ -316,6 +342,21 @@ module Google
316
342
  #
317
343
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
318
344
  #
345
+ # @example Basic example
346
+ # require "google/cloud/metastore/v1"
347
+ #
348
+ # # Create a client object. The client can be reused for multiple calls.
349
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
350
+ #
351
+ # # Create a request. To set request fields, pass in keyword arguments.
352
+ # request = Google::Cloud::Metastore::V1::GetServiceRequest.new
353
+ #
354
+ # # Call the get_service method.
355
+ # result = client.get_service request
356
+ #
357
+ # # The returned object is of type Google::Cloud::Metastore::V1::Service.
358
+ # p result
359
+ #
319
360
  def get_service request, options = nil
320
361
  raise ::ArgumentError, "request must be provided" if request.nil?
321
362
 
@@ -333,16 +374,20 @@ module Google
333
374
  gapic_version: ::Google::Cloud::Metastore::V1::VERSION
334
375
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
335
376
 
336
- header_params = {
337
- "name" => request.name
338
- }
377
+ header_params = {}
378
+ if request.name
379
+ header_params["name"] = request.name
380
+ end
381
+
339
382
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
340
383
  metadata[:"x-goog-request-params"] ||= request_params_header
341
384
 
342
385
  options.apply_defaults timeout: @config.rpcs.get_service.timeout,
343
386
  metadata: metadata,
344
387
  retry_policy: @config.rpcs.get_service.retry_policy
345
- options.apply_defaults metadata: @config.metadata,
388
+
389
+ options.apply_defaults timeout: @config.timeout,
390
+ metadata: @config.metadata,
346
391
  retry_policy: @config.retry_policy
347
392
 
348
393
  @dataproc_metastore_stub.call_rpc :get_service, request, options: options do |response, operation|
@@ -409,6 +454,28 @@ module Google
409
454
  #
410
455
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
411
456
  #
457
+ # @example Basic example
458
+ # require "google/cloud/metastore/v1"
459
+ #
460
+ # # Create a client object. The client can be reused for multiple calls.
461
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
462
+ #
463
+ # # Create a request. To set request fields, pass in keyword arguments.
464
+ # request = Google::Cloud::Metastore::V1::CreateServiceRequest.new
465
+ #
466
+ # # Call the create_service method.
467
+ # result = client.create_service request
468
+ #
469
+ # # The returned object is of type Gapic::Operation. You can use this
470
+ # # object to check the status of an operation, cancel it, or wait
471
+ # # for results. Here is how to block until completion:
472
+ # result.wait_until_done! timeout: 60
473
+ # if result.response?
474
+ # p result.response
475
+ # else
476
+ # puts "Error!"
477
+ # end
478
+ #
412
479
  def create_service request, options = nil
413
480
  raise ::ArgumentError, "request must be provided" if request.nil?
414
481
 
@@ -426,16 +493,20 @@ module Google
426
493
  gapic_version: ::Google::Cloud::Metastore::V1::VERSION
427
494
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
428
495
 
429
- header_params = {
430
- "parent" => request.parent
431
- }
496
+ header_params = {}
497
+ if request.parent
498
+ header_params["parent"] = request.parent
499
+ end
500
+
432
501
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
433
502
  metadata[:"x-goog-request-params"] ||= request_params_header
434
503
 
435
504
  options.apply_defaults timeout: @config.rpcs.create_service.timeout,
436
505
  metadata: metadata,
437
506
  retry_policy: @config.rpcs.create_service.retry_policy
438
- options.apply_defaults metadata: @config.metadata,
507
+
508
+ options.apply_defaults timeout: @config.timeout,
509
+ metadata: @config.metadata,
439
510
  retry_policy: @config.retry_policy
440
511
 
441
512
  @dataproc_metastore_stub.call_rpc :create_service, request, options: options do |response, operation|
@@ -498,6 +569,28 @@ module Google
498
569
  #
499
570
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
500
571
  #
572
+ # @example Basic example
573
+ # require "google/cloud/metastore/v1"
574
+ #
575
+ # # Create a client object. The client can be reused for multiple calls.
576
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
577
+ #
578
+ # # Create a request. To set request fields, pass in keyword arguments.
579
+ # request = Google::Cloud::Metastore::V1::UpdateServiceRequest.new
580
+ #
581
+ # # Call the update_service method.
582
+ # result = client.update_service request
583
+ #
584
+ # # The returned object is of type Gapic::Operation. You can use this
585
+ # # object to check the status of an operation, cancel it, or wait
586
+ # # for results. Here is how to block until completion:
587
+ # result.wait_until_done! timeout: 60
588
+ # if result.response?
589
+ # p result.response
590
+ # else
591
+ # puts "Error!"
592
+ # end
593
+ #
501
594
  def update_service request, options = nil
502
595
  raise ::ArgumentError, "request must be provided" if request.nil?
503
596
 
@@ -515,16 +608,20 @@ module Google
515
608
  gapic_version: ::Google::Cloud::Metastore::V1::VERSION
516
609
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
517
610
 
518
- header_params = {
519
- "service.name" => request.service.name
520
- }
611
+ header_params = {}
612
+ if request.service&.name
613
+ header_params["service.name"] = request.service.name
614
+ end
615
+
521
616
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
522
617
  metadata[:"x-goog-request-params"] ||= request_params_header
523
618
 
524
619
  options.apply_defaults timeout: @config.rpcs.update_service.timeout,
525
620
  metadata: metadata,
526
621
  retry_policy: @config.rpcs.update_service.retry_policy
527
- options.apply_defaults metadata: @config.metadata,
622
+
623
+ options.apply_defaults timeout: @config.timeout,
624
+ metadata: @config.metadata,
528
625
  retry_policy: @config.retry_policy
529
626
 
530
627
  @dataproc_metastore_stub.call_rpc :update_service, request, options: options do |response, operation|
@@ -581,6 +678,28 @@ module Google
581
678
  #
582
679
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
583
680
  #
681
+ # @example Basic example
682
+ # require "google/cloud/metastore/v1"
683
+ #
684
+ # # Create a client object. The client can be reused for multiple calls.
685
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
686
+ #
687
+ # # Create a request. To set request fields, pass in keyword arguments.
688
+ # request = Google::Cloud::Metastore::V1::DeleteServiceRequest.new
689
+ #
690
+ # # Call the delete_service method.
691
+ # result = client.delete_service request
692
+ #
693
+ # # The returned object is of type Gapic::Operation. You can use this
694
+ # # object to check the status of an operation, cancel it, or wait
695
+ # # for results. Here is how to block until completion:
696
+ # result.wait_until_done! timeout: 60
697
+ # if result.response?
698
+ # p result.response
699
+ # else
700
+ # puts "Error!"
701
+ # end
702
+ #
584
703
  def delete_service request, options = nil
585
704
  raise ::ArgumentError, "request must be provided" if request.nil?
586
705
 
@@ -598,16 +717,20 @@ module Google
598
717
  gapic_version: ::Google::Cloud::Metastore::V1::VERSION
599
718
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
600
719
 
601
- header_params = {
602
- "name" => request.name
603
- }
720
+ header_params = {}
721
+ if request.name
722
+ header_params["name"] = request.name
723
+ end
724
+
604
725
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
605
726
  metadata[:"x-goog-request-params"] ||= request_params_header
606
727
 
607
728
  options.apply_defaults timeout: @config.rpcs.delete_service.timeout,
608
729
  metadata: metadata,
609
730
  retry_policy: @config.rpcs.delete_service.retry_policy
610
- options.apply_defaults metadata: @config.metadata,
731
+
732
+ options.apply_defaults timeout: @config.timeout,
733
+ metadata: @config.metadata,
611
734
  retry_policy: @config.retry_policy
612
735
 
613
736
  @dataproc_metastore_stub.call_rpc :delete_service, request, options: options do |response, operation|
@@ -670,6 +793,27 @@ module Google
670
793
  #
671
794
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
672
795
  #
796
+ # @example Basic example
797
+ # require "google/cloud/metastore/v1"
798
+ #
799
+ # # Create a client object. The client can be reused for multiple calls.
800
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
801
+ #
802
+ # # Create a request. To set request fields, pass in keyword arguments.
803
+ # request = Google::Cloud::Metastore::V1::ListMetadataImportsRequest.new
804
+ #
805
+ # # Call the list_metadata_imports method.
806
+ # result = client.list_metadata_imports request
807
+ #
808
+ # # The returned object is of type Gapic::PagedEnumerable. You can
809
+ # # iterate over all elements by calling #each, and the enumerable
810
+ # # will lazily make API calls to fetch subsequent pages. Other
811
+ # # methods are also available for managing paging directly.
812
+ # result.each do |response|
813
+ # # Each element is of type ::Google::Cloud::Metastore::V1::MetadataImport.
814
+ # p response
815
+ # end
816
+ #
673
817
  def list_metadata_imports request, options = nil
674
818
  raise ::ArgumentError, "request must be provided" if request.nil?
675
819
 
@@ -687,16 +831,20 @@ module Google
687
831
  gapic_version: ::Google::Cloud::Metastore::V1::VERSION
688
832
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
689
833
 
690
- header_params = {
691
- "parent" => request.parent
692
- }
834
+ header_params = {}
835
+ if request.parent
836
+ header_params["parent"] = request.parent
837
+ end
838
+
693
839
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
694
840
  metadata[:"x-goog-request-params"] ||= request_params_header
695
841
 
696
842
  options.apply_defaults timeout: @config.rpcs.list_metadata_imports.timeout,
697
843
  metadata: metadata,
698
844
  retry_policy: @config.rpcs.list_metadata_imports.retry_policy
699
- options.apply_defaults metadata: @config.metadata,
845
+
846
+ options.apply_defaults timeout: @config.timeout,
847
+ metadata: @config.metadata,
700
848
  retry_policy: @config.retry_policy
701
849
 
702
850
  @dataproc_metastore_stub.call_rpc :list_metadata_imports, request, options: options do |response, operation|
@@ -740,6 +888,21 @@ module Google
740
888
  #
741
889
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
742
890
  #
891
+ # @example Basic example
892
+ # require "google/cloud/metastore/v1"
893
+ #
894
+ # # Create a client object. The client can be reused for multiple calls.
895
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
896
+ #
897
+ # # Create a request. To set request fields, pass in keyword arguments.
898
+ # request = Google::Cloud::Metastore::V1::GetMetadataImportRequest.new
899
+ #
900
+ # # Call the get_metadata_import method.
901
+ # result = client.get_metadata_import request
902
+ #
903
+ # # The returned object is of type Google::Cloud::Metastore::V1::MetadataImport.
904
+ # p result
905
+ #
743
906
  def get_metadata_import request, options = nil
744
907
  raise ::ArgumentError, "request must be provided" if request.nil?
745
908
 
@@ -757,16 +920,20 @@ module Google
757
920
  gapic_version: ::Google::Cloud::Metastore::V1::VERSION
758
921
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
759
922
 
760
- header_params = {
761
- "name" => request.name
762
- }
923
+ header_params = {}
924
+ if request.name
925
+ header_params["name"] = request.name
926
+ end
927
+
763
928
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
764
929
  metadata[:"x-goog-request-params"] ||= request_params_header
765
930
 
766
931
  options.apply_defaults timeout: @config.rpcs.get_metadata_import.timeout,
767
932
  metadata: metadata,
768
933
  retry_policy: @config.rpcs.get_metadata_import.retry_policy
769
- options.apply_defaults metadata: @config.metadata,
934
+
935
+ options.apply_defaults timeout: @config.timeout,
936
+ metadata: @config.metadata,
770
937
  retry_policy: @config.retry_policy
771
938
 
772
939
  @dataproc_metastore_stub.call_rpc :get_metadata_import, request, options: options do |response, operation|
@@ -833,6 +1000,28 @@ module Google
833
1000
  #
834
1001
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
835
1002
  #
1003
+ # @example Basic example
1004
+ # require "google/cloud/metastore/v1"
1005
+ #
1006
+ # # Create a client object. The client can be reused for multiple calls.
1007
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
1008
+ #
1009
+ # # Create a request. To set request fields, pass in keyword arguments.
1010
+ # request = Google::Cloud::Metastore::V1::CreateMetadataImportRequest.new
1011
+ #
1012
+ # # Call the create_metadata_import method.
1013
+ # result = client.create_metadata_import request
1014
+ #
1015
+ # # The returned object is of type Gapic::Operation. You can use this
1016
+ # # object to check the status of an operation, cancel it, or wait
1017
+ # # for results. Here is how to block until completion:
1018
+ # result.wait_until_done! timeout: 60
1019
+ # if result.response?
1020
+ # p result.response
1021
+ # else
1022
+ # puts "Error!"
1023
+ # end
1024
+ #
836
1025
  def create_metadata_import request, options = nil
837
1026
  raise ::ArgumentError, "request must be provided" if request.nil?
838
1027
 
@@ -850,16 +1039,20 @@ module Google
850
1039
  gapic_version: ::Google::Cloud::Metastore::V1::VERSION
851
1040
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
852
1041
 
853
- header_params = {
854
- "parent" => request.parent
855
- }
1042
+ header_params = {}
1043
+ if request.parent
1044
+ header_params["parent"] = request.parent
1045
+ end
1046
+
856
1047
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
857
1048
  metadata[:"x-goog-request-params"] ||= request_params_header
858
1049
 
859
1050
  options.apply_defaults timeout: @config.rpcs.create_metadata_import.timeout,
860
1051
  metadata: metadata,
861
1052
  retry_policy: @config.rpcs.create_metadata_import.retry_policy
862
- options.apply_defaults metadata: @config.metadata,
1053
+
1054
+ options.apply_defaults timeout: @config.timeout,
1055
+ metadata: @config.metadata,
863
1056
  retry_policy: @config.retry_policy
864
1057
 
865
1058
  @dataproc_metastore_stub.call_rpc :create_metadata_import, request, options: options do |response, operation|
@@ -923,6 +1116,28 @@ module Google
923
1116
  #
924
1117
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
925
1118
  #
1119
+ # @example Basic example
1120
+ # require "google/cloud/metastore/v1"
1121
+ #
1122
+ # # Create a client object. The client can be reused for multiple calls.
1123
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
1124
+ #
1125
+ # # Create a request. To set request fields, pass in keyword arguments.
1126
+ # request = Google::Cloud::Metastore::V1::UpdateMetadataImportRequest.new
1127
+ #
1128
+ # # Call the update_metadata_import method.
1129
+ # result = client.update_metadata_import request
1130
+ #
1131
+ # # The returned object is of type Gapic::Operation. You can use this
1132
+ # # object to check the status of an operation, cancel it, or wait
1133
+ # # for results. Here is how to block until completion:
1134
+ # result.wait_until_done! timeout: 60
1135
+ # if result.response?
1136
+ # p result.response
1137
+ # else
1138
+ # puts "Error!"
1139
+ # end
1140
+ #
926
1141
  def update_metadata_import request, options = nil
927
1142
  raise ::ArgumentError, "request must be provided" if request.nil?
928
1143
 
@@ -940,16 +1155,20 @@ module Google
940
1155
  gapic_version: ::Google::Cloud::Metastore::V1::VERSION
941
1156
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
942
1157
 
943
- header_params = {
944
- "metadata_import.name" => request.metadata_import.name
945
- }
1158
+ header_params = {}
1159
+ if request.metadata_import&.name
1160
+ header_params["metadata_import.name"] = request.metadata_import.name
1161
+ end
1162
+
946
1163
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
947
1164
  metadata[:"x-goog-request-params"] ||= request_params_header
948
1165
 
949
1166
  options.apply_defaults timeout: @config.rpcs.update_metadata_import.timeout,
950
1167
  metadata: metadata,
951
1168
  retry_policy: @config.rpcs.update_metadata_import.retry_policy
952
- options.apply_defaults metadata: @config.metadata,
1169
+
1170
+ options.apply_defaults timeout: @config.timeout,
1171
+ metadata: @config.metadata,
953
1172
  retry_policy: @config.retry_policy
954
1173
 
955
1174
  @dataproc_metastore_stub.call_rpc :update_metadata_import, request, options: options do |response, operation|
@@ -1012,6 +1231,28 @@ module Google
1012
1231
  #
1013
1232
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1014
1233
  #
1234
+ # @example Basic example
1235
+ # require "google/cloud/metastore/v1"
1236
+ #
1237
+ # # Create a client object. The client can be reused for multiple calls.
1238
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
1239
+ #
1240
+ # # Create a request. To set request fields, pass in keyword arguments.
1241
+ # request = Google::Cloud::Metastore::V1::ExportMetadataRequest.new
1242
+ #
1243
+ # # Call the export_metadata method.
1244
+ # result = client.export_metadata request
1245
+ #
1246
+ # # The returned object is of type Gapic::Operation. You can use this
1247
+ # # object to check the status of an operation, cancel it, or wait
1248
+ # # for results. Here is how to block until completion:
1249
+ # result.wait_until_done! timeout: 60
1250
+ # if result.response?
1251
+ # p result.response
1252
+ # else
1253
+ # puts "Error!"
1254
+ # end
1255
+ #
1015
1256
  def export_metadata request, options = nil
1016
1257
  raise ::ArgumentError, "request must be provided" if request.nil?
1017
1258
 
@@ -1029,16 +1270,20 @@ module Google
1029
1270
  gapic_version: ::Google::Cloud::Metastore::V1::VERSION
1030
1271
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1031
1272
 
1032
- header_params = {
1033
- "service" => request.service
1034
- }
1273
+ header_params = {}
1274
+ if request.service
1275
+ header_params["service"] = request.service
1276
+ end
1277
+
1035
1278
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1036
1279
  metadata[:"x-goog-request-params"] ||= request_params_header
1037
1280
 
1038
1281
  options.apply_defaults timeout: @config.rpcs.export_metadata.timeout,
1039
1282
  metadata: metadata,
1040
1283
  retry_policy: @config.rpcs.export_metadata.retry_policy
1041
- options.apply_defaults metadata: @config.metadata,
1284
+
1285
+ options.apply_defaults timeout: @config.timeout,
1286
+ metadata: @config.metadata,
1042
1287
  retry_policy: @config.retry_policy
1043
1288
 
1044
1289
  @dataproc_metastore_stub.call_rpc :export_metadata, request, options: options do |response, operation|
@@ -1050,6 +1295,552 @@ module Google
1050
1295
  raise ::Google::Cloud::Error.from_error(e)
1051
1296
  end
1052
1297
 
1298
+ ##
1299
+ # Restores a service from a backup.
1300
+ #
1301
+ # @overload restore_service(request, options = nil)
1302
+ # Pass arguments to `restore_service` via a request object, either of type
1303
+ # {::Google::Cloud::Metastore::V1::RestoreServiceRequest} or an equivalent Hash.
1304
+ #
1305
+ # @param request [::Google::Cloud::Metastore::V1::RestoreServiceRequest, ::Hash]
1306
+ # A request object representing the call parameters. Required. To specify no
1307
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1308
+ # @param options [::Gapic::CallOptions, ::Hash]
1309
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1310
+ #
1311
+ # @overload restore_service(service: nil, backup: nil, restore_type: nil, request_id: nil)
1312
+ # Pass arguments to `restore_service` via keyword arguments. Note that at
1313
+ # least one keyword argument is required. To specify no parameters, or to keep all
1314
+ # the default parameter values, pass an empty Hash as a request object (see above).
1315
+ #
1316
+ # @param service [::String]
1317
+ # Required. The relative resource name of the metastore service to run restore, in the
1318
+ # following form:
1319
+ #
1320
+ # `projects/{project_id}/locations/{location_id}/services/{service_id}`.
1321
+ # @param backup [::String]
1322
+ # Required. The relative resource name of the metastore service backup to restore
1323
+ # from, in the following form:
1324
+ #
1325
+ # `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
1326
+ # @param restore_type [::Google::Cloud::Metastore::V1::Restore::RestoreType]
1327
+ # Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`.
1328
+ # @param request_id [::String]
1329
+ # Optional. A request ID. Specify a unique request ID to allow the server to ignore the
1330
+ # request if it has completed. The server will ignore subsequent requests
1331
+ # that provide a duplicate request ID for at least 60 minutes after the first
1332
+ # request.
1333
+ #
1334
+ # For example, if an initial request times out, followed by another request
1335
+ # with the same request ID, the server ignores the second request to prevent
1336
+ # the creation of duplicate commitments.
1337
+ #
1338
+ # The request ID must be a valid
1339
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format).
1340
+ # A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1341
+ #
1342
+ # @yield [response, operation] Access the result along with the RPC operation
1343
+ # @yieldparam response [::Gapic::Operation]
1344
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1345
+ #
1346
+ # @return [::Gapic::Operation]
1347
+ #
1348
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1349
+ #
1350
+ # @example Basic example
1351
+ # require "google/cloud/metastore/v1"
1352
+ #
1353
+ # # Create a client object. The client can be reused for multiple calls.
1354
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
1355
+ #
1356
+ # # Create a request. To set request fields, pass in keyword arguments.
1357
+ # request = Google::Cloud::Metastore::V1::RestoreServiceRequest.new
1358
+ #
1359
+ # # Call the restore_service method.
1360
+ # result = client.restore_service request
1361
+ #
1362
+ # # The returned object is of type Gapic::Operation. You can use this
1363
+ # # object to check the status of an operation, cancel it, or wait
1364
+ # # for results. Here is how to block until completion:
1365
+ # result.wait_until_done! timeout: 60
1366
+ # if result.response?
1367
+ # p result.response
1368
+ # else
1369
+ # puts "Error!"
1370
+ # end
1371
+ #
1372
+ def restore_service request, options = nil
1373
+ raise ::ArgumentError, "request must be provided" if request.nil?
1374
+
1375
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::RestoreServiceRequest
1376
+
1377
+ # Converts hash and nil to an options object
1378
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1379
+
1380
+ # Customize the options with defaults
1381
+ metadata = @config.rpcs.restore_service.metadata.to_h
1382
+
1383
+ # Set x-goog-api-client and x-goog-user-project headers
1384
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1385
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1386
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION
1387
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1388
+
1389
+ header_params = {}
1390
+ if request.service
1391
+ header_params["service"] = request.service
1392
+ end
1393
+
1394
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1395
+ metadata[:"x-goog-request-params"] ||= request_params_header
1396
+
1397
+ options.apply_defaults timeout: @config.rpcs.restore_service.timeout,
1398
+ metadata: metadata,
1399
+ retry_policy: @config.rpcs.restore_service.retry_policy
1400
+
1401
+ options.apply_defaults timeout: @config.timeout,
1402
+ metadata: @config.metadata,
1403
+ retry_policy: @config.retry_policy
1404
+
1405
+ @dataproc_metastore_stub.call_rpc :restore_service, request, options: options do |response, operation|
1406
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1407
+ yield response, operation if block_given?
1408
+ return response
1409
+ end
1410
+ rescue ::GRPC::BadStatus => e
1411
+ raise ::Google::Cloud::Error.from_error(e)
1412
+ end
1413
+
1414
+ ##
1415
+ # Lists backups in a service.
1416
+ #
1417
+ # @overload list_backups(request, options = nil)
1418
+ # Pass arguments to `list_backups` via a request object, either of type
1419
+ # {::Google::Cloud::Metastore::V1::ListBackupsRequest} or an equivalent Hash.
1420
+ #
1421
+ # @param request [::Google::Cloud::Metastore::V1::ListBackupsRequest, ::Hash]
1422
+ # A request object representing the call parameters. Required. To specify no
1423
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1424
+ # @param options [::Gapic::CallOptions, ::Hash]
1425
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1426
+ #
1427
+ # @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1428
+ # Pass arguments to `list_backups` via keyword arguments. Note that at
1429
+ # least one keyword argument is required. To specify no parameters, or to keep all
1430
+ # the default parameter values, pass an empty Hash as a request object (see above).
1431
+ #
1432
+ # @param parent [::String]
1433
+ # Required. The relative resource name of the service whose backups to
1434
+ # list, in the following form:
1435
+ #
1436
+ # `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`.
1437
+ # @param page_size [::Integer]
1438
+ # Optional. The maximum number of backups to return. The response may contain less
1439
+ # than the maximum number. If unspecified, no more than 500 backups are
1440
+ # returned. The maximum value is 1000; values above 1000 are changed to 1000.
1441
+ # @param page_token [::String]
1442
+ # Optional. A page token, received from a previous {::Google::Cloud::Metastore::V1::DataprocMetastore::Client#list_backups DataprocMetastore.ListBackups}
1443
+ # call. Provide this token to retrieve the subsequent page.
1444
+ #
1445
+ # To retrieve the first page, supply an empty page token.
1446
+ #
1447
+ # When paginating, other parameters provided to
1448
+ # {::Google::Cloud::Metastore::V1::DataprocMetastore::Client#list_backups DataprocMetastore.ListBackups} must match the call that provided the
1449
+ # page token.
1450
+ # @param filter [::String]
1451
+ # Optional. The filter to apply to list results.
1452
+ # @param order_by [::String]
1453
+ # Optional. Specify the ordering of results as described in [Sorting
1454
+ # Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
1455
+ # If not specified, the results will be sorted in the default order.
1456
+ #
1457
+ # @yield [response, operation] Access the result along with the RPC operation
1458
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Backup>]
1459
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1460
+ #
1461
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Backup>]
1462
+ #
1463
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1464
+ #
1465
+ # @example Basic example
1466
+ # require "google/cloud/metastore/v1"
1467
+ #
1468
+ # # Create a client object. The client can be reused for multiple calls.
1469
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
1470
+ #
1471
+ # # Create a request. To set request fields, pass in keyword arguments.
1472
+ # request = Google::Cloud::Metastore::V1::ListBackupsRequest.new
1473
+ #
1474
+ # # Call the list_backups method.
1475
+ # result = client.list_backups request
1476
+ #
1477
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1478
+ # # iterate over all elements by calling #each, and the enumerable
1479
+ # # will lazily make API calls to fetch subsequent pages. Other
1480
+ # # methods are also available for managing paging directly.
1481
+ # result.each do |response|
1482
+ # # Each element is of type ::Google::Cloud::Metastore::V1::Backup.
1483
+ # p response
1484
+ # end
1485
+ #
1486
+ def list_backups request, options = nil
1487
+ raise ::ArgumentError, "request must be provided" if request.nil?
1488
+
1489
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::ListBackupsRequest
1490
+
1491
+ # Converts hash and nil to an options object
1492
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1493
+
1494
+ # Customize the options with defaults
1495
+ metadata = @config.rpcs.list_backups.metadata.to_h
1496
+
1497
+ # Set x-goog-api-client and x-goog-user-project headers
1498
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1499
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1500
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION
1501
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1502
+
1503
+ header_params = {}
1504
+ if request.parent
1505
+ header_params["parent"] = request.parent
1506
+ end
1507
+
1508
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1509
+ metadata[:"x-goog-request-params"] ||= request_params_header
1510
+
1511
+ options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
1512
+ metadata: metadata,
1513
+ retry_policy: @config.rpcs.list_backups.retry_policy
1514
+
1515
+ options.apply_defaults timeout: @config.timeout,
1516
+ metadata: @config.metadata,
1517
+ retry_policy: @config.retry_policy
1518
+
1519
+ @dataproc_metastore_stub.call_rpc :list_backups, request, options: options do |response, operation|
1520
+ response = ::Gapic::PagedEnumerable.new @dataproc_metastore_stub, :list_backups, request, response, operation, options
1521
+ yield response, operation if block_given?
1522
+ return response
1523
+ end
1524
+ rescue ::GRPC::BadStatus => e
1525
+ raise ::Google::Cloud::Error.from_error(e)
1526
+ end
1527
+
1528
+ ##
1529
+ # Gets details of a single backup.
1530
+ #
1531
+ # @overload get_backup(request, options = nil)
1532
+ # Pass arguments to `get_backup` via a request object, either of type
1533
+ # {::Google::Cloud::Metastore::V1::GetBackupRequest} or an equivalent Hash.
1534
+ #
1535
+ # @param request [::Google::Cloud::Metastore::V1::GetBackupRequest, ::Hash]
1536
+ # A request object representing the call parameters. Required. To specify no
1537
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1538
+ # @param options [::Gapic::CallOptions, ::Hash]
1539
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1540
+ #
1541
+ # @overload get_backup(name: nil)
1542
+ # Pass arguments to `get_backup` via keyword arguments. Note that at
1543
+ # least one keyword argument is required. To specify no parameters, or to keep all
1544
+ # the default parameter values, pass an empty Hash as a request object (see above).
1545
+ #
1546
+ # @param name [::String]
1547
+ # Required. The relative resource name of the backup to retrieve, in the
1548
+ # following form:
1549
+ #
1550
+ # `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
1551
+ #
1552
+ # @yield [response, operation] Access the result along with the RPC operation
1553
+ # @yieldparam response [::Google::Cloud::Metastore::V1::Backup]
1554
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1555
+ #
1556
+ # @return [::Google::Cloud::Metastore::V1::Backup]
1557
+ #
1558
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1559
+ #
1560
+ # @example Basic example
1561
+ # require "google/cloud/metastore/v1"
1562
+ #
1563
+ # # Create a client object. The client can be reused for multiple calls.
1564
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
1565
+ #
1566
+ # # Create a request. To set request fields, pass in keyword arguments.
1567
+ # request = Google::Cloud::Metastore::V1::GetBackupRequest.new
1568
+ #
1569
+ # # Call the get_backup method.
1570
+ # result = client.get_backup request
1571
+ #
1572
+ # # The returned object is of type Google::Cloud::Metastore::V1::Backup.
1573
+ # p result
1574
+ #
1575
+ def get_backup request, options = nil
1576
+ raise ::ArgumentError, "request must be provided" if request.nil?
1577
+
1578
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::GetBackupRequest
1579
+
1580
+ # Converts hash and nil to an options object
1581
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1582
+
1583
+ # Customize the options with defaults
1584
+ metadata = @config.rpcs.get_backup.metadata.to_h
1585
+
1586
+ # Set x-goog-api-client and x-goog-user-project headers
1587
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1588
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1589
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION
1590
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1591
+
1592
+ header_params = {}
1593
+ if request.name
1594
+ header_params["name"] = request.name
1595
+ end
1596
+
1597
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1598
+ metadata[:"x-goog-request-params"] ||= request_params_header
1599
+
1600
+ options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
1601
+ metadata: metadata,
1602
+ retry_policy: @config.rpcs.get_backup.retry_policy
1603
+
1604
+ options.apply_defaults timeout: @config.timeout,
1605
+ metadata: @config.metadata,
1606
+ retry_policy: @config.retry_policy
1607
+
1608
+ @dataproc_metastore_stub.call_rpc :get_backup, request, options: options do |response, operation|
1609
+ yield response, operation if block_given?
1610
+ return response
1611
+ end
1612
+ rescue ::GRPC::BadStatus => e
1613
+ raise ::Google::Cloud::Error.from_error(e)
1614
+ end
1615
+
1616
+ ##
1617
+ # Creates a new backup in a given project and location.
1618
+ #
1619
+ # @overload create_backup(request, options = nil)
1620
+ # Pass arguments to `create_backup` via a request object, either of type
1621
+ # {::Google::Cloud::Metastore::V1::CreateBackupRequest} or an equivalent Hash.
1622
+ #
1623
+ # @param request [::Google::Cloud::Metastore::V1::CreateBackupRequest, ::Hash]
1624
+ # A request object representing the call parameters. Required. To specify no
1625
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1626
+ # @param options [::Gapic::CallOptions, ::Hash]
1627
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1628
+ #
1629
+ # @overload create_backup(parent: nil, backup_id: nil, backup: nil, request_id: nil)
1630
+ # Pass arguments to `create_backup` via keyword arguments. Note that at
1631
+ # least one keyword argument is required. To specify no parameters, or to keep all
1632
+ # the default parameter values, pass an empty Hash as a request object (see above).
1633
+ #
1634
+ # @param parent [::String]
1635
+ # Required. The relative resource name of the service in which to create a backup
1636
+ # of the following form:
1637
+ #
1638
+ # `projects/{project_number}/locations/{location_id}/services/{service_id}`.
1639
+ # @param backup_id [::String]
1640
+ # Required. The ID of the backup, which is used as the final component of the
1641
+ # backup's name.
1642
+ #
1643
+ # This value must be between 1 and 64 characters long, begin with a letter,
1644
+ # end with a letter or number, and consist of alpha-numeric ASCII characters
1645
+ # or hyphens.
1646
+ # @param backup [::Google::Cloud::Metastore::V1::Backup, ::Hash]
1647
+ # Required. The backup to create. The `name` field is ignored. The ID of the created
1648
+ # backup must be provided in the request's `backup_id` field.
1649
+ # @param request_id [::String]
1650
+ # Optional. A request ID. Specify a unique request ID to allow the server to ignore the
1651
+ # request if it has completed. The server will ignore subsequent requests
1652
+ # that provide a duplicate request ID for at least 60 minutes after the first
1653
+ # request.
1654
+ #
1655
+ # For example, if an initial request times out, followed by another request
1656
+ # with the same request ID, the server ignores the second request to prevent
1657
+ # the creation of duplicate commitments.
1658
+ #
1659
+ # The request ID must be a valid
1660
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
1661
+ # A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1662
+ #
1663
+ # @yield [response, operation] Access the result along with the RPC operation
1664
+ # @yieldparam response [::Gapic::Operation]
1665
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1666
+ #
1667
+ # @return [::Gapic::Operation]
1668
+ #
1669
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1670
+ #
1671
+ # @example Basic example
1672
+ # require "google/cloud/metastore/v1"
1673
+ #
1674
+ # # Create a client object. The client can be reused for multiple calls.
1675
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
1676
+ #
1677
+ # # Create a request. To set request fields, pass in keyword arguments.
1678
+ # request = Google::Cloud::Metastore::V1::CreateBackupRequest.new
1679
+ #
1680
+ # # Call the create_backup method.
1681
+ # result = client.create_backup request
1682
+ #
1683
+ # # The returned object is of type Gapic::Operation. You can use this
1684
+ # # object to check the status of an operation, cancel it, or wait
1685
+ # # for results. Here is how to block until completion:
1686
+ # result.wait_until_done! timeout: 60
1687
+ # if result.response?
1688
+ # p result.response
1689
+ # else
1690
+ # puts "Error!"
1691
+ # end
1692
+ #
1693
+ def create_backup request, options = nil
1694
+ raise ::ArgumentError, "request must be provided" if request.nil?
1695
+
1696
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::CreateBackupRequest
1697
+
1698
+ # Converts hash and nil to an options object
1699
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1700
+
1701
+ # Customize the options with defaults
1702
+ metadata = @config.rpcs.create_backup.metadata.to_h
1703
+
1704
+ # Set x-goog-api-client and x-goog-user-project headers
1705
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1706
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1707
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION
1708
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1709
+
1710
+ header_params = {}
1711
+ if request.parent
1712
+ header_params["parent"] = request.parent
1713
+ end
1714
+
1715
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1716
+ metadata[:"x-goog-request-params"] ||= request_params_header
1717
+
1718
+ options.apply_defaults timeout: @config.rpcs.create_backup.timeout,
1719
+ metadata: metadata,
1720
+ retry_policy: @config.rpcs.create_backup.retry_policy
1721
+
1722
+ options.apply_defaults timeout: @config.timeout,
1723
+ metadata: @config.metadata,
1724
+ retry_policy: @config.retry_policy
1725
+
1726
+ @dataproc_metastore_stub.call_rpc :create_backup, request, options: options do |response, operation|
1727
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1728
+ yield response, operation if block_given?
1729
+ return response
1730
+ end
1731
+ rescue ::GRPC::BadStatus => e
1732
+ raise ::Google::Cloud::Error.from_error(e)
1733
+ end
1734
+
1735
+ ##
1736
+ # Deletes a single backup.
1737
+ #
1738
+ # @overload delete_backup(request, options = nil)
1739
+ # Pass arguments to `delete_backup` via a request object, either of type
1740
+ # {::Google::Cloud::Metastore::V1::DeleteBackupRequest} or an equivalent Hash.
1741
+ #
1742
+ # @param request [::Google::Cloud::Metastore::V1::DeleteBackupRequest, ::Hash]
1743
+ # A request object representing the call parameters. Required. To specify no
1744
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1745
+ # @param options [::Gapic::CallOptions, ::Hash]
1746
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1747
+ #
1748
+ # @overload delete_backup(name: nil, request_id: nil)
1749
+ # Pass arguments to `delete_backup` via keyword arguments. Note that at
1750
+ # least one keyword argument is required. To specify no parameters, or to keep all
1751
+ # the default parameter values, pass an empty Hash as a request object (see above).
1752
+ #
1753
+ # @param name [::String]
1754
+ # Required. The relative resource name of the backup to delete, in the
1755
+ # following form:
1756
+ #
1757
+ # `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
1758
+ # @param request_id [::String]
1759
+ # Optional. A request ID. Specify a unique request ID to allow the server to ignore the
1760
+ # request if it has completed. The server will ignore subsequent requests
1761
+ # that provide a duplicate request ID for at least 60 minutes after the first
1762
+ # request.
1763
+ #
1764
+ # For example, if an initial request times out, followed by another request
1765
+ # with the same request ID, the server ignores the second request to prevent
1766
+ # the creation of duplicate commitments.
1767
+ #
1768
+ # The request ID must be a valid
1769
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
1770
+ # A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1771
+ #
1772
+ # @yield [response, operation] Access the result along with the RPC operation
1773
+ # @yieldparam response [::Gapic::Operation]
1774
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1775
+ #
1776
+ # @return [::Gapic::Operation]
1777
+ #
1778
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1779
+ #
1780
+ # @example Basic example
1781
+ # require "google/cloud/metastore/v1"
1782
+ #
1783
+ # # Create a client object. The client can be reused for multiple calls.
1784
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
1785
+ #
1786
+ # # Create a request. To set request fields, pass in keyword arguments.
1787
+ # request = Google::Cloud::Metastore::V1::DeleteBackupRequest.new
1788
+ #
1789
+ # # Call the delete_backup method.
1790
+ # result = client.delete_backup request
1791
+ #
1792
+ # # The returned object is of type Gapic::Operation. You can use this
1793
+ # # object to check the status of an operation, cancel it, or wait
1794
+ # # for results. Here is how to block until completion:
1795
+ # result.wait_until_done! timeout: 60
1796
+ # if result.response?
1797
+ # p result.response
1798
+ # else
1799
+ # puts "Error!"
1800
+ # end
1801
+ #
1802
+ def delete_backup request, options = nil
1803
+ raise ::ArgumentError, "request must be provided" if request.nil?
1804
+
1805
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::DeleteBackupRequest
1806
+
1807
+ # Converts hash and nil to an options object
1808
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1809
+
1810
+ # Customize the options with defaults
1811
+ metadata = @config.rpcs.delete_backup.metadata.to_h
1812
+
1813
+ # Set x-goog-api-client and x-goog-user-project headers
1814
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1815
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1816
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION
1817
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1818
+
1819
+ header_params = {}
1820
+ if request.name
1821
+ header_params["name"] = request.name
1822
+ end
1823
+
1824
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1825
+ metadata[:"x-goog-request-params"] ||= request_params_header
1826
+
1827
+ options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
1828
+ metadata: metadata,
1829
+ retry_policy: @config.rpcs.delete_backup.retry_policy
1830
+
1831
+ options.apply_defaults timeout: @config.timeout,
1832
+ metadata: @config.metadata,
1833
+ retry_policy: @config.retry_policy
1834
+
1835
+ @dataproc_metastore_stub.call_rpc :delete_backup, request, options: options do |response, operation|
1836
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1837
+ yield response, operation if block_given?
1838
+ return response
1839
+ end
1840
+ rescue ::GRPC::BadStatus => e
1841
+ raise ::Google::Cloud::Error.from_error(e)
1842
+ end
1843
+
1053
1844
  ##
1054
1845
  # Configuration class for the DataprocMetastore API.
1055
1846
  #
@@ -1063,22 +1854,21 @@ module Google
1063
1854
  # Configuration can be applied globally to all clients, or to a single client
1064
1855
  # on construction.
1065
1856
  #
1066
- # # Examples
1857
+ # @example
1067
1858
  #
1068
- # To modify the global config, setting the timeout for list_services
1069
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1859
+ # # Modify the global config, setting the timeout for
1860
+ # # list_services to 20 seconds,
1861
+ # # and all remaining timeouts to 10 seconds.
1862
+ # ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.configure do |config|
1863
+ # config.timeout = 10.0
1864
+ # config.rpcs.list_services.timeout = 20.0
1865
+ # end
1070
1866
  #
1071
- # ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.configure do |config|
1072
- # config.timeout = 10.0
1073
- # config.rpcs.list_services.timeout = 20.0
1074
- # end
1075
- #
1076
- # To apply the above configuration only to a new client:
1077
- #
1078
- # client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config|
1079
- # config.timeout = 10.0
1080
- # config.rpcs.list_services.timeout = 20.0
1081
- # end
1867
+ # # Apply the above configuration only to a new client.
1868
+ # client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config|
1869
+ # config.timeout = 10.0
1870
+ # config.rpcs.list_services.timeout = 20.0
1871
+ # end
1082
1872
  #
1083
1873
  # @!attribute [rw] endpoint
1084
1874
  # The hostname or hostname:port of the service endpoint.
@@ -1236,6 +2026,31 @@ module Google
1236
2026
  # @return [::Gapic::Config::Method]
1237
2027
  #
1238
2028
  attr_reader :export_metadata
2029
+ ##
2030
+ # RPC-specific configuration for `restore_service`
2031
+ # @return [::Gapic::Config::Method]
2032
+ #
2033
+ attr_reader :restore_service
2034
+ ##
2035
+ # RPC-specific configuration for `list_backups`
2036
+ # @return [::Gapic::Config::Method]
2037
+ #
2038
+ attr_reader :list_backups
2039
+ ##
2040
+ # RPC-specific configuration for `get_backup`
2041
+ # @return [::Gapic::Config::Method]
2042
+ #
2043
+ attr_reader :get_backup
2044
+ ##
2045
+ # RPC-specific configuration for `create_backup`
2046
+ # @return [::Gapic::Config::Method]
2047
+ #
2048
+ attr_reader :create_backup
2049
+ ##
2050
+ # RPC-specific configuration for `delete_backup`
2051
+ # @return [::Gapic::Config::Method]
2052
+ #
2053
+ attr_reader :delete_backup
1239
2054
 
1240
2055
  # @private
1241
2056
  def initialize parent_rpcs = nil
@@ -1259,6 +2074,16 @@ module Google
1259
2074
  @update_metadata_import = ::Gapic::Config::Method.new update_metadata_import_config
1260
2075
  export_metadata_config = parent_rpcs.export_metadata if parent_rpcs.respond_to? :export_metadata
1261
2076
  @export_metadata = ::Gapic::Config::Method.new export_metadata_config
2077
+ restore_service_config = parent_rpcs.restore_service if parent_rpcs.respond_to? :restore_service
2078
+ @restore_service = ::Gapic::Config::Method.new restore_service_config
2079
+ list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
2080
+ @list_backups = ::Gapic::Config::Method.new list_backups_config
2081
+ get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
2082
+ @get_backup = ::Gapic::Config::Method.new get_backup_config
2083
+ create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup
2084
+ @create_backup = ::Gapic::Config::Method.new create_backup_config
2085
+ delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
2086
+ @delete_backup = ::Gapic::Config::Method.new delete_backup_config
1262
2087
 
1263
2088
  yield self if block_given?
1264
2089
  end