google-cloud-gaming-v1 0.3.1 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +8 -8
  3. data/README.md +1 -1
  4. data/lib/google/cloud/gaming/v1/common_pb.rb +2 -2
  5. data/lib/google/cloud/gaming/v1/game_server_clusters_pb.rb +33 -2
  6. data/lib/google/cloud/gaming/v1/game_server_clusters_service/client.rb +275 -108
  7. data/lib/google/cloud/gaming/v1/game_server_clusters_service/operations.rb +149 -37
  8. data/lib/google/cloud/gaming/v1/game_server_clusters_service_pb.rb +2 -2
  9. data/lib/google/cloud/gaming/v1/game_server_configs_pb.rb +2 -2
  10. data/lib/google/cloud/gaming/v1/game_server_configs_service/client.rb +148 -69
  11. data/lib/google/cloud/gaming/v1/game_server_configs_service/operations.rb +149 -37
  12. data/lib/google/cloud/gaming/v1/game_server_configs_service_pb.rb +2 -2
  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 +286 -116
  15. data/lib/google/cloud/gaming/v1/game_server_deployments_service/operations.rb +149 -37
  16. data/lib/google/cloud/gaming/v1/game_server_deployments_service_pb.rb +2 -2
  17. data/lib/google/cloud/gaming/v1/realms_pb.rb +2 -2
  18. data/lib/google/cloud/gaming/v1/realms_service/client.rb +204 -85
  19. data/lib/google/cloud/gaming/v1/realms_service/operations.rb +149 -37
  20. data/lib/google/cloud/gaming/v1/realms_service_pb.rb +2 -2
  21. data/lib/google/cloud/gaming/v1/version.rb +1 -1
  22. data/proto_docs/google/api/field_behavior.rb +7 -1
  23. data/proto_docs/google/cloud/gaming/v1/common.rb +0 -3
  24. data/proto_docs/google/cloud/gaming/v1/game_server_clusters.rb +117 -19
  25. data/proto_docs/google/cloud/gaming/v1/game_server_configs.rb +5 -11
  26. data/proto_docs/google/cloud/gaming/v1/game_server_deployments.rb +12 -28
  27. data/proto_docs/google/cloud/gaming/v1/realms.rb +7 -13
  28. metadata +4 -4
@@ -42,13 +42,12 @@ module Google
42
42
  # See {::Google::Cloud::Gaming::V1::GameServerClustersService::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 GameServerClustersService clients:
48
- #
49
- # ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
47
+ # # Modify the configuration for all GameServerClustersService clients
48
+ # ::Google::Cloud::Gaming::V1::GameServerClustersService::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]
@@ -68,48 +67,33 @@ module Google
68
67
 
69
68
  default_config.rpcs.list_game_server_clusters.timeout = 60.0
70
69
  default_config.rpcs.list_game_server_clusters.retry_policy = {
71
- initial_delay: 1.0,
72
- max_delay: 10.0,
73
- multiplier: 1.3,
74
- retry_codes: [14]
70
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
75
71
  }
76
72
 
77
73
  default_config.rpcs.get_game_server_cluster.timeout = 60.0
78
74
  default_config.rpcs.get_game_server_cluster.retry_policy = {
79
- initial_delay: 1.0,
80
- max_delay: 10.0,
81
- multiplier: 1.3,
82
- retry_codes: [14]
75
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
83
76
  }
84
77
 
85
78
  default_config.rpcs.create_game_server_cluster.timeout = 120.0
86
79
 
87
80
  default_config.rpcs.preview_create_game_server_cluster.timeout = 60.0
88
81
  default_config.rpcs.preview_create_game_server_cluster.retry_policy = {
89
- initial_delay: 1.0,
90
- max_delay: 10.0,
91
- multiplier: 1.3,
92
- retry_codes: [14]
82
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
93
83
  }
94
84
 
95
85
  default_config.rpcs.delete_game_server_cluster.timeout = 60.0
