google-cloud-gaming-v1 0.3.2 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/gaming/v1/common_pb.rb +2 -2
  3. data/lib/google/cloud/gaming/v1/game_server_clusters_pb.rb +33 -2
  4. data/lib/google/cloud/gaming/v1/game_server_clusters_service/client.rb +269 -87
  5. data/lib/google/cloud/gaming/v1/game_server_clusters_service/operations.rb +145 -33
  6. data/lib/google/cloud/gaming/v1/game_server_clusters_service_pb.rb +2 -2
  7. data/lib/google/cloud/gaming/v1/game_server_clusters_service_services_pb.rb +1 -1
  8. data/lib/google/cloud/gaming/v1/game_server_configs_pb.rb +2 -2
  9. data/lib/google/cloud/gaming/v1/game_server_configs_service/client.rb +145 -60
  10. data/lib/google/cloud/gaming/v1/game_server_configs_service/operations.rb +145 -33
  11. data/lib/google/cloud/gaming/v1/game_server_configs_service_pb.rb +2 -2
  12. data/lib/google/cloud/gaming/v1/game_server_configs_service_services_pb.rb +1 -1
  13. data/lib/google/cloud/gaming/v1/game_server_deployments_pb.rb +2 -2
  14. data/lib/google/cloud/gaming/v1/game_server_deployments_service/client.rb +280 -95
  15. data/lib/google/cloud/gaming/v1/game_server_deployments_service/operations.rb +145 -33
  16. data/lib/google/cloud/gaming/v1/game_server_deployments_service_pb.rb +2 -2
  17. data/lib/google/cloud/gaming/v1/game_server_deployments_service_services_pb.rb +1 -1
  18. data/lib/google/cloud/gaming/v1/realms_pb.rb +2 -2
  19. data/lib/google/cloud/gaming/v1/realms_service/client.rb +200 -72
  20. data/lib/google/cloud/gaming/v1/realms_service/operations.rb +145 -33
  21. data/lib/google/cloud/gaming/v1/realms_service_pb.rb +2 -2
  22. data/lib/google/cloud/gaming/v1/realms_service_services_pb.rb +1 -1
  23. data/lib/google/cloud/gaming/v1/version.rb +1 -1
  24. data/proto_docs/google/cloud/gaming/v1/common.rb +4 -5
  25. data/proto_docs/google/cloud/gaming/v1/game_server_clusters.rb +117 -19
  26. data/proto_docs/google/cloud/gaming/v1/game_server_configs.rb +5 -11
  27. data/proto_docs/google/cloud/gaming/v1/game_server_deployments.rb +12 -28
  28. data/proto_docs/google/cloud/gaming/v1/realms.rb +7 -13
  29. metadata +4 -4
@@ -42,13 +42,12 @@ module Google
42
42
  # See {::Google::Cloud::Gaming::V1::RealmsService::Client::Configuration}
43
43
  # for a description of the configuration fields.
44
44
  #
45
- # ## Example
45
+ # @example
46
46
  #
47
- # To modify the configuration for all RealmsService clients:
48
- #
49
- # ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
47
+ # # Modify the configuration for all RealmsService clients
48
+ # ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
52
51
  #
53
52
  # @yield [config] Configure the Client client.
54
53
  # @yieldparam config [Client::Configuration]
@@ -116,19 +115,15 @@ module Google
116
115
  ##
117
116
  # Create a new RealmsService client object.
118
117
  #
119
- # ## Examples
120
- #
121
- # To create a new RealmsService client with the default
122
- # configuration:
118
+ # @example
123
119
  #
124
- # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new
120
+ # # Create a client using the default configuration
121
+ # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new
125
122
  #
126
- # To create a new RealmsService client with a custom
127
- # configuration:
128
- #
129
- # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config|
130
- # config.timeout = 10.0
131
- # end
123
+ # # Create a client using a custom configuration
124
+ # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config|
125
+ # config.timeout = 10.0
126
+ # end
132
127
  #
133
128
  # @yield [config] Configure the RealmsService client.
134
129
  # @yieldparam config [Client::Configuration]
@@ -148,10 +143,9 @@ module Google
148
143
 
