google-cloud-cloud_dms-v1 0.1.0 → 0.1.4

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.
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::CloudDMS::V1::DataMigrationService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all DataMigrationService clients:
47
- #
48
- # ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all DataMigrationService clients
47
+ # ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -67,10 +66,7 @@ module Google
67
66
 
68
67
  default_config.timeout = 60.0
69
68
  default_config.retry_policy = {
70
- initial_delay: 1.0,
71
- max_delay: 10.0,
72
- multiplier: 1.3,
73
- retry_codes: [14]
69
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
74
70
  }
75
71
 
76
72
  default_config.rpcs.list_migration_jobs.timeout = 60.0
@@ -136,19 +132,15 @@ module Google
136
132
  ##
137
133
  # Create a new DataMigrationService client object.
138
134
  #
139
- # ## Examples
140
- #
141
- # To create a new DataMigrationService client with the default
142
- # configuration:
143
- #
144
- # client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
135
+ # @example
145
136
  #
146
- # To create a new DataMigrationService client with a custom
147
- # configuration:
137
+ # # Create a client using the default configuration
138
+ # client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
148
139
  #
149
- # client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new do |config|
150
- # config.timeout = 10.0
151
- # end
140
+ # # Create a client using a custom configuration
141
+ # client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new do |config|
142
+ # config.timeout = 10.0
143
+ # end
152
144
  #
153
145
  # @yield [config] Configure the DataMigrationService client.
154
146
  # @yieldparam config [Client::Configuration]
@@ -168,14 +160,13 @@ module Google
168
160
 
169
161
  # Create credentials
170
162
  credentials = @config.credentials
171
- # 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,
172
164
  # but only if the default endpoint does not have a region prefix.
173
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
174
- @config.endpoint == Client.configure.endpoint &&
165
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
175
166
  !@config.endpoint.split(".").first.include?("-")
176
167
  credentials ||= Credentials.default scope: @config.scope,
177
168
  enable_self_signed_jwt: enable_self_signed_jwt
178
- if credentials.is_a?(String) || credentials.is_a?(Hash)
169
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
179
170
  credentials = Credentials.new credentials, scope: @config.scope
180
171
  end
181
172
  @quota_project_id = @config.quota_project
@@ -257,6 +248,27 @@ module Google
257
248
  #
258
249
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
259
250
  #
251
+ # @example Basic example
252
+ # require "google/cloud/cloud_dms/v1"
253
+ #
254
+ # # Create a client object. The client can be reused for multiple calls.
255
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
256
+ #
257
+ # # Create a request. To set request fields, pass in keyword arguments.
258
+ # request = Google::Cloud::CloudDMS::V1::ListMigrationJobsRequest.new
259
+ #
260
+ # # Call the list_migration_jobs method.
261
+ # result = client.list_migration_jobs request
262
+ #
263
+ # # The returned object is of type Gapic::PagedEnumerable. You can
264
+ # # iterate over all elements by calling #each, and the enumerable
265
+ # # will lazily make API calls to fetch subsequent pages. Other
266
+ # # methods are also available for managing paging directly.
267
+ # result.each do |response|
268
+ # # Each element is of type ::Google::Cloud::CloudDMS::V1::MigrationJob.
269
+ # p response
270
+ # end
271
+ #
260
272
  def list_migration_jobs request, options = nil
261
273
  raise ::ArgumentError, "request must be provided" if request.nil?
262
274
 
@@ -274,16 +286,20 @@ module Google
274
286
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
275
287
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
276
288
 
277
- header_params = {
278
- "parent" => request.parent
279
- }
289
+ header_params = {}
290
+ if request.parent
291
+ header_params["parent"] = request.parent
292
+ end
293
+
280
294
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
281
295
  metadata[:"x-goog-request-params"] ||= request_params_header
282
296
 
283
297
  options.apply_defaults timeout: @config.rpcs.list_migration_jobs.timeout,
284
298
  metadata: metadata,
285
299
  retry_policy: @config.rpcs.list_migration_jobs.retry_policy
286
- options.apply_defaults metadata: @config.metadata,
300
+
301
+ options.apply_defaults timeout: @config.timeout,
302
+ metadata: @config.metadata,
287
303
  retry_policy: @config.retry_policy
288
304
 
289
305
  @data_migration_service_stub.call_rpc :list_migration_jobs, request, options: options do |response, operation|
@@ -324,6 +340,21 @@ module Google
324
340
  #
325
341
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
326
342
  #
343
+ # @example Basic example
344
+ # require "google/cloud/cloud_dms/v1"
345
+ #
346
+ # # Create a client object. The client can be reused for multiple calls.
347
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
348
+ #
349
+ # # Create a request. To set request fields, pass in keyword arguments.
350
+ # request = Google::Cloud::CloudDMS::V1::GetMigrationJobRequest.new
351
+ #
352
+ # # Call the get_migration_job method.
353
+ # result = client.get_migration_job request
354
+ #
355
+ # # The returned object is of type Google::Cloud::CloudDMS::V1::MigrationJob.
356
+ # p result
357
+ #
327
358
  def get_migration_job request, options = nil
