google-cloud-notebooks-v1 0.6.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,6 +34,9 @@ module Google
34
34
  # API v1 service for Managed Notebooks.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "notebooks.$UNIVERSE_DOMAIN$"
39
+
37
40
  include Paths
38
41
 
39
42
  # @private
@@ -119,6 +122,15 @@ module Google
119
122
  @config
120
123
  end
121
124
 
125
+ ##
126
+ # The effective universe domain
127
+ #
128
+ # @return [String]
129
+ #
130
+ def universe_domain
131
+ @managed_notebook_service_stub.universe_domain
132
+ end
133
+
122
134
  ##
123
135
  # Create a new ManagedNotebookService REST client object.
124
136
  #
@@ -146,8 +158,9 @@ module Google
146
158
  credentials = @config.credentials
147
159
  # Use self-signed JWT if the endpoint is unchanged from default,
148
160
  # but only if the default endpoint does not have a region prefix.
149
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
150
- !@config.endpoint.split(".").first.include?("-")
161
+ enable_self_signed_jwt = @config.endpoint.nil? ||
162
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
163
+ !@config.endpoint.split(".").first.include?("-"))
151
164
  credentials ||= Credentials.default scope: @config.scope,
152
165
  enable_self_signed_jwt: enable_self_signed_jwt
153
166
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -161,12 +174,14 @@ module Google
161
174
  config.credentials = credentials
162
175
  config.quota_project = @quota_project_id
163
176
  config.endpoint = @config.endpoint
177
+ config.universe_domain = @config.universe_domain
164
178
  end
165
179
 
166
180
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
167
181
  config.credentials = credentials
168
182
  config.quota_project = @quota_project_id
169
183
  config.endpoint = @config.endpoint
184
+ config.universe_domain = @config.universe_domain
170
185
  config.bindings_override = @config.bindings_override
171
186
  end
172
187
 
@@ -174,10 +189,16 @@ module Google
174
189
  config.credentials = credentials
175
190
  config.quota_project = @quota_project_id
176
191
  config.endpoint = @config.endpoint
192
+ config.universe_domain = @config.universe_domain
177
193
  config.bindings_override = @config.bindings_override
178
194
  end
179
195
 
180
- @managed_notebook_service_stub = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
196
+ @managed_notebook_service_stub = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::ServiceStub.new(
197
+ endpoint: @config.endpoint,
198
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
199
+ universe_domain: @config.universe_domain,
200
+ credentials: credentials
201
+ )
181
202
  end
182
203
 
183
204
  ##
@@ -236,6 +257,26 @@ module Google
236
257
  # @return [::Google::Cloud::Notebooks::V1::ListRuntimesResponse]
237
258
  #
238
259
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
260
+ #
261
+ # @example Basic example
262
+ # require "google/cloud/notebooks/v1"
263
+ #
264
+ # # Create a client object. The client can be reused for multiple calls.
265
+ # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new
266
+ #
267
+ # # Create a request. To set request fields, pass in keyword arguments.
268
+ # request = Google::Cloud::Notebooks::V1::ListRuntimesRequest.new
269
+ #
270
+ # # Call the list_runtimes method.
271
+ # result = client.list_runtimes request
272
+ #
273
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
274
+ # # over elements, and API calls will be issued to fetch pages as needed.
275
+ # result.each do |item|
276
+ # # Each element is of type ::Google::Cloud::Notebooks::V1::Runtime.
277
+ # p item
278
+ # end
279
+ #
239
280
  def list_runtimes request, options = nil
240
281
  raise ::ArgumentError, "request must be provided" if request.nil?
241
282
 
@@ -300,6 +341,22 @@ module Google
300
341
  # @return [::Google::Cloud::Notebooks::V1::Runtime]
301
342
  #
302
343
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
344
+ #
345
+ # @example Basic example
346
+ # require "google/cloud/notebooks/v1"
347
+ #
348
+ # # Create a client object. The client can be reused for multiple calls.
349
+ # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new
350
+ #
351
+ # # Create a request. To set request fields, pass in keyword arguments.
352
+ # request = Google::Cloud::Notebooks::V1::GetRuntimeRequest.new
353
+ #
354
+ # # Call the get_runtime method.
355
+ # result = client.get_runtime request
356
+ #
357
+ # # The returned object is of type Google::Cloud::Notebooks::V1::Runtime.
358
+ # p result
359
+ #
303
360
  def get_runtime request, options = nil
304
361
  raise ::ArgumentError, "request must be provided" if request.nil?
305
362
 
@@ -369,6 +426,29 @@ module Google
369
426
  # @return [::Gapic::Operation]
370
427
  #
