google-cloud-assured_workloads-v1beta1 0.6.2 → 0.8.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcbb171dc99b70144d7e0e25b65d46f414dac37e8a0be1b6430bd4236e7fab9a
4
- data.tar.gz: 440f4e74031f6c392d32299b109b3381488d37ac5024266c25e0837727a8bb46
3
+ metadata.gz: 1e0a780eeabce7bf7b855b58fe63620614d2e3ee9b574a99e86d67dda315b48a
4
+ data.tar.gz: 3b761ae99c0777b309153122e844814ad64816e61f7903f1d8a0ba052474b6bf
5
5
  SHA512:
6
- metadata.gz: 0a3b471544edb798e83272166d4d7f6fb6055c341446a07189dd0cda44a5ef18d4ce528b9a70fabfcaf5a28ab240f6d96c656652076e6e18d63574fac90c27fb
7
- data.tar.gz: 3cf3e9a45fed01d56550f991fba88c1c6b7f95dddee5e64ce565cd6e9b4a139fe9ea735dfb32aa692f8b7a4015c427f61b7d7fd5acaa169a22809a3b450b3dcd
6
+ metadata.gz: 3e63d558c2cc7c51f1d20be20296930e92bbe9a6d5bb5cd4615ef1ea3161eb30b711f69a4fa40e5aa0e649d1aa72e96b9003bed0b5bf1d02ad0cbf24ea527d9f
7
+ data.tar.gz: 2e7df0739af6f15a1417f8f69145c2e131a4e4f3e93822dd37445e794de58b8d648959ed986f01c3454f67e3f2db5e2c4fc43ef888edfe2495ed8baf0eca1eb8
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::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 AssuredWorkloadsService clients:
47
- #
48
- # ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all AssuredWorkloadsService clients
47
+ # ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::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]
@@ -113,19 +112,15 @@ module Google
113
112
  ##
114
113
  # Create a new AssuredWorkloadsService client object.
115
114
  #
116
- # ## Examples
117
- #
118
- # To create a new AssuredWorkloadsService client with the default
119
- # configuration:
120
- #
121
- # client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new
115
+ # @example
122
116
  #
123
- # To create a new AssuredWorkloadsService client with a custom
124
- # configuration:
117
+ # # Create a client using the default configuration
118
+ # client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new
125
119
  #
126
- # client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new do |config|
127
- # config.timeout = 10.0
128
- # end
120
+ # # Create a client using a custom configuration
121
+ # client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new do |config|
122
+ # config.timeout = 10.0
123
+ # end
129
124
  #
130
125
  # @yield [config] Configure the AssuredWorkloadsService client.
131
126
  # @yieldparam config [Client::Configuration]
@@ -145,10 +140,9 @@ module Google
145
140
 
146
141
  # Create credentials
147
142
  credentials = @config.credentials
148
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
143
+ # Use self-signed JWT if the endpoint is unchanged from default,
149
144
  # but only if the default endpoint does not have a region prefix.
150
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
151
- @config.endpoint == Client.configure.endpoint &&
145
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
152
146
  !@config.endpoint.split(".").first.include?("-")
153
147
  credentials ||= Credentials.default scope: @config.scope,
154
148
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -218,6 +212,28 @@ module Google
218
212
  #
219
213
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
220
214
  #
215
+ # @example Basic example
216
+ # require "google/cloud/assured_workloads/v1beta1"
217
+ #
218
+ # # Create a client object. The client can be reused for multiple calls.
219
+ # client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new
220
+ #
221
+ # # Create a request. To set request fields, pass in keyword arguments.
222
+ # request = Google::Cloud::AssuredWorkloads::V1beta1::CreateWorkloadRequest.new
223
+ #
224
+ # # Call the create_workload method.
225
+ # result = client.create_workload request
226
+ #
227
+ # # The returned object is of type Gapic::Operation. You can use this
228
+ # # object to check the status of an operation, cancel it, or wait
229
+ # # for results. Here is how to block until completion:
230
+ # result.wait_until_done! timeout: 60
231
+ # if result.response?
232
+ # p result.response
233
+ # else
234
+ # puts "Error!"
235
+ # end
236
+ #
221
237
  def create_workload request, options = nil
