google-cloud-gaming-v1 0.7.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -143
  3. data/lib/google/cloud/gaming/v1/version.rb +3 -8
  4. metadata +16 -229
  5. data/.yardopts +0 -12
  6. data/AUTHENTICATION.md +0 -151
  7. data/lib/google/cloud/gaming/v1/common_pb.rb +0 -63
  8. data/lib/google/cloud/gaming/v1/game_server_clusters_pb.rb +0 -68
  9. data/lib/google/cloud/gaming/v1/game_server_clusters_service/client.rb +0 -1168
  10. data/lib/google/cloud/gaming/v1/game_server_clusters_service/credentials.rb +0 -51
  11. data/lib/google/cloud/gaming/v1/game_server_clusters_service/operations.rb +0 -770
  12. data/lib/google/cloud/gaming/v1/game_server_clusters_service/paths.rb +0 -73
  13. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest/client.rb +0 -938
  14. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest/operations.rb +0 -795
  15. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest/service_stub.rb +0 -524
  16. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest.rb +0 -54
  17. data/lib/google/cloud/gaming/v1/game_server_clusters_service.rb +0 -57
  18. data/lib/google/cloud/gaming/v1/game_server_clusters_service_pb.rb +0 -46
  19. data/lib/google/cloud/gaming/v1/game_server_clusters_service_services_pb.rb +0 -61
  20. data/lib/google/cloud/gaming/v1/game_server_configs_pb.rb +0 -56
  21. data/lib/google/cloud/gaming/v1/game_server_configs_service/client.rb +0 -738
  22. data/lib/google/cloud/gaming/v1/game_server_configs_service/credentials.rb +0 -51
  23. data/lib/google/cloud/gaming/v1/game_server_configs_service/operations.rb +0 -770
  24. data/lib/google/cloud/gaming/v1/game_server_configs_service/paths.rb +0 -73
  25. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest/client.rb +0 -607
  26. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest/operations.rb +0 -795
  27. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest/service_stub.rb +0 -285
  28. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest.rb +0 -53
  29. data/lib/google/cloud/gaming/v1/game_server_configs_service.rb +0 -56
  30. data/lib/google/cloud/gaming/v1/game_server_configs_service_pb.rb +0 -46
  31. data/lib/google/cloud/gaming/v1/game_server_configs_service_services_pb.rb +0 -55
  32. data/lib/google/cloud/gaming/v1/game_server_deployments_pb.rb +0 -66
  33. data/lib/google/cloud/gaming/v1/game_server_deployments_service/client.rb +0 -1259
  34. data/lib/google/cloud/gaming/v1/game_server_deployments_service/credentials.rb +0 -51
  35. data/lib/google/cloud/gaming/v1/game_server_deployments_service/operations.rb +0 -770
  36. data/lib/google/cloud/gaming/v1/game_server_deployments_service/paths.rb +0 -88
  37. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest/client.rb +0 -999
  38. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest/operations.rb +0 -795
  39. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest/service_stub.rb +0 -584
  40. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest.rb +0 -54
  41. data/lib/google/cloud/gaming/v1/game_server_deployments_service.rb +0 -57
  42. data/lib/google/cloud/gaming/v1/game_server_deployments_service_pb.rb +0 -46
  43. data/lib/google/cloud/gaming/v1/game_server_deployments_service_services_pb.rb +0 -70
  44. data/lib/google/cloud/gaming/v1/realms_pb.rb +0 -59
  45. data/lib/google/cloud/gaming/v1/realms_service/client.rb +0 -947
  46. data/lib/google/cloud/gaming/v1/realms_service/credentials.rb +0 -51
  47. data/lib/google/cloud/gaming/v1/realms_service/operations.rb +0 -770
  48. data/lib/google/cloud/gaming/v1/realms_service/paths.rb +0 -69
  49. data/lib/google/cloud/gaming/v1/realms_service/rest/client.rb +0 -763
  50. data/lib/google/cloud/gaming/v1/realms_service/rest/operations.rb +0 -795
  51. data/lib/google/cloud/gaming/v1/realms_service/rest/service_stub.rb +0 -405
  52. data/lib/google/cloud/gaming/v1/realms_service/rest.rb +0 -54
  53. data/lib/google/cloud/gaming/v1/realms_service.rb +0 -57
  54. data/lib/google/cloud/gaming/v1/realms_service_pb.rb +0 -46
  55. data/lib/google/cloud/gaming/v1/realms_service_services_pb.rb +0 -56
  56. data/lib/google/cloud/gaming/v1/rest.rb +0 -40
  57. data/lib/google/cloud/gaming/v1.rb +0 -48
  58. data/lib/google-cloud-gaming-v1.rb +0 -21
  59. data/proto_docs/README.md +0 -4
  60. data/proto_docs/google/api/client.rb +0 -381
  61. data/proto_docs/google/api/field_behavior.rb +0 -71
  62. data/proto_docs/google/api/launch_stage.rb +0 -71
  63. data/proto_docs/google/api/resource.rb +0 -222
  64. data/proto_docs/google/cloud/gaming/v1/common.rb +0 -302
  65. data/proto_docs/google/cloud/gaming/v1/game_server_clusters.rb +0 -386
  66. data/proto_docs/google/cloud/gaming/v1/game_server_configs.rb +0 -180
  67. data/proto_docs/google/cloud/gaming/v1/game_server_deployments.rb +0 -301
  68. data/proto_docs/google/cloud/gaming/v1/realms.rb +0 -191
  69. data/proto_docs/google/longrunning/operations.rb +0 -164
  70. data/proto_docs/google/protobuf/any.rb +0 -144
  71. data/proto_docs/google/protobuf/duration.rb +0 -98
  72. data/proto_docs/google/protobuf/empty.rb +0 -34
  73. data/proto_docs/google/protobuf/field_mask.rb +0 -229
  74. data/proto_docs/google/protobuf/timestamp.rb +0 -127
  75. data/proto_docs/google/rpc/status.rb +0 -48
