google-cloud-resource_manager-v3 0.6.2 → 0.8.0

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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/lib/google/cloud/resource_manager/v3/folders/client.rb +42 -9
  4. data/lib/google/cloud/resource_manager/v3/folders/operations.rb +38 -7
  5. data/lib/google/cloud/resource_manager/v3/folders/rest/client.rb +253 -7
  6. data/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb +108 -8
  7. data/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb +14 -2
  8. data/lib/google/cloud/resource_manager/v3/organizations/client.rb +41 -9
  9. data/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb +117 -7
  10. data/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb +14 -2
  11. data/lib/google/cloud/resource_manager/v3/projects/client.rb +42 -9
  12. data/lib/google/cloud/resource_manager/v3/projects/operations.rb +38 -7
  13. data/lib/google/cloud/resource_manager/v3/projects/rest/client.rb +253 -7
  14. data/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb +108 -8
  15. data/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb +14 -2
  16. data/lib/google/cloud/resource_manager/v3/tag_bindings/client.rb +42 -9
  17. data/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb +38 -7
  18. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb +120 -7
  19. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb +108 -8
  20. data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb +14 -2
  21. data/lib/google/cloud/resource_manager/v3/tag_holds/client.rb +42 -9
  22. data/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb +38 -7
  23. data/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb +100 -7
  24. data/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb +108 -8
  25. data/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb +14 -2
  26. data/lib/google/cloud/resource_manager/v3/tag_keys/client.rb +42 -9
  27. data/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb +38 -7
  28. data/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb +203 -7
  29. data/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb +108 -8
  30. data/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb +14 -2
  31. data/lib/google/cloud/resource_manager/v3/tag_values/client.rb +42 -9
  32. data/lib/google/cloud/resource_manager/v3/tag_values/operations.rb +38 -7
  33. data/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb +203 -7
  34. data/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb +108 -8
  35. data/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb +14 -2
  36. data/lib/google/cloud/resource_manager/v3/version.rb +1 -1
  37. data/proto_docs/google/api/client.rb +14 -0
  38. data/proto_docs/google/api/field_behavior.rb +14 -0
  39. metadata +5 -5
@@ -34,6 +34,9 @@ module Google
34
34
  # organization and to control the policies applied to groups of resources.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$"
39
+
37
40
  include Paths
38
41
 
39
42
  # @private
@@ -123,6 +126,15 @@ module Google
123
126
  @config
124
127
  end
125
128
 
129
+ ##
130
+ # The effective universe domain
131
+ #
132
+ # @return [String]
133
+ #
134
+ def universe_domain
135
+ @folders_stub.universe_domain
136
+ end
137
+
126
138
  ##
127
139
  # Create a new Folders REST client object.
128
140
  #
@@ -150,8 +162,9 @@ module Google
150
162
  credentials = @config.credentials
151
163
  # Use self-signed JWT if the endpoint is unchanged from default,
152
164
  # but only if the default endpoint does not have a region prefix.
153
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
154
- !@config.endpoint.split(".").first.include?("-")
165
+ enable_self_signed_jwt = @config.endpoint.nil? ||
166
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
167
+ !@config.endpoint.split(".").first.include?("-"))
155
168
  credentials ||= Credentials.default scope: @config.scope,
156
169
  enable_self_signed_jwt: enable_self_signed_jwt
157
170
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -165,9 +178,15 @@ module Google
165
178
  config.credentials = credentials
166
179
  config.quota_project = @quota_project_id
167
180
  config.endpoint = @config.endpoint
181
+ config.universe_domain = @config.universe_domain
168
182
  end
169
183
 
170
- @folders_stub = ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
184
+ @folders_stub = ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.new(
185
+ endpoint: @config.endpoint,
186
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
187
+ universe_domain: @config.universe_domain,
188
+ credentials: credentials
189
+ )
171
190
  end
172
191
 
173
192
  ##
@@ -211,6 +230,22 @@ module Google
211
230
  # @return [::Google::Cloud::ResourceManager::V3::Folder]
212
231
  #
