google-cloud-spanner-admin-database-v1 0.14.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -40,6 +40,9 @@ module Google
40
40
  # * restore a database from an existing backup
41
41
  #
42
42
  class Client
43
+ # @private
44
+ DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$"
45
+
43
46
  include Paths
44
47
 
45
48
  # @private
@@ -182,6 +185,15 @@ module Google
182
185
  @config
183
186
  end
184
187
 
188
+ ##
189
+ # The effective universe domain
190
+ #
191
+ # @return [String]
192
+ #
193
+ def universe_domain
194
+ @database_admin_stub.universe_domain
195
+ end
196
+
185
197
  ##
186
198
  # Create a new DatabaseAdmin REST client object.
187
199
  #
@@ -209,8 +221,9 @@ module Google
209
221
  credentials = @config.credentials
210
222
  # Use self-signed JWT if the endpoint is unchanged from default,
211
223
  # but only if the default endpoint does not have a region prefix.
212
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
213
- !@config.endpoint.split(".").first.include?("-")
224
+ enable_self_signed_jwt = @config.endpoint.nil? ||
225
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
226
+ !@config.endpoint.split(".").first.include?("-"))
214
227
  credentials ||= Credentials.default scope: @config.scope,
215
228
  enable_self_signed_jwt: enable_self_signed_jwt
216
229
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -224,9 +237,15 @@ module Google
224
237
  config.credentials = credentials
225
238
  config.quota_project = @quota_project_id
226
239
  config.endpoint = @config.endpoint
240
+ config.universe_domain = @config.universe_domain
227
241
  end
228
242
 
229
- @database_admin_stub = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
243
+ @database_admin_stub = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.new(
244
+ endpoint: @config.endpoint,
245
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
246
+ universe_domain: @config.universe_domain,
247
+ credentials: credentials
248
+ )
230
249
  end
231
250
 
232
251
  ##
@@ -273,6 +292,26 @@ module Google
273
292
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Database>]
274
293
  #
275
294
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
295
+ #
296
+ # @example Basic example
297
+ # require "google/cloud/spanner/admin/database/v1"
298
+ #
299
+ # # Create a client object. The client can be reused for multiple calls.
300
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
301
+ #
302
+ # # Create a request. To set request fields, pass in keyword arguments.
303
+ # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.new
304
+ #
305
+ # # Call the list_databases method.
306
+ # result = client.list_databases request
307
+ #
308
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
309
+ # # over elements, and API calls will be issued to fetch pages as needed.
310
+ # result.each do |item|
311
+ # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::Database.
312
+ # p item
313
+ # end
314
+ #
276
315
  def list_databases request, options = nil
277
316
  raise ::ArgumentError, "request must be provided" if request.nil?
278
317
 
@@ -361,6 +400,29 @@ module Google
361
400
  # @return [::Gapic::Operation]
362
401
  #
363
402
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
403
+ #
404
+ # @example Basic example
405
+ # require "google/cloud/spanner/admin/database/v1"
406
+ #
407
+ # # Create a client object. The client can be reused for multiple calls.
408
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
409
+ #
410
+ # # Create a request. To set request fields, pass in keyword arguments.
411
+ # request = Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new
412
+ #
413
+ # # Call the create_database method.
414
+ # result = client.create_database request
415
+ #
416
+ # # The returned object is of type Gapic::Operation. You can use it to
417
+ # # check the status of an operation, cancel it, or wait for results.
418
+ # # Here is how to wait for a response.
419
+ # result.wait_until_done! timeout: 60
420
+ # if result.response?
421
+ # p result.response
422
+ # else
423
+ # puts "No response received."
424
+ # end
425
+ #
364
426
  def create_database request, options = nil
365
427
  raise ::ArgumentError, "request must be provided" if request.nil?
366
428
 
@@ -425,6 +487,22 @@ module Google
425
487
  # @return [::Google::Cloud::Spanner::Admin::Database::V1::Database]
426
488
  #
427
489
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
490
+ #
491
+ # @example Basic example
492
+ # require "google/cloud/spanner/admin/database/v1"
493
+ #
494
+ # # Create a client object. The client can be reused for multiple calls.
495
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
496
+ #
497
+ # # Create a request. To set request fields, pass in keyword arguments.
498
+ # request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new
499
+ #
500
+ # # Call the get_database method.
501
+ # result = client.get_database request
502
+ #
503
+ # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Database.
504
+ # p result
505
+ #
428
506
  def get_database request, options = nil
429
507
  raise ::ArgumentError, "request must be provided" if request.nil?