@@ -1,1168 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2020 Google LLC
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # https://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
-
19
- require "google/cloud/errors"
20
- require "google/cloud/gaming/v1/game_server_clusters_service_pb"
21
-
22
- module Google
23
- module Cloud
24
- module Gaming
25
- module V1
26
- module GameServerClustersService
27
- ##
28
- # Client for the GameServerClustersService service.
29
- #
30
- # The game server cluster maps to Kubernetes clusters running Agones and is
31
- # used to manage fleets within clusters.
32
- #
33
- class Client
34
- include Paths
35
-
36
- # @private
37
- attr_reader :game_server_clusters_service_stub
38
-
39
- ##
40
- # Configure the GameServerClustersService Client class.
41
- #
42
- # See {::Google::Cloud::Gaming::V1::GameServerClustersService::Client::Configuration}
43
- # for a description of the configuration fields.
44
- #
45
- # @example
46
- #
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
51
- #
52
- # @yield [config] Configure the Client client.
53
- # @yieldparam config [Client::Configuration]
54
- #
55
- # @return [Client::Configuration]
56
- #
57
- def self.configure
58
- @configure ||= begin
59
- namespace = ["Google", "Cloud", "Gaming", "V1"]
60
- parent_config = while namespace.any?
61
- parent_name = namespace.join "::"
62
- parent_const = const_get parent_name
63
- break parent_const.configure if parent_const.respond_to? :configure
64
- namespace.pop
65
- end
66
- default_config = Client::Configuration.new parent_config
67
-
68
- default_config.rpcs.list_game_server_clusters.timeout = 60.0
69
- default_config.rpcs.list_game_server_clusters.retry_policy = {
70
- initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
71
- }
72
-
73
- default_config.rpcs.get_game_server_cluster.timeout = 60.0
74
- default_config.rpcs.get_game_server_cluster.retry_policy = {
75
- initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
76
- }
77
-
78
- default_config.rpcs.create_game_server_cluster.timeout = 120.0
79
-
80
- default_config.rpcs.preview_create_game_server_cluster.timeout = 60.0
81
- default_config.rpcs.preview_create_game_server_cluster.retry_policy = {
82
- initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
83
- }
84
-
85
- default_config.rpcs.delete_game_server_cluster.timeout = 60.0
86
-
87
- default_config.rpcs.preview_delete_game_server_cluster.timeout = 60.0
88
- default_config.rpcs.preview_delete_game_server_cluster.retry_policy = {
89
- initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
90
- }
91
-
92
- default_config.rpcs.update_game_server_cluster.timeout = 60.0
93
-
94
- default_config.rpcs.preview_update_game_server_cluster.timeout = 60.0
95
- default_config.rpcs.preview_update_game_server_cluster.retry_policy = {
96
- initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
97
- }
98
-
99
- default_config
100
- end
101
- yield @configure if block_given?
102
- @configure
103
- end
104
-
105
- ##
106
- # Configure the GameServerClustersService Client instance.
107
- #
108
- # The configuration is set to the derived mode, meaning that values can be changed,
109
- # but structural changes (adding new fields, etc.) are not allowed. Structural changes
110
- # should be made on {Client.configure}.
111
- #
112
- # See {::Google::Cloud::Gaming::V1::GameServerClustersService::Client::Configuration}
113
- # for a description of the configuration fields.
114
- #
115
- # @yield [config] Configure the Client client.
116
- # @yieldparam config [Client::Configuration]
117
- #
118
- # @return [Client::Configuration]
119
- #
120
- def configure
121
- yield @config if block_given?
122
- @config
123
- end
124
-
125
- ##
126
- # Create a new GameServerClustersService client object.
127
- #
128
- # @example
129
- #
130
- # # Create a client using the default configuration
131
- # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
132
- #
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
137
- #
138
- # @yield [config] Configure the GameServerClustersService client.
139
- # @yieldparam config [Client::Configuration]
140
- #
141
- def initialize
142
- # These require statements are intentionally placed here to initialize
143
- # the gRPC module only when it's required.
144
- # See https://github.com/googleapis/toolkit/issues/446
145
- require "gapic/grpc"
146
- require "google/cloud/gaming/v1/game_server_clusters_service_services_pb"
147
-
148
- # Create the configuration object
149
- @config = Configuration.new Client.configure
150
-
151
- # Yield the configuration if needed
152
- yield @config if block_given?
153
-
154
- # Create credentials
155
- credentials = @config.credentials
156
- # Use self-signed JWT if the endpoint is unchanged from default,
157
- # but only if the default endpoint does not have a region prefix.
158
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
159
- !@config.endpoint.split(".").first.include?("-")
160
- credentials ||= Credentials.default scope: @config.scope,
161
- enable_self_signed_jwt: enable_self_signed_jwt
162
- if credentials.is_a?(::String) || credentials.is_a?(::Hash)
163
- credentials = Credentials.new credentials, scope: @config.scope
164
- end
165
- @quota_project_id = @config.quota_project
166
- @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
167
-
168
- @operations_client = Operations.new do |config|
169
- config.credentials = credentials
170
- config.quota_project = @quota_project_id
171
- config.endpoint = @config.endpoint
172
- end
173
-
174
- @game_server_clusters_service_stub = ::Gapic::ServiceStub.new(
175
- ::Google::Cloud::Gaming::V1::GameServerClustersService::Stub,
176
- credentials: credentials,
177
- endpoint: @config.endpoint,
178
- channel_args: @config.channel_args,
179
- interceptors: @config.interceptors
180
- )
181
- end
182
-
183
- ##
184
- # Get the associated client for long-running operations.
185
- #
186
- # @return [::Google::Cloud::Gaming::V1::GameServerClustersService::Operations]
187
- #
188
- attr_reader :operations_client
189
-
190
- # Service calls
191
-
192
- ##
193
- # Lists game server clusters in a given project and location.
194
- #
195
- # @overload list_game_server_clusters(request, options = nil)
196
- # Pass arguments to `list_game_server_clusters` via a request object, either of type
197
- # {::Google::Cloud::Gaming::V1::ListGameServerClustersRequest} or an equivalent Hash.
198
- #
199
- # @param request [::Google::Cloud::Gaming::V1::ListGameServerClustersRequest, ::Hash]
200
- # A request object representing the call parameters. Required. To specify no
201
- # parameters, or to keep all the default parameter values, pass an empty Hash.
202
- # @param options [::Gapic::CallOptions, ::Hash]
203
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
204
- #
205
- # @overload list_game_server_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil)
206
- # Pass arguments to `list_game_server_clusters` via keyword arguments. Note that at
207
- # least one keyword argument is required. To specify no parameters, or to keep all
208
- # the default parameter values, pass an empty Hash as a request object (see above).
209
- #
210
- # @param parent [::String]
211
- # Required. The parent resource name, in the following form:
212
- # "projects/\\{project}/locations/\\{location}/realms/\\{realm}".
213
- # @param page_size [::Integer]
214
- # Optional. The maximum number of items to return. If unspecified, the server
215
- # will pick an appropriate default. The server may return fewer items than
216
- # requested. A caller should only rely on response's
217
- # {::Google::Cloud::Gaming::V1::ListGameServerClustersResponse#next_page_token next_page_token} to
218
- # determine if there are more GameServerClusters left to be queried.
219
- # @param page_token [::String]
220
- # Optional. The next_page_token value returned from a previous List request, if any.
221
- # @param filter [::String]
222
- # Optional. The filter to apply to list results.
223
- # @param order_by [::String]
224
- # Optional. Specifies the ordering of results following syntax at
225
- # https://cloud.google.com/apis/design/design_patterns#sorting_order.
226
- # @param view [::Google::Cloud::Gaming::V1::GameServerClusterView]
227
- # Optional. View for the returned GameServerCluster objects. When `FULL` is
228
- # specified, the `cluster_state` field is also returned in the
229
- # GameServerCluster object, which includes the state of the referenced
230
- # Kubernetes cluster such as versions and provider info. The default/unset
231
- # value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does
232
- # not return the `cluster_state` field.
233
- #
234
- # @yield [response, operation] Access the result along with the RPC operation
235
- # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::GameServerCluster>]
236
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
237
- #
238
- # @return [::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::GameServerCluster>]
239
- #
240
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
241
- #
242
- # @example Basic example
243
- # require "google/cloud/gaming/v1"
244
- #
245
- # # Create a client object. The client can be reused for multiple calls.
246
- # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
247
- #
248
- # # Create a request. To set request fields, pass in keyword arguments.
249
- # request = Google::Cloud::Gaming::V1::ListGameServerClustersRequest.new
250
- #
251
- # # Call the list_game_server_clusters method.
252
- # result = client.list_game_server_clusters request
253
- #
254
- # # The returned object is of type Gapic::PagedEnumerable. You can iterate
255
- # # over elements, and API calls will be issued to fetch pages as needed.
256
- # result.each do |item|
257
- # # Each element is of type ::Google::Cloud::Gaming::V1::GameServerCluster.
258
- # p item
259
- # end
260
- #
261
- def list_game_server_clusters request, options = nil
262
- raise ::ArgumentError, "request must be provided" if request.nil?
263
-
264
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::ListGameServerClustersRequest
265
-
266
- # Converts hash and nil to an options object
267
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
268
-
269
- # Customize the options with defaults
270
- metadata = @config.rpcs.list_game_server_clusters.metadata.to_h
271
-
272
- # Set x-goog-api-client and x-goog-user-project headers
273
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
274
- lib_name: @config.lib_name, lib_version: @config.lib_version,
275
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
276
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
277
-
278
- header_params = {}
279
- if request.parent
280
- header_params["parent"] = request.parent
281
- end
282
-
283
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
284
- metadata[:"x-goog-request-params"] ||= request_params_header
285
-
286
- options.apply_defaults timeout: @config.rpcs.list_game_server_clusters.timeout,
287
- metadata: metadata,
288
- retry_policy: @config.rpcs.list_game_server_clusters.retry_policy
289
-
290
- options.apply_defaults timeout: @config.timeout,
291
- metadata: @config.metadata,
292
- retry_policy: @config.retry_policy
293
-
294
- @game_server_clusters_service_stub.call_rpc :list_game_server_clusters, request, options: options do |response, operation|
295
- response = ::Gapic::PagedEnumerable.new @game_server_clusters_service_stub, :list_game_server_clusters, request, response, operation, options
296
- yield response, operation if block_given?
297
- return response
298
- end
299
- rescue ::GRPC::BadStatus => e
300
- raise ::Google::Cloud::Error.from_error(e)
301
- end
302
-
303
- ##
304
- # Gets details of a single game server cluster.
305
- #
306
- # @overload get_game_server_cluster(request, options = nil)
307
- # Pass arguments to `get_game_server_cluster` via a request object, either of type
308
- # {::Google::Cloud::Gaming::V1::GetGameServerClusterRequest} or an equivalent Hash.
309
- #
310
- # @param request [::Google::Cloud::Gaming::V1::GetGameServerClusterRequest, ::Hash]
311
- # A request object representing the call parameters. Required. To specify no
312
- # parameters, or to keep all the default parameter values, pass an empty Hash.
313
- # @param options [::Gapic::CallOptions, ::Hash]
314
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
315
- #
316
- # @overload get_game_server_cluster(name: nil, view: nil)
317
- # Pass arguments to `get_game_server_cluster` via keyword arguments. Note that at
318
- # least one keyword argument is required. To specify no parameters, or to keep all
319
- # the default parameter values, pass an empty Hash as a request object (see above).
320
- #
321
- # @param name [::String]
322
- # Required. The name of the game server cluster to retrieve, in the following form:
323
- # `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`.
324
- # @param view [::Google::Cloud::Gaming::V1::GameServerClusterView]
325
- # Optional. View for the returned GameServerCluster objects. When `FULL` is
326
- # specified, the `cluster_state` field is also returned in the
327
- # GameServerCluster object, which includes the state of the referenced
328
- # Kubernetes cluster such as versions and provider info. The default/unset
329
- # value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does
330
- # not return the `cluster_state` field.
331
- #
332
- # @yield [response, operation] Access the result along with the RPC operation
333
- # @yieldparam response [::Google::Cloud::Gaming::V1::GameServerCluster]
334
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
335
- #
336
- # @return [::Google::Cloud::Gaming::V1::GameServerCluster]
337
- #
338
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
339
- #
340
- # @example Basic example
341
- # require "google/cloud/gaming/v1"
342
- #
343
- # # Create a client object. The client can be reused for multiple calls.
344
- # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
345
- #
346
- # # Create a request. To set request fields, pass in keyword arguments.
347
- # request = Google::Cloud::Gaming::V1::GetGameServerClusterRequest.new
348
- #
349
- # # Call the get_game_server_cluster method.
350
- # result = client.get_game_server_cluster request
351
- #
352
- # # The returned object is of type Google::Cloud::Gaming::V1::GameServerCluster.
353
- # p result
354
- #
355
- def get_game_server_cluster request, options = nil
356
- raise ::ArgumentError, "request must be provided" if request.nil?
357
-
358
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::GetGameServerClusterRequest
359
-
360
- # Converts hash and nil to an options object
361
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
362
-
363
- # Customize the options with defaults
364
- metadata = @config.rpcs.get_game_server_cluster.metadata.to_h
365
-
366
- # Set x-goog-api-client and x-goog-user-project headers
367
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
368
- lib_name: @config.lib_name, lib_version: @config.lib_version,
369
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
370
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
371
-
372
- header_params = {}
373
- if request.name
374
- header_params["name"] = request.name
375
- end
376
-
377
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
378
- metadata[:"x-goog-request-params"] ||= request_params_header
379
-
380
- options.apply_defaults timeout: @config.rpcs.get_game_server_cluster.timeout,
381
- metadata: metadata,
382
- retry_policy: @config.rpcs.get_game_server_cluster.retry_policy
383
-
384
- options.apply_defaults timeout: @config.timeout,
385
- metadata: @config.metadata,
386
- retry_policy: @config.retry_policy
387
-
388
- @game_server_clusters_service_stub.call_rpc :get_game_server_cluster, request, options: options do |response, operation|
389
- yield response, operation if block_given?
390
- return response
391
- end
392
- rescue ::GRPC::BadStatus => e
393
- raise ::Google::Cloud::Error.from_error(e)
394
- end
395
-
396
- ##
397
- # Creates a new game server cluster in a given project and location.
398
- #
399
- # @overload create_game_server_cluster(request, options = nil)
400
- # Pass arguments to `create_game_server_cluster` via a request object, either of type
401
- # {::Google::Cloud::Gaming::V1::CreateGameServerClusterRequest} or an equivalent Hash.
402
- #
403
- # @param request [::Google::Cloud::Gaming::V1::CreateGameServerClusterRequest, ::Hash]
404
- # A request object representing the call parameters. Required. To specify no
405
- # parameters, or to keep all the default parameter values, pass an empty Hash.
406
- # @param options [::Gapic::CallOptions, ::Hash]
407
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
408
- #
409
- # @overload create_game_server_cluster(parent: nil, game_server_cluster_id: nil, game_server_cluster: nil)
410
- # Pass arguments to `create_game_server_cluster` via keyword arguments. Note that at
411
- # least one keyword argument is required. To specify no parameters, or to keep all
412
- # the default parameter values, pass an empty Hash as a request object (see above).
413
- #
414
- # @param parent [::String]
415
- # Required. The parent resource name, in the following form:
416
- # `projects/{project}/locations/{location}/realms/{realm-id}`.
417
- # @param game_server_cluster_id [::String]
418
- # Required. The ID of the game server cluster resource to be created.
419
- # @param game_server_cluster [::Google::Cloud::Gaming::V1::GameServerCluster, ::Hash]
420
- # Required. The game server cluster resource to be created.
421
- #
422
- # @yield [response, operation] Access the result along with the RPC operation
423
- # @yieldparam response [::Gapic::Operation]
424
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
425
- #
426
- # @return [::Gapic::Operation]
427
- #
428
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
429
- #
430
- # @example Basic example
431
- # require "google/cloud/gaming/v1"
432
- #
433
- # # Create a client object. The client can be reused for multiple calls.
434
- # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
435
- #
436
- # # Create a request. To set request fields, pass in keyword arguments.
437
- # request = Google::Cloud::Gaming::V1::CreateGameServerClusterRequest.new
438
- #
439
- # # Call the create_game_server_cluster method.
440
- # result = client.create_game_server_cluster 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
- #
452
- def create_game_server_cluster request, options = nil
453
- raise ::ArgumentError, "request must be provided" if request.nil?
454
-
455
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::CreateGameServerClusterRequest
456
-
457
- # Converts hash and nil to an options object
458
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
459
-
460
- # Customize the options with defaults
461
- metadata = @config.rpcs.create_game_server_cluster.metadata.to_h
462
-
463
- # Set x-goog-api-client and x-goog-user-project headers
464
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
465
- lib_name: @config.lib_name, lib_version: @config.lib_version,
466
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
467
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
468
-
469
- header_params = {}
470
- if request.parent
471
- header_params["parent"] = request.parent
472
- end
473
-
474
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
475
- metadata[:"x-goog-request-params"] ||= request_params_header
476
-
477
- options.apply_defaults timeout: @config.rpcs.create_game_server_cluster.timeout,
478
- metadata: metadata,
479
- retry_policy: @config.rpcs.create_game_server_cluster.retry_policy
480
-
481
- options.apply_defaults timeout: @config.timeout,
482
- metadata: @config.metadata,
483
- retry_policy: @config.retry_policy
484
-
485
- @game_server_clusters_service_stub.call_rpc :create_game_server_cluster, request, options: options do |response, operation|
486
- response = ::Gapic::Operation.new response, @operations_client, options: options
487
- yield response, operation if block_given?
488
- return response
489
- end
490
- rescue ::GRPC::BadStatus => e
491
- raise ::Google::Cloud::Error.from_error(e)
492
- end
493
-
494
- ##
495
- # Previews creation of a new game server cluster in a given project and
496
- # location.
497
- #
498
- # @overload preview_create_game_server_cluster(request, options = nil)
499
- # Pass arguments to `preview_create_game_server_cluster` via a request object, either of type
500
- # {::Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterRequest} or an equivalent Hash.
501
- #
502
- # @param request [::Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterRequest, ::Hash]
503
- # A request object representing the call parameters. Required. To specify no
504
- # parameters, or to keep all the default parameter values, pass an empty Hash.
505
- # @param options [::Gapic::CallOptions, ::Hash]
506
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
507
- #
508
- # @overload preview_create_game_server_cluster(parent: nil, game_server_cluster_id: nil, game_server_cluster: nil, preview_time: nil, view: nil)
509
- # Pass arguments to `preview_create_game_server_cluster` via keyword arguments. Note that at
510
- # least one keyword argument is required. To specify no parameters, or to keep all
511
- # the default parameter values, pass an empty Hash as a request object (see above).
512
- #
513
- # @param parent [::String]
514
- # Required. The parent resource name, in the following form:
515
- # `projects/{project}/locations/{location}/realms/{realm}`.
516
- # @param game_server_cluster_id [::String]
517
- # Required. The ID of the game server cluster resource to be created.
518
- # @param game_server_cluster [::Google::Cloud::Gaming::V1::GameServerCluster, ::Hash]
519
- # Required. The game server cluster resource to be created.
520
- # @param preview_time [::Google::Protobuf::Timestamp, ::Hash]
521
- # Optional. The target timestamp to compute the preview.
522
- # @param view [::Google::Cloud::Gaming::V1::GameServerClusterView]
523
- # Optional. This field is deprecated, preview will always return
524
- # KubernetesClusterState.
525
- #
526
- # @yield [response, operation] Access the result along with the RPC operation
527
- # @yieldparam response [::Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterResponse]
528
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
529
- #
530
- # @return [::Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterResponse]
531
- #
532
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
533
- #
534
- # @example Basic example
535
- # require "google/cloud/gaming/v1"
536
- #
537
- # # Create a client object. The client can be reused for multiple calls.
538
- # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
539
- #
540
- # # Create a request. To set request fields, pass in keyword arguments.
541
- # request = Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterRequest.new
542
- #
543
- # # Call the preview_create_game_server_cluster method.
544
- # result = client.preview_create_game_server_cluster request
545
- #
546
- # # The returned object is of type Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterResponse.
547
- # p result
548
- #
549
- def preview_create_game_server_cluster request, options = nil
550
- raise ::ArgumentError, "request must be provided" if request.nil?
551
-
552
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterRequest
553
-
554
- # Converts hash and nil to an options object
555
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
556
-
557
- # Customize the options with defaults
558
- metadata = @config.rpcs.preview_create_game_server_cluster.metadata.to_h
559
-
560
- # Set x-goog-api-client and x-goog-user-project headers
561
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
562
- lib_name: @config.lib_name, lib_version: @config.lib_version,
563
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
564
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
565
-
566
- header_params = {}
567
- if request.parent
568
- header_params["parent"] = request.parent
569
- end
570
-
571
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
572
- metadata[:"x-goog-request-params"] ||= request_params_header
573
-
574
- options.apply_defaults timeout: @config.rpcs.preview_create_game_server_cluster.timeout,
575
- metadata: metadata,
576
- retry_policy: @config.rpcs.preview_create_game_server_cluster.retry_policy
577
-
578
- options.apply_defaults timeout: @config.timeout,
579
- metadata: @config.metadata,
580
- retry_policy: @config.retry_policy
581
-
582
- @game_server_clusters_service_stub.call_rpc :preview_create_game_server_cluster, request, options: options do |response, operation|
583
- yield response, operation if block_given?
584
- return response
585
- end
586
- rescue ::GRPC::BadStatus => e
587
- raise ::Google::Cloud::Error.from_error(e)
588
- end
589
-
590
- ##
591
- # Deletes a single game server cluster.
592
- #
593
- # @overload delete_game_server_cluster(request, options = nil)
594
- # Pass arguments to `delete_game_server_cluster` via a request object, either of type
595
- # {::Google::Cloud::Gaming::V1::DeleteGameServerClusterRequest} or an equivalent Hash.
596
- #
597
- # @param request [::Google::Cloud::Gaming::V1::DeleteGameServerClusterRequest, ::Hash]
598
- # A request object representing the call parameters. Required. To specify no
599
- # parameters, or to keep all the default parameter values, pass an empty Hash.
600
- # @param options [::Gapic::CallOptions, ::Hash]
601
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
602
- #
603
- # @overload delete_game_server_cluster(name: nil)
604
- # Pass arguments to `delete_game_server_cluster` via keyword arguments. Note that at
605
- # least one keyword argument is required. To specify no parameters, or to keep all
606
- # the default parameter values, pass an empty Hash as a request object (see above).
607
- #
608
- # @param name [::String]
609
- # Required. The name of the game server cluster to delete, in the following form:
610
- # `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.
611
- #
612
- # @yield [response, operation] Access the result along with the RPC operation
613
- # @yieldparam response [::Gapic::Operation]
614
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
615
- #
616
- # @return [::Gapic::Operation]
617
- #
618
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
619
- #
620
- # @example Basic example
621
- # require "google/cloud/gaming/v1"
622
- #
623
- # # Create a client object. The client can be reused for multiple calls.
624
- # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
625
- #
626
- # # Create a request. To set request fields, pass in keyword arguments.
627
- # request = Google::Cloud::Gaming::V1::DeleteGameServerClusterRequest.new
628
- #
629
- # # Call the delete_game_server_cluster method.
630
- # result = client.delete_game_server_cluster request
631
- #
632
- # # The returned object is of type Gapic::Operation. You can use it to
633
- # # check the status of an operation, cancel it, or wait for results.
634
- # # Here is how to wait for a response.
635
- # result.wait_until_done! timeout: 60
636
- # if result.response?
637
- # p result.response
638
- # else
639
- # puts "No response received."
640
- # end
641
- #
642
- def delete_game_server_cluster request, options = nil
643
- raise ::ArgumentError, "request must be provided" if request.nil?
644
-
645
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::DeleteGameServerClusterRequest
646
-
647
- # Converts hash and nil to an options object
648
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
649
-
650
- # Customize the options with defaults
651
- metadata = @config.rpcs.delete_game_server_cluster.metadata.to_h
652
-
653
- # Set x-goog-api-client and x-goog-user-project headers
654
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
655
- lib_name: @config.lib_name, lib_version: @config.lib_version,
656
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
657
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
658
-
659
- header_params = {}
660
- if request.name
661
- header_params["name"] = request.name
662
- end
663
-
664
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
665
- metadata[:"x-goog-request-params"] ||= request_params_header
666
-
667
- options.apply_defaults timeout: @config.rpcs.delete_game_server_cluster.timeout,
668
- metadata: metadata,
669
- retry_policy: @config.rpcs.delete_game_server_cluster.retry_policy
670
-
671
- options.apply_defaults timeout: @config.timeout,
672
- metadata: @config.metadata,
673
- retry_policy: @config.retry_policy
674
-
675
- @game_server_clusters_service_stub.call_rpc :delete_game_server_cluster, request, options: options do |response, operation|
676
- response = ::Gapic::Operation.new response, @operations_client, options: options
677
- yield response, operation if block_given?
678
- return response
679
- end
680
- rescue ::GRPC::BadStatus => e
681
- raise ::Google::Cloud::Error.from_error(e)
682
- end
683
-
684
- ##
685
- # Previews deletion of a single game server cluster.
686
- #
687
- # @overload preview_delete_game_server_cluster(request, options = nil)
688
- # Pass arguments to `preview_delete_game_server_cluster` via a request object, either of type
689
- # {::Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterRequest} or an equivalent Hash.
690
- #
691
- # @param request [::Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterRequest, ::Hash]
692
- # A request object representing the call parameters. Required. To specify no
693
- # parameters, or to keep all the default parameter values, pass an empty Hash.
694
- # @param options [::Gapic::CallOptions, ::Hash]
695
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
696
- #
697
- # @overload preview_delete_game_server_cluster(name: nil, preview_time: nil)
698
- # Pass arguments to `preview_delete_game_server_cluster` via keyword arguments. Note that at
699
- # least one keyword argument is required. To specify no parameters, or to keep all
700
- # the default parameter values, pass an empty Hash as a request object (see above).
701
- #
702
- # @param name [::String]
703
- # Required. The name of the game server cluster to delete, in the following form:
704
- # `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.
705
- # @param preview_time [::Google::Protobuf::Timestamp, ::Hash]
706
- # Optional. The target timestamp to compute the preview.
707
- #
708
- # @yield [response, operation] Access the result along with the RPC operation
709
- # @yieldparam response [::Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterResponse]
710
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
711
- #
712
- # @return [::Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterResponse]
713
- #
714
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
715
- #
716
- # @example Basic example
717
- # require "google/cloud/gaming/v1"
718
- #
719
- # # Create a client object. The client can be reused for multiple calls.
720
- # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
721
- #
722
- # # Create a request. To set request fields, pass in keyword arguments.
723
- # request = Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterRequest.new
724
- #
725
- # # Call the preview_delete_game_server_cluster method.
726
- # result = client.preview_delete_game_server_cluster request
727
- #
728
- # # The returned object is of type Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterResponse.
729
- # p result
730
- #
731
- def preview_delete_game_server_cluster request, options = nil
732
- raise ::ArgumentError, "request must be provided" if request.nil?
733
-
734
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterRequest
735
-
736
- # Converts hash and nil to an options object
737
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
738
-
739
- # Customize the options with defaults
740
- metadata = @config.rpcs.preview_delete_game_server_cluster.metadata.to_h
741
-
742
- # Set x-goog-api-client and x-goog-user-project headers
743
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
744
- lib_name: @config.lib_name, lib_version: @config.lib_version,
745
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
746
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
747
-
748
- header_params = {}
749
- if request.name
750
- header_params["name"] = request.name
751
- end
752
-
753
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
754
- metadata[:"x-goog-request-params"] ||= request_params_header
755
-
756
- options.apply_defaults timeout: @config.rpcs.preview_delete_game_server_cluster.timeout,
757
- metadata: metadata,
758
- retry_policy: @config.rpcs.preview_delete_game_server_cluster.retry_policy
759
-
760
- options.apply_defaults timeout: @config.timeout,
761
- metadata: @config.metadata,
762
- retry_policy: @config.retry_policy
763
-
764
- @game_server_clusters_service_stub.call_rpc :preview_delete_game_server_cluster, request, options: options do |response, operation|
765
- yield response, operation if block_given?
766
- return response
767
- end
768
- rescue ::GRPC::BadStatus => e
769
- raise ::Google::Cloud::Error.from_error(e)
770
- end
771
-
772
- ##
773
- # Patches a single game server cluster.
774
- #
775
- # @overload update_game_server_cluster(request, options = nil)
776
- # Pass arguments to `update_game_server_cluster` via a request object, either of type
777
- # {::Google::Cloud::Gaming::V1::UpdateGameServerClusterRequest} or an equivalent Hash.
778
- #
779
- # @param request [::Google::Cloud::Gaming::V1::UpdateGameServerClusterRequest, ::Hash]
780
- # A request object representing the call parameters. Required. To specify no
781
- # parameters, or to keep all the default parameter values, pass an empty Hash.
782
- # @param options [::Gapic::CallOptions, ::Hash]
783
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
784
- #
785
- # @overload update_game_server_cluster(game_server_cluster: nil, update_mask: nil)
786
- # Pass arguments to `update_game_server_cluster` via keyword arguments. Note that at
787
- # least one keyword argument is required. To specify no parameters, or to keep all
788
- # the default parameter values, pass an empty Hash as a request object (see above).
789
- #
790
- # @param game_server_cluster [::Google::Cloud::Gaming::V1::GameServerCluster, ::Hash]
791
- # Required. The game server cluster to be updated.
792
- # Only fields specified in update_mask are updated.
793
- # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
794
- # Required. Mask of fields to update. At least one path must be supplied in
795
- # this field. For the `FieldMask` definition, see
796
- # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
797
- #
798
- # @yield [response, operation] Access the result along with the RPC operation
799
- # @yieldparam response [::Gapic::Operation]
800
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
801
- #
802
- # @return [::Gapic::Operation]
803
- #
804
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
805
- #
806
- # @example Basic example
807
- # require "google/cloud/gaming/v1"
808
- #
809
- # # Create a client object. The client can be reused for multiple calls.
810
- # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
811
- #
812
- # # Create a request. To set request fields, pass in keyword arguments.
813
- # request = Google::Cloud::Gaming::V1::UpdateGameServerClusterRequest.new
814
- #
815
- # # Call the update_game_server_cluster method.
816
- # result = client.update_game_server_cluster request
817
- #
818
- # # The returned object is of type Gapic::Operation. You can use it to
819
- # # check the status of an operation, cancel it, or wait for results.
820
- # # Here is how to wait for a response.
821
- # result.wait_until_done! timeout: 60
822
- # if result.response?
823
- # p result.response
824
- # else
825
- # puts "No response received."
826
- # end
827
- #
828
- def update_game_server_cluster request, options = nil
829
- raise ::ArgumentError, "request must be provided" if request.nil?
830
-
831
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::UpdateGameServerClusterRequest
832
-
833
- # Converts hash and nil to an options object
834
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
835
-
836
- # Customize the options with defaults
837
- metadata = @config.rpcs.update_game_server_cluster.metadata.to_h
838
-
839
- # Set x-goog-api-client and x-goog-user-project headers
840
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
841
- lib_name: @config.lib_name, lib_version: @config.lib_version,
842
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
843
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
844
-
845
- header_params = {}
846
- if request.game_server_cluster&.name
847
- header_params["game_server_cluster.name"] = request.game_server_cluster.name
848
- end
849
-
850
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
851
- metadata[:"x-goog-request-params"] ||= request_params_header
852
-
853
- options.apply_defaults timeout: @config.rpcs.update_game_server_cluster.timeout,
854
- metadata: metadata,
855
- retry_policy: @config.rpcs.update_game_server_cluster.retry_policy
856
-
857
- options.apply_defaults timeout: @config.timeout,
858
- metadata: @config.metadata,
859
- retry_policy: @config.retry_policy
860
-
861
- @game_server_clusters_service_stub.call_rpc :update_game_server_cluster, request, options: options do |response, operation|
862
- response = ::Gapic::Operation.new response, @operations_client, options: options
863
- yield response, operation if block_given?
864
- return response
865
- end
866
- rescue ::GRPC::BadStatus => e
867
- raise ::Google::Cloud::Error.from_error(e)
868
- end
869
-
870
- ##
871
- # Previews updating a GameServerCluster.
872
- #
873
- # @overload preview_update_game_server_cluster(request, options = nil)
874
- # Pass arguments to `preview_update_game_server_cluster` via a request object, either of type
875
- # {::Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterRequest} or an equivalent Hash.
876
- #
877
- # @param request [::Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterRequest, ::Hash]
878
- # A request object representing the call parameters. Required. To specify no
879
- # parameters, or to keep all the default parameter values, pass an empty Hash.
880
- # @param options [::Gapic::CallOptions, ::Hash]
881
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
882
- #
883
- # @overload preview_update_game_server_cluster(game_server_cluster: nil, update_mask: nil, preview_time: nil)
884
- # Pass arguments to `preview_update_game_server_cluster` via keyword arguments. Note that at
885
- # least one keyword argument is required. To specify no parameters, or to keep all
886
- # the default parameter values, pass an empty Hash as a request object (see above).
887
- #
888
- # @param game_server_cluster [::Google::Cloud::Gaming::V1::GameServerCluster, ::Hash]
889
- # Required. The game server cluster to be updated.
890
- # Only fields specified in update_mask are updated.
891
- # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
892
- # Required. Mask of fields to update. At least one path must be supplied in
893
- # this field. For the `FieldMask` definition, see
894
- # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
895
- # @param preview_time [::Google::Protobuf::Timestamp, ::Hash]
896
- # Optional. The target timestamp to compute the preview.
897
- #
898
- # @yield [response, operation] Access the result along with the RPC operation
899
- # @yieldparam response [::Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterResponse]
900
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
901
- #
902
- # @return [::Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterResponse]
903
- #
904
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
905
- #
906
- # @example Basic example
907
- # require "google/cloud/gaming/v1"
908
- #
909
- # # Create a client object. The client can be reused for multiple calls.
910
- # client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
911
- #
912
- # # Create a request. To set request fields, pass in keyword arguments.
913
- # request = Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterRequest.new
914
- #
915
- # # Call the preview_update_game_server_cluster method.
916
- # result = client.preview_update_game_server_cluster request
917
- #
918
- # # The returned object is of type Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterResponse.
919
- # p result
920
- #
921
- def preview_update_game_server_cluster request, options = nil
922
- raise ::ArgumentError, "request must be provided" if request.nil?
923
-
924
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterRequest
925
-
926
- # Converts hash and nil to an options object
927
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
928
-
929
- # Customize the options with defaults
930
- metadata = @config.rpcs.preview_update_game_server_cluster.metadata.to_h
931
-
932
- # Set x-goog-api-client and x-goog-user-project headers
933
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
934
- lib_name: @config.lib_name, lib_version: @config.lib_version,
935
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
936
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
937
-
938
- header_params = {}
939
- if request.game_server_cluster&.name
940
- header_params["game_server_cluster.name"] = request.game_server_cluster.name
941
- end
942
-
943
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
944
- metadata[:"x-goog-request-params"] ||= request_params_header
945
-
946
- options.apply_defaults timeout: @config.rpcs.preview_update_game_server_cluster.timeout,
947
- metadata: metadata,
948
- retry_policy: @config.rpcs.preview_update_game_server_cluster.retry_policy
949
-
950
- options.apply_defaults timeout: @config.timeout,
951
- metadata: @config.metadata,
952
- retry_policy: @config.retry_policy
953
-
954
- @game_server_clusters_service_stub.call_rpc :preview_update_game_server_cluster, request, options: options do |response, operation|
955
- yield response, operation if block_given?
956
- return response
957
- end
958
- rescue ::GRPC::BadStatus => e
959
- raise ::Google::Cloud::Error.from_error(e)
960
- end
961
-
962
- ##
963
- # Configuration class for the GameServerClustersService API.
964
- #
965
- # This class represents the configuration for GameServerClustersService,
966
- # providing control over timeouts, retry behavior, logging, transport
967
- # parameters, and other low-level controls. Certain parameters can also be
968
- # applied individually to specific RPCs. See
969
- # {::Google::Cloud::Gaming::V1::GameServerClustersService::Client::Configuration::Rpcs}
970
- # for a list of RPCs that can be configured independently.
971
- #
972
- # Configuration can be applied globally to all clients, or to a single client
973
- # on construction.
974
- #
975
- # @example
976
- #
977
- # # Modify the global config, setting the timeout for
978
- # # list_game_server_clusters to 20 seconds,
979
- # # and all remaining timeouts to 10 seconds.
980
- # ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.configure do |config|
981
- # config.timeout = 10.0
982
- # config.rpcs.list_game_server_clusters.timeout = 20.0
983
- # end
984
- #
985
- # # Apply the above configuration only to a new client.
986
- # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new do |config|
987
- # config.timeout = 10.0
988
- # config.rpcs.list_game_server_clusters.timeout = 20.0
989
- # end
990
- #
991
- # @!attribute [rw] endpoint
992
- # The hostname or hostname:port of the service endpoint.
993
- # Defaults to `"gameservices.googleapis.com"`.
994
- # @return [::String]
995
- # @!attribute [rw] credentials
996
- # Credentials to send with calls. You may provide any of the following types:
997
- # * (`String`) The path to a service account key file in JSON format
998
- # * (`Hash`) A service account key as a Hash
999
- # * (`Google::Auth::Credentials`) A googleauth credentials object
1000
- # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1001
- # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1002
- # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1003
- # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1004
- # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1005
- # * (`nil`) indicating no credentials
1006
- # @return [::Object]
1007
- # @!attribute [rw] scope
1008
- # The OAuth scopes
1009
- # @return [::Array<::String>]
1010
- # @!attribute [rw] lib_name
1011
- # The library name as recorded in instrumentation and logging
1012
- # @return [::String]
1013
- # @!attribute [rw] lib_version
1014
- # The library version as recorded in instrumentation and logging
1015
- # @return [::String]
1016
- # @!attribute [rw] channel_args
1017
- # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1018
- # `GRPC::Core::Channel` object is provided as the credential.
1019
- # @return [::Hash]
1020
- # @!attribute [rw] interceptors
1021
- # An array of interceptors that are run before calls are executed.
1022
- # @return [::Array<::GRPC::ClientInterceptor>]
1023
- # @!attribute [rw] timeout
1024
- # The call timeout in seconds.
1025
- # @return [::Numeric]
1026
- # @!attribute [rw] metadata
1027
- # Additional gRPC headers to be sent with the call.
1028
- # @return [::Hash{::Symbol=>::String}]
1029
- # @!attribute [rw] retry_policy
1030
- # The retry policy. The value is a hash with the following keys:
1031
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1032
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1033
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1034
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1035
- # trigger a retry.
1036
- # @return [::Hash]
1037
- # @!attribute [rw] quota_project
1038
- # A separate project against which to charge quota.
1039
- # @return [::String]
1040
- #
1041
- class Configuration
1042
- extend ::Gapic::Config
1043
-
1044
- DEFAULT_ENDPOINT = "gameservices.googleapis.com"
1045
-
1046
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1047
- config_attr :credentials, nil do |value|
1048
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1049
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1050
- allowed.any? { |klass| klass === value }
1051
- end
1052
- config_attr :scope, nil, ::String, ::Array, nil
1053
- config_attr :lib_name, nil, ::String, nil
1054
- config_attr :lib_version, nil, ::String, nil
1055
- config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1056
- config_attr :interceptors, nil, ::Array, nil
1057
- config_attr :timeout, nil, ::Numeric, nil
1058
- config_attr :metadata, nil, ::Hash, nil
1059
- config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1060
- config_attr :quota_project, nil, ::String, nil
1061
-
1062
- # @private
1063
- def initialize parent_config = nil
1064
- @parent_config = parent_config unless parent_config.nil?
1065
-
1066
- yield self if block_given?
1067
- end
1068
-
1069
- ##
1070
- # Configurations for individual RPCs
1071
- # @return [Rpcs]
1072
- #
1073
- def rpcs
1074
- @rpcs ||= begin
1075
- parent_rpcs = nil
1076
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1077
- Rpcs.new parent_rpcs
1078
- end
1079
- end
1080
-
1081
- ##
1082
- # Configuration RPC class for the GameServerClustersService API.
1083
- #
1084
- # Includes fields providing the configuration for each RPC in this service.
1085
- # Each configuration object is of type `Gapic::Config::Method` and includes
1086
- # the following configuration fields:
1087
- #
1088
- # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1089
- # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1090
- # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1091
- # include the following keys:
1092
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1093
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1094
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1095
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1096
- # trigger a retry.
1097
- #
1098
- class Rpcs
1099
- ##
1100
- # RPC-specific configuration for `list_game_server_clusters`
1101
- # @return [::Gapic::Config::Method]
1102
- #
1103
- attr_reader :list_game_server_clusters
1104
- ##
1105
- # RPC-specific configuration for `get_game_server_cluster`
1106
- # @return [::Gapic::Config::Method]
1107
- #
1108
- attr_reader :get_game_server_cluster
1109
- ##
1110
- # RPC-specific configuration for `create_game_server_cluster`
1111
- # @return [::Gapic::Config::Method]
1112
- #
1113
- attr_reader :create_game_server_cluster
1114
- ##
1115
- # RPC-specific configuration for `preview_create_game_server_cluster`
1116
- # @return [::Gapic::Config::Method]
1117
- #
1118
- attr_reader :preview_create_game_server_cluster
1119
- ##
1120
- # RPC-specific configuration for `delete_game_server_cluster`
1121
- # @return [::Gapic::Config::Method]
1122
- #
1123
- attr_reader :delete_game_server_cluster
1124
- ##
1125
- # RPC-specific configuration for `preview_delete_game_server_cluster`
1126
- # @return [::Gapic::Config::Method]
1127
- #
1128
- attr_reader :preview_delete_game_server_cluster
1129
- ##
1130
- # RPC-specific configuration for `update_game_server_cluster`
1131
- # @return [::Gapic::Config::Method]
1132
- #
1133
- attr_reader :update_game_server_cluster
1134
- ##
1135
- # RPC-specific configuration for `preview_update_game_server_cluster`
1136
- # @return [::Gapic::Config::Method]
1137
- #
1138
- attr_reader :preview_update_game_server_cluster
1139
-
1140
- # @private
1141
- def initialize parent_rpcs = nil
1142
- list_game_server_clusters_config = parent_rpcs.list_game_server_clusters if parent_rpcs.respond_to? :list_game_server_clusters
1143
- @list_game_server_clusters = ::Gapic::Config::Method.new list_game_server_clusters_config
1144
- get_game_server_cluster_config = parent_rpcs.get_game_server_cluster if parent_rpcs.respond_to? :get_game_server_cluster
1145
- @get_game_server_cluster = ::Gapic::Config::Method.new get_game_server_cluster_config
1146
- create_game_server_cluster_config = parent_rpcs.create_game_server_cluster if parent_rpcs.respond_to? :create_game_server_cluster
1147
- @create_game_server_cluster = ::Gapic::Config::Method.new create_game_server_cluster_config
1148
- preview_create_game_server_cluster_config = parent_rpcs.preview_create_game_server_cluster if parent_rpcs.respond_to? :preview_create_game_server_cluster
1149
- @preview_create_game_server_cluster = ::Gapic::Config::Method.new preview_create_game_server_cluster_config
1150
- delete_game_server_cluster_config = parent_rpcs.delete_game_server_cluster if parent_rpcs.respond_to? :delete_game_server_cluster
1151
- @delete_game_server_cluster = ::Gapic::Config::Method.new delete_game_server_cluster_config
1152
- preview_delete_game_server_cluster_config = parent_rpcs.preview_delete_game_server_cluster if parent_rpcs.respond_to? :preview_delete_game_server_cluster
1153
- @preview_delete_game_server_cluster = ::Gapic::Config::Method.new preview_delete_game_server_cluster_config
1154
- update_game_server_cluster_config = parent_rpcs.update_game_server_cluster if parent_rpcs.respond_to? :update_game_server_cluster
1155
- @update_game_server_cluster = ::Gapic::Config::Method.new update_game_server_cluster_config
1156
- preview_update_game_server_cluster_config = parent_rpcs.preview_update_game_server_cluster if parent_rpcs.respond_to? :preview_update_game_server_cluster
1157
- @preview_update_game_server_cluster = ::Gapic::Config::Method.new preview_update_game_server_cluster_config
1158
-
1159
- yield self if block_given?
1160
- end
1161
- end
1162
- end
1163
- end
1164
- end
1165
- end
1166
- end
1167
- end
1168
- end