222
238
  raise ::ArgumentError, "request must be provided" if request.nil?
223
239
 
@@ -235,16 +251,20 @@ module Google
235
251
  gapic_version: ::Google::Cloud::AssuredWorkloads::V1beta1::VERSION
236
252
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
237
253
 
238
- header_params = {
239
- "parent" => request.parent
240
- }
254
+ header_params = {}
255
+ if request.parent
256
+ header_params["parent"] = request.parent
257
+ end
258
+
241
259
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
242
260
  metadata[:"x-goog-request-params"] ||= request_params_header
243
261
 
244
262
  options.apply_defaults timeout: @config.rpcs.create_workload.timeout,
245
263
  metadata: metadata,
246
264
  retry_policy: @config.rpcs.create_workload.retry_policy
247
- options.apply_defaults metadata: @config.metadata,
265
+
266
+ options.apply_defaults timeout: @config.timeout,
267
+ metadata: @config.metadata,
248
268
  retry_policy: @config.retry_policy
249
269
 
250
270
  @assured_workloads_service_stub.call_rpc :create_workload, request, options: options do |response, operation|
@@ -293,6 +313,21 @@ module Google
293
313
  #
294
314
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
295
315
  #
316
+ # @example Basic example
317
+ # require "google/cloud/assured_workloads/v1beta1"
318
+ #
319
+ # # Create a client object. The client can be reused for multiple calls.
320
+ # client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new
321
+ #
322
+ # # Create a request. To set request fields, pass in keyword arguments.
323
+ # request = Google::Cloud::AssuredWorkloads::V1beta1::UpdateWorkloadRequest.new
324
+ #
325
+ # # Call the update_workload method.
326
+ # result = client.update_workload request
327
+ #
328
+ # # The returned object is of type Google::Cloud::AssuredWorkloads::V1beta1::Workload.
329
+ # p result
330
+ #
296
331
  def update_workload request, options = nil
297
332
  raise ::ArgumentError, "request must be provided" if request.nil?
298
333
 
@@ -310,16 +345,20 @@ module Google
310
345
  gapic_version: ::Google::Cloud::AssuredWorkloads::V1beta1::VERSION
311
346
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
312
347
 
313
- header_params = {
314
- "workload.name" => request.workload.name
315
- }
348
+ header_params = {}
349
+ if request.workload&.name
350
+ header_params["workload.name"] = request.workload.name
351
+ end
352
+
316
353
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
317
354
  metadata[:"x-goog-request-params"] ||= request_params_header
318
355
 
319
356
  options.apply_defaults timeout: @config.rpcs.update_workload.timeout,
320
357
  metadata: metadata,
321
358
  retry_policy: @config.rpcs.update_workload.retry_policy
322
- options.apply_defaults metadata: @config.metadata,
359
+
360
+ options.apply_defaults timeout: @config.timeout,
361
+ metadata: @config.metadata,
323
362
  retry_policy: @config.retry_policy
324
363
 
325
364
  @assured_workloads_service_stub.call_rpc :update_workload, request, options: options do |response, operation|
@@ -366,6 +405,21 @@ module Google
366
405
  #
367
406
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
368
407
  #
408
+ # @example Basic example
409
+ # require "google/cloud/assured_workloads/v1beta1"
410
+ #
411
+ # # Create a client object. The client can be reused for multiple calls.
412
+ # client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new
413
+ #
414
+ # # Create a request. To set request fields, pass in keyword arguments.
415
+ # request = Google::Cloud::AssuredWorkloads::V1beta1::DeleteWorkloadRequest.new
416
+ #
417
+ # # Call the delete_workload method.
418
+ # result = client.delete_workload request
419
+ #
420
+ # # The returned object is of type Google::Protobuf::Empty.
421
+ # p result
422
+ #
369
423
  def delete_workload request, options = nil