213
232
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
233
+ #
234
+ # @example Basic example
235
+ # require "google/cloud/resource_manager/v3"
236
+ #
237
+ # # Create a client object. The client can be reused for multiple calls.
238
+ # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new
239
+ #
240
+ # # Create a request. To set request fields, pass in keyword arguments.
241
+ # request = Google::Cloud::ResourceManager::V3::GetFolderRequest.new
242
+ #
243
+ # # Call the get_folder method.
244
+ # result = client.get_folder request
245
+ #
246
+ # # The returned object is of type Google::Cloud::ResourceManager::V3::Folder.
247
+ # p result
248
+ #
214
249
  def get_folder request, options = nil
215
250
  raise ::ArgumentError, "request must be provided" if request.nil?
216
251
 
@@ -298,6 +333,26 @@ module Google
298
333
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>]
299
334
  #
300
335
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
336
+ #
337
+ # @example Basic example
338
+ # require "google/cloud/resource_manager/v3"
339
+ #
340
+ # # Create a client object. The client can be reused for multiple calls.
341
+ # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new
342
+ #
343
+ # # Create a request. To set request fields, pass in keyword arguments.
344
+ # request = Google::Cloud::ResourceManager::V3::ListFoldersRequest.new
345
+ #
346
+ # # Call the list_folders method.
347
+ # result = client.list_folders request
348
+ #
349
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
350
+ # # over elements, and API calls will be issued to fetch pages as needed.
351
+ # result.each do |item|
352
+ # # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder.
353
+ # p item
354
+ # end
355
+ #
301
356
  def list_folders request, options = nil
302
357
  raise ::ArgumentError, "request must be provided" if request.nil?
303
358
 
@@ -403,6 +458,26 @@ module Google
403
458
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>]
404
459
  #
405
460
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
461
+ #
462
+ # @example Basic example
463
+ # require "google/cloud/resource_manager/v3"
464
+ #
465
+ # # Create a client object. The client can be reused for multiple calls.
466
+ # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new
467
+ #
468
+ # # Create a request. To set request fields, pass in keyword arguments.
469
+ # request = Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new
470
+ #
471
+ # # Call the search_folders method.
472
+ # result = client.search_folders request
473
+ #
474
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
475
+ # # over elements, and API calls will be issued to fetch pages as needed.
476
+ # result.each do |item|
477
+ # # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder.
478
+ # p item
479
+ # end
480
+ #
406
481
  def search_folders request, options = nil
407
482
  raise ::ArgumentError, "request must be provided" if request.nil?
408
483
 
@@ -493,6 +568,29 @@ module Google
493
568
  # @return [::Gapic::Operation]
494
569
  #
495
570
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
571
+ #
572
+ # @example Basic example
573
+ # require "google/cloud/resource_manager/v3"
574
+ #
575
+ # # Create a client object. The client can be reused for multiple calls.
576
+ # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new
577
+ #
578
+ # # Create a request. To set request fields, pass in keyword arguments.
579
+ # request = Google::Cloud::ResourceManager::V3::CreateFolderRequest.new
580
+ #
581
+ # # Call the create_folder method.
582
+ # result = client.create_folder request
583
+ #
584
+ # # The returned object is of type Gapic::Operation. You can use it to
585
+ # # check the status of an operation, cancel it, or wait for results.
586
+ # # Here is how to wait for a response.
587
+ # result.wait_until_done! timeout: 60
588
+ # if result.response?
589
+ # p result.response
590
+ # else
591
+ # puts "No response received."
592
+ # end
593
+ #
496
594
  def create_folder request, options = nil
497
595
  raise ::ArgumentError, "request must be provided" if request.nil?
498
596
 
@@ -576,6 +674,29 @@ module Google
576
674
  # @return [::Gapic::Operation]
577
675
  #