96
86
 
97
87
  default_config.rpcs.preview_delete_game_server_cluster.timeout = 60.0
98
88
  default_config.rpcs.preview_delete_game_server_cluster.retry_policy = {
99
- initial_delay: 1.0,
100
- max_delay: 10.0,
101
- multiplier: 1.3,
102
- retry_codes: [14]
89
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
103
90
  }
104
91
 
105
92
  default_config.rpcs.update_game_server_cluster.timeout = 60.0
106
93
 
107
94
  default_config.rpcs.preview_update_game_server_cluster.timeout = 60.0
108
95
  default_config.rpcs.preview_update_game_server_cluster.retry_policy = {
109
- initial_delay: 1.0,
110
- max_delay: 10.0,
111
- multiplier: 1.3,
112
- retry_codes: [14]
96
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
113
97
  }
114
98
 
115
99
  default_config
@@ -141,19 +125,15 @@ module Google
141
125
  ##
142
126
  # Create a new GameServerClustersService client object.
143
127
  #
144
- # ## Examples
145
- #
146
- # To create a new GameServerClustersService client with the default
147
- # configuration:
148
- #
149
- # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
128
+ # @example
150
129
  #
151
- # To create a new GameServerClustersService client with a custom
152
- # configuration:
130
+ # # Create a client using the default configuration
131
+ # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
153
132
  #
154
- # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new do |config|
155
- # config.timeout = 10.0
156
- # end
133
+ # # Create a client using a custom configuration
134
+ # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new do |config|
135
+ # config.timeout = 10.0
136
+ # end
157
137
  #
158
138
  # @yield [config] Configure the GameServerClustersService client.
159
139
  # @yieldparam config [Client::Configuration]
@@ -173,14 +153,13 @@ module Google
173
153
 
174
154
  # Create credentials
175
155
  credentials = @config.credentials
176
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
156
+ # Use self-signed JWT if the endpoint is unchanged from default,
177
157
  # but only if the default endpoint does not have a region prefix.
178
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
179
- @config.endpoint == Client.configure.endpoint &&
158
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
180
159
  !@config.endpoint.split(".").first.include?("-")
181
160
  credentials ||= Credentials.default scope: @config.scope,
182
161
  enable_self_signed_jwt: enable_self_signed_jwt
183
- if credentials.is_a?(String) || credentials.is_a?(Hash)
162
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
184
163
  credentials = Credentials.new credentials, scope: @config.scope
185
164
  end
186
165
  @quota_project_id = @config.quota_project
@@ -222,16 +201,16 @@ module Google
222
201
  # @param options [::Gapic::CallOptions, ::Hash]
223
202
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
224
203
  #
225
- # @overload list_game_server_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
204
+ # @overload list_game_server_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil)
226
205
  # Pass arguments to `list_game_server_clusters` via keyword arguments. Note that at
227
206
  # least one keyword argument is required. To specify no parameters, or to keep all
228
207
  # the default parameter values, pass an empty Hash as a request object (see above).
229
208
  #
230
209
  # @param parent [::String]
231
- # Required. The parent resource name. Uses the form:
210
+ # Required. The parent resource name, in the following form:
232
211
  # "projects/\\{project}/locations/\\{location}/realms/\\{realm}".
233
212
  # @param page_size [::Integer]
234
- # Optional. The maximum number of items to return. If unspecified, the server
213
+ # Optional. The maximum number of items to return. If unspecified, the server
235
214
  # will pick an appropriate default. The server may return fewer items than
236
215
  # requested. A caller should only rely on response's
237
216
  # {::Google::Cloud::Gaming::V1::ListGameServerClustersResponse#next_page_token next_page_token} to
@@ -243,6 +222,13 @@ module Google
243
222
  # @param order_by [::String]
244
223
  # Optional. Specifies the ordering of results following syntax at
245
224
  # https://cloud.google.com/apis/design/design_patterns#sorting_order.
