google-cloud-gaming-v1 0.5.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +3 -3
  4. data/lib/google/cloud/gaming/v1/common_pb.rb +26 -80
  5. data/lib/google/cloud/gaming/v1/game_server_clusters_pb.rb +27 -101
  6. data/lib/google/cloud/gaming/v1/game_server_clusters_service/client.rb +22 -22
  7. data/lib/google/cloud/gaming/v1/game_server_clusters_service/operations.rb +17 -17
  8. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest/client.rb +938 -0
  9. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest/operations.rb +795 -0
  10. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest/service_stub.rb +524 -0
  11. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest.rb +54 -0
  12. data/lib/google/cloud/gaming/v1/game_server_clusters_service.rb +7 -1
  13. data/lib/google/cloud/gaming/v1/game_server_clusters_service_pb.rb +25 -2
  14. data/lib/google/cloud/gaming/v1/game_server_configs_pb.rb +26 -43
  15. data/lib/google/cloud/gaming/v1/game_server_configs_service/client.rb +18 -18
  16. data/lib/google/cloud/gaming/v1/game_server_configs_service/operations.rb +17 -17
  17. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest/client.rb +607 -0
  18. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest/operations.rb +795 -0
  19. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest/service_stub.rb +285 -0
  20. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest.rb +53 -0
  21. data/lib/google/cloud/gaming/v1/game_server_configs_service.rb +7 -1
  22. data/lib/google/cloud/gaming/v1/game_server_configs_service_pb.rb +25 -2
  23. data/lib/google/cloud/gaming/v1/game_server_deployments_pb.rb +27 -80
  24. data/lib/google/cloud/gaming/v1/game_server_deployments_service/client.rb +26 -26
  25. data/lib/google/cloud/gaming/v1/game_server_deployments_service/operations.rb +17 -17
  26. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest/client.rb +999 -0
  27. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest/operations.rb +795 -0
  28. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest/service_stub.rb +584 -0
  29. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest.rb +54 -0
  30. data/lib/google/cloud/gaming/v1/game_server_deployments_service.rb +7 -1
  31. data/lib/google/cloud/gaming/v1/game_server_deployments_service_pb.rb +25 -2
  32. data/lib/google/cloud/gaming/v1/realms_pb.rb +27 -46
  33. data/lib/google/cloud/gaming/v1/realms_service/client.rb +22 -22
  34. data/lib/google/cloud/gaming/v1/realms_service/operations.rb +17 -17
  35. data/lib/google/cloud/gaming/v1/realms_service/rest/client.rb +763 -0
  36. data/lib/google/cloud/gaming/v1/realms_service/rest/operations.rb +795 -0
  37. data/lib/google/cloud/gaming/v1/realms_service/rest/service_stub.rb +405 -0
  38. data/lib/google/cloud/gaming/v1/realms_service/rest.rb +54 -0
  39. data/lib/google/cloud/gaming/v1/realms_service.rb +7 -1
  40. data/lib/google/cloud/gaming/v1/realms_service_pb.rb +25 -2
  41. data/lib/google/cloud/gaming/v1/rest.rb +40 -0
  42. data/lib/google/cloud/gaming/v1/version.rb +1 -1
  43. data/lib/google/cloud/gaming/v1.rb +7 -2
  44. data/proto_docs/google/api/client.rb +381 -0
  45. data/proto_docs/google/api/launch_stage.rb +71 -0
  46. data/proto_docs/google/protobuf/any.rb +7 -4
  47. data/proto_docs/google/protobuf/empty.rb +0 -2
  48. data/proto_docs/google/protobuf/timestamp.rb +1 -3
  49. data/proto_docs/google/rpc/status.rb +4 -2
  50. metadata +27 -8