578
676
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
677
+ #
678
+ # @example Basic example
679
+ # require "google/cloud/resource_manager/v3"
680
+ #
681
+ # # Create a client object. The client can be reused for multiple calls.
682
+ # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new
683
+ #
684
+ # # Create a request. To set request fields, pass in keyword arguments.
685
+ # request = Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new
686
+ #
687
+ # # Call the update_folder method.
688
+ # result = client.update_folder request
689
+ #
690
+ # # The returned object is of type Gapic::Operation. You can use it to
691
+ # # check the status of an operation, cancel it, or wait for results.
692
+ # # Here is how to wait for a response.
693
+ # result.wait_until_done! timeout: 60
694
+ # if result.response?
695
+ # p result.response
696
+ # else
697
+ # puts "No response received."
698
+ # end
699
+ #
579
700
  def update_folder request, options = nil
580
701
  raise ::ArgumentError, "request must be provided" if request.nil?
581
702
 
@@ -660,6 +781,29 @@ module Google
660
781
  # @return [::Gapic::Operation]
661
782
  #
662
783
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
784
+ #
785
+ # @example Basic example
786
+ # require "google/cloud/resource_manager/v3"
787
+ #
788
+ # # Create a client object. The client can be reused for multiple calls.
789
+ # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new
790
+ #
791
+ # # Create a request. To set request fields, pass in keyword arguments.
792
+ # request = Google::Cloud::ResourceManager::V3::MoveFolderRequest.new
793
+ #
794
+ # # Call the move_folder method.
795
+ # result = client.move_folder request
796
+ #
797
+ # # The returned object is of type Gapic::Operation. You can use it to
798
+ # # check the status of an operation, cancel it, or wait for results.
799
+ # # Here is how to wait for a response.
800
+ # result.wait_until_done! timeout: 60
801
+ # if result.response?
802
+ # p result.response
803
+ # else
804
+ # puts "No response received."
805
+ # end
806
+ #
663
807
  def move_folder request, options = nil
664
808
  raise ::ArgumentError, "request must be provided" if request.nil?
665
809
 
@@ -734,6 +878,29 @@ module Google
734
878
  # @return [::Gapic::Operation]
735
879
  #
736
880
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
881
+ #
882
+ # @example Basic example
883
+ # require "google/cloud/resource_manager/v3"
884
+ #
885
+ # # Create a client object. The client can be reused for multiple calls.
886
+ # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new
887
+ #
888
+ # # Create a request. To set request fields, pass in keyword arguments.
889
+ # request = Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new
890
+ #
891
+ # # Call the delete_folder method.
892
+ # result = client.delete_folder request
893
+ #
894
+ # # The returned object is of type Gapic::Operation. You can use it to
895
+ # # check the status of an operation, cancel it, or wait for results.
896
+ # # Here is how to wait for a response.
897
+ # result.wait_until_done! timeout: 60
898
+ # if result.response?
899
+ # p result.response
900
+ # else
901
+ # puts "No response received."
902
+ # end
903
+ #
737
904
  def delete_folder request, options = nil
738
905
  raise ::ArgumentError, "request must be provided" if request.nil?
739
906
 
@@ -808,6 +975,29 @@ module Google
808
975
  # @return [::Gapic::Operation]
809
976
  #
810
977
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
978
+ #
979
+ # @example Basic example
980
+ # require "google/cloud/resource_manager/v3"
981
+ #
982
+ # # Create a client object. The client can be reused for multiple calls.
983
+ # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new
984
+ #
985
+ # # Create a request. To set request fields, pass in keyword arguments.
986
+ # request = Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new
987
+ #
988
+ # # Call the undelete_folder method.
989
+ # result = client.undelete_folder request
990
+ #
991
+ # # The returned object is of type Gapic::Operation. You can use it to
992
+ # # check the status of an operation, cancel it, or wait for results.
993
+ # # Here is how to wait for a response.
994
+ # result.wait_until_done! timeout: 60
995
+ # if result.response?
996
+ # p result.response
997
+ # else
998
+ # puts "No response received."
999
+ # end
1000
+ #
811
1001
  def undelete_folder request, options = nil
812
1002
  raise ::ArgumentError, "request must be provided" if request.nil?
813
1003
 
@@ -879,6 +1069,22 @@ module Google
879
1069
  # @return [::Google::Iam::V1::Policy]
880
1070
  #