370
424
  raise ::ArgumentError, "request must be provided" if request.nil?
371
425
 
@@ -383,16 +437,20 @@ module Google
383
437
  gapic_version: ::Google::Cloud::AssuredWorkloads::V1beta1::VERSION
384
438
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
385
439
 
386
- header_params = {
387
- "name" => request.name
388
- }
440
+ header_params = {}
441
+ if request.name
442
+ header_params["name"] = request.name
443
+ end
444
+
389
445
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
390
446
  metadata[:"x-goog-request-params"] ||= request_params_header
391
447
 
392
448
  options.apply_defaults timeout: @config.rpcs.delete_workload.timeout,
393
449
  metadata: metadata,
394
450
  retry_policy: @config.rpcs.delete_workload.retry_policy
395
- options.apply_defaults metadata: @config.metadata,
451
+
452
+ options.apply_defaults timeout: @config.timeout,
453
+ metadata: @config.metadata,
396
454
  retry_policy: @config.retry_policy
397
455
 
398
456
  @assured_workloads_service_stub.call_rpc :delete_workload, request, options: options do |response, operation|
@@ -436,6 +494,21 @@ module Google
436
494
  #
437
495
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
438
496
  #
497
+ # @example Basic example
498
+ # require "google/cloud/assured_workloads/v1beta1"
499
+ #
500
+ # # Create a client object. The client can be reused for multiple calls.
501
+ # client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new
502
+ #
503
+ # # Create a request. To set request fields, pass in keyword arguments.
504
+ # request = Google::Cloud::AssuredWorkloads::V1beta1::GetWorkloadRequest.new
505
+ #
506
+ # # Call the get_workload method.
507
+ # result = client.get_workload request
508
+ #
509
+ # # The returned object is of type Google::Cloud::AssuredWorkloads::V1beta1::Workload.
510
+ # p result
511
+ #
439
512
  def get_workload request, options = nil
440
513
  raise ::ArgumentError, "request must be provided" if request.nil?
441
514
 
@@ -453,16 +526,20 @@ module Google
453
526
  gapic_version: ::Google::Cloud::AssuredWorkloads::V1beta1::VERSION
454
527
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
455
528
 
456
- header_params = {
457
- "name" => request.name
458
- }
529
+ header_params = {}
530
+ if request.name
531
+ header_params["name"] = request.name
532
+ end
533
+
459
534
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
460
535
  metadata[:"x-goog-request-params"] ||= request_params_header
461
536
 
462
537
  options.apply_defaults timeout: @config.rpcs.get_workload.timeout,
463
538
  metadata: metadata,
464
539
  retry_policy: @config.rpcs.get_workload.retry_policy
465
- options.apply_defaults metadata: @config.metadata,
540
+
541
+ options.apply_defaults timeout: @config.timeout,
542
+ metadata: @config.metadata,
466
543
  retry_policy: @config.retry_policy
467
544
 
468
545
  @assured_workloads_service_stub.call_rpc :get_workload, request, options: options do |response, operation|
@@ -512,6 +589,27 @@ module Google
512
589
  #
513
590
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
514
591
  #
592
+ # @example Basic example
593
+ # require "google/cloud/assured_workloads/v1beta1"
594
+ #
595
+ # # Create a client object. The client can be reused for multiple calls.
596
+ # client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new
597
+ #
598
+ # # Create a request. To set request fields, pass in keyword arguments.
599
+ # request = Google::Cloud::AssuredWorkloads::V1beta1::ListWorkloadsRequest.new
600
+ #
601
+ # # Call the list_workloads method.
602
+ # result = client.list_workloads request
603
+ #
604
+ # # The returned object is of type Gapic::PagedEnumerable. You can
605
+ # # iterate over all elements by calling #each, and the enumerable
606
+ # # will lazily make API calls to fetch subsequent pages. Other
607
+ # # methods are also available for managing paging directly.
608
+ # result.each do |response|
609
+ # # Each element is of type ::Google::Cloud::AssuredWorkloads::V1beta1::Workload.
610
+ # p response
611
+ # end
612
+ #
515
613
  def list_workloads request, options = nil