328
359
  raise ::ArgumentError, "request must be provided" if request.nil?
329
360
 
@@ -341,16 +372,20 @@ module Google
341
372
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
342
373
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
343
374
 
344
- header_params = {
345
- "name" => request.name
346
- }
375
+ header_params = {}
376
+ if request.name
377
+ header_params["name"] = request.name
378
+ end
379
+
347
380
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
348
381
  metadata[:"x-goog-request-params"] ||= request_params_header
349
382
 
350
383
  options.apply_defaults timeout: @config.rpcs.get_migration_job.timeout,
351
384
  metadata: metadata,
352
385
  retry_policy: @config.rpcs.get_migration_job.retry_policy
353
- options.apply_defaults metadata: @config.metadata,
386
+
387
+ options.apply_defaults timeout: @config.timeout,
388
+ metadata: @config.metadata,
354
389
  retry_policy: @config.retry_policy
355
390
 
356
391
  @data_migration_service_stub.call_rpc :get_migration_job, request, options: options do |response, operation|
@@ -404,6 +439,28 @@ module Google
404
439
  #
405
440
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
406
441
  #
442
+ # @example Basic example
443
+ # require "google/cloud/cloud_dms/v1"
444
+ #
445
+ # # Create a client object. The client can be reused for multiple calls.
446
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
447
+ #
448
+ # # Create a request. To set request fields, pass in keyword arguments.
449
+ # request = Google::Cloud::CloudDMS::V1::CreateMigrationJobRequest.new
450
+ #
451
+ # # Call the create_migration_job method.
452
+ # result = client.create_migration_job request
453
+ #
454
+ # # The returned object is of type Gapic::Operation. You can use this
455
+ # # object to check the status of an operation, cancel it, or wait
456
+ # # for results. Here is how to block until completion:
457
+ # result.wait_until_done! timeout: 60
458
+ # if result.response?
459
+ # p result.response
460
+ # else
461
+ # puts "Error!"
462
+ # end
463
+ #
407
464
  def create_migration_job request, options = nil
408
465
  raise ::ArgumentError, "request must be provided" if request.nil?
409
466
 
@@ -421,16 +478,20 @@ module Google
421
478
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
422
479
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
423
480
 
424
- header_params = {
425
- "parent" => request.parent
426
- }
481
+ header_params = {}
482
+ if request.parent
483
+ header_params["parent"] = request.parent
484
+ end
485
+
427
486
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
428
487
  metadata[:"x-goog-request-params"] ||= request_params_header
429
488
 
430
489
  options.apply_defaults timeout: @config.rpcs.create_migration_job.timeout,
431
490
  metadata: metadata,
432
491
  retry_policy: @config.rpcs.create_migration_job.retry_policy
433
- options.apply_defaults metadata: @config.metadata,
492
+
493
+ options.apply_defaults timeout: @config.timeout,
494
+ metadata: @config.metadata,
434
495
  retry_policy: @config.retry_policy
435
496
 
436
497
  @data_migration_service_stub.call_rpc :create_migration_job, request, options: options do |response, operation|
@@ -482,6 +543,28 @@ module Google
482
543
  #
483
544
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
484
545
  #
546
+ # @example Basic example
547
+ # require "google/cloud/cloud_dms/v1"
548
+ #
549
+ # # Create a client object. The client can be reused for multiple calls.
550
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
551
+ #
552
+ # # Create a request. To set request fields, pass in keyword arguments.
553
+ # request = Google::Cloud::CloudDMS::V1::UpdateMigrationJobRequest.new
554
+ #
555
+ # # Call the update_migration_job method.
556
+ # result = client.update_migration_job request
557
+ #
558
+ # # The returned object is of type Gapic::Operation. You can use this
559
+ # # object to check the status of an operation, cancel it, or wait
560
+ # # for results. Here is how to block until completion:
561
+ # result.wait_until_done! timeout: 60
562
+ # if result.response?
563
+ # p result.response
564
+ # else
565
+ # puts "Error!"
566
+ # end
567
+ #
485
568
  def update_migration_job request, options = nil
486
569
  raise ::ArgumentError, "request must be provided" if request.nil?
487
570
 
@@ -499,16 +582,20 @@ module Google
499
582
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
500
583
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
501
584
 
502
- header_params = {
503
- "migration_job.name" => request.migration_job.name
504
- }
585
+ header_params = {}
586
+ if request.migration_job&.name
587
+ header_params["migration_job.name"] = request.migration_job.name
588
+ end
589
+
505
590
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
506
591
  metadata[:"x-goog-request-params"] ||= request_params_header
507
592
 
508
593
  options.apply_defaults timeout: @config.rpcs.update_migration_job.timeout,