371
428
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
429
+ #
430
+ # @example Basic example
431
+ # require "google/cloud/notebooks/v1"
432
+ #
433
+ # # Create a client object. The client can be reused for multiple calls.
434
+ # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new
435
+ #
436
+ # # Create a request. To set request fields, pass in keyword arguments.
437
+ # request = Google::Cloud::Notebooks::V1::CreateRuntimeRequest.new
438
+ #
439
+ # # Call the create_runtime method.
440
+ # result = client.create_runtime request
441
+ #
442
+ # # The returned object is of type Gapic::Operation. You can use it to
443
+ # # check the status of an operation, cancel it, or wait for results.
444
+ # # Here is how to wait for a response.
445
+ # result.wait_until_done! timeout: 60
446
+ # if result.response?
447
+ # p result.response
448
+ # else
449
+ # puts "No response received."
450
+ # end
451
+ #
372
452
  def create_runtime request, options = nil
373
453
  raise ::ArgumentError, "request must be provided" if request.nil?
374
454
 
@@ -458,6 +538,29 @@ module Google
458
538
  # @return [::Gapic::Operation]
459
539
  #
460
540
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
541
+ #
542
+ # @example Basic example
543
+ # require "google/cloud/notebooks/v1"
544
+ #
545
+ # # Create a client object. The client can be reused for multiple calls.
546
+ # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new
547
+ #
548
+ # # Create a request. To set request fields, pass in keyword arguments.
549
+ # request = Google::Cloud::Notebooks::V1::UpdateRuntimeRequest.new
550
+ #
551
+ # # Call the update_runtime method.
552
+ # result = client.update_runtime request
553
+ #
554
+ # # The returned object is of type Gapic::Operation. You can use it to
555
+ # # check the status of an operation, cancel it, or wait for results.
556
+ # # Here is how to wait for a response.
557
+ # result.wait_until_done! timeout: 60
558
+ # if result.response?
559
+ # p result.response
560
+ # else
561
+ # puts "No response received."
562
+ # end
563
+ #
461
564
  def update_runtime request, options = nil
462
565
  raise ::ArgumentError, "request must be provided" if request.nil?
463
566
 
@@ -524,6 +627,29 @@ module Google
524
627
  # @return [::Gapic::Operation]
525
628
  #
526
629
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
630
+ #
631
+ # @example Basic example
632
+ # require "google/cloud/notebooks/v1"
633
+ #
634
+ # # Create a client object. The client can be reused for multiple calls.
635
+ # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new
636
+ #
637
+ # # Create a request. To set request fields, pass in keyword arguments.
638
+ # request = Google::Cloud::Notebooks::V1::DeleteRuntimeRequest.new
639
+ #
640
+ # # Call the delete_runtime method.
641
+ # result = client.delete_runtime request
642
+ #
643
+ # # The returned object is of type Gapic::Operation. You can use it to
644
+ # # check the status of an operation, cancel it, or wait for results.
645
+ # # Here is how to wait for a response.
646
+ # result.wait_until_done! timeout: 60
647
+ # if result.response?
648
+ # p result.response
649
+ # else
650
+ # puts "No response received."
651
+ # end
652
+ #
527
653
  def delete_runtime request, options = nil
528
654
  raise ::ArgumentError, "request must be provided" if request.nil?
529
655
 
@@ -594,6 +720,29 @@ module Google
594
720
  # @return [::Gapic::Operation]
595
721
  #
596
722
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
723
+ #
724
+ # @example Basic example
725
+ # require "google/cloud/notebooks/v1"
726
+ #
727
+ # # Create a client object. The client can be reused for multiple calls.
728
+ # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new
729
+ #
730
+ # # Create a request. To set request fields, pass in keyword arguments.
731
+ # request = Google::Cloud::Notebooks::V1::StartRuntimeRequest.new
732
+ #
733
+ # # Call the start_runtime method.
734
+ # result = client.start_runtime request
735
+ #
736
+ # # The returned object is of type Gapic::Operation. You can use it to
737
+ # # check the status of an operation, cancel it, or wait for results.
738
+ # # Here is how to wait for a response.
739
+ # result.wait_until_done! timeout: 60
740
+ # if result.response?
741
+ # p result.response
742
+ # else
743
+ # puts "No response received."
744
+ # end
745
+ #
597
746
  def start_runtime request, options = nil
598
747
  raise ::ArgumentError, "request must be provided" if request.nil?
599
748
 
@@ -664,6 +813,29 @@ module Google
664
813
  # @return [::Gapic::Operation]
665
814
  #