516
614
  raise ::ArgumentError, "request must be provided" if request.nil?
517
615
 
@@ -529,16 +627,20 @@ module Google
529
627
  gapic_version: ::Google::Cloud::AssuredWorkloads::V1beta1::VERSION
530
628
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
531
629
 
532
- header_params = {
533
- "parent" => request.parent
534
- }
630
+ header_params = {}
631
+ if request.parent
632
+ header_params["parent"] = request.parent
633
+ end
634
+
535
635
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
536
636
  metadata[:"x-goog-request-params"] ||= request_params_header
537
637
 
538
638
  options.apply_defaults timeout: @config.rpcs.list_workloads.timeout,
539
639
  metadata: metadata,
540
640
  retry_policy: @config.rpcs.list_workloads.retry_policy
541
- options.apply_defaults metadata: @config.metadata,
641
+
642
+ options.apply_defaults timeout: @config.timeout,
643
+ metadata: @config.metadata,
542
644
  retry_policy: @config.retry_policy
543
645
 
544
646
  @assured_workloads_service_stub.call_rpc :list_workloads, request, options: options do |response, operation|
@@ -563,22 +665,21 @@ module Google
563
665
  # Configuration can be applied globally to all clients, or to a single client
564
666
  # on construction.
565
667
  #
566
- # # Examples
567
- #
568
- # To modify the global config, setting the timeout for create_workload
569
- # to 20 seconds, and all remaining timeouts to 10 seconds:
570
- #
571
- # ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.configure do |config|
572
- # config.timeout = 10.0
573
- # config.rpcs.create_workload.timeout = 20.0
574
- # end
575
- #
576
- # To apply the above configuration only to a new client:
577
- #
578
- # client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new do |config|
579
- # config.timeout = 10.0
580
- # config.rpcs.create_workload.timeout = 20.0
581
- # end
668
+ # @example
669
+ #
670
+ # # Modify the global config, setting the timeout for
671
+ # # create_workload to 20 seconds,
672
+ # # and all remaining timeouts to 10 seconds.
673
+ # ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.configure do |config|
674
+ # config.timeout = 10.0
675
+ # config.rpcs.create_workload.timeout = 20.0
676
+ # end
677
+ #
678
+ # # Apply the above configuration only to a new client.
679
+ # client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new do |config|
680
+ # config.timeout = 10.0
681
+ # config.rpcs.create_workload.timeout = 20.0
682
+ # end
582
683
  #
583
684
  # @!attribute [rw] endpoint
584
685
  # The hostname or hostname:port of the service endpoint.
@@ -143,6 +143,27 @@ module Google
143
143
  #
144
144
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
145
145
  #
146
+ # @example Basic example
147
+ # require "google/longrunning"
148
+ #
149
+ # # Create a client object. The client can be reused for multiple calls.
150
+ # client = Google::Longrunning::Operations::Client.new
151
+ #
152
+ # # Create a request. To set request fields, pass in keyword arguments.
153
+ # request = Google::Longrunning::ListOperationsRequest.new
154
+ #
155
+ # # Call the list_operations method.
156
+ # result = client.list_operations request
157
+ #
158
+ # # The returned object is of type Gapic::PagedEnumerable. You can
159
+ # # iterate over all elements by calling #each, and the enumerable
160
+ # # will lazily make API calls to fetch subsequent pages. Other
161
+ # # methods are also available for managing paging directly.
162
+ # result.each do |response|
163
+ # # Each element is of type ::Google::Longrunning::Operation.
164
+ # p response
165
+ # end
166
+ #
146
167
  def list_operations request, options = nil