430
508
 
@@ -527,6 +605,29 @@ module Google
527
605
  # @return [::Gapic::Operation]
528
606
  #
529
607
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
608
+ #
609
+ # @example Basic example
610
+ # require "google/cloud/spanner/admin/database/v1"
611
+ #
612
+ # # Create a client object. The client can be reused for multiple calls.
613
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
614
+ #
615
+ # # Create a request. To set request fields, pass in keyword arguments.
616
+ # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new
617
+ #
618
+ # # Call the update_database method.
619
+ # result = client.update_database request
620
+ #
621
+ # # The returned object is of type Gapic::Operation. You can use it to
622
+ # # check the status of an operation, cancel it, or wait for results.
623
+ # # Here is how to wait for a response.
624
+ # result.wait_until_done! timeout: 60
625
+ # if result.response?
626
+ # p result.response
627
+ # else
628
+ # puts "No response received."
629
+ # end
630
+ #
530
631
  def update_database request, options = nil
531
632
  raise ::ArgumentError, "request must be provided" if request.nil?
532
633
 
@@ -618,6 +719,29 @@ module Google
618
719
  # @return [::Gapic::Operation]
619
720
  #
620
721
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
722
+ #
723
+ # @example Basic example
724
+ # require "google/cloud/spanner/admin/database/v1"
725
+ #
726
+ # # Create a client object. The client can be reused for multiple calls.
727
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
728
+ #
729
+ # # Create a request. To set request fields, pass in keyword arguments.
730
+ # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new
731
+ #
732
+ # # Call the update_database_ddl method.
733
+ # result = client.update_database_ddl request
734
+ #
735
+ # # The returned object is of type Gapic::Operation. You can use it to
736
+ # # check the status of an operation, cancel it, or wait for results.
737
+ # # Here is how to wait for a response.
738
+ # result.wait_until_done! timeout: 60
739
+ # if result.response?
740
+ # p result.response
741
+ # else
742
+ # puts "No response received."
743
+ # end
744
+ #
621
745
  def update_database_ddl request, options = nil
622
746
  raise ::ArgumentError, "request must be provided" if request.nil?
623
747
 
@@ -685,6 +809,22 @@ module Google
685
809
  # @return [::Google::Protobuf::Empty]
686
810
  #
687
811
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
812
+ #
813
+ # @example Basic example
814
+ # require "google/cloud/spanner/admin/database/v1"
815
+ #
816
+ # # Create a client object. The client can be reused for multiple calls.
817
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
818
+ #
819
+ # # Create a request. To set request fields, pass in keyword arguments.
820
+ # request = Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new
821
+ #
822
+ # # Call the drop_database method.
823
+ # result = client.drop_database request
824
+ #
825
+ # # The returned object is of type Google::Protobuf::Empty.
826
+ # p result
827
+ #
688
828
  def drop_database request, options = nil
689
829
  raise ::ArgumentError, "request must be provided" if request.nil?
690
830
 
@@ -751,6 +891,22 @@ module Google
751
891
  # @return [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse]
752
892
  #
753
893
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
894
+ #
895
+ # @example Basic example
896
+ # require "google/cloud/spanner/admin/database/v1"
897
+ #
898
+ # # Create a client object. The client can be reused for multiple calls.
899
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
900
+ #
901
+ # # Create a request. To set request fields, pass in keyword arguments.
902
+ # request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new
903
+ #
904
+ # # Call the get_database_ddl method.
905
+ # result = client.get_database_ddl request
906
+ #
907
+ # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse.
908
+ # p result
909
+ #
754
910
  def get_database_ddl request, options = nil
755
911
  raise ::ArgumentError, "request must be provided" if request.nil?
756
912
 
@@ -831,6 +987,22 @@ module Google
831
987
  # @return [::Google::Iam::V1::Policy]
832
988
  #
833
989
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
990
+ #
991
+ # @example Basic example
992
+ # require "google/cloud/spanner/admin/database/v1"
993
+ #
994
+ # # Create a client object. The client can be reused for multiple calls.
995
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
996
+ #
997
+ # # Create a request. To set request fields, pass in keyword arguments.
998
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
999
+ #
1000
+ # # Call the set_iam_policy method.
1001
+ # result = client.set_iam_policy request
1002
+ #
1003
+ # # The returned object is of type Google::Iam::V1::Policy.
1004
+ # p result
1005
+ #
834
1006
  def set_iam_policy request, options = nil
835
1007
  raise ::ArgumentError, "request must be provided" if request.nil?
836
1008
 