509
594
  metadata: metadata,
510
595
  retry_policy: @config.rpcs.update_migration_job.retry_policy
511
- options.apply_defaults metadata: @config.metadata,
596
+
597
+ options.apply_defaults timeout: @config.timeout,
598
+ metadata: @config.metadata,
512
599
  retry_policy: @config.retry_policy
513
600
 
514
601
  @data_migration_service_stub.call_rpc :update_migration_job, request, options: options do |response, operation|
@@ -561,6 +648,28 @@ module Google
561
648
  #
562
649
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
563
650
  #
651
+ # @example Basic example
652
+ # require "google/cloud/cloud_dms/v1"
653
+ #
654
+ # # Create a client object. The client can be reused for multiple calls.
655
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
656
+ #
657
+ # # Create a request. To set request fields, pass in keyword arguments.
658
+ # request = Google::Cloud::CloudDMS::V1::DeleteMigrationJobRequest.new
659
+ #
660
+ # # Call the delete_migration_job method.
661
+ # result = client.delete_migration_job request
662
+ #
663
+ # # The returned object is of type Gapic::Operation. You can use this
664
+ # # object to check the status of an operation, cancel it, or wait
665
+ # # for results. Here is how to block until completion:
666
+ # result.wait_until_done! timeout: 60
667
+ # if result.response?
668
+ # p result.response
669
+ # else
670
+ # puts "Error!"
671
+ # end
672
+ #
564
673
  def delete_migration_job request, options = nil
565
674
  raise ::ArgumentError, "request must be provided" if request.nil?
566
675
 
@@ -578,16 +687,20 @@ module Google
578
687
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
579
688
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
580
689
 
581
- header_params = {
582
- "name" => request.name
583
- }
690
+ header_params = {}
691
+ if request.name
692
+ header_params["name"] = request.name
693
+ end
694
+
584
695
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
585
696
  metadata[:"x-goog-request-params"] ||= request_params_header
586
697
 
587
698
  options.apply_defaults timeout: @config.rpcs.delete_migration_job.timeout,
588
699
  metadata: metadata,
589
700
  retry_policy: @config.rpcs.delete_migration_job.retry_policy
590
- options.apply_defaults metadata: @config.metadata,
701
+
702
+ options.apply_defaults timeout: @config.timeout,
703
+ metadata: @config.metadata,
591
704
  retry_policy: @config.retry_policy
592
705
 
593
706
  @data_migration_service_stub.call_rpc :delete_migration_job, request, options: options do |response, operation|
@@ -628,6 +741,28 @@ module Google
628
741
  #
629
742
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
630
743
  #
744
+ # @example Basic example
745
+ # require "google/cloud/cloud_dms/v1"
746
+ #
747
+ # # Create a client object. The client can be reused for multiple calls.
748
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
749
+ #
750
+ # # Create a request. To set request fields, pass in keyword arguments.
751
+ # request = Google::Cloud::CloudDMS::V1::StartMigrationJobRequest.new
752
+ #
753
+ # # Call the start_migration_job method.
754
+ # result = client.start_migration_job request
755
+ #
756
+ # # The returned object is of type Gapic::Operation. You can use this
757
+ # # object to check the status of an operation, cancel it, or wait
758
+ # # for results. Here is how to block until completion:
759
+ # result.wait_until_done! timeout: 60
760
+ # if result.response?
761
+ # p result.response
762
+ # else
763
+ # puts "Error!"
764
+ # end
765
+ #
631
766
  def start_migration_job request, options = nil
632
767
  raise ::ArgumentError, "request must be provided" if request.nil?
633
768
 
@@ -645,16 +780,20 @@ module Google
645
780
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
646
781
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
647
782
 
648
- header_params = {
649
- "name" => request.name
650
- }
783
+ header_params = {}
784
+ if request.name
785
+ header_params["name"] = request.name
786
+ end
787
+
651
788
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
652
789
  metadata[:"x-goog-request-params"] ||= request_params_header
653
790
 
654
791
  options.apply_defaults timeout: @config.rpcs.start_migration_job.timeout,
655
792
  metadata: metadata,
656
793
  retry_policy: @config.rpcs.start_migration_job.retry_policy
657
- options.apply_defaults metadata: @config.metadata,
794
+
795
+ options.apply_defaults timeout: @config.timeout,
796
+ metadata: @config.metadata,
658
797
  retry_policy: @config.retry_policy
659
798
 
660
799
  @data_migration_service_stub.call_rpc :start_migration_job, request, options: options do |response, operation|
@@ -695,6 +834,28 @@ module Google
695
834
  #
696
835
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
697
836
  #