147
168
  raise ::ArgumentError, "request must be provided" if request.nil?
148
169
 
@@ -160,16 +181,20 @@ module Google
160
181
  gapic_version: ::Google::Cloud::AssuredWorkloads::V1beta1::VERSION
161
182
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
162
183
 
163
- header_params = {
164
- "name" => request.name
165
- }
184
+ header_params = {}
185
+ if request.name
186
+ header_params["name"] = request.name
187
+ end
188
+
166
189
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
167
190
  metadata[:"x-goog-request-params"] ||= request_params_header
168
191
 
169
192
  options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
170
193
  metadata: metadata,
171
194
  retry_policy: @config.rpcs.list_operations.retry_policy
172
- options.apply_defaults metadata: @config.metadata,
195
+
196
+ options.apply_defaults timeout: @config.timeout,
197
+ metadata: @config.metadata,
173
198
  retry_policy: @config.retry_policy
174
199
 
175
200
  @operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
@@ -213,6 +238,28 @@ module Google
213
238
  #
214
239
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
215
240
  #
241
+ # @example Basic example
242
+ # require "google/longrunning"
243
+ #
244
+ # # Create a client object. The client can be reused for multiple calls.
245
+ # client = Google::Longrunning::Operations::Client.new
246
+ #
247
+ # # Create a request. To set request fields, pass in keyword arguments.
248
+ # request = Google::Longrunning::GetOperationRequest.new
249
+ #
250
+ # # Call the get_operation method.
251
+ # result = client.get_operation request
252
+ #
253
+ # # The returned object is of type Gapic::Operation. You can use this
254
+ # # object to check the status of an operation, cancel it, or wait
255
+ # # for results. Here is how to block until completion:
256
+ # result.wait_until_done! timeout: 60
257
+ # if result.response?
258
+ # p result.response
259
+ # else
260
+ # puts "Error!"
261
+ # end
262
+ #
216
263
  def get_operation request, options = nil
217
264
  raise ::ArgumentError, "request must be provided" if request.nil?
218
265
 
@@ -230,16 +277,20 @@ module Google
230
277
  gapic_version: ::Google::Cloud::AssuredWorkloads::V1beta1::VERSION
231
278
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
232
279
 
233
- header_params = {
234
- "name" => request.name
235
- }
280
+ header_params = {}
281
+ if request.name
282
+ header_params["name"] = request.name
283
+ end
284
+
236
285
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
237
286
  metadata[:"x-goog-request-params"] ||= request_params_header
238
287
 
239
288
  options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
240
289
  metadata: metadata,
241
290
  retry_policy: @config.rpcs.get_operation.retry_policy
242
- options.apply_defaults metadata: @config.metadata,
291
+
292
+ options.apply_defaults timeout: @config.timeout,
293
+ metadata: @config.metadata,
243
294
  retry_policy: @config.retry_policy
244
295
 
245
296
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
@@ -283,6 +334,21 @@ module Google
283
334
  #
284
335
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
285
336
  #
337
+ # @example Basic example
338
+ # require "google/longrunning"
339
+ #
340
+ # # Create a client object. The client can be reused for multiple calls.
341
+ # client = Google::Longrunning::Operations::Client.new
342
+ #
343
+ # # Create a request. To set request fields, pass in keyword arguments.
344
+ # request = Google::Longrunning::DeleteOperationRequest.new
345
+ #
346
+ # # Call the delete_operation method.
347
+ # result = client.delete_operation request
348
+ #
349
+ # # The returned object is of type Google::Protobuf::Empty.
350
+ # p result
351
+ #
286
352
  def delete_operation request, options = nil
287
353
  raise ::ArgumentError, "request must be provided" if request.nil?
288
354
 
@@ -300,16 +366,20 @@ module Google
300
366
  gapic_version: ::Google::Cloud::AssuredWorkloads::V1beta1::VERSION
301
367
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
302
368
 