@@ -904,6 +1076,22 @@ module Google
904
1076
  # @return [::Google::Iam::V1::Policy]
905
1077
  #
906
1078
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1079
+ #
1080
+ # @example Basic example
1081
+ # require "google/cloud/spanner/admin/database/v1"
1082
+ #
1083
+ # # Create a client object. The client can be reused for multiple calls.
1084
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
1085
+ #
1086
+ # # Create a request. To set request fields, pass in keyword arguments.
1087
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1088
+ #
1089
+ # # Call the get_iam_policy method.
1090
+ # result = client.get_iam_policy request
1091
+ #
1092
+ # # The returned object is of type Google::Iam::V1::Policy.
1093
+ # p result
1094
+ #
907
1095
  def get_iam_policy request, options = nil
908
1096
  raise ::ArgumentError, "request must be provided" if request.nil?
909
1097
 
@@ -981,6 +1169,22 @@ module Google
981
1169
  # @return [::Google::Iam::V1::TestIamPermissionsResponse]
982
1170
  #
983
1171
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1172
+ #
1173
+ # @example Basic example
1174
+ # require "google/cloud/spanner/admin/database/v1"
1175
+ #
1176
+ # # Create a client object. The client can be reused for multiple calls.
1177
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
1178
+ #
1179
+ # # Create a request. To set request fields, pass in keyword arguments.
1180
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
1181
+ #
1182
+ # # Call the test_iam_permissions method.
1183
+ # result = client.test_iam_permissions request
1184
+ #
1185
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
1186
+ # p result
1187
+ #
984
1188
  def test_iam_permissions request, options = nil
985
1189
  raise ::ArgumentError, "request must be provided" if request.nil?
986
1190
 
@@ -1071,6 +1275,29 @@ module Google
1071
1275
  # @return [::Gapic::Operation]
1072
1276
  #
1073
1277
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1278
+ #
1279
+ # @example Basic example
1280
+ # require "google/cloud/spanner/admin/database/v1"
1281
+ #
1282
+ # # Create a client object. The client can be reused for multiple calls.
1283
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
1284
+ #
1285
+ # # Create a request. To set request fields, pass in keyword arguments.
1286
+ # request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new
1287
+ #
1288
+ # # Call the create_backup method.
1289
+ # result = client.create_backup request
1290
+ #
1291
+ # # The returned object is of type Gapic::Operation. You can use it to
1292
+ # # check the status of an operation, cancel it, or wait for results.
1293
+ # # Here is how to wait for a response.
1294
+ # result.wait_until_done! timeout: 60
1295
+ # if result.response?
1296
+ # p result.response
1297
+ # else
1298
+ # puts "No response received."
1299
+ # end
1300
+ #
1074
1301
  def create_backup request, options = nil
1075
1302
  raise ::ArgumentError, "request must be provided" if request.nil?
1076
1303
 
@@ -1169,6 +1396,29 @@ module Google
1169
1396
  # @return [::Gapic::Operation]
1170
1397
  #
1171
1398
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1399
+ #
1400
+ # @example Basic example
1401
+ # require "google/cloud/spanner/admin/database/v1"
1402
+ #
1403
+ # # Create a client object. The client can be reused for multiple calls.
1404
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
1405
+ #
1406
+ # # Create a request. To set request fields, pass in keyword arguments.
1407
+ # request = Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new
1408
+ #
1409
+ # # Call the copy_backup method.
1410
+ # result = client.copy_backup request
1411
+ #
1412
+ # # The returned object is of type Gapic::Operation. You can use it to
1413
+ # # check the status of an operation, cancel it, or wait for results.
1414
+ # # Here is how to wait for a response.
1415
+ # result.wait_until_done! timeout: 60
1416
+ # if result.response?
1417
+ # p result.response
1418
+ # else
1419
+ # puts "No response received."
1420
+ # end
1421
+ #
1172
1422
  def copy_backup request, options = nil
1173
1423
  raise ::ArgumentError, "request must be provided" if request.nil?
1174
1424
 
@@ -1234,6 +1484,22 @@ module Google
1234
1484
  # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup]
1235
1485
  #
1236
1486
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1487
+ #
1488
+ # @example Basic example
1489
+ # require "google/cloud/spanner/admin/database/v1"
1490
+ #
1491
+ # # Create a client object. The client can be reused for multiple calls.
1492
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
1493
+ #
1494
+ # # Create a request. To set request fields, pass in keyword arguments.
1495
+ # request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest.new
1496
+ #
1497
+ # # Call the get_backup method.
1498
+ # result = client.get_backup request
1499
+ #
1500
+ # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup.
1501
+ # p result
1502
+ #
1237
1503
  def get_backup request, options = nil