837
+ # @example Basic example
838
+ # require "google/cloud/cloud_dms/v1"
839
+ #
840
+ # # Create a client object. The client can be reused for multiple calls.
841
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
842
+ #
843
+ # # Create a request. To set request fields, pass in keyword arguments.
844
+ # request = Google::Cloud::CloudDMS::V1::StopMigrationJobRequest.new
845
+ #
846
+ # # Call the stop_migration_job method.
847
+ # result = client.stop_migration_job request
848
+ #
849
+ # # The returned object is of type Gapic::Operation. You can use this
850
+ # # object to check the status of an operation, cancel it, or wait
851
+ # # for results. Here is how to block until completion:
852
+ # result.wait_until_done! timeout: 60
853
+ # if result.response?
854
+ # p result.response
855
+ # else
856
+ # puts "Error!"
857
+ # end
858
+ #
698
859
  def stop_migration_job request, options = nil
699
860
  raise ::ArgumentError, "request must be provided" if request.nil?
700
861
 
@@ -712,16 +873,20 @@ module Google
712
873
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
713
874
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
714
875
 
715
- header_params = {
716
- "name" => request.name
717
- }
876
+ header_params = {}
877
+ if request.name
878
+ header_params["name"] = request.name
879
+ end
880
+
718
881
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
719
882
  metadata[:"x-goog-request-params"] ||= request_params_header
720
883
 
721
884
  options.apply_defaults timeout: @config.rpcs.stop_migration_job.timeout,
722
885
  metadata: metadata,
723
886
  retry_policy: @config.rpcs.stop_migration_job.retry_policy
724
- options.apply_defaults metadata: @config.metadata,
887
+
888
+ options.apply_defaults timeout: @config.timeout,
889
+ metadata: @config.metadata,
725
890
  retry_policy: @config.retry_policy
726
891
 
727
892
  @data_migration_service_stub.call_rpc :stop_migration_job, request, options: options do |response, operation|
@@ -763,6 +928,28 @@ module Google
763
928
  #
764
929
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
765
930
  #
931
+ # @example Basic example
932
+ # require "google/cloud/cloud_dms/v1"
933
+ #
934
+ # # Create a client object. The client can be reused for multiple calls.
935
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
936
+ #
937
+ # # Create a request. To set request fields, pass in keyword arguments.
938
+ # request = Google::Cloud::CloudDMS::V1::ResumeMigrationJobRequest.new
939
+ #
940
+ # # Call the resume_migration_job method.
941
+ # result = client.resume_migration_job request
942
+ #
943
+ # # The returned object is of type Gapic::Operation. You can use this
944
+ # # object to check the status of an operation, cancel it, or wait
945
+ # # for results. Here is how to block until completion:
946
+ # result.wait_until_done! timeout: 60
947
+ # if result.response?
948
+ # p result.response
949
+ # else
950
+ # puts "Error!"
951
+ # end
952
+ #
766
953
  def resume_migration_job request, options = nil
767
954
  raise ::ArgumentError, "request must be provided" if request.nil?
768
955
 
@@ -780,16 +967,20 @@ module Google
780
967
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
781
968
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
782
969
 
783
- header_params = {
784
- "name" => request.name
785
- }
970
+ header_params = {}
971
+ if request.name
972
+ header_params["name"] = request.name
973
+ end
974
+
786
975
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
787
976
  metadata[:"x-goog-request-params"] ||= request_params_header
788
977
 
789
978
  options.apply_defaults timeout: @config.rpcs.resume_migration_job.timeout,
790
979
  metadata: metadata,
791
980
  retry_policy: @config.rpcs.resume_migration_job.retry_policy
792
- options.apply_defaults metadata: @config.metadata,
981
+
982
+ options.apply_defaults timeout: @config.timeout,
983
+ metadata: @config.metadata,
793
984
  retry_policy: @config.retry_policy
794
985
 
795
986
  @data_migration_service_stub.call_rpc :resume_migration_job, request, options: options do |response, operation|
@@ -831,6 +1022,28 @@ module Google
831
1022
  #
832
1023
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
833
1024
  #
1025
+ # @example Basic example
1026
+ # require "google/cloud/cloud_dms/v1"
1027
+ #
1028
+ # # Create a client object. The client can be reused for multiple calls.
1029
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
1030
+ #
1031
+ # # Create a request. To set request fields, pass in keyword arguments.
1032
+ # request = Google::Cloud::CloudDMS::V1::PromoteMigrationJobRequest.new
1033
+ #
1034
+ # # Call the promote_migration_job method.
1035
+ # result = client.promote_migration_job request
1036
+ #
1037
+ # # The returned object is of type Gapic::Operation. You can use this
1038
+ # # object to check the status of an operation, cancel it, or wait
1039
+ # # for results. Here is how to block until completion:
1040
+ # result.wait_until_done! timeout: 60
1041
+ # if result.response?
1042
+ # p result.response
1043
+ # else
1044
+ # puts "Error!"
1045
+ # end
1046
+ #
834
1047
  def promote_migration_job request, options = nil
835
1048
  raise ::ArgumentError, "request must be provided" if request.nil?