225
+ # @param view [::Google::Cloud::Gaming::V1::GameServerClusterView]
226
+ # Optional. View for the returned GameServerCluster objects. When `FULL` is
227
+ # specified, the `cluster_state` field is also returned in the
228
+ # GameServerCluster object, which includes the state of the referenced
229
+ # Kubernetes cluster such as versions and provider info. The default/unset
230
+ # value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does
231
+ # not return the `cluster_state` field.
246
232
  #
247
233
  # @yield [response, operation] Access the result along with the RPC operation
248
234
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::GameServerCluster>]
@@ -252,6 +238,27 @@ module Google
252
238
  #
253
239
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
254
240
  #
241
+ # @example Basic example
242
+ # require "google/cloud/gaming/v1"
243
+ #
244
+ # # Create a client object. The client can be reused for multiple calls.
245
+ # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
246
+ #
247
+ # # Create a request. To set request fields, pass in keyword arguments.
248
+ # request = Google::Cloud::Gaming::V1::ListGameServerClustersRequest.new
249
+ #
250
+ # # Call the list_game_server_clusters method.
251
+ # result = client.list_game_server_clusters request
252
+ #
253
+ # # The returned object is of type Gapic::PagedEnumerable. You can
254
+ # # iterate over all elements by calling #each, and the enumerable
255
+ # # will lazily make API calls to fetch subsequent pages. Other
256
+ # # methods are also available for managing paging directly.
257
+ # result.each do |response|
258
+ # # Each element is of type ::Google::Cloud::Gaming::V1::GameServerCluster.
259
+ # p response
260
+ # end
261
+ #
255
262
  def list_game_server_clusters request, options = nil
256
263
  raise ::ArgumentError, "request must be provided" if request.nil?
257
264
 
@@ -269,16 +276,20 @@ module Google
269
276
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
270
277
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
271
278
 
272
- header_params = {
273
- "parent" => request.parent
274
- }
279
+ header_params = {}
280
+ if request.parent
281
+ header_params["parent"] = request.parent
282
+ end
283
+
275
284
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
276
285
  metadata[:"x-goog-request-params"] ||= request_params_header
277
286
 
278
287
  options.apply_defaults timeout: @config.rpcs.list_game_server_clusters.timeout,
279
288
  metadata: metadata,
280
289
  retry_policy: @config.rpcs.list_game_server_clusters.retry_policy
281
- options.apply_defaults metadata: @config.metadata,
290
+
291
+ options.apply_defaults timeout: @config.timeout,
292
+ metadata: @config.metadata,
282
293
  retry_policy: @config.retry_policy
283
294
 
284
295
  @game_server_clusters_service_stub.call_rpc :list_game_server_clusters, request, options: options do |response, operation|
@@ -303,15 +314,21 @@ module Google
303
314
  # @param options [::Gapic::CallOptions, ::Hash]
304
315
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
305
316
  #
306
- # @overload get_game_server_cluster(name: nil)
317
+ # @overload get_game_server_cluster(name: nil, view: nil)
307
318
  # Pass arguments to `get_game_server_cluster` via keyword arguments. Note that at
308
319
  # least one keyword argument is required. To specify no parameters, or to keep all
309
320
  # the default parameter values, pass an empty Hash as a request object (see above).
310
321
  #
311
322
  # @param name [::String]
312
- # Required. The name of the game server cluster to retrieve. Uses the form:
313
- #
323
+ # Required. The name of the game server cluster to retrieve, in the following form:
314
324
  # `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`.
325
+ # @param view [::Google::Cloud::Gaming::V1::GameServerClusterView]
326
+ # Optional. View for the returned GameServerCluster objects. When `FULL` is
327
+ # specified, the `cluster_state` field is also returned in the
328
+ # GameServerCluster object, which includes the state of the referenced
329
+ # Kubernetes cluster such as versions and provider info. The default/unset
330
+ # value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does
331
+ # not return the `cluster_state` field.
315
332
  #