1238
1504
  raise ::ArgumentError, "request must be provided" if request.nil?
1239
1505
 
@@ -1305,6 +1571,22 @@ module Google
1305
1571
  # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup]
1306
1572
  #
1307
1573
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1574
+ #
1575
+ # @example Basic example
1576
+ # require "google/cloud/spanner/admin/database/v1"
1577
+ #
1578
+ # # Create a client object. The client can be reused for multiple calls.
1579
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
1580
+ #
1581
+ # # Create a request. To set request fields, pass in keyword arguments.
1582
+ # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new
1583
+ #
1584
+ # # Call the update_backup method.
1585
+ # result = client.update_backup request
1586
+ #
1587
+ # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup.
1588
+ # p result
1589
+ #
1308
1590
  def update_backup request, options = nil
1309
1591
  raise ::ArgumentError, "request must be provided" if request.nil?
1310
1592
 
@@ -1369,6 +1651,22 @@ module Google
1369
1651
  # @return [::Google::Protobuf::Empty]
1370
1652
  #
1371
1653
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1654
+ #
1655
+ # @example Basic example
1656
+ # require "google/cloud/spanner/admin/database/v1"
1657
+ #
1658
+ # # Create a client object. The client can be reused for multiple calls.
1659
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
1660
+ #
1661
+ # # Create a request. To set request fields, pass in keyword arguments.
1662
+ # request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new
1663
+ #
1664
+ # # Call the delete_backup method.
1665
+ # result = client.delete_backup request
1666
+ #
1667
+ # # The returned object is of type Google::Protobuf::Empty.
1668
+ # p result
1669
+ #
1372
1670
  def delete_backup request, options = nil
1373
1671
  raise ::ArgumentError, "request must be provided" if request.nil?
1374
1672
 
@@ -1478,6 +1776,26 @@ module Google
1478
1776
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Backup>]
1479
1777
  #
1480
1778
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1779
+ #
1780
+ # @example Basic example
1781
+ # require "google/cloud/spanner/admin/database/v1"
1782
+ #
1783
+ # # Create a client object. The client can be reused for multiple calls.
1784
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
1785
+ #
1786
+ # # Create a request. To set request fields, pass in keyword arguments.
1787
+ # request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest.new
1788
+ #
1789
+ # # Call the list_backups method.
1790
+ # result = client.list_backups request
1791
+ #
1792
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1793
+ # # over elements, and API calls will be issued to fetch pages as needed.
1794
+ # result.each do |item|
1795
+ # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::Backup.
1796
+ # p item
1797
+ # end
1798
+ #
1481
1799
  def list_backups request, options = nil
1482
1800
  raise ::ArgumentError, "request must be provided" if request.nil?
1483
1801
 
@@ -1576,6 +1894,29 @@ module Google
1576
1894
  # @return [::Gapic::Operation]
1577
1895
  #
1578
1896
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1897
+ #
1898
+ # @example Basic example
1899
+ # require "google/cloud/spanner/admin/database/v1"
1900
+ #
1901
+ # # Create a client object. The client can be reused for multiple calls.
1902
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
1903
+ #
1904
+ # # Create a request. To set request fields, pass in keyword arguments.
1905
+ # request = Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new
1906
+ #
1907
+ # # Call the restore_database method.
1908
+ # result = client.restore_database request
1909
+ #
1910
+ # # The returned object is of type Gapic::Operation. You can use it to
1911
+ # # check the status of an operation, cancel it, or wait for results.
1912
+ # # Here is how to wait for a response.
1913
+ # result.wait_until_done! timeout: 60
1914
+ # if result.response?
1915
+ # p result.response
1916
+ # else
1917
+ # puts "No response received."
1918
+ # end
1919
+ #
1579
1920
  def restore_database request, options = nil
1580
1921
  raise ::ArgumentError, "request must be provided" if request.nil?
1581
1922
 
@@ -1698,6 +2039,26 @@ module Google
1698
2039
  # @return [::Gapic::Operation]
1699
2040
  #