836
1049
 
@@ -848,16 +1061,20 @@ module Google
848
1061
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
849
1062
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
850
1063
 
851
- header_params = {
852
- "name" => request.name
853
- }
1064
+ header_params = {}
1065
+ if request.name
1066
+ header_params["name"] = request.name
1067
+ end
1068
+
854
1069
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
855
1070
  metadata[:"x-goog-request-params"] ||= request_params_header
856
1071
 
857
1072
  options.apply_defaults timeout: @config.rpcs.promote_migration_job.timeout,
858
1073
  metadata: metadata,
859
1074
  retry_policy: @config.rpcs.promote_migration_job.retry_policy
860
- options.apply_defaults metadata: @config.metadata,
1075
+
1076
+ options.apply_defaults timeout: @config.timeout,
1077
+ metadata: @config.metadata,
861
1078
  retry_policy: @config.retry_policy
862
1079
 
863
1080
  @data_migration_service_stub.call_rpc :promote_migration_job, request, options: options do |response, operation|
@@ -899,6 +1116,28 @@ module Google
899
1116
  #
900
1117
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
901
1118
  #
1119
+ # @example Basic example
1120
+ # require "google/cloud/cloud_dms/v1"
1121
+ #
1122
+ # # Create a client object. The client can be reused for multiple calls.
1123
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
1124
+ #
1125
+ # # Create a request. To set request fields, pass in keyword arguments.
1126
+ # request = Google::Cloud::CloudDMS::V1::VerifyMigrationJobRequest.new
1127
+ #
1128
+ # # Call the verify_migration_job method.
1129
+ # result = client.verify_migration_job 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
+ #
902
1141
  def verify_migration_job request, options = nil
903
1142
  raise ::ArgumentError, "request must be provided" if request.nil?
904
1143
 
@@ -916,16 +1155,20 @@ module Google
916
1155
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
917
1156
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
918
1157
 
919
- header_params = {
920
- "name" => request.name
921
- }
1158
+ header_params = {}
1159
+ if request.name
1160
+ header_params["name"] = request.name
1161
+ end
1162
+
922
1163
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
923
1164
  metadata[:"x-goog-request-params"] ||= request_params_header
924
1165
 
925
1166
  options.apply_defaults timeout: @config.rpcs.verify_migration_job.timeout,
926
1167
  metadata: metadata,
927
1168
  retry_policy: @config.rpcs.verify_migration_job.retry_policy
928
- options.apply_defaults metadata: @config.metadata,
1169
+
1170
+ options.apply_defaults timeout: @config.timeout,
1171
+ metadata: @config.metadata,
929
1172
  retry_policy: @config.retry_policy
930
1173
 
931
1174
  @data_migration_service_stub.call_rpc :verify_migration_job, request, options: options do |response, operation|
@@ -968,6 +1211,28 @@ module Google
968
1211
  #
969
1212
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
970
1213
  #
1214
+ # @example Basic example
1215
+ # require "google/cloud/cloud_dms/v1"
1216
+ #
1217
+ # # Create a client object. The client can be reused for multiple calls.
1218
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
1219
+ #
1220
+ # # Create a request. To set request fields, pass in keyword arguments.
1221
+ # request = Google::Cloud::CloudDMS::V1::RestartMigrationJobRequest.new
1222
+ #
1223
+ # # Call the restart_migration_job method.
1224
+ # result = client.restart_migration_job request
1225
+ #
1226
+ # # The returned object is of type Gapic::Operation. You can use this
1227
+ # # object to check the status of an operation, cancel it, or wait
1228
+ # # for results. Here is how to block until completion:
1229
+ # result.wait_until_done! timeout: 60
1230
+ # if result.response?
1231
+ # p result.response
1232
+ # else
1233
+ # puts "Error!"
1234
+ # end
1235
+ #
971
1236
  def restart_migration_job request, options = nil
972
1237
  raise ::ArgumentError, "request must be provided" if request.nil?
973
1238
 
@@ -985,16 +1250,20 @@ module Google
985
1250
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
986
1251
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
987
1252
 
988
- header_params = {
989
- "name" => request.name
990
- }
1253
+ header_params = {}
1254
+ if request.name
1255
+ header_params["name"] = request.name
1256
+ end
1257
+
991
1258
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
992
1259
  metadata[:"x-goog-request-params"] ||= request_params_header
993
1260
 
994
1261
  options.apply_defaults timeout: @config.rpcs.restart_migration_job.timeout,
995
1262
  metadata: metadata,
996
1263
  retry_policy: @config.rpcs.restart_migration_job.retry_policy
997
- options.apply_defaults metadata: @config.metadata,
1264
+
1265
+ options.apply_defaults timeout: @config.timeout,
1266
+ metadata: @config.metadata,
998
1267
  retry_policy: @config.retry_policy
999
1268
 
1000
1269
  @data_migration_service_stub.call_rpc :restart_migration_job, request, options: options do |response, operation|