149
144
  # Create credentials
150
145
  credentials = @config.credentials
151
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
146
+ # Use self-signed JWT if the endpoint is unchanged from default,
152
147
  # but only if the default endpoint does not have a region prefix.
153
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
154
- @config.endpoint == Client.configure.endpoint &&
148
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
155
149
  !@config.endpoint.split(".").first.include?("-")
156
150
  credentials ||= Credentials.default scope: @config.scope,
157
151
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -203,7 +197,7 @@ module Google
203
197
  # the default parameter values, pass an empty Hash as a request object (see above).
204
198
  #
205
199
  # @param parent [::String]
206
- # Required. The parent resource name. Uses the form:
200
+ # Required. The parent resource name, in the following form:
207
201
  # `projects/{project}/locations/{location}`.
208
202
  # @param page_size [::Integer]
209
203
  # Optional. The maximum number of items to return. If unspecified, server
@@ -228,6 +222,27 @@ module Google
228
222
  #
229
223
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
230
224
  #
225
+ # @example Basic example
226
+ # require "google/cloud/gaming/v1"
227
+ #
228
+ # # Create a client object. The client can be reused for multiple calls.
229
+ # client = Google::Cloud::Gaming::V1::RealmsService::Client.new
230
+ #
231
+ # # Create a request. To set request fields, pass in keyword arguments.
232
+ # request = Google::Cloud::Gaming::V1::ListRealmsRequest.new
233
+ #
234
+ # # Call the list_realms method.
235
+ # result = client.list_realms request
236
+ #
237
+ # # The returned object is of type Gapic::PagedEnumerable. You can
238
+ # # iterate over all elements by calling #each, and the enumerable
239
+ # # will lazily make API calls to fetch subsequent pages. Other
240
+ # # methods are also available for managing paging directly.
241
+ # result.each do |response|
242
+ # # Each element is of type ::Google::Cloud::Gaming::V1::Realm.
243
+ # p response
244
+ # end
245
+ #
231
246
  def list_realms request, options = nil
232
247
  raise ::ArgumentError, "request must be provided" if request.nil?
233
248
 
@@ -245,16 +260,20 @@ module Google
245
260
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
246
261
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
247
262
 
248
- header_params = {
249
- "parent" => request.parent
250
- }
263
+ header_params = {}
264
+ if request.parent
265
+ header_params["parent"] = request.parent
266
+ end
267
+
251
268
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
252
269
  metadata[:"x-goog-request-params"] ||= request_params_header
253
270
 
254
271
  options.apply_defaults timeout: @config.rpcs.list_realms.timeout,
255
272
  metadata: metadata,
256
273
  retry_policy: @config.rpcs.list_realms.retry_policy
257
- options.apply_defaults metadata: @config.metadata,
274
+
275
+ options.apply_defaults timeout: @config.timeout,
276
+ metadata: @config.metadata,
258
277
  retry_policy: @config.retry_policy
259
278
 
260
279
  @realms_service_stub.call_rpc :list_realms, request, options: options do |response, operation|
@@ -285,7 +304,7 @@ module Google
285
304
  # the default parameter values, pass an empty Hash as a request object (see above).
286
305
  #
287
306
  # @param name [::String]
288
- # Required. The name of the realm to retrieve. Uses the form:
307
+ # Required. The name of the realm to retrieve, in the following form:
289
308
  # `projects/{project}/locations/{location}/realms/{realm}`.
290
309
  #
291
310
  # @yield [response, operation] Access the result along with the RPC operation
@@ -296,6 +315,21 @@ module Google
296
315
  #
297
316
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
298
317
  #
318
+ # @example Basic example
319
+ # require "google/cloud/gaming/v1"
320
+ #
321
+ # # Create a client object. The client can be reused for multiple calls.
322
+ # client = Google::Cloud::Gaming::V1::RealmsService::Client.new
323
+ #
324
+ # # Create a request. To set request fields, pass in keyword arguments.
325
+ # request = Google::Cloud::Gaming::V1::GetRealmRequest.new
326
+ #
327
+ # # Call the get_realm method.
328
+ # result = client.get_realm request
329
+ #
330
+ # # The returned object is of type Google::Cloud::Gaming::V1::Realm.
331
+ # p result
332
+ #
299
333
  def get_realm request, options = nil