666
815
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
816
+ #
817
+ # @example Basic example
818
+ # require "google/cloud/notebooks/v1"
819
+ #
820
+ # # Create a client object. The client can be reused for multiple calls.
821
+ # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new
822
+ #
823
+ # # Create a request. To set request fields, pass in keyword arguments.
824
+ # request = Google::Cloud::Notebooks::V1::StopRuntimeRequest.new
825
+ #
826
+ # # Call the stop_runtime method.
827
+ # result = client.stop_runtime request
828
+ #
829
+ # # The returned object is of type Gapic::Operation. You can use it to
830
+ # # check the status of an operation, cancel it, or wait for results.
831
+ # # Here is how to wait for a response.
832
+ # result.wait_until_done! timeout: 60
833
+ # if result.response?
834
+ # p result.response
835
+ # else
836
+ # puts "No response received."
837
+ # end
838
+ #
667
839
  def stop_runtime request, options = nil
668
840
  raise ::ArgumentError, "request must be provided" if request.nil?
669
841
 
@@ -734,6 +906,29 @@ module Google
734
906
  # @return [::Gapic::Operation]
735
907
  #
736
908
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
909
+ #
910
+ # @example Basic example
911
+ # require "google/cloud/notebooks/v1"
912
+ #
913
+ # # Create a client object. The client can be reused for multiple calls.
914
+ # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new
915
+ #
916
+ # # Create a request. To set request fields, pass in keyword arguments.
917
+ # request = Google::Cloud::Notebooks::V1::SwitchRuntimeRequest.new
918
+ #
919
+ # # Call the switch_runtime method.
920
+ # result = client.switch_runtime request
921
+ #
922
+ # # The returned object is of type Gapic::Operation. You can use it to
923
+ # # check the status of an operation, cancel it, or wait for results.
924
+ # # Here is how to wait for a response.
925
+ # result.wait_until_done! timeout: 60
926
+ # if result.response?
927
+ # p result.response
928
+ # else
929
+ # puts "No response received."
930
+ # end
931
+ #
737
932
  def switch_runtime request, options = nil
738
933
  raise ::ArgumentError, "request must be provided" if request.nil?
739
934
 
@@ -800,6 +995,29 @@ module Google
800
995
  # @return [::Gapic::Operation]
801
996
  #
802
997
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
998
+ #
999
+ # @example Basic example
1000
+ # require "google/cloud/notebooks/v1"
1001
+ #
1002
+ # # Create a client object. The client can be reused for multiple calls.
1003
+ # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new
1004
+ #
1005
+ # # Create a request. To set request fields, pass in keyword arguments.
1006
+ # request = Google::Cloud::Notebooks::V1::ResetRuntimeRequest.new
1007
+ #
1008
+ # # Call the reset_runtime method.
1009
+ # result = client.reset_runtime request
1010
+ #
1011
+ # # The returned object is of type Gapic::Operation. You can use it to
1012
+ # # check the status of an operation, cancel it, or wait for results.
1013
+ # # Here is how to wait for a response.
1014
+ # result.wait_until_done! timeout: 60
1015
+ # if result.response?
1016
+ # p result.response
1017
+ # else
1018
+ # puts "No response received."
1019
+ # end
1020
+ #
803
1021
  def reset_runtime request, options = nil
804
1022
  raise ::ArgumentError, "request must be provided" if request.nil?
805
1023
 
@@ -866,6 +1084,29 @@ module Google
866
1084
  # @return [::Gapic::Operation]
867
1085
  #
868
1086
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1087
+ #
1088
+ # @example Basic example
1089
+ # require "google/cloud/notebooks/v1"
1090
+ #
1091
+ # # Create a client object. The client can be reused for multiple calls.
1092
+ # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new
1093
+ #
1094
+ # # Create a request. To set request fields, pass in keyword arguments.
1095
+ # request = Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest.new
1096
+ #
1097
+ # # Call the upgrade_runtime method.
1098
+ # result = client.upgrade_runtime request
1099
+ #
1100
+ # # The returned object is of type Gapic::Operation. You can use it to
1101
+ # # check the status of an operation, cancel it, or wait for results.
1102
+ # # Here is how to wait for a response.
1103
+ # result.wait_until_done! timeout: 60
1104
+ # if result.response?
1105
+ # p result.response
1106
+ # else
1107
+ # puts "No response received."
1108
+ # end
1109
+ #
869
1110
  def upgrade_runtime request, options = nil
870
1111
  raise ::ArgumentError, "request must be provided" if request.nil?
871
1112
 
@@ -935,6 +1176,29 @@ module Google
935
1176
  # @return [::Gapic::Operation]
936
1177
  #