@@ -1044,6 +1313,21 @@ module Google
1044
1313
  #
1045
1314
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1046
1315
  #
1316
+ # @example Basic example
1317
+ # require "google/cloud/cloud_dms/v1"
1318
+ #
1319
+ # # Create a client object. The client can be reused for multiple calls.
1320
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
1321
+ #
1322
+ # # Create a request. To set request fields, pass in keyword arguments.
1323
+ # request = Google::Cloud::CloudDMS::V1::GenerateSshScriptRequest.new
1324
+ #
1325
+ # # Call the generate_ssh_script method.
1326
+ # result = client.generate_ssh_script request
1327
+ #
1328
+ # # The returned object is of type Google::Cloud::CloudDMS::V1::SshScript.
1329
+ # p result
1330
+ #
1047
1331
  def generate_ssh_script request, options = nil
1048
1332
  raise ::ArgumentError, "request must be provided" if request.nil?
1049
1333
 
@@ -1061,16 +1345,20 @@ module Google
1061
1345
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
1062
1346
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1063
1347
 
1064
- header_params = {
1065
- "migration_job" => request.migration_job
1066
- }
1348
+ header_params = {}
1349
+ if request.migration_job
1350
+ header_params["migration_job"] = request.migration_job
1351
+ end
1352
+
1067
1353
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1068
1354
  metadata[:"x-goog-request-params"] ||= request_params_header
1069
1355
 
1070
1356
  options.apply_defaults timeout: @config.rpcs.generate_ssh_script.timeout,
1071
1357
  metadata: metadata,
1072
1358
  retry_policy: @config.rpcs.generate_ssh_script.retry_policy
1073
- options.apply_defaults metadata: @config.metadata,
1359
+
1360
+ options.apply_defaults timeout: @config.timeout,
1361
+ metadata: @config.metadata,
1074
1362
  retry_policy: @config.retry_policy
1075
1363
 
1076
1364
  @data_migration_service_stub.call_rpc :generate_ssh_script, request, options: options do |response, operation|
@@ -1133,6 +1421,27 @@ module Google
1133
1421
  #
1134
1422
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1135
1423
  #
1424
+ # @example Basic example
1425
+ # require "google/cloud/cloud_dms/v1"
1426
+ #
1427
+ # # Create a client object. The client can be reused for multiple calls.
1428
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
1429
+ #
1430
+ # # Create a request. To set request fields, pass in keyword arguments.
1431
+ # request = Google::Cloud::CloudDMS::V1::ListConnectionProfilesRequest.new
1432
+ #
1433
+ # # Call the list_connection_profiles method.
1434
+ # result = client.list_connection_profiles request
1435
+ #
1436
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1437
+ # # iterate over all elements by calling #each, and the enumerable
1438
+ # # will lazily make API calls to fetch subsequent pages. Other
1439
+ # # methods are also available for managing paging directly.
1440
+ # result.each do |response|
1441
+ # # Each element is of type ::Google::Cloud::CloudDMS::V1::ConnectionProfile.
1442
+ # p response
1443
+ # end
1444
+ #
1136
1445
  def list_connection_profiles request, options = nil
1137
1446
  raise ::ArgumentError, "request must be provided" if request.nil?
1138
1447
 
@@ -1150,16 +1459,20 @@ module Google
1150
1459
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
1151
1460
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1152
1461
 
1153
- header_params = {
1154
- "parent" => request.parent
1155
- }
1462
+ header_params = {}
1463
+ if request.parent
1464
+ header_params["parent"] = request.parent
1465
+ end
1466
+
1156
1467
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1157
1468
  metadata[:"x-goog-request-params"] ||= request_params_header
1158
1469
 
1159
1470
  options.apply_defaults timeout: @config.rpcs.list_connection_profiles.timeout,
1160
1471
  metadata: metadata,
1161
1472
  retry_policy: @config.rpcs.list_connection_profiles.retry_policy
1162
- options.apply_defaults metadata: @config.metadata,
1473
+
1474
+ options.apply_defaults timeout: @config.timeout,
1475
+ metadata: @config.metadata,
1163
1476
  retry_policy: @config.retry_policy
1164
1477
 
1165
1478
  @data_migration_service_stub.call_rpc :list_connection_profiles, request, options: options do |response, operation|
@@ -1200,6 +1513,21 @@ module Google
1200
1513
  #
1201
1514
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1202
1515
  #
1516
+ # @example Basic example
1517
+ # require "google/cloud/cloud_dms/v1"
1518
+ #
1519
+ # # Create a client object. The client can be reused for multiple calls.
1520
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
1521
+ #
1522
+ # # Create a request. To set request fields, pass in keyword arguments.
1523
+ # request = Google::Cloud::CloudDMS::V1::GetConnectionProfileRequest.new
1524
+ #
1525
+ # # Call the get_connection_profile method.
1526
+ # result = client.get_connection_profile request
1527
+ #
1528
+ # # The returned object is of type Google::Cloud::CloudDMS::V1::ConnectionProfile.
1529
+ # p result
1530
+ #
1203
1531
  def get_connection_profile request, options = nil