300
334
  raise ::ArgumentError, "request must be provided" if request.nil?
301
335
 
@@ -313,16 +347,20 @@ module Google
313
347
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
314
348
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
315
349
 
316
- header_params = {
317
- "name" => request.name
318
- }
350
+ header_params = {}
351
+ if request.name
352
+ header_params["name"] = request.name
353
+ end
354
+
319
355
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
320
356
  metadata[:"x-goog-request-params"] ||= request_params_header
321
357
 
322
358
  options.apply_defaults timeout: @config.rpcs.get_realm.timeout,
323
359
  metadata: metadata,
324
360
  retry_policy: @config.rpcs.get_realm.retry_policy
325
- options.apply_defaults metadata: @config.metadata,
361
+
362
+ options.apply_defaults timeout: @config.timeout,
363
+ metadata: @config.metadata,
326
364
  retry_policy: @config.retry_policy
327
365
 
328
366
  @realms_service_stub.call_rpc :get_realm, request, options: options do |response, operation|
@@ -352,7 +390,7 @@ module Google
352
390
  # the default parameter values, pass an empty Hash as a request object (see above).
353
391
  #
354
392
  # @param parent [::String]
355
- # Required. The parent resource name. Uses the form:
393
+ # Required. The parent resource name, in the following form:
356
394
  # `projects/{project}/locations/{location}`.
357
395
  # @param realm_id [::String]
358
396
  # Required. The ID of the realm resource to be created.
@@ -367,6 +405,28 @@ module Google
367
405
  #
368
406
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
369
407
  #
408
+ # @example Basic example
409
+ # require "google/cloud/gaming/v1"
410
+ #
411
+ # # Create a client object. The client can be reused for multiple calls.
412
+ # client = Google::Cloud::Gaming::V1::RealmsService::Client.new
413
+ #
414
+ # # Create a request. To set request fields, pass in keyword arguments.
415
+ # request = Google::Cloud::Gaming::V1::CreateRealmRequest.new
416
+ #
417
+ # # Call the create_realm method.
418
+ # result = client.create_realm request
419
+ #
420
+ # # The returned object is of type Gapic::Operation. You can use this
421
+ # # object to check the status of an operation, cancel it, or wait
422
+ # # for results. Here is how to block until completion:
423
+ # result.wait_until_done! timeout: 60
424
+ # if result.response?
425
+ # p result.response
426
+ # else
427
+ # puts "Error!"
428
+ # end
429
+ #
370
430
  def create_realm request, options = nil
371
431
  raise ::ArgumentError, "request must be provided" if request.nil?
372
432
 
@@ -384,16 +444,20 @@ module Google
384
444
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
385
445
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
386
446
 
387
- header_params = {
388
- "parent" => request.parent
389
- }
447
+ header_params = {}
448
+ if request.parent
449
+ header_params["parent"] = request.parent
450
+ end
451
+
390
452
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
391
453
  metadata[:"x-goog-request-params"] ||= request_params_header
392
454
 
393
455
  options.apply_defaults timeout: @config.rpcs.create_realm.timeout,
394
456
  metadata: metadata,
395
457
  retry_policy: @config.rpcs.create_realm.retry_policy
396
- options.apply_defaults metadata: @config.metadata,
458
+
459
+ options.apply_defaults timeout: @config.timeout,
460
+ metadata: @config.metadata,
397
461
  retry_policy: @config.retry_policy
398
462
 
399
463
  @realms_service_stub.call_rpc :create_realm, request, options: options do |response, operation|
@@ -424,7 +488,7 @@ module Google
424
488
  # the default parameter values, pass an empty Hash as a request object (see above).
425
489
  #
426
490
  # @param name [::String]
427
- # Required. The name of the realm to delete. Uses the form:
491
+ # Required. The name of the realm to delete, in the following form:
428
492
  # `projects/{project}/locations/{location}/realms/{realm}`.
429
493
  #
430
494
  # @yield [response, operation] Access the result along with the RPC operation