@@ -0,0 +1,607 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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_configs_service_pb"
21
+ require "google/cloud/gaming/v1/game_server_configs_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Gaming
26
+ module V1
27
+ module GameServerConfigsService
28
+ module Rest
29
+ ##
30
+ # REST client for the GameServerConfigsService service.
31
+ #
32
+ # The game server config configures the game servers in an Agones fleet.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :game_server_configs_service_stub
39
+
40
+ ##
41
+ # Configure the GameServerConfigsService Client class.
42
+ #
43
+ # See {::Google::Cloud::Gaming::V1::GameServerConfigsService::Rest::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all GameServerConfigsService clients
49
+ # ::Google::Cloud::Gaming::V1::GameServerConfigsService::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "Gaming", "V1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.rpcs.list_game_server_configs.timeout = 60.0
70
+ default_config.rpcs.list_game_server_configs.retry_policy = {
71
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
72
+ }
73
+
74
+ default_config.rpcs.get_game_server_config.timeout = 60.0
75
+ default_config.rpcs.get_game_server_config.retry_policy = {
76
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
77
+ }
78
+
79
+ default_config.rpcs.create_game_server_config.timeout = 60.0
80
+
81
+ default_config.rpcs.delete_game_server_config.timeout = 60.0
82
+
83
+ default_config
84
+ end
85
+ yield @configure if block_given?
86
+ @configure
87
+ end
88
+
89
+ ##
90
+ # Configure the GameServerConfigsService Client instance.
91
+ #
92
+ # The configuration is set to the derived mode, meaning that values can be changed,
93
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
94
+ # should be made on {Client.configure}.
95
+ #
96
+ # See {::Google::Cloud::Gaming::V1::GameServerConfigsService::Rest::Client::Configuration}
97
+ # for a description of the configuration fields.
98
+ #
99
+ # @yield [config] Configure the Client client.
100
+ # @yieldparam config [Client::Configuration]
101
+ #
102
+ # @return [Client::Configuration]
103
+ #
104
+ def configure
105
+ yield @config if block_given?
106
+ @config
107
+ end
108
+
109
+ ##
110
+ # Create a new GameServerConfigsService REST client object.
111
+ #
112
+ # @example
113
+ #
114
+ # # Create a client using the default configuration
115
+ # client = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Rest::Client.new
116
+ #
117
+ # # Create a client using a custom configuration
118
+ # client = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Rest::Client.new do |config|
119
+ # config.timeout = 10.0
120
+ # end
121
+ #
122
+ # @yield [config] Configure the GameServerConfigsService client.
123
+ # @yieldparam config [Client::Configuration]
124
+ #
125
+ def initialize
126
+ # Create the configuration object
127
+ @config = Configuration.new Client.configure
128
+
129
+ # Yield the configuration if needed
130
+ yield @config if block_given?
131
+
132
+ # Create credentials
133
+ credentials = @config.credentials
134
+ # Use self-signed JWT if the endpoint is unchanged from default,
135
+ # but only if the default endpoint does not have a region prefix.
136
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
137
+ !@config.endpoint.split(".").first.include?("-")
138
+ credentials ||= Credentials.default scope: @config.scope,
139
+ enable_self_signed_jwt: enable_self_signed_jwt
140
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
141
+ credentials = Credentials.new credentials, scope: @config.scope
142
+ end
143
+
144
+ @quota_project_id = @config.quota_project
145
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
146
+
147
+ @operations_client = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Rest::Operations.new do |config|
148
+ config.credentials = credentials
149
+ config.quota_project = @quota_project_id
150
+ config.endpoint = @config.endpoint
151
+ end
152
+
153
+ @game_server_configs_service_stub = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
154
+ end
155
+
156
+ ##
157
+ # Get the associated client for long-running operations.
158
+ #
159
+ # @return [::Google::Cloud::Gaming::V1::GameServerConfigsService::Rest::Operations]
160
+ #
161
+ attr_reader :operations_client
162
+
163
+ # Service calls
164
+
165
+ ##
166
+ # Lists game server configs in a given project, location, and game server
167
+ # deployment.
168
+ #
169
+ # @overload list_game_server_configs(request, options = nil)
170
+ # Pass arguments to `list_game_server_configs` via a request object, either of type
171
+ # {::Google::Cloud::Gaming::V1::ListGameServerConfigsRequest} or an equivalent Hash.
172
+ #
173
+ # @param request [::Google::Cloud::Gaming::V1::ListGameServerConfigsRequest, ::Hash]
174
+ # A request object representing the call parameters. Required. To specify no
175
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
176
+ # @param options [::Gapic::CallOptions, ::Hash]
177
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
178
+ #
179
+ # @overload list_game_server_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
180
+ # Pass arguments to `list_game_server_configs` via keyword arguments. Note that at
181
+ # least one keyword argument is required. To specify no parameters, or to keep all
182
+ # the default parameter values, pass an empty Hash as a request object (see above).
183
+ #
184
+ # @param parent [::String]
185
+ # Required. The parent resource name, in the following form:
186
+ # `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`.
187
+ # @param page_size [::Integer]
188
+ # Optional. The maximum number of items to return. If unspecified, server
189
+ # will pick an appropriate default. Server may return fewer items than
190
+ # requested. A caller should only rely on response's
191
+ # {::Google::Cloud::Gaming::V1::ListGameServerConfigsResponse#next_page_token next_page_token} to
192
+ # determine if there are more GameServerConfigs left to be queried.
193
+ # @param page_token [::String]
194
+ # Optional. The next_page_token value returned from a previous list request, if any.
195
+ # @param filter [::String]
196
+ # Optional. The filter to apply to list results.
197
+ # @param order_by [::String]
198
+ # Optional. Specifies the ordering of results following syntax at
199
+ # https://cloud.google.com/apis/design/design_patterns#sorting_order.
200
+ # @yield [result, operation] Access the result along with the TransportOperation object
201
+ # @yieldparam result [::Google::Cloud::Gaming::V1::ListGameServerConfigsResponse]
202
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
203
+ #
204
+ # @return [::Google::Cloud::Gaming::V1::ListGameServerConfigsResponse]
205
+ #
206
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
207
+ def list_game_server_configs request, options = nil
208
+ raise ::ArgumentError, "request must be provided" if request.nil?
209
+
210
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::ListGameServerConfigsRequest
211
+
212
+ # Converts hash and nil to an options object
213
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
214
+
215
+ # Customize the options with defaults
216
+ call_metadata = @config.rpcs.list_game_server_configs.metadata.to_h
217
+
218
+ # Set x-goog-api-client and x-goog-user-project headers
219
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
220
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
221
+ gapic_version: ::Google::Cloud::Gaming::V1::VERSION,
222
+ transports_version_send: [:rest]
223
+
224
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
225
+
226
+ options.apply_defaults timeout: @config.rpcs.list_game_server_configs.timeout,
227
+ metadata: call_metadata,
228
+ retry_policy: @config.rpcs.list_game_server_configs.retry_policy
229
+
230
+ options.apply_defaults timeout: @config.timeout,
231
+ metadata: @config.metadata,
232
+ retry_policy: @config.retry_policy
233
+
234
+ @game_server_configs_service_stub.list_game_server_configs request, options do |result, operation|
235
+ yield result, operation if block_given?
236
+ return result
237
+ end
238
+ rescue ::Gapic::Rest::Error => e
239
+ raise ::Google::Cloud::Error.from_error(e)
240
+ end
241
+
242
+ ##
243
+ # Gets details of a single game server config.
244
+ #
245
+ # @overload get_game_server_config(request, options = nil)
246
+ # Pass arguments to `get_game_server_config` via a request object, either of type
247
+ # {::Google::Cloud::Gaming::V1::GetGameServerConfigRequest} or an equivalent Hash.
248
+ #
249
+ # @param request [::Google::Cloud::Gaming::V1::GetGameServerConfigRequest, ::Hash]
250
+ # A request object representing the call parameters. Required. To specify no
251
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
252
+ # @param options [::Gapic::CallOptions, ::Hash]
253
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
254
+ #
255
+ # @overload get_game_server_config(name: nil)
256
+ # Pass arguments to `get_game_server_config` via keyword arguments. Note that at
257
+ # least one keyword argument is required. To specify no parameters, or to keep all
258
+ # the default parameter values, pass an empty Hash as a request object (see above).
259
+ #
260
+ # @param name [::String]
261
+ # Required. The name of the game server config to retrieve, in the following form:
262
+ # `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`.
263
+ # @yield [result, operation] Access the result along with the TransportOperation object
264
+ # @yieldparam result [::Google::Cloud::Gaming::V1::GameServerConfig]
265
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
266
+ #
267
+ # @return [::Google::Cloud::Gaming::V1::GameServerConfig]
268
+ #
269
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
270
+ def get_game_server_config request, options = nil
271
+ raise ::ArgumentError, "request must be provided" if request.nil?
272
+
273
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::GetGameServerConfigRequest
274
+
275
+ # Converts hash and nil to an options object
276
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
277
+
278
+ # Customize the options with defaults
279
+ call_metadata = @config.rpcs.get_game_server_config.metadata.to_h
280
+
281
+ # Set x-goog-api-client and x-goog-user-project headers
282
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
283
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
284
+ gapic_version: ::Google::Cloud::Gaming::V1::VERSION,
285
+ transports_version_send: [:rest]
286
+
287
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
288
+
289
+ options.apply_defaults timeout: @config.rpcs.get_game_server_config.timeout,
290
+ metadata: call_metadata,
291
+ retry_policy: @config.rpcs.get_game_server_config.retry_policy
292
+
293
+ options.apply_defaults timeout: @config.timeout,
294
+ metadata: @config.metadata,
295
+ retry_policy: @config.retry_policy
296
+
297
+ @game_server_configs_service_stub.get_game_server_config request, options do |result, operation|
298
+ yield result, operation if block_given?
299
+ return result
300
+ end
301
+ rescue ::Gapic::Rest::Error => e
302
+ raise ::Google::Cloud::Error.from_error(e)
303
+ end
304
+
305
+ ##
306
+ # Creates a new game server config in a given project, location, and game
307
+ # server deployment. Game server configs are immutable, and are not applied
308
+ # until referenced in the game server deployment rollout resource.
309
+ #
310
+ # @overload create_game_server_config(request, options = nil)
311
+ # Pass arguments to `create_game_server_config` via a request object, either of type
312
+ # {::Google::Cloud::Gaming::V1::CreateGameServerConfigRequest} or an equivalent Hash.
313
+ #
314
+ # @param request [::Google::Cloud::Gaming::V1::CreateGameServerConfigRequest, ::Hash]
315
+ # A request object representing the call parameters. Required. To specify no
316
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
317
+ # @param options [::Gapic::CallOptions, ::Hash]
318
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
319
+ #
320
+ # @overload create_game_server_config(parent: nil, config_id: nil, game_server_config: nil)
321
+ # Pass arguments to `create_game_server_config` via keyword arguments. Note that at
322
+ # least one keyword argument is required. To specify no parameters, or to keep all
323
+ # the default parameter values, pass an empty Hash as a request object (see above).
324
+ #
325
+ # @param parent [::String]
326
+ # Required. The parent resource name, in the following form:
327
+ # `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`.
328
+ # @param config_id [::String]
329
+ # Required. The ID of the game server config resource to be created.
330
+ # @param game_server_config [::Google::Cloud::Gaming::V1::GameServerConfig, ::Hash]
331
+ # Required. The game server config resource to be created.
332
+ # @yield [result, operation] Access the result along with the TransportOperation object
333
+ # @yieldparam result [::Gapic::Operation]
334
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
335
+ #
336
+ # @return [::Gapic::Operation]
337
+ #
338
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
339
+ def create_game_server_config request, options = nil
340
+ raise ::ArgumentError, "request must be provided" if request.nil?
341
+
342
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::CreateGameServerConfigRequest
343
+
344
+ # Converts hash and nil to an options object
345
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
346
+
347
+ # Customize the options with defaults
348
+ call_metadata = @config.rpcs.create_game_server_config.metadata.to_h
349
+
350
+ # Set x-goog-api-client and x-goog-user-project headers
351
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
352
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
353
+ gapic_version: ::Google::Cloud::Gaming::V1::VERSION,
354
+ transports_version_send: [:rest]
355
+
356
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
357
+
358
+ options.apply_defaults timeout: @config.rpcs.create_game_server_config.timeout,
359
+ metadata: call_metadata,
360
+ retry_policy: @config.rpcs.create_game_server_config.retry_policy
361
+
362
+ options.apply_defaults timeout: @config.timeout,
363
+ metadata: @config.metadata,
364
+ retry_policy: @config.retry_policy
365
+
366
+ @game_server_configs_service_stub.create_game_server_config request, options do |result, operation|
367
+ result = ::Gapic::Operation.new result, @operations_client, options: options
368
+ yield result, operation if block_given?
369
+ return result
370
+ end
371
+ rescue ::Gapic::Rest::Error => e
372
+ raise ::Google::Cloud::Error.from_error(e)
373
+ end
374
+
375
+ ##
376
+ # Deletes a single game server config. The deletion will fail if the game
377
+ # server config is referenced in a game server deployment rollout.
378
+ #
379
+ # @overload delete_game_server_config(request, options = nil)
380
+ # Pass arguments to `delete_game_server_config` via a request object, either of type
381
+ # {::Google::Cloud::Gaming::V1::DeleteGameServerConfigRequest} or an equivalent Hash.
382
+ #
383
+ # @param request [::Google::Cloud::Gaming::V1::DeleteGameServerConfigRequest, ::Hash]
384
+ # A request object representing the call parameters. Required. To specify no
385
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
386
+ # @param options [::Gapic::CallOptions, ::Hash]
387
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
388
+ #
389
+ # @overload delete_game_server_config(name: nil)
390
+ # Pass arguments to `delete_game_server_config` via keyword arguments. Note that at
391
+ # least one keyword argument is required. To specify no parameters, or to keep all
392
+ # the default parameter values, pass an empty Hash as a request object (see above).
393
+ #
394
+ # @param name [::String]
395
+ # Required. The name of the game server config to delete, in the following form:
396
+ # `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`.
397
+ # @yield [result, operation] Access the result along with the TransportOperation object
398
+ # @yieldparam result [::Gapic::Operation]
399
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
400
+ #
401
+ # @return [::Gapic::Operation]
402
+ #
403
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
404
+ def delete_game_server_config request, options = nil
405
+ raise ::ArgumentError, "request must be provided" if request.nil?
406
+
407
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::DeleteGameServerConfigRequest
408
+
409
+ # Converts hash and nil to an options object
410
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
411
+
412
+ # Customize the options with defaults
413
+ call_metadata = @config.rpcs.delete_game_server_config.metadata.to_h
414
+
415
+ # Set x-goog-api-client and x-goog-user-project headers
416
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
417
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
418
+ gapic_version: ::Google::Cloud::Gaming::V1::VERSION,
419
+ transports_version_send: [:rest]
420
+
421
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
422
+
423
+ options.apply_defaults timeout: @config.rpcs.delete_game_server_config.timeout,
424
+ metadata: call_metadata,
425
+ retry_policy: @config.rpcs.delete_game_server_config.retry_policy
426
+
427
+ options.apply_defaults timeout: @config.timeout,
428
+ metadata: @config.metadata,
429
+ retry_policy: @config.retry_policy
430
+
431
+ @game_server_configs_service_stub.delete_game_server_config request, options do |result, operation|
432
+ result = ::Gapic::Operation.new result, @operations_client, options: options
433
+ yield result, operation if block_given?
434
+ return result
435
+ end
436
+ rescue ::Gapic::Rest::Error => e
437
+ raise ::Google::Cloud::Error.from_error(e)
438
+ end
439
+
440
+ ##
441
+ # Configuration class for the GameServerConfigsService REST API.
442
+ #
443
+ # This class represents the configuration for GameServerConfigsService REST,
444
+ # providing control over timeouts, retry behavior, logging, transport
445
+ # parameters, and other low-level controls. Certain parameters can also be
446
+ # applied individually to specific RPCs. See
447
+ # {::Google::Cloud::Gaming::V1::GameServerConfigsService::Rest::Client::Configuration::Rpcs}
448
+ # for a list of RPCs that can be configured independently.
449
+ #
450
+ # Configuration can be applied globally to all clients, or to a single client
451
+ # on construction.
452
+ #
453
+ # @example
454
+ #
455
+ # # Modify the global config, setting the timeout for
456
+ # # list_game_server_configs to 20 seconds,
457
+ # # and all remaining timeouts to 10 seconds.
458
+ # ::Google::Cloud::Gaming::V1::GameServerConfigsService::Rest::Client.configure do |config|
459
+ # config.timeout = 10.0
460
+ # config.rpcs.list_game_server_configs.timeout = 20.0
461
+ # end
462
+ #
463
+ # # Apply the above configuration only to a new client.
464
+ # client = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Rest::Client.new do |config|
465
+ # config.timeout = 10.0
466
+ # config.rpcs.list_game_server_configs.timeout = 20.0
467
+ # end
468
+ #
469
+ # @!attribute [rw] endpoint
470
+ # The hostname or hostname:port of the service endpoint.
471
+ # Defaults to `"gameservices.googleapis.com"`.
472
+ # @return [::String]
473
+ # @!attribute [rw] credentials
474
+ # Credentials to send with calls. You may provide any of the following types:
475
+ # * (`String`) The path to a service account key file in JSON format
476
+ # * (`Hash`) A service account key as a Hash
477
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
478
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
479
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
480
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
481
+ # * (`nil`) indicating no credentials
482
+ # @return [::Object]
483
+ # @!attribute [rw] scope
484
+ # The OAuth scopes
485
+ # @return [::Array<::String>]
486
+ # @!attribute [rw] lib_name
487
+ # The library name as recorded in instrumentation and logging
488
+ # @return [::String]
489
+ # @!attribute [rw] lib_version
490
+ # The library version as recorded in instrumentation and logging
491
+ # @return [::String]
492
+ # @!attribute [rw] timeout
493
+ # The call timeout in seconds.
494
+ # @return [::Numeric]
495
+ # @!attribute [rw] metadata
496
+ # Additional headers to be sent with the call.
497
+ # @return [::Hash{::Symbol=>::String}]
498
+ # @!attribute [rw] retry_policy
499
+ # The retry policy. The value is a hash with the following keys:
500
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
501
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
502
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
503
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
504
+ # trigger a retry.
505
+ # @return [::Hash]
506
+ # @!attribute [rw] quota_project
507
+ # A separate project against which to charge quota.
508
+ # @return [::String]
509
+ #
510
+ class Configuration
511
+ extend ::Gapic::Config
512
+
513
+ DEFAULT_ENDPOINT = "gameservices.googleapis.com"
514
+
515
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
516
+ config_attr :credentials, nil do |value|
517
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
518
+ allowed.any? { |klass| klass === value }
519
+ end
520
+ config_attr :scope, nil, ::String, ::Array, nil
521
+ config_attr :lib_name, nil, ::String, nil
522
+ config_attr :lib_version, nil, ::String, nil
523
+ config_attr :timeout, nil, ::Numeric, nil
524
+ config_attr :metadata, nil, ::Hash, nil
525
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
526
+ config_attr :quota_project, nil, ::String, nil
527
+
528
+ # @private
529
+ def initialize parent_config = nil
530
+ @parent_config = parent_config unless parent_config.nil?
531
+
532
+ yield self if block_given?
533
+ end
534
+
535
+ ##
536
+ # Configurations for individual RPCs
537
+ # @return [Rpcs]
538
+ #
539
+ def rpcs
540
+ @rpcs ||= begin
541
+ parent_rpcs = nil
542
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
543
+ Rpcs.new parent_rpcs
544
+ end
545
+ end
546
+
547
+ ##
548
+ # Configuration RPC class for the GameServerConfigsService API.
549
+ #
550
+ # Includes fields providing the configuration for each RPC in this service.
551
+ # Each configuration object is of type `Gapic::Config::Method` and includes
552
+ # the following configuration fields:
553
+ #
554
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
555
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
556
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
557
+ # include the following keys:
558
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
559
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
560
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
561
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
562
+ # trigger a retry.
563
+ #
564
+ class Rpcs
565
+ ##
566
+ # RPC-specific configuration for `list_game_server_configs`
567
+ # @return [::Gapic::Config::Method]
568
+ #
569
+ attr_reader :list_game_server_configs
570
+ ##
571
+ # RPC-specific configuration for `get_game_server_config`
572
+ # @return [::Gapic::Config::Method]
573
+ #
574
+ attr_reader :get_game_server_config
575
+ ##
576
+ # RPC-specific configuration for `create_game_server_config`
577
+ # @return [::Gapic::Config::Method]
578
+ #
579
+ attr_reader :create_game_server_config
580
+ ##
581
+ # RPC-specific configuration for `delete_game_server_config`
582
+ # @return [::Gapic::Config::Method]
583
+ #
584
+ attr_reader :delete_game_server_config
585
+
586
+ # @private
587
+ def initialize parent_rpcs = nil
588
+ list_game_server_configs_config = parent_rpcs.list_game_server_configs if parent_rpcs.respond_to? :list_game_server_configs
589
+ @list_game_server_configs = ::Gapic::Config::Method.new list_game_server_configs_config
590
+ get_game_server_config_config = parent_rpcs.get_game_server_config if parent_rpcs.respond_to? :get_game_server_config
591
+ @get_game_server_config = ::Gapic::Config::Method.new get_game_server_config_config
592
+ create_game_server_config_config = parent_rpcs.create_game_server_config if parent_rpcs.respond_to? :create_game_server_config
593
+ @create_game_server_config = ::Gapic::Config::Method.new create_game_server_config_config
594
+ delete_game_server_config_config = parent_rpcs.delete_game_server_config if parent_rpcs.respond_to? :delete_game_server_config
595
+ @delete_game_server_config = ::Gapic::Config::Method.new delete_game_server_config_config
596
+
597
+ yield self if block_given?
598
+ end
599
+ end
600
+ end
601
+ end
602
+ end
603
+ end
604
+ end
605
+ end
606
+ end
607
+ end