1204
1532
  raise ::ArgumentError, "request must be provided" if request.nil?
1205
1533
 
@@ -1217,16 +1545,20 @@ module Google
1217
1545
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
1218
1546
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1219
1547
 
1220
- header_params = {
1221
- "name" => request.name
1222
- }
1548
+ header_params = {}
1549
+ if request.name
1550
+ header_params["name"] = request.name
1551
+ end
1552
+
1223
1553
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1224
1554
  metadata[:"x-goog-request-params"] ||= request_params_header
1225
1555
 
1226
1556
  options.apply_defaults timeout: @config.rpcs.get_connection_profile.timeout,
1227
1557
  metadata: metadata,
1228
1558
  retry_policy: @config.rpcs.get_connection_profile.retry_policy
1229
- options.apply_defaults metadata: @config.metadata,
1559
+
1560
+ options.apply_defaults timeout: @config.timeout,
1561
+ metadata: @config.metadata,
1230
1562
  retry_policy: @config.retry_policy
1231
1563
 
1232
1564
  @data_migration_service_stub.call_rpc :get_connection_profile, request, options: options do |response, operation|
@@ -1278,6 +1610,28 @@ module Google
1278
1610
  #
1279
1611
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1280
1612
  #
1613
+ # @example Basic example
1614
+ # require "google/cloud/cloud_dms/v1"
1615
+ #
1616
+ # # Create a client object. The client can be reused for multiple calls.
1617
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
1618
+ #
1619
+ # # Create a request. To set request fields, pass in keyword arguments.
1620
+ # request = Google::Cloud::CloudDMS::V1::CreateConnectionProfileRequest.new
1621
+ #
1622
+ # # Call the create_connection_profile method.
1623
+ # result = client.create_connection_profile request
1624
+ #
1625
+ # # The returned object is of type Gapic::Operation. You can use this
1626
+ # # object to check the status of an operation, cancel it, or wait
1627
+ # # for results. Here is how to block until completion:
1628
+ # result.wait_until_done! timeout: 60
1629
+ # if result.response?
1630
+ # p result.response
1631
+ # else
1632
+ # puts "Error!"
1633
+ # end
1634
+ #
1281
1635
  def create_connection_profile request, options = nil
1282
1636
  raise ::ArgumentError, "request must be provided" if request.nil?
1283
1637
 
@@ -1295,16 +1649,20 @@ module Google
1295
1649
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
1296
1650
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1297
1651
 
1298
- header_params = {
1299
- "parent" => request.parent
1300
- }
1652
+ header_params = {}
1653
+ if request.parent
1654
+ header_params["parent"] = request.parent
1655
+ end
1656
+
1301
1657
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1302
1658
  metadata[:"x-goog-request-params"] ||= request_params_header
1303
1659
 
1304
1660
  options.apply_defaults timeout: @config.rpcs.create_connection_profile.timeout,
1305
1661
  metadata: metadata,
1306
1662
  retry_policy: @config.rpcs.create_connection_profile.retry_policy
1307
- options.apply_defaults metadata: @config.metadata,
1663
+
1664
+ options.apply_defaults timeout: @config.timeout,
1665
+ metadata: @config.metadata,
1308
1666
  retry_policy: @config.retry_policy
1309
1667
 
1310
1668
  @data_migration_service_stub.call_rpc :create_connection_profile, request, options: options do |response, operation|
@@ -1356,6 +1714,28 @@ module Google
1356
1714
  #
1357
1715
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1358
1716
  #
1717
+ # @example Basic example
1718
+ # require "google/cloud/cloud_dms/v1"
1719
+ #
1720
+ # # Create a client object. The client can be reused for multiple calls.
1721
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
1722
+ #
1723
+ # # Create a request. To set request fields, pass in keyword arguments.
1724
+ # request = Google::Cloud::CloudDMS::V1::UpdateConnectionProfileRequest.new
1725
+ #
1726
+ # # Call the update_connection_profile method.
1727
+ # result = client.update_connection_profile request
1728
+ #
1729
+ # # The returned object is of type Gapic::Operation. You can use this
1730
+ # # object to check the status of an operation, cancel it, or wait
1731
+ # # for results. Here is how to block until completion:
1732
+ # result.wait_until_done! timeout: 60
1733
+ # if result.response?
1734
+ # p result.response
1735
+ # else
1736
+ # puts "Error!"
1737
+ # end
1738
+ #
1359
1739
  def update_connection_profile request, options = nil
1360
1740
  raise ::ArgumentError, "request must be provided" if request.nil?
1361
1741
 
@@ -1373,16 +1753,20 @@ module Google
1373
1753
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
1374
1754
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1375
1755
 