@@ -435,6 +499,28 @@ module Google
435
499
  #
436
500
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
437
501
  #
502
+ # @example Basic example
503
+ # require "google/cloud/gaming/v1"
504
+ #
505
+ # # Create a client object. The client can be reused for multiple calls.
506
+ # client = Google::Cloud::Gaming::V1::RealmsService::Client.new
507
+ #
508
+ # # Create a request. To set request fields, pass in keyword arguments.
509
+ # request = Google::Cloud::Gaming::V1::DeleteRealmRequest.new
510
+ #
511
+ # # Call the delete_realm method.
512
+ # result = client.delete_realm request
513
+ #
514
+ # # The returned object is of type Gapic::Operation. You can use this
515
+ # # object to check the status of an operation, cancel it, or wait
516
+ # # for results. Here is how to block until completion:
517
+ # result.wait_until_done! timeout: 60
518
+ # if result.response?
519
+ # p result.response
520
+ # else
521
+ # puts "Error!"
522
+ # end
523
+ #
438
524
  def delete_realm request, options = nil
439
525
  raise ::ArgumentError, "request must be provided" if request.nil?
440
526
 
@@ -452,16 +538,20 @@ module Google
452
538
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
453
539
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
454
540
 
455
- header_params = {
456
- "name" => request.name
457
- }
541
+ header_params = {}
542
+ if request.name
543
+ header_params["name"] = request.name
544
+ end
545
+
458
546
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
459
547
  metadata[:"x-goog-request-params"] ||= request_params_header
460
548
 
461
549
  options.apply_defaults timeout: @config.rpcs.delete_realm.timeout,
462
550
  metadata: metadata,
463
551
  retry_policy: @config.rpcs.delete_realm.retry_policy
464
- options.apply_defaults metadata: @config.metadata,
552
+
553
+ options.apply_defaults timeout: @config.timeout,
554
+ metadata: @config.metadata,
465
555
  retry_policy: @config.retry_policy
466
556
 
467
557
  @realms_service_stub.call_rpc :delete_realm, request, options: options do |response, operation|
@@ -497,10 +587,7 @@ module Google
497
587
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
498
588
  # Required. The update mask applies to the resource. For the `FieldMask`
499
589
  # definition, see
500
- #
501
- # https:
502
- # //developers.google.com/protocol-buffers
503
- # // /docs/reference/google.protobuf#fieldmask
590
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
504
591
  #
505
592
  # @yield [response, operation] Access the result along with the RPC operation
506
593
  # @yieldparam response [::Gapic::Operation]
@@ -510,6 +597,28 @@ module Google
510
597
  #
511
598
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
512
599
  #
600
+ # @example Basic example
601
+ # require "google/cloud/gaming/v1"
602
+ #
603
+ # # Create a client object. The client can be reused for multiple calls.
604
+ # client = Google::Cloud::Gaming::V1::RealmsService::Client.new
605
+ #
606
+ # # Create a request. To set request fields, pass in keyword arguments.
607
+ # request = Google::Cloud::Gaming::V1::UpdateRealmRequest.new
608
+ #
609
+ # # Call the update_realm method.
610
+ # result = client.update_realm request
611
+ #
612
+ # # The returned object is of type Gapic::Operation. You can use this
613
+ # # object to check the status of an operation, cancel it, or wait
614
+ # # for results. Here is how to block until completion:
615
+ # result.wait_until_done! timeout: 60
616
+ # if result.response?
617
+ # p result.response
618
+ # else
619
+ # puts "Error!"
620
+ # end
621
+ #
513
622
  def update_realm request, options = nil
514
623
  raise ::ArgumentError, "request must be provided" if request.nil?
515
624
 
@@ -527,16 +636,20 @@ module Google
527
636
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
528
637
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
529
638
 
530
- header_params = {
531
- "realm.name" => request.realm.name
532
- }
639
+ header_params = {}
640
+ if request.realm&.name
641
+ header_params["realm.name"] = request.realm.name
642
+ end
643
+
533
644
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
534
645
  metadata[:"x-goog-request-params"] ||= request_params_header
535
646
 
536
647
  options.apply_defaults timeout: @config.rpcs.update_realm.timeout,