303
- header_params = {
304
- "name" => request.name
305
- }
369
+ header_params = {}
370
+ if request.name
371
+ header_params["name"] = request.name
372
+ end
373
+
306
374
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
307
375
  metadata[:"x-goog-request-params"] ||= request_params_header
308
376
 
309
377
  options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
310
378
  metadata: metadata,
311
379
  retry_policy: @config.rpcs.delete_operation.retry_policy
312
- options.apply_defaults metadata: @config.metadata,
380
+
381
+ options.apply_defaults timeout: @config.timeout,
382
+ metadata: @config.metadata,
313
383
  retry_policy: @config.retry_policy
314
384
 
315
385
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
@@ -358,6 +428,21 @@ module Google
358
428
  #
359
429
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
360
430
  #
431
+ # @example Basic example
432
+ # require "google/longrunning"
433
+ #
434
+ # # Create a client object. The client can be reused for multiple calls.
435
+ # client = Google::Longrunning::Operations::Client.new
436
+ #
437
+ # # Create a request. To set request fields, pass in keyword arguments.
438
+ # request = Google::Longrunning::CancelOperationRequest.new
439
+ #
440
+ # # Call the cancel_operation method.
441
+ # result = client.cancel_operation request
442
+ #
443
+ # # The returned object is of type Google::Protobuf::Empty.
444
+ # p result
445
+ #
361
446
  def cancel_operation request, options = nil
362
447
  raise ::ArgumentError, "request must be provided" if request.nil?
363
448
 
@@ -375,16 +460,20 @@ module Google
375
460
  gapic_version: ::Google::Cloud::AssuredWorkloads::V1beta1::VERSION
376
461
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
377
462
 
378
- header_params = {
379
- "name" => request.name
380
- }
463
+ header_params = {}
464
+ if request.name
465
+ header_params["name"] = request.name
466
+ end
467
+
381
468
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
382
469
  metadata[:"x-goog-request-params"] ||= request_params_header
383
470
 
384
471
  options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
385
472
  metadata: metadata,
386
473
  retry_policy: @config.rpcs.cancel_operation.retry_policy
387
- options.apply_defaults metadata: @config.metadata,
474
+
475
+ options.apply_defaults timeout: @config.timeout,
476
+ metadata: @config.metadata,
388
477
  retry_policy: @config.retry_policy
389
478
 
390
479
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
@@ -436,6 +525,28 @@ module Google
436
525
  #
437
526
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
438
527
  #
528
+ # @example Basic example
529
+ # require "google/longrunning"
530
+ #
531
+ # # Create a client object. The client can be reused for multiple calls.
532
+ # client = Google::Longrunning::Operations::Client.new
533
+ #
534
+ # # Create a request. To set request fields, pass in keyword arguments.
535
+ # request = Google::Longrunning::WaitOperationRequest.new
536
+ #
537
+ # # Call the wait_operation method.
538
+ # result = client.wait_operation request
539
+ #
540
+ # # The returned object is of type Gapic::Operation. You can use this
541
+ # # object to check the status of an operation, cancel it, or wait
542
+ # # for results. Here is how to block until completion:
543
+ # result.wait_until_done! timeout: 60
544
+ # if result.response?
545
+ # p result.response
546
+ # else
547
+ # puts "Error!"
548
+ # end
549
+ #
439
550
  def wait_operation request, options = nil
440
551
  raise ::ArgumentError, "request must be provided" if request.nil?
441
552
 
@@ -456,7 +567,9 @@ module Google
456
567
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
457
568
  metadata: metadata,
458
569
  retry_policy: @config.rpcs.wait_operation.retry_policy
459
- options.apply_defaults metadata: @config.metadata,
570
+
571
+ options.apply_defaults timeout: @config.timeout,
572
+ metadata: @config.metadata,
460
573
  retry_policy: @config.retry_policy
461
574
 
462
575
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
@@ -481,22 +594,21 @@ module Google
481
594
  # Configuration can be applied globally to all clients, or to a single client
