google-cloud-gaming-v1 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +2 -2
  4. data/lib/google/cloud/gaming/v1/game_server_clusters_service/client.rb +16 -18
  5. data/lib/google/cloud/gaming/v1/game_server_clusters_service/operations.rb +12 -14
  6. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest/client.rb +936 -0
  7. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest/operations.rb +793 -0
  8. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest/service_stub.rb +524 -0
  9. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest.rb +54 -0
  10. data/lib/google/cloud/gaming/v1/game_server_clusters_service.rb +7 -1
  11. data/lib/google/cloud/gaming/v1/game_server_configs_service/client.rb +12 -14
  12. data/lib/google/cloud/gaming/v1/game_server_configs_service/operations.rb +12 -14
  13. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest/client.rb +605 -0
  14. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest/operations.rb +793 -0
  15. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest/service_stub.rb +285 -0
  16. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest.rb +53 -0
  17. data/lib/google/cloud/gaming/v1/game_server_configs_service.rb +7 -1
  18. data/lib/google/cloud/gaming/v1/game_server_deployments_service/client.rb +20 -22
  19. data/lib/google/cloud/gaming/v1/game_server_deployments_service/operations.rb +12 -14
  20. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest/client.rb +997 -0
  21. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest/operations.rb +793 -0
  22. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest/service_stub.rb +584 -0
  23. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest.rb +54 -0
  24. data/lib/google/cloud/gaming/v1/game_server_deployments_service.rb +7 -1
  25. data/lib/google/cloud/gaming/v1/realms_service/client.rb +16 -18
  26. data/lib/google/cloud/gaming/v1/realms_service/operations.rb +12 -14
  27. data/lib/google/cloud/gaming/v1/realms_service/rest/client.rb +761 -0
  28. data/lib/google/cloud/gaming/v1/realms_service/rest/operations.rb +793 -0
  29. data/lib/google/cloud/gaming/v1/realms_service/rest/service_stub.rb +405 -0
  30. data/lib/google/cloud/gaming/v1/realms_service/rest.rb +54 -0
  31. data/lib/google/cloud/gaming/v1/realms_service.rb +7 -1
  32. data/lib/google/cloud/gaming/v1/rest.rb +40 -0
  33. data/lib/google/cloud/gaming/v1/version.rb +1 -1
  34. data/lib/google/cloud/gaming/v1.rb +7 -2
  35. data/proto_docs/google/api/client.rb +318 -0
  36. data/proto_docs/google/api/launch_stage.rb +71 -0
  37. data/proto_docs/google/protobuf/empty.rb +0 -2
  38. data/proto_docs/google/rpc/status.rb +4 -2
  39. metadata +27 -8
@@ -158,13 +158,11 @@ module Google
158
158
  # # Call the list_operations method.
159
159
  # result = client.list_operations request
160
160
  #
161
- # # The returned object is of type Gapic::PagedEnumerable. You can
162
- # # iterate over all elements by calling #each, and the enumerable
163
- # # will lazily make API calls to fetch subsequent pages. Other
164
- # # methods are also available for managing paging directly.
165
- # result.each do |response|
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
162
+ # # over elements, and API calls will be issued to fetch pages as needed.
163
+ # result.each do |item|
166
164
  # # Each element is of type ::Google::Longrunning::Operation.
167
- # p response
165
+ # p item
168
166
  # end
169
167
  #
170
168
  def list_operations request, options = nil
@@ -253,14 +251,14 @@ module Google
253
251
  # # Call the get_operation method.
254
252
  # result = client.get_operation request
255
253
  #
256
- # # The returned object is of type Gapic::Operation. You can use this
257
- # # object to check the status of an operation, cancel it, or wait
258
- # # for results. Here is how to block until completion:
254
+ # # The returned object is of type Gapic::Operation. You can use it to
255
+ # # check the status of an operation, cancel it, or wait for results.
256
+ # # Here is how to wait for a response.
259
257
  # result.wait_until_done! timeout: 60
260
258
  # if result.response?
261
259
  # p result.response
262
260
  # else
263
- # puts "Error!"
261
+ # puts "No response received."
264
262
  # end
265
263
  #
266
264
  def get_operation request, options = nil
@@ -540,14 +538,14 @@ module Google
540
538
  # # Call the wait_operation method.
541
539
  # result = client.wait_operation request
542
540
  #