316
333
  # @yield [response, operation] Access the result along with the RPC operation
317
334
  # @yieldparam response [::Google::Cloud::Gaming::V1::GameServerCluster]
@@ -321,6 +338,21 @@ module Google
321
338
  #
322
339
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
323
340
  #
341
+ # @example Basic example
342
+ # require "google/cloud/gaming/v1"
343
+ #
344
+ # # Create a client object. The client can be reused for multiple calls.
345
+ # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
346
+ #
347
+ # # Create a request. To set request fields, pass in keyword arguments.
348
+ # request = Google::Cloud::Gaming::V1::GetGameServerClusterRequest.new
349
+ #
350
+ # # Call the get_game_server_cluster method.
351
+ # result = client.get_game_server_cluster request
352
+ #
353
+ # # The returned object is of type Google::Cloud::Gaming::V1::GameServerCluster.
354
+ # p result
355
+ #
324
356
  def get_game_server_cluster request, options = nil
325
357
  raise ::ArgumentError, "request must be provided" if request.nil?
326
358
 
@@ -338,16 +370,20 @@ module Google
338
370
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
339
371
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
340
372
 
341
- header_params = {
342
- "name" => request.name
343
- }
373
+ header_params = {}
374
+ if request.name
375
+ header_params["name"] = request.name
376
+ end
377
+
344
378
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
345
379
  metadata[:"x-goog-request-params"] ||= request_params_header
346
380
 
347
381
  options.apply_defaults timeout: @config.rpcs.get_game_server_cluster.timeout,
348
382
  metadata: metadata,
349
383
  retry_policy: @config.rpcs.get_game_server_cluster.retry_policy
350
- options.apply_defaults metadata: @config.metadata,
384
+
385
+ options.apply_defaults timeout: @config.timeout,
386
+ metadata: @config.metadata,
351
387
  retry_policy: @config.retry_policy
352
388
 
353
389
  @game_server_clusters_service_stub.call_rpc :get_game_server_cluster, request, options: options do |response, operation|
@@ -377,7 +413,7 @@ module Google
377
413
  # the default parameter values, pass an empty Hash as a request object (see above).
378
414
  #
379
415
  # @param parent [::String]
380
- # Required. The parent resource name. Uses the form:
416
+ # Required. The parent resource name, in the following form:
381
417
  # `projects/{project}/locations/{location}/realms/{realm-id}`.
382
418
  # @param game_server_cluster_id [::String]
383
419
  # Required. The ID of the game server cluster resource to be created.
@@ -392,6 +428,28 @@ module Google
392
428
  #
393
429
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
394
430
  #
431
+ # @example Basic example
432
+ # require "google/cloud/gaming/v1"
433
+ #
434
+ # # Create a client object. The client can be reused for multiple calls.
435
+ # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
436
+ #
437
+ # # Create a request. To set request fields, pass in keyword arguments.
438
+ # request = Google::Cloud::Gaming::V1::CreateGameServerClusterRequest.new
439
+ #
440
+ # # Call the create_game_server_cluster method.
441
+ # result = client.create_game_server_cluster request
442
+ #
443
+ # # The returned object is of type Gapic::Operation. You can use this
444
+ # # object to check the status of an operation, cancel it, or wait
445
+ # # for results. Here is how to block until completion:
446
+ # result.wait_until_done! timeout: 60
447
+ # if result.response?
448
+ # p result.response
449
+ # else
450
+ # puts "Error!"
451
+ # end
452
+ #
395
453
  def create_game_server_cluster request, options = nil
396
454
  raise ::ArgumentError, "request must be provided" if request.nil?
397
455
 
@@ -409,16 +467,20 @@ module Google
409
467
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
410
468
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
411
469
 
412
- header_params = {
413
- "parent" => request.parent
414
- }
470
+ header_params = {}
471
+ if request.parent
472
+ header_params["parent"] = request.parent
473
+ end
474
+
415
475
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
416
476
  metadata[:"x-goog-request-params"] ||= request_params_header