1700
2041
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2042
+ #
2043
+ # @example Basic example
2044
+ # require "google/cloud/spanner/admin/database/v1"
2045
+ #
2046
+ # # Create a client object. The client can be reused for multiple calls.
2047
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
2048
+ #
2049
+ # # Create a request. To set request fields, pass in keyword arguments.
2050
+ # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new
2051
+ #
2052
+ # # Call the list_database_operations method.
2053
+ # result = client.list_database_operations request
2054
+ #
2055
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2056
+ # # over elements, and API calls will be issued to fetch pages as needed.
2057
+ # result.each do |item|
2058
+ # # Each element is of type ::Google::Longrunning::Operation.
2059
+ # p item
2060
+ # end
2061
+ #
1701
2062
  def list_database_operations request, options = nil
1702
2063
  raise ::ArgumentError, "request must be provided" if request.nil?
1703
2064
 
@@ -1846,6 +2207,26 @@ module Google
1846
2207
  # @return [::Gapic::Operation]
1847
2208
  #
1848
2209
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2210
+ #
2211
+ # @example Basic example
2212
+ # require "google/cloud/spanner/admin/database/v1"
2213
+ #
2214
+ # # Create a client object. The client can be reused for multiple calls.
2215
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
2216
+ #
2217
+ # # Create a request. To set request fields, pass in keyword arguments.
2218
+ # request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new
2219
+ #
2220
+ # # Call the list_backup_operations method.
2221
+ # result = client.list_backup_operations request
2222
+ #
2223
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2224
+ # # over elements, and API calls will be issued to fetch pages as needed.
2225
+ # result.each do |item|
2226
+ # # Each element is of type ::Google::Longrunning::Operation.
2227
+ # p item
2228
+ # end
2229
+ #
1849
2230
  def list_backup_operations request, options = nil
1850
2231
  raise ::ArgumentError, "request must be provided" if request.nil?
1851
2232
 
@@ -1918,6 +2299,26 @@ module Google
1918
2299
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>]
1919
2300
  #
1920
2301
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
2302
+ #
2303
+ # @example Basic example
2304
+ # require "google/cloud/spanner/admin/database/v1"
2305
+ #
2306
+ # # Create a client object. The client can be reused for multiple calls.
2307
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
2308
+ #
2309
+ # # Create a request. To set request fields, pass in keyword arguments.
2310
+ # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.new
2311
+ #
2312
+ # # Call the list_database_roles method.
2313
+ # result = client.list_database_roles request
2314
+ #
2315
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2316
+ # # over elements, and API calls will be issued to fetch pages as needed.
2317
+ # result.each do |item|
2318
+ # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole.
2319
+ # p item
2320
+ # end
2321
+ #
1921
2322
  def list_database_roles request, options = nil
1922
2323
  raise ::ArgumentError, "request must be provided" if request.nil?
1923
2324
 
@@ -1984,9 +2385,9 @@ module Google
1984
2385
  # end
1985
2386
  #
1986
2387
  # @!attribute [rw] endpoint
1987
- # The hostname or hostname:port of the service endpoint.
1988
- # Defaults to `"spanner.googleapis.com"`.
1989
- # @return [::String]
2388
+ # A custom service endpoint, as a hostname or hostname:port. The default is
2389
+ # nil, indicating to use the default endpoint in the current universe domain.
2390
+ # @return [::String,nil]
1990
2391
  # @!attribute [rw] credentials
1991
2392
  # Credentials to send with calls. You may provide any of the following types:
1992
2393
  # * (`String`) The path to a service account key file in JSON format
@@ -2023,13 +2424,20 @@ module Google
2023
2424
  # @!attribute [rw] quota_project
2024
2425
  # A separate project against which to charge quota.
2025
2426
  # @return [::String]
2427
+ # @!attribute [rw] universe_domain
2428
+ # The universe domain within which to make requests. This determines the
2429
+ # default endpoint URL. The default value of nil uses the environment
2430
+ # universe (usually the default "googleapis.com" universe).
2431
+ # @return [::String,nil]
2026
2432
  #
2027
2433
  class Configuration
2028
2434
  extend ::Gapic::Config
2029
2435
 
2436
+ # @private
2437
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
2030
2438
  DEFAULT_ENDPOINT = "spanner.googleapis.com"
2031
2439
 
2032
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
2440
+ config_attr :endpoint, nil, ::String, nil
2033
2441
  config_attr :credentials, nil do |value|
2034
2442
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2035
2443
  allowed.any? { |klass| klass === value }
@@ -2041,6 +2449,7 @@ module Google
2041
2449
  config_attr :metadata, nil, ::Hash, nil
2042
2450
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2043
2451
  config_attr :quota_project, nil, ::String, nil
2452
+ config_attr :universe_domain, nil, ::String, nil
2044
2453
 
2045
2454
  # @private
2046
2455
  def initialize parent_config = nil