937
1178
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1179
+ #
1180
+ # @example Basic example
1181
+ # require "google/cloud/notebooks/v1"
1182
+ #
1183
+ # # Create a client object. The client can be reused for multiple calls.
1184
+ # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new
1185
+ #
1186
+ # # Create a request. To set request fields, pass in keyword arguments.
1187
+ # request = Google::Cloud::Notebooks::V1::ReportRuntimeEventRequest.new
1188
+ #
1189
+ # # Call the report_runtime_event method.
1190
+ # result = client.report_runtime_event request
1191
+ #
1192
+ # # The returned object is of type Gapic::Operation. You can use it to
1193
+ # # check the status of an operation, cancel it, or wait for results.
1194
+ # # Here is how to wait for a response.
1195
+ # result.wait_until_done! timeout: 60
1196
+ # if result.response?
1197
+ # p result.response
1198
+ # else
1199
+ # puts "No response received."
1200
+ # end
1201
+ #
938
1202
  def report_runtime_event request, options = nil
939
1203
  raise ::ArgumentError, "request must be provided" if request.nil?
940
1204
 
@@ -1003,6 +1267,22 @@ module Google
1003
1267
  # @return [::Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalResponse]
1004
1268
  #
1005
1269
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1270
+ #
1271
+ # @example Basic example
1272
+ # require "google/cloud/notebooks/v1"
1273
+ #
1274
+ # # Create a client object. The client can be reused for multiple calls.
1275
+ # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new
1276
+ #
1277
+ # # Create a request. To set request fields, pass in keyword arguments.
1278
+ # request = Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalRequest.new
1279
+ #
1280
+ # # Call the refresh_runtime_token_internal method.
1281
+ # result = client.refresh_runtime_token_internal request
1282
+ #
1283
+ # # The returned object is of type Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalResponse.
1284
+ # p result
1285
+ #
1006
1286
  def refresh_runtime_token_internal request, options = nil
1007
1287
  raise ::ArgumentError, "request must be provided" if request.nil?
1008
1288
 
@@ -1068,6 +1348,29 @@ module Google
1068
1348
  # @return [::Gapic::Operation]
1069
1349
  #
1070
1350
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1351
+ #
1352
+ # @example Basic example
1353
+ # require "google/cloud/notebooks/v1"
1354
+ #
1355
+ # # Create a client object. The client can be reused for multiple calls.
1356
+ # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new
1357
+ #
1358
+ # # Create a request. To set request fields, pass in keyword arguments.
1359
+ # request = Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest.new
1360
+ #
1361
+ # # Call the diagnose_runtime method.
1362
+ # result = client.diagnose_runtime request
1363
+ #
1364
+ # # The returned object is of type Gapic::Operation. You can use it to
1365
+ # # check the status of an operation, cancel it, or wait for results.
1366
+ # # Here is how to wait for a response.
1367
+ # result.wait_until_done! timeout: 60
1368
+ # if result.response?
1369
+ # p result.response
1370
+ # else
1371
+ # puts "No response received."
1372
+ # end
1373
+ #
1071
1374
  def diagnose_runtime request, options = nil
1072
1375
  raise ::ArgumentError, "request must be provided" if request.nil?
1073
1376
 
@@ -1134,9 +1437,9 @@ module Google
1134
1437
  # end
1135
1438
  #
1136
1439
  # @!attribute [rw] endpoint
1137
- # The hostname or hostname:port of the service endpoint.
1138
- # Defaults to `"notebooks.googleapis.com"`.
1139
- # @return [::String]
1440
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1441
+ # nil, indicating to use the default endpoint in the current universe domain.
1442
+ # @return [::String,nil]
1140
1443
  # @!attribute [rw] credentials
1141
1444
  # Credentials to send with calls. You may provide any of the following types:
1142
1445
  # * (`String`) The path to a service account key file in JSON format
@@ -1173,13 +1476,20 @@ module Google
1173
1476
  # @!attribute [rw] quota_project
1174
1477
  # A separate project against which to charge quota.
1175
1478
  # @return [::String]
1479
+ # @!attribute [rw] universe_domain
1480
+ # The universe domain within which to make requests. This determines the
1481
+ # default endpoint URL. The default value of nil uses the environment
1482
+ # universe (usually the default "googleapis.com" universe).
1483
+ # @return [::String,nil]
1176
1484
  #
1177
1485
  class Configuration
1178
1486
  extend ::Gapic::Config
1179
1487
 
1488
+ # @private
1489
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1180
1490
  DEFAULT_ENDPOINT = "notebooks.googleapis.com"
1181
1491
 
1182
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1492
+ config_attr :endpoint, nil, ::String, nil
1183
1493
  config_attr :credentials, nil do |value|
1184
1494
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1185
1495
  allowed.any? { |klass| klass === value }
@@ -1191,6 +1501,7 @@ module Google
1191
1501
  config_attr :metadata, nil, ::Hash, nil
1192
1502
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1193
1503
  config_attr :quota_project, nil, ::String, nil
1504
+ config_attr :universe_domain, nil, ::String, nil
1194
1505
 
1195
1506
  # @private
1196
1507
  # Overrides for http bindings for the RPCs of this service
@@ -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 = "notebooks.$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 `"notebooks.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 = "notebooks.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
  ##