417
477
 
418
478
  options.apply_defaults timeout: @config.rpcs.create_game_server_cluster.timeout,
419
479
  metadata: metadata,
420
480
  retry_policy: @config.rpcs.create_game_server_cluster.retry_policy
421
- options.apply_defaults metadata: @config.metadata,
481
+
482
+ options.apply_defaults timeout: @config.timeout,
483
+ metadata: @config.metadata,
422
484
  retry_policy: @config.retry_policy
423
485
 
424
486
  @game_server_clusters_service_stub.call_rpc :create_game_server_cluster, request, options: options do |response, operation|
@@ -444,13 +506,13 @@ module Google
444
506
  # @param options [::Gapic::CallOptions, ::Hash]
445
507
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
446
508
  #
447
- # @overload preview_create_game_server_cluster(parent: nil, game_server_cluster_id: nil, game_server_cluster: nil, preview_time: nil)
509
+ # @overload preview_create_game_server_cluster(parent: nil, game_server_cluster_id: nil, game_server_cluster: nil, preview_time: nil, view: nil)
448
510
  # Pass arguments to `preview_create_game_server_cluster` via keyword arguments. Note that at
449
511
  # least one keyword argument is required. To specify no parameters, or to keep all
450
512
  # the default parameter values, pass an empty Hash as a request object (see above).
451
513
  #
452
514
  # @param parent [::String]
453
- # Required. The parent resource name. Uses the form:
515
+ # Required. The parent resource name, in the following form:
454
516
  # `projects/{project}/locations/{location}/realms/{realm}`.
455
517
  # @param game_server_cluster_id [::String]
456
518
  # Required. The ID of the game server cluster resource to be created.
@@ -458,6 +520,9 @@ module Google
458
520
  # Required. The game server cluster resource to be created.
459
521
  # @param preview_time [::Google::Protobuf::Timestamp, ::Hash]
460
522
  # Optional. The target timestamp to compute the preview.
523
+ # @param view [::Google::Cloud::Gaming::V1::GameServerClusterView]
524
+ # Optional. This field is deprecated, preview will always return
525
+ # KubernetesClusterState.
461
526
  #
462
527
  # @yield [response, operation] Access the result along with the RPC operation
463
528
  # @yieldparam response [::Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterResponse]
@@ -467,6 +532,21 @@ module Google
467
532
  #
468
533
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
469
534
  #
535
+ # @example Basic example
536
+ # require "google/cloud/gaming/v1"
537
+ #
538
+ # # Create a client object. The client can be reused for multiple calls.
539
+ # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
540
+ #
541
+ # # Create a request. To set request fields, pass in keyword arguments.
542
+ # request = Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterRequest.new
543
+ #
544
+ # # Call the preview_create_game_server_cluster method.
545
+ # result = client.preview_create_game_server_cluster request
546
+ #
547
+ # # The returned object is of type Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterResponse.
548
+ # p result
549
+ #
470
550
  def preview_create_game_server_cluster request, options = nil
471
551
  raise ::ArgumentError, "request must be provided" if request.nil?
472
552
 
@@ -484,16 +564,20 @@ module Google
484
564
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
485
565
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
486
566
 
487
- header_params = {
488
- "parent" => request.parent
489
- }
567
+ header_params = {}
568
+ if request.parent
569
+ header_params["parent"] = request.parent
570
+ end
571
+
490
572
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
491
573
  metadata[:"x-goog-request-params"] ||= request_params_header
492
574
 
493
575
  options.apply_defaults timeout: @config.rpcs.preview_create_game_server_cluster.timeout,
494
576
  metadata: metadata,
495
577
  retry_policy: @config.rpcs.preview_create_game_server_cluster.retry_policy
