google-cloud-cloud_dms-v1 0.1.1 → 0.1.5

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