537
648
  metadata: metadata,
538
649
  retry_policy: @config.rpcs.update_realm.retry_policy
539
- options.apply_defaults metadata: @config.metadata,
650
+
651
+ options.apply_defaults timeout: @config.timeout,
652
+ metadata: @config.metadata,
540
653
  retry_policy: @config.retry_policy
541
654
 
542
655
  @realms_service_stub.call_rpc :update_realm, request, options: options do |response, operation|
@@ -572,10 +685,7 @@ module Google
572
685
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
573
686
  # Required. The update mask applies to the resource. For the `FieldMask`
574
687
  # definition, see
575
- #
576
- # https:
577
- # //developers.google.com/protocol-buffers
578
- # // /docs/reference/google.protobuf#fieldmask
688
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
579
689
  # @param preview_time [::Google::Protobuf::Timestamp, ::Hash]
580
690
  # Optional. The target timestamp to compute the preview.
581
691
  #
@@ -587,6 +697,21 @@ module Google
587
697
  #
588
698
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
589
699
  #
700
+ # @example Basic example
701
+ # require "google/cloud/gaming/v1"
702
+ #
703
+ # # Create a client object. The client can be reused for multiple calls.
704
+ # client = Google::Cloud::Gaming::V1::RealmsService::Client.new
705
+ #
706
+ # # Create a request. To set request fields, pass in keyword arguments.
707
+ # request = Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest.new
708
+ #
709
+ # # Call the preview_realm_update method.
710
+ # result = client.preview_realm_update request
711
+ #
712
+ # # The returned object is of type Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse.
713
+ # p result
714
+ #
590
715
  def preview_realm_update request, options = nil
591
716
  raise ::ArgumentError, "request must be provided" if request.nil?
592
717
 
@@ -604,16 +729,20 @@ module Google
604
729
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
605
730
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
606
731
 
607
- header_params = {
608
- "realm.name" => request.realm.name
609
- }
732
+ header_params = {}
733
+ if request.realm&.name
734
+ header_params["realm.name"] = request.realm.name
735
+ end
736
+
610
737
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
611
738
  metadata[:"x-goog-request-params"] ||= request_params_header
612
739
 
613
740
  options.apply_defaults timeout: @config.rpcs.preview_realm_update.timeout,
614
741
  metadata: metadata,
615
742
  retry_policy: @config.rpcs.preview_realm_update.retry_policy
616
- options.apply_defaults metadata: @config.metadata,
743
+
744
+ options.apply_defaults timeout: @config.timeout,
745
+ metadata: @config.metadata,
617
746
  retry_policy: @config.retry_policy
618
747
 
619
748
  @realms_service_stub.call_rpc :preview_realm_update, request, options: options do |response, operation|
@@ -637,22 +766,21 @@ module Google
637
766
  # Configuration can be applied globally to all clients, or to a single client
638
767
  # on construction.
639
768
  #
640
- # # Examples
641
- #
642
- # To modify the global config, setting the timeout for list_realms
643
- # to 20 seconds, and all remaining timeouts to 10 seconds:
644
- #
645
- # ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config|
646
- # config.timeout = 10.0
647
- # config.rpcs.list_realms.timeout = 20.0
648
- # end
649
- #
650
- # To apply the above configuration only to a new client:
651
- #
652
- # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config|
653
- # config.timeout = 10.0
654
- # config.rpcs.list_realms.timeout = 20.0
655
- # end
769
+ # @example
770
+ #
771
+ # # Modify the global config, setting the timeout for
772
+ # # list_realms to 20 seconds,
773
+ # # and all remaining timeouts to 10 seconds.
774
+ # ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config|
775
+ # config.timeout = 10.0
776
+ # config.rpcs.list_realms.timeout = 20.0
777
+ # end
778
+ #
779
+ # # Apply the above configuration only to a new client.
780
+ # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config|
781
+ # config.timeout = 10.0
782
+ # config.rpcs.list_realms.timeout = 20.0
783
+ # end
656
784
  #
657
785
  # @!attribute [rw] endpoint
658
786
  # The hostname or hostname:port of the service endpoint.