881
1071
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1072
+ #
1073
+ # @example Basic example
1074
+ # require "google/cloud/resource_manager/v3"
1075
+ #
1076
+ # # Create a client object. The client can be reused for multiple calls.
1077
+ # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new
1078
+ #
1079
+ # # Create a request. To set request fields, pass in keyword arguments.
1080
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1081
+ #
1082
+ # # Call the get_iam_policy method.
1083
+ # result = client.get_iam_policy request
1084
+ #
1085
+ # # The returned object is of type Google::Iam::V1::Policy.
1086
+ # p result
1087
+ #
882
1088
  def get_iam_policy request, options = nil
883
1089
  raise ::ArgumentError, "request must be provided" if request.nil?
884
1090
 
@@ -957,6 +1163,22 @@ module Google
957
1163
  # @return [::Google::Iam::V1::Policy]
958
1164
  #
959
1165
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1166
+ #
1167
+ # @example Basic example
1168
+ # require "google/cloud/resource_manager/v3"
1169
+ #
1170
+ # # Create a client object. The client can be reused for multiple calls.
1171
+ # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new
1172
+ #
1173
+ # # Create a request. To set request fields, pass in keyword arguments.
1174
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
1175
+ #
1176
+ # # Call the set_iam_policy method.
1177
+ # result = client.set_iam_policy request
1178
+ #
1179
+ # # The returned object is of type Google::Iam::V1::Policy.
1180
+ # p result
1181
+ #
960
1182
  def set_iam_policy request, options = nil
961
1183
  raise ::ArgumentError, "request must be provided" if request.nil?
962
1184
 
@@ -1029,6 +1251,22 @@ module Google
1029
1251
  # @return [::Google::Iam::V1::TestIamPermissionsResponse]
1030
1252
  #
1031
1253
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1254
+ #
1255
+ # @example Basic example
1256
+ # require "google/cloud/resource_manager/v3"
1257
+ #
1258
+ # # Create a client object. The client can be reused for multiple calls.
1259
+ # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new
1260
+ #
1261
+ # # Create a request. To set request fields, pass in keyword arguments.
1262
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
1263
+ #
1264
+ # # Call the test_iam_permissions method.
1265
+ # result = client.test_iam_permissions request
1266
+ #
1267
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
1268
+ # p result
1269
+ #
1032
1270
  def test_iam_permissions request, options = nil
1033
1271
  raise ::ArgumentError, "request must be provided" if request.nil?
1034
1272
 
@@ -1094,9 +1332,9 @@ module Google
1094
1332
  # end
1095
1333
  #
1096
1334
  # @!attribute [rw] endpoint
1097
- # The hostname or hostname:port of the service endpoint.
1098
- # Defaults to `"cloudresourcemanager.googleapis.com"`.
1099
- # @return [::String]
1335
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1336
+ # nil, indicating to use the default endpoint in the current universe domain.
1337
+ # @return [::String,nil]
1100
1338
  # @!attribute [rw] credentials
1101
1339
  # Credentials to send with calls. You may provide any of the following types:
1102
1340
  # * (`String`) The path to a service account key file in JSON format
@@ -1133,13 +1371,20 @@ module Google
1133
1371
  # @!attribute [rw] quota_project
1134
1372
  # A separate project against which to charge quota.
1135
1373
  # @return [::String]
1374
+ # @!attribute [rw] universe_domain
1375
+ # The universe domain within which to make requests. This determines the
1376
+ # default endpoint URL. The default value of nil uses the environment
1377
+ # universe (usually the default "googleapis.com" universe).
1378
+ # @return [::String,nil]
1136
1379
  #
1137
1380
  class Configuration
1138
1381
  extend ::Gapic::Config
1139
1382
 
1383
+ # @private
1384
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1140
1385
  DEFAULT_ENDPOINT = "cloudresourcemanager.googleapis.com"
1141
1386
 
1142
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1387
+ config_attr :endpoint, nil, ::String, nil
1143
1388
  config_attr :credentials, nil do |value|
1144
1389
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1145
1390
  allowed.any? { |klass| klass === value }