482
595
  # on construction.
483
596
  #
484
- # # Examples
485
- #
486
- # To modify the global config, setting the timeout for list_operations
487
- # to 20 seconds, and all remaining timeouts to 10 seconds:
488
- #
489
- # ::Google::Longrunning::Operations::Client.configure do |config|
490
- # config.timeout = 10.0
491
- # config.rpcs.list_operations.timeout = 20.0
492
- # end
493
- #
494
- # To apply the above configuration only to a new client:
495
- #
496
- # client = ::Google::Longrunning::Operations::Client.new do |config|
497
- # config.timeout = 10.0
498
- # config.rpcs.list_operations.timeout = 20.0
499
- # end
597
+ # @example
598
+ #
599
+ # # Modify the global config, setting the timeout for
600
+ # # list_operations to 20 seconds,
601
+ # # and all remaining timeouts to 10 seconds.
602
+ # ::Google::Longrunning::Operations::Client.configure do |config|
603
+ # config.timeout = 10.0
604
+ # config.rpcs.list_operations.timeout = 20.0
605
+ # end
606
+ #
607
+ # # Apply the above configuration only to a new client.
608
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
609
+ # config.timeout = 10.0
610
+ # config.rpcs.list_operations.timeout = 20.0
611
+ # end
500
612
  #
501
613
  # @!attribute [rw] endpoint
502
614
  # The hostname or hostname:port of the service endpoint.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module AssuredWorkloads
23
23
  module V1beta1
24
- VERSION = "0.6.2"
24
+ VERSION = "0.8.1"
25
25
  end
26
26
  end
27
27
  end
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -12,6 +10,8 @@ require 'google/protobuf/duration_pb'
12
10
  require 'google/protobuf/empty_pb'
13
11
  require 'google/protobuf/field_mask_pb'
14
12
  require 'google/protobuf/timestamp_pb'
13
+ require 'google/protobuf'
14
+
15
15
  Google::Protobuf::DescriptorPool.generated_pool.build do
16
16
  add_file("google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto", :syntax => :proto3) do
17
17
  add_message "google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest" do
@@ -66,7 +66,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
66
66
  add_enum "google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType" do
67
67
  value :RESOURCE_TYPE_UNSPECIFIED, 0
68
68
  value :CONSUMER_PROJECT, 1
69
+ value :CONSUMER_FOLDER, 4
69
70
  value :ENCRYPTION_KEYS_PROJECT, 2
71
+ value :KEYRING, 3
70
72
  end
71
73
  add_message "google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings" do
72
74
  optional :next_rotation_time, :message, 1, "google.protobuf.Timestamp"
@@ -87,6 +89,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
87
89
  add_message "google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings" do
88
90
  optional :resource_id, :string, 1
89
91
  optional :resource_type, :enum, 2, "google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType"
92
+ optional :display_name, :string, 3
90
93
  end
91
94
  add_enum "google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime" do
92
95
  value :COMPLIANCE_REGIME_UNSPECIFIED, 0
@@ -97,12 +100,15 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
97
100
  value :US_REGIONAL_ACCESS, 5
98
101
  value :HIPAA, 6
99
102
  value :HITRUST, 7
103
+ value :EU_REGIONS_AND_SUPPORT, 8
104
+ value :CA_REGIONS_AND_SUPPORT, 9
100
105
  end
101
106
  add_message "google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata" do
102
107
  optional :create_time, :message, 1, "google.protobuf.Timestamp"
103
108
  optional :display_name, :string, 2
104
109
  optional :parent, :string, 3
105
110
  optional :compliance_regime, :enum, 4, "google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime"
111
+ repeated :resource_settings, :message, 5, "google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings"
106
112
  end
107
113
  end
108
114
  end
@@ -27,7 +27,7 @@ module Google
27
27
  # Service to manage AssuredWorkloads.
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -148,7 +148,7 @@ module Google
148
148
  # Output only. Immutable. The Workload creation timestamp.