1376
- header_params = {
1377
- "connection_profile.name" => request.connection_profile.name
1378
- }
1756
+ header_params = {}
1757
+ if request.connection_profile&.name
1758
+ header_params["connection_profile.name"] = request.connection_profile.name
1759
+ end
1760
+
1379
1761
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1380
1762
  metadata[:"x-goog-request-params"] ||= request_params_header
1381
1763
 
1382
1764
  options.apply_defaults timeout: @config.rpcs.update_connection_profile.timeout,
1383
1765
  metadata: metadata,
1384
1766
  retry_policy: @config.rpcs.update_connection_profile.retry_policy
1385
- options.apply_defaults metadata: @config.metadata,
1767
+
1768
+ options.apply_defaults timeout: @config.timeout,
1769
+ metadata: @config.metadata,
1386
1770
  retry_policy: @config.retry_policy
1387
1771
 
1388
1772
  @data_migration_service_stub.call_rpc :update_connection_profile, request, options: options do |response, operation|
@@ -1436,6 +1820,28 @@ module Google
1436
1820
  #
1437
1821
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1438
1822
  #
1823
+ # @example Basic example
1824
+ # require "google/cloud/cloud_dms/v1"
1825
+ #
1826
+ # # Create a client object. The client can be reused for multiple calls.
1827
+ # client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new
1828
+ #
1829
+ # # Create a request. To set request fields, pass in keyword arguments.
1830
+ # request = Google::Cloud::CloudDMS::V1::DeleteConnectionProfileRequest.new
1831
+ #
1832
+ # # Call the delete_connection_profile method.
1833
+ # result = client.delete_connection_profile request
1834
+ #
1835
+ # # The returned object is of type Gapic::Operation. You can use this
1836
+ # # object to check the status of an operation, cancel it, or wait
1837
+ # # for results. Here is how to block until completion:
1838
+ # result.wait_until_done! timeout: 60
1839
+ # if result.response?
1840
+ # p result.response
1841
+ # else
1842
+ # puts "Error!"
1843
+ # end
1844
+ #
1439
1845
  def delete_connection_profile request, options = nil
1440
1846
  raise ::ArgumentError, "request must be provided" if request.nil?
1441
1847
 
@@ -1453,16 +1859,20 @@ module Google
1453
1859
  gapic_version: ::Google::Cloud::CloudDMS::V1::VERSION
1454
1860
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1455
1861
 
1456
- header_params = {
1457
- "name" => request.name
1458
- }
1862
+ header_params = {}
1863
+ if request.name
1864
+ header_params["name"] = request.name
1865
+ end
1866
+
1459
1867
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1460
1868
  metadata[:"x-goog-request-params"] ||= request_params_header
1461
1869
 
1462
1870
  options.apply_defaults timeout: @config.rpcs.delete_connection_profile.timeout,
1463
1871
  metadata: metadata,
1464
1872
  retry_policy: @config.rpcs.delete_connection_profile.retry_policy
1465
- options.apply_defaults metadata: @config.metadata,
1873
+
1874
+ options.apply_defaults timeout: @config.timeout,
1875
+ metadata: @config.metadata,
1466
1876
  retry_policy: @config.retry_policy
1467
1877
 
1468
1878
  @data_migration_service_stub.call_rpc :delete_connection_profile, request, options: options do |response, operation|
@@ -1487,22 +1897,21 @@ module Google
1487
1897
  # Configuration can be applied globally to all clients, or to a single client
1488
1898
  # on construction.
1489
1899
  #
1490
- # # Examples
1491
- #
1492
- # To modify the global config, setting the timeout for list_migration_jobs
1493
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1494
- #
1495
- # ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.configure do |config|
1496
- # config.timeout = 10.0
1497
- # config.rpcs.list_migration_jobs.timeout = 20.0
1498
- # end
1499
- #
1500
- # To apply the above configuration only to a new client:
1501
- #
1502
- # client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new do |config|
1503
- # config.timeout = 10.0
1504
- # config.rpcs.list_migration_jobs.timeout = 20.0
1505
- # end
1900
+ # @example
1901
+ #
1902
+ # # Modify the global config, setting the timeout for
1903
+ # # list_migration_jobs to 20 seconds,
1904
+ # # and all remaining timeouts to 10 seconds.
1905
+ # ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.configure do |config|
1906
+ # config.timeout = 10.0
1907
+ # config.rpcs.list_migration_jobs.timeout = 20.0
1908
+ # end
1909
+ #
1910
+ # # Apply the above configuration only to a new client.
1911
+ # client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new do |config|
1912
+ # config.timeout = 10.0
1913
+ # config.rpcs.list_migration_jobs.timeout = 20.0
1914
+ # end
1506
1915
  #
1507
1916
  # @!attribute [rw] endpoint
1508
1917
  # The hostname or hostname:port of the service endpoint.