496
- options.apply_defaults metadata: @config.metadata,
578
+
579
+ options.apply_defaults timeout: @config.timeout,
580
+ metadata: @config.metadata,
497
581
  retry_policy: @config.retry_policy
498
582
 
499
583
  @game_server_clusters_service_stub.call_rpc :preview_create_game_server_cluster, request, options: options do |response, operation|
@@ -523,7 +607,7 @@ module Google
523
607
  # the default parameter values, pass an empty Hash as a request object (see above).
524
608
  #
525
609
  # @param name [::String]
526
- # Required. The name of the game server cluster to delete. Uses the form:
610
+ # Required. The name of the game server cluster to delete, in the following form:
527
611
  # `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.
528
612
  #
529
613
  # @yield [response, operation] Access the result along with the RPC operation
@@ -534,6 +618,28 @@ module Google
534
618
  #
535
619
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
536
620
  #
621
+ # @example Basic example
622
+ # require "google/cloud/gaming/v1"
623
+ #
624
+ # # Create a client object. The client can be reused for multiple calls.
625
+ # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
626
+ #
627
+ # # Create a request. To set request fields, pass in keyword arguments.
628
+ # request = Google::Cloud::Gaming::V1::DeleteGameServerClusterRequest.new
629
+ #
630
+ # # Call the delete_game_server_cluster method.
631
+ # result = client.delete_game_server_cluster request
632
+ #
633
+ # # The returned object is of type Gapic::Operation. You can use this
634
+ # # object to check the status of an operation, cancel it, or wait
635
+ # # for results. Here is how to block until completion:
636
+ # result.wait_until_done! timeout: 60
637
+ # if result.response?
638
+ # p result.response
639
+ # else
640
+ # puts "Error!"
641
+ # end
642
+ #
537
643
  def delete_game_server_cluster request, options = nil
538
644
  raise ::ArgumentError, "request must be provided" if request.nil?
539
645
 
@@ -551,16 +657,20 @@ module Google
551
657
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
552
658
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
553
659
 
554
- header_params = {
555
- "name" => request.name
556
- }
660
+ header_params = {}
661
+ if request.name
662
+ header_params["name"] = request.name
663
+ end
664
+
557
665
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
558
666
  metadata[:"x-goog-request-params"] ||= request_params_header
559
667
 
560
668
  options.apply_defaults timeout: @config.rpcs.delete_game_server_cluster.timeout,
561
669
  metadata: metadata,
562
670
  retry_policy: @config.rpcs.delete_game_server_cluster.retry_policy
563
- options.apply_defaults metadata: @config.metadata,
671
+
672
+ options.apply_defaults timeout: @config.timeout,
673
+ metadata: @config.metadata,
564
674
  retry_policy: @config.retry_policy
565
675
 
566
676
  @game_server_clusters_service_stub.call_rpc :delete_game_server_cluster, request, options: options do |response, operation|
@@ -591,7 +701,7 @@ module Google
591
701
  # the default parameter values, pass an empty Hash as a request object (see above).
592
702
  #
593
703
  # @param name [::String]
594
- # Required. The name of the game server cluster to delete. Uses the form:
704
+ # Required. The name of the game server cluster to delete, in the following form:
595
705
  # `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.
596
706
  # @param preview_time [::Google::Protobuf::Timestamp, ::Hash]
597
707
  # Optional. The target timestamp to compute the preview.
@@ -604,6 +714,21 @@ module Google
604
714
  #
605
715
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
606
716
  #
717
+ # @example Basic example
718
+ # require "google/cloud/gaming/v1"
719
+ #
720
+ # # Create a client object. The client can be reused for multiple calls.
721
+ # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
722
+ #
723
+ # # Create a request. To set request fields, pass in keyword arguments.
724
+ # request = Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterRequest.new
725
+ #
726
+ # # Call the preview_delete_game_server_cluster method.
727
+ # result = client.preview_delete_game_server_cluster request
728
+ #
729
+ # # The returned object is of type Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterResponse.
730
+ # p result
731
+ #
607
732
  def preview_delete_game_server_cluster request, options = nil