543
- # # The returned object is of type Gapic::Operation. You can use this
544
- # # object to check the status of an operation, cancel it, or wait
545
- # # for results. Here is how to block until completion:
541
+ # # The returned object is of type Gapic::Operation. You can use it to
542
+ # # check the status of an operation, cancel it, or wait for results.
543
+ # # Here is how to wait for a response.
546
544
  # result.wait_until_done! timeout: 60
547
545
  # if result.response?
548
546
  # p result.response
549
547
  # else
550
- # puts "Error!"
548
+ # puts "No response received."
551
549
  # end
552
550
  #
553
551
  def wait_operation request, options = nil
@@ -0,0 +1,605 @@
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 == Client.configure.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://googleapis.dev/ruby/googleauth/latest/index.html))
479
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
480
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
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
+ config_attr :endpoint, "gameservices.googleapis.com", ::String
514
+ config_attr :credentials, nil do |value|
515
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
516
+ allowed.any? { |klass| klass === value }
517
+ end
518
+ config_attr :scope, nil, ::String, ::Array, nil
519
+ config_attr :lib_name, nil, ::String, nil
520
+ config_attr :lib_version, nil, ::String, nil
521
+ config_attr :timeout, nil, ::Numeric, nil
522
+ config_attr :metadata, nil, ::Hash, nil
523
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
524
+ config_attr :quota_project, nil, ::String, nil
525
+
526
+ # @private
527
+ def initialize parent_config = nil
528
+ @parent_config = parent_config unless parent_config.nil?
529
+
530
+ yield self if block_given?
531
+ end
532
+
533
+ ##
534
+ # Configurations for individual RPCs
535
+ # @return [Rpcs]
536
+ #
537
+ def rpcs
538
+ @rpcs ||= begin
539
+ parent_rpcs = nil
540
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
541
+ Rpcs.new parent_rpcs
542
+ end
543
+ end
544
+
545
+ ##
546
+ # Configuration RPC class for the GameServerConfigsService API.
547
+ #
548
+ # Includes fields providing the configuration for each RPC in this service.
549
+ # Each configuration object is of type `Gapic::Config::Method` and includes
550
+ # the following configuration fields:
551
+ #
552
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
553
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
554
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
555
+ # include the following keys:
556
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
557
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
558
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
559
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
560
+ # trigger a retry.
561
+ #
562
+ class Rpcs
563
+ ##
564
+ # RPC-specific configuration for `list_game_server_configs`
565
+ # @return [::Gapic::Config::Method]
566
+ #
567
+ attr_reader :list_game_server_configs
568
+ ##
569
+ # RPC-specific configuration for `get_game_server_config`
570
+ # @return [::Gapic::Config::Method]
571
+ #
572
+ attr_reader :get_game_server_config
573
+ ##
574
+ # RPC-specific configuration for `create_game_server_config`
575
+ # @return [::Gapic::Config::Method]
576
+ #
577
+ attr_reader :create_game_server_config
578
+ ##
579
+ # RPC-specific configuration for `delete_game_server_config`
580
+ # @return [::Gapic::Config::Method]
581
+ #
582
+ attr_reader :delete_game_server_config
583
+
584
+ # @private
585
+ def initialize parent_rpcs = nil
586
+ list_game_server_configs_config = parent_rpcs.list_game_server_configs if parent_rpcs.respond_to? :list_game_server_configs
587
+ @list_game_server_configs = ::Gapic::Config::Method.new list_game_server_configs_config
588
+ get_game_server_config_config = parent_rpcs.get_game_server_config if parent_rpcs.respond_to? :get_game_server_config
589
+ @get_game_server_config = ::Gapic::Config::Method.new get_game_server_config_config
590
+ create_game_server_config_config = parent_rpcs.create_game_server_config if parent_rpcs.respond_to? :create_game_server_config
591
+ @create_game_server_config = ::Gapic::Config::Method.new create_game_server_config_config
592
+ delete_game_server_config_config = parent_rpcs.delete_game_server_config if parent_rpcs.respond_to? :delete_game_server_config
593
+ @delete_game_server_config = ::Gapic::Config::Method.new delete_game_server_config_config
594
+
595
+ yield self if block_given?
596
+ end
597
+ end
598
+ end
599
+ end
600
+ end
601
+ end
602
+ end
603
+ end
604
+ end
605
+ end