@@ -1151,6 +1396,7 @@ module Google
1151
1396
  config_attr :metadata, nil, ::Hash, nil
1152
1397
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1153
1398
  config_attr :quota_project, nil, ::String, nil
1399
+ config_attr :universe_domain, nil, ::String, nil
1154
1400
 
1155
1401
  # @private
1156
1402
  def initialize parent_config = nil
@@ -26,6 +26,9 @@ module Google
26
26
  module Rest
27
27
  # Service that implements Longrunning Operations API.
28
28
  class Operations
29
+ # @private
30
+ DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$"
31
+
29
32
  # @private
30
33
  attr_reader :operations_stub
31
34
 
@@ -60,6 +63,15 @@ module Google
60
63
  @config
61
64
  end
62
65
 
66
+ ##
67
+ # The effective universe domain
68
+ #
69
+ # @return [String]
70
+ #
71
+ def universe_domain
72
+ @operations_stub.universe_domain
73
+ end
74
+
63
75
  ##
64
76
  # Create a new Operations client object.
65
77
  #
@@ -84,8 +96,10 @@ module Google
84
96
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
85
97
 
86
98
  @operations_stub = OperationsServiceStub.new(
87
- endpoint: @config.endpoint,
88
- credentials: credentials
99
+ endpoint: @config.endpoint,
100
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
101
+ universe_domain: @config.universe_domain,
102
+ credentials: credentials
89
103
  )
90
104
 
91
105
  # Used by an LRO wrapper for some methods of this service
@@ -136,6 +150,26 @@ module Google
136
150
  # @return [::Gapic::Operation]
137
151
  #
138
152
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
153
+ #
154
+ # @example Basic example
155
+ # require "google/longrunning"
156
+ #
157
+ # # Create a client object. The client can be reused for multiple calls.
158
+ # client = Google::Longrunning::Operations::Rest::Client.new
159
+ #
160
+ # # Create a request. To set request fields, pass in keyword arguments.
161
+ # request = Google::Longrunning::ListOperationsRequest.new
162
+ #
163
+ # # Call the list_operations method.
164
+ # result = client.list_operations request
165
+ #
166
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
167
+ # # over elements, and API calls will be issued to fetch pages as needed.
168
+ # result.each do |item|
169
+ # # Each element is of type ::Google::Longrunning::Operation.
170
+ # p item
171
+ # end
172
+ #
139
173
  def list_operations request, options = nil
140
174
  raise ::ArgumentError, "request must be provided" if request.nil?
141
175
 
@@ -201,6 +235,29 @@ module Google
201
235
  # @return [::Gapic::Operation]
202
236
  #
203
237
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
238
+ #
239
+ # @example Basic example
240
+ # require "google/longrunning"
241
+ #
242
+ # # Create a client object. The client can be reused for multiple calls.
243
+ # client = Google::Longrunning::Operations::Rest::Client.new
244
+ #
245
+ # # Create a request. To set request fields, pass in keyword arguments.
246
+ # request = Google::Longrunning::GetOperationRequest.new
247
+ #
248
+ # # Call the get_operation method.
249
+ # result = client.get_operation request
250
+ #
251
+ # # The returned object is of type Gapic::Operation. You can use it to
252
+ # # check the status of an operation, cancel it, or wait for results.
253
+ # # Here is how to wait for a response.
254
+ # result.wait_until_done! timeout: 60
255
+ # if result.response?
256
+ # p result.response
257
+ # else
258
+ # puts "No response received."
259
+ # end
260
+ #
204
261
  def get_operation request, options = nil
205
262
  raise ::ArgumentError, "request must be provided" if request.nil?
206
263
 
@@ -267,6 +324,22 @@ module Google
267
324
  # @return [::Google::Protobuf::Empty]
268
325
  #