608
733
  raise ::ArgumentError, "request must be provided" if request.nil?
609
734
 
@@ -621,16 +746,20 @@ module Google
621
746
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
622
747
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
623
748
 
624
- header_params = {
625
- "name" => request.name
626
- }
749
+ header_params = {}
750
+ if request.name
751
+ header_params["name"] = request.name
752
+ end
753
+
627
754
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
628
755
  metadata[:"x-goog-request-params"] ||= request_params_header
629
756
 
630
757
  options.apply_defaults timeout: @config.rpcs.preview_delete_game_server_cluster.timeout,
631
758
  metadata: metadata,
632
759
  retry_policy: @config.rpcs.preview_delete_game_server_cluster.retry_policy
633
- options.apply_defaults metadata: @config.metadata,
760
+
761
+ options.apply_defaults timeout: @config.timeout,
762
+ metadata: @config.metadata,
634
763
  retry_policy: @config.retry_policy
635
764
 
636
765
  @game_server_clusters_service_stub.call_rpc :preview_delete_game_server_cluster, request, options: options do |response, operation|
@@ -665,10 +794,7 @@ module Google
665
794
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
666
795
  # Required. Mask of fields to update. At least one path must be supplied in
667
796
  # this field. For the `FieldMask` definition, see
668
- #
669
- # https:
670
- # //developers.google.com/protocol-buffers
671
- # // /docs/reference/google.protobuf#fieldmask
797
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
672
798
  #
673
799
  # @yield [response, operation] Access the result along with the RPC operation
674
800
  # @yieldparam response [::Gapic::Operation]
@@ -678,6 +804,28 @@ module Google
678
804
  #
679
805
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
680
806
  #
807
+ # @example Basic example
808
+ # require "google/cloud/gaming/v1"
809
+ #
810
+ # # Create a client object. The client can be reused for multiple calls.
811
+ # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
812
+ #
813
+ # # Create a request. To set request fields, pass in keyword arguments.
814
+ # request = Google::Cloud::Gaming::V1::UpdateGameServerClusterRequest.new
815
+ #
816
+ # # Call the update_game_server_cluster method.
817
+ # result = client.update_game_server_cluster request
818
+ #
819
+ # # The returned object is of type Gapic::Operation. You can use this
820
+ # # object to check the status of an operation, cancel it, or wait
821
+ # # for results. Here is how to block until completion:
822
+ # result.wait_until_done! timeout: 60
823
+ # if result.response?
824
+ # p result.response
825
+ # else
826
+ # puts "Error!"
827
+ # end
828
+ #
681
829
  def update_game_server_cluster request, options = nil
682
830
  raise ::ArgumentError, "request must be provided" if request.nil?
683
831
 
@@ -695,16 +843,20 @@ module Google
695
843
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
696
844
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
697
845
 
698
- header_params = {
699
- "game_server_cluster.name" => request.game_server_cluster.name
700
- }
846
+ header_params = {}
847
+ if request.game_server_cluster&.name
848
+ header_params["game_server_cluster.name"] = request.game_server_cluster.name
849
+ end
850
+
701
851
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
702
852
  metadata[:"x-goog-request-params"] ||= request_params_header
703
853
 
704
854
  options.apply_defaults timeout: @config.rpcs.update_game_server_cluster.timeout,
705
855
  metadata: metadata,
706
856
  retry_policy: @config.rpcs.update_game_server_cluster.retry_policy
707
- options.apply_defaults metadata: @config.metadata,
857
+
858
+ options.apply_defaults timeout: @config.timeout,
859
+ metadata: @config.metadata,
708
860
  retry_policy: @config.retry_policy
709
861
 
710
862
  @game_server_clusters_service_stub.call_rpc :update_game_server_cluster, request, options: options do |response, operation|