149
149
  # @!attribute [rw] billing_account
150
150
  # @return [::String]
151
- # Required. Input only. The billing account used for the resources which are
151
+ # Input only. The billing account used for the resources which are
152
152
  # direct children of workload. This billing account is initially associated
153
153
  # with the resources created as part of Workload creation.
154
154
  # After the initial creation of these resources, the customer can change
@@ -178,12 +178,11 @@ module Google
178
178
  # @!attribute [rw] provisioned_resources_parent
179
179
  # @return [::String]
180
180
  # Input only. The parent resource for the resources managed by this Assured Workload. May
181
- # be either an organization or a folder. Must be the same or a child of the
181
+ # be either empty or a folder resource which is a child of the
182
182
  # Workload parent. If not specified all resources are created under the
183
- # Workload parent.
184
- # Formats:
183
+ # parent organization.
184
+ # Format:
185
185
  # folders/\\{folder_id}
186
- # organizations/\\{organization_id}
187
186
  # @!attribute [rw] kms_settings
188
187
  # @return [::Google::Cloud::AssuredWorkloads::V1beta1::Workload::KMSSettings]
189
188
  # Input only. Settings used to create a CMEK crypto key. When set a project with a KMS
@@ -215,11 +214,18 @@ module Google
215
214
  # Unknown resource type.
216
215
  RESOURCE_TYPE_UNSPECIFIED = 0
217
216
 
218
- # Consumer project.
217
+ # Deprecated. Existing workloads will continue to support this, but new
218
+ # CreateWorkloadRequests should not specify this as an input value.
219
219
  CONSUMER_PROJECT = 1
220
220
 
221
+ # Consumer Folder.
222
+ CONSUMER_FOLDER = 4
223
+
221
224
  # Consumer project containing encryption keys.
222
225
  ENCRYPTION_KEYS_PROJECT = 2
226
+
227
+ # Keyring resource that hosts encryption keys.
228
+ KEYRING = 3
223
229
  end
224
230
  end
225
231
 
@@ -285,6 +291,11 @@ module Google
285
291
  # Indicates the type of resource. This field should be specified to
286
292
  # correspond the id to the right project type (CONSUMER_PROJECT or
287
293
  # ENCRYPTION_KEYS_PROJECT)
294
+ # @!attribute [rw] display_name
295
+ # @return [::String]
296
+ # User-assigned resource display name.
297
+ # If not empty it will be used to create a resource with the specified
298
+ # name.
288
299
  class ResourceSettings
289
300
  include ::Google::Protobuf::MessageExts
290
301
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -324,6 +335,12 @@ module Google
324
335
 
325
336
  # Health Information Trust Alliance controls
326
337
  HITRUST = 7
338
+
339
+ # Assured Workloads For EU Regions and Support controls
340
+ EU_REGIONS_AND_SUPPORT = 8
341
+
342
+ # Assured Workloads For Canada Regions and Support controls
343
+ CA_REGIONS_AND_SUPPORT = 9
327
344
  end
328
345
  end
329
346
 
@@ -341,6 +358,10 @@ module Google
341
358
  # @return [::Google::Cloud::AssuredWorkloads::V1beta1::Workload::ComplianceRegime]
342
359
  # Optional. Compliance controls that should be applied to the resources managed by
343
360
  # the workload.
361
+ # @!attribute [rw] resource_settings
362
+ # @return [::Array<::Google::Cloud::AssuredWorkloads::V1beta1::Workload::ResourceSettings>]
363
+ # Optional. Resource properties in the input that are used for creating/customizing
364
+ # workload resources.
344
365
  class CreateWorkloadOperationMetadata
345
366
  include ::Google::Protobuf::MessageExts
346
367
  extend ::Google::Protobuf::MessageExts::ClassMethods
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-assured_workloads-v1beta1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-12 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.5'
19
+ version: '0.7'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.5'
29
+ version: '0.7'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a