269
326
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
327
+ #
328
+ # @example Basic example
329
+ # require "google/longrunning"
330
+ #
331
+ # # Create a client object. The client can be reused for multiple calls.
332
+ # client = Google::Longrunning::Operations::Rest::Client.new
333
+ #
334
+ # # Create a request. To set request fields, pass in keyword arguments.
335
+ # request = Google::Longrunning::DeleteOperationRequest.new
336
+ #
337
+ # # Call the delete_operation method.
338
+ # result = client.delete_operation request
339
+ #
340
+ # # The returned object is of type Google::Protobuf::Empty.
341
+ # p result
342
+ #
270
343
  def delete_operation request, options = nil
271
344
  raise ::ArgumentError, "request must be provided" if request.nil?
272
345
 
@@ -338,6 +411,22 @@ module Google
338
411
  # @return [::Google::Protobuf::Empty]
339
412
  #
340
413
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
414
+ #
415
+ # @example Basic example
416
+ # require "google/longrunning"
417
+ #
418
+ # # Create a client object. The client can be reused for multiple calls.
419
+ # client = Google::Longrunning::Operations::Rest::Client.new
420
+ #
421
+ # # Create a request. To set request fields, pass in keyword arguments.
422
+ # request = Google::Longrunning::CancelOperationRequest.new
423
+ #
424
+ # # Call the cancel_operation method.
425
+ # result = client.cancel_operation request
426
+ #
427
+ # # The returned object is of type Google::Protobuf::Empty.
428
+ # p result
429
+ #
341
430
  def cancel_operation request, options = nil
342
431
  raise ::ArgumentError, "request must be provided" if request.nil?
343
432
 
@@ -403,9 +492,9 @@ module Google
403
492
  # end
404
493
  #
405
494
  # @!attribute [rw] endpoint
406
- # The hostname or hostname:port of the service endpoint.
407
- # Defaults to `"cloudresourcemanager.googleapis.com"`.
408
- # @return [::String]
495
+ # A custom service endpoint, as a hostname or hostname:port. The default is
496
+ # nil, indicating to use the default endpoint in the current universe domain.
497
+ # @return [::String,nil]
409
498
  # @!attribute [rw] credentials
410
499
  # Credentials to send with calls. You may provide any of the following types:
411
500
  # * (`String`) The path to a service account key file in JSON format
@@ -442,13 +531,20 @@ module Google
442
531
  # @!attribute [rw] quota_project
443
532
  # A separate project against which to charge quota.
444
533
  # @return [::String]
534
+ # @!attribute [rw] universe_domain
535
+ # The universe domain within which to make requests. This determines the
536
+ # default endpoint URL. The default value of nil uses the environment
537
+ # universe (usually the default "googleapis.com" universe).
538
+ # @return [::String,nil]
445
539
  #
446
540
  class Configuration
447
541
  extend ::Gapic::Config
448
542
 
543
+ # @private
544
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
449
545
  DEFAULT_ENDPOINT = "cloudresourcemanager.googleapis.com"
450
546
 
451
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
547
+ config_attr :endpoint, nil, ::String, nil
452
548
  config_attr :credentials, nil do |value|
453
549
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
454
550
  allowed.any? { |klass| klass === value }
@@ -460,6 +556,7 @@ module Google
460
556
  config_attr :metadata, nil, ::Hash, nil
461
557
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
462
558
  config_attr :quota_project, nil, ::String, nil
559
+ config_attr :universe_domain, nil, ::String, nil
463
560
 
464
561
  # @private
465
562
  def initialize parent_config = nil
@@ -542,12 +639,15 @@ module Google
542
639
  # Service stub contains baseline method implementations
543
640
  # including transcoding, making the REST call, and deserialing the response.
544
641
  class OperationsServiceStub
545
- def initialize endpoint:, credentials:
642
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
546
643
  # These require statements are intentionally placed here to initialize
547
644
  # the REST modules only when it's required.
548
645
  require "gapic/rest"
549
646
 
550
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
647
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
648
+ endpoint_template: endpoint_template,
649
+ universe_domain: universe_domain,
650
+ credentials: credentials
551
651
  end
552
652
 
553
653
  ##
@@ -30,16 +30,28 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: true,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
43
55
  ##
44
56
  # Baseline implementation for the get_folder REST call
45
57
  #