@@ -740,10 +892,7 @@ module Google
740
892
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
741
893
  # Required. Mask of fields to update. At least one path must be supplied in
742
894
  # this field. For the `FieldMask` definition, see
743
- #
744
- # https:
745
- # //developers.google.com/protocol-buffers
746
- # // /docs/reference/google.protobuf#fieldmask
895
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
747
896
  # @param preview_time [::Google::Protobuf::Timestamp, ::Hash]
748
897
  # Optional. The target timestamp to compute the preview.
749
898
  #
@@ -755,6 +904,21 @@ module Google
755
904
  #
756
905
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
757
906
  #
907
+ # @example Basic example
908
+ # require "google/cloud/gaming/v1"
909
+ #
910
+ # # Create a client object. The client can be reused for multiple calls.
911
+ # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
912
+ #
913
+ # # Create a request. To set request fields, pass in keyword arguments.
914
+ # request = Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterRequest.new
915
+ #
916
+ # # Call the preview_update_game_server_cluster method.
917
+ # result = client.preview_update_game_server_cluster request
918
+ #
919
+ # # The returned object is of type Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterResponse.
920
+ # p result
921
+ #
758
922
  def preview_update_game_server_cluster request, options = nil
759
923
  raise ::ArgumentError, "request must be provided" if request.nil?
760
924
 
@@ -772,16 +936,20 @@ module Google
772
936
  gapic_version: ::Google::Cloud::Gaming::V1::VERSION
773
937
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
774
938
 
775
- header_params = {
776
- "game_server_cluster.name" => request.game_server_cluster.name
777
- }
939
+ header_params = {}
940
+ if request.game_server_cluster&.name
941
+ header_params["game_server_cluster.name"] = request.game_server_cluster.name
942
+ end
943
+
778
944
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
779
945
  metadata[:"x-goog-request-params"] ||= request_params_header
780
946
 
781
947
  options.apply_defaults timeout: @config.rpcs.preview_update_game_server_cluster.timeout,
782
948
  metadata: metadata,
783
949
  retry_policy: @config.rpcs.preview_update_game_server_cluster.retry_policy
784
- options.apply_defaults metadata: @config.metadata,
950
+
951
+ options.apply_defaults timeout: @config.timeout,
952
+ metadata: @config.metadata,
785
953
  retry_policy: @config.retry_policy
786
954
 
787
955
  @game_server_clusters_service_stub.call_rpc :preview_update_game_server_cluster, request, options: options do |response, operation|
@@ -805,22 +973,21 @@ module Google
805
973
  # Configuration can be applied globally to all clients, or to a single client
806
974
  # on construction.
807
975
  #
808
- # # Examples
809
- #
810
- # To modify the global config, setting the timeout for list_game_server_clusters
811
- # to 20 seconds, and all remaining timeouts to 10 seconds:
812
- #
813
- # ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.configure do |config|
814
- # config.timeout = 10.0
815
- # config.rpcs.list_game_server_clusters.timeout = 20.0
816
- # end
817
- #
818
- # To apply the above configuration only to a new client:
819
- #
820
- # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new do |config|
821
- # config.timeout = 10.0
822
- # config.rpcs.list_game_server_clusters.timeout = 20.0
823
- # end
976
+ # @example
977
+ #
978
+ # # Modify the global config, setting the timeout for
979
+ # # list_game_server_clusters to 20 seconds,
980
+ # # and all remaining timeouts to 10 seconds.
981
+ # ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.configure do |config|
982
+ # config.timeout = 10.0
983
+ # config.rpcs.list_game_server_clusters.timeout = 20.0
984
+ # end
985
+ #
986
+ # # Apply the above configuration only to a new client.
987
+ # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new do |config|
988
+ # config.timeout = 10.0
989
+ # config.rpcs.list_game_server_clusters.timeout = 20.0
990
+ # end
824
991
  #
825
992
  # @!attribute [rw] endpoint
826
993
  # The hostname or hostname:port of the service endpoint.