google-cloud-gaming-v1 0.6.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 -117
  8. data/lib/google/cloud/gaming/v1/game_server_clusters_pb.rb +0 -142
  9. data/lib/google/cloud/gaming/v1/game_server_clusters_service/client.rb +0 -1166
  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 -768
  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 -936
  14. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest/operations.rb +0 -793
  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 -23
  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 -73
  21. data/lib/google/cloud/gaming/v1/game_server_configs_service/client.rb +0 -736
  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 -768
  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 -605
  26. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest/operations.rb +0 -793
  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 -23
  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 -119
  33. data/lib/google/cloud/gaming/v1/game_server_deployments_service/client.rb +0 -1257
  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 -768
  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 -997
  38. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest/operations.rb +0 -793
  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 -23
  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 -78
  45. data/lib/google/cloud/gaming/v1/realms_service/client.rb +0 -945
  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 -768
  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 -761
  50. data/lib/google/cloud/gaming/v1/realms_service/rest/operations.rb +0 -793
  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 -23
  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 -318
  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 -141
  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 -129
  75. data/proto_docs/google/rpc/status.rb +0 -48
@@ -1,736 +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_configs_service_pb"
21
-
22
- module Google
23
- module Cloud
24
- module Gaming
25
- module V1
26
- module GameServerConfigsService
27
- ##
28
- # Client for the GameServerConfigsService service.
29
- #
30
- # The game server config configures the game servers in an Agones fleet.
31
- #
32
- class Client
33
- include Paths
34
-
35
- # @private
36
- attr_reader :game_server_configs_service_stub
37
-
38
- ##
39
- # Configure the GameServerConfigsService Client class.
40
- #
41
- # See {::Google::Cloud::Gaming::V1::GameServerConfigsService::Client::Configuration}
42
- # for a description of the configuration fields.
43
- #
44
- # @example
45
- #
46
- # # Modify the configuration for all GameServerConfigsService clients
47
- # ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.configure do |config|
48
- # config.timeout = 10.0
49
- # end
50
- #
51
- # @yield [config] Configure the Client client.
52
- # @yieldparam config [Client::Configuration]
53
- #
54
- # @return [Client::Configuration]
55
- #
56
- def self.configure
57
- @configure ||= begin
58
- namespace = ["Google", "Cloud", "Gaming", "V1"]
59
- parent_config = while namespace.any?
60
- parent_name = namespace.join "::"
61
- parent_const = const_get parent_name
62
- break parent_const.configure if parent_const.respond_to? :configure
63
- namespace.pop
64
- end
65
- default_config = Client::Configuration.new parent_config
66
-
67
- default_config.rpcs.list_game_server_configs.timeout = 60.0
68
- default_config.rpcs.list_game_server_configs.retry_policy = {
69
- initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
70
- }
71
-
72
- default_config.rpcs.get_game_server_config.timeout = 60.0
73
- default_config.rpcs.get_game_server_config.retry_policy = {
74
- initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
75
- }
76
-
77
- default_config.rpcs.create_game_server_config.timeout = 60.0
78
-
79
- default_config.rpcs.delete_game_server_config.timeout = 60.0
80
-
81
- default_config
82
- end
83
- yield @configure if block_given?
84
- @configure
85
- end
86
-
87
- ##
88
- # Configure the GameServerConfigsService Client instance.
89
- #
90
- # The configuration is set to the derived mode, meaning that values can be changed,
91
- # but structural changes (adding new fields, etc.) are not allowed. Structural changes
92
- # should be made on {Client.configure}.
93
- #
94
- # See {::Google::Cloud::Gaming::V1::GameServerConfigsService::Client::Configuration}
95
- # for a description of the configuration fields.
96
- #
97
- # @yield [config] Configure the Client client.
98
- # @yieldparam config [Client::Configuration]
99
- #
100
- # @return [Client::Configuration]
101
- #
102
- def configure
103
- yield @config if block_given?
104
- @config
105
- end
106
-
107
- ##
108
- # Create a new GameServerConfigsService client object.
109
- #
110
- # @example
111
- #
112
- # # Create a client using the default configuration
113
- # client = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new
114
- #
115
- # # Create a client using a custom configuration
116
- # client = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new do |config|
117
- # config.timeout = 10.0
118
- # end
119
- #
120
- # @yield [config] Configure the GameServerConfigsService client.
121
- # @yieldparam config [Client::Configuration]
122
- #
123
- def initialize
124
- # These require statements are intentionally placed here to initialize
125
- # the gRPC module only when it's required.
126
- # See https://github.com/googleapis/toolkit/issues/446
127
- require "gapic/grpc"
128
- require "google/cloud/gaming/v1/game_server_configs_service_services_pb"
129
-
130
- # Create the configuration object
131
- @config = Configuration.new Client.configure
132
-
133
- # Yield the configuration if needed
134
- yield @config if block_given?
135
-
136
- # Create credentials
137
- credentials = @config.credentials
138
- # Use self-signed JWT if the endpoint is unchanged from default,
139
- # but only if the default endpoint does not have a region prefix.
140
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
141
- !@config.endpoint.split(".").first.include?("-")
142
- credentials ||= Credentials.default scope: @config.scope,
143
- enable_self_signed_jwt: enable_self_signed_jwt
144
- if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
- credentials = Credentials.new credentials, scope: @config.scope
146
- end
147
- @quota_project_id = @config.quota_project
148
- @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
149
-
150
- @operations_client = Operations.new do |config|
151
- config.credentials = credentials
152
- config.quota_project = @quota_project_id
153
- config.endpoint = @config.endpoint
154
- end
155
-
156
- @game_server_configs_service_stub = ::Gapic::ServiceStub.new(
157
- ::Google::Cloud::Gaming::V1::GameServerConfigsService::Stub,
158
- credentials: credentials,
159
- endpoint: @config.endpoint,
160
- channel_args: @config.channel_args,
161
- interceptors: @config.interceptors
162
- )
163
- end
164
-
165
- ##
166
- # Get the associated client for long-running operations.
167
- #
168
- # @return [::Google::Cloud::Gaming::V1::GameServerConfigsService::Operations]
169
- #
170
- attr_reader :operations_client
171
-
172
- # Service calls
173
-
174
- ##
175
- # Lists game server configs in a given project, location, and game server
176
- # deployment.
177
- #
178
- # @overload list_game_server_configs(request, options = nil)
179
- # Pass arguments to `list_game_server_configs` via a request object, either of type
180
- # {::Google::Cloud::Gaming::V1::ListGameServerConfigsRequest} or an equivalent Hash.
181
- #
182
- # @param request [::Google::Cloud::Gaming::V1::ListGameServerConfigsRequest, ::Hash]
183
- # A request object representing the call parameters. Required. To specify no
184
- # parameters, or to keep all the default parameter values, pass an empty Hash.
185
- # @param options [::Gapic::CallOptions, ::Hash]
186
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
187
- #
188
- # @overload list_game_server_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
189
- # Pass arguments to `list_game_server_configs` via keyword arguments. Note that at
190
- # least one keyword argument is required. To specify no parameters, or to keep all
191
- # the default parameter values, pass an empty Hash as a request object (see above).
192
- #
193
- # @param parent [::String]
194
- # Required. The parent resource name, in the following form:
195
- # `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`.
196
- # @param page_size [::Integer]
197
- # Optional. The maximum number of items to return. If unspecified, server
198
- # will pick an appropriate default. Server may return fewer items than
199
- # requested. A caller should only rely on response's
200
- # {::Google::Cloud::Gaming::V1::ListGameServerConfigsResponse#next_page_token next_page_token} to
201
- # determine if there are more GameServerConfigs left to be queried.
202
- # @param page_token [::String]
203
- # Optional. The next_page_token value returned from a previous list request, if any.
204
- # @param filter [::String]
205
- # Optional. The filter to apply to list results.
206
- # @param order_by [::String]
207
- # Optional. Specifies the ordering of results following syntax at
208
- # https://cloud.google.com/apis/design/design_patterns#sorting_order.
209
- #
210
- # @yield [response, operation] Access the result along with the RPC operation
211
- # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::GameServerConfig>]
212
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
213
- #
214
- # @return [::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::GameServerConfig>]
215
- #
216
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
217
- #
218
- # @example Basic example
219
- # require "google/cloud/gaming/v1"
220
- #
221
- # # Create a client object. The client can be reused for multiple calls.
222
- # client = Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new
223
- #
224
- # # Create a request. To set request fields, pass in keyword arguments.
225
- # request = Google::Cloud::Gaming::V1::ListGameServerConfigsRequest.new
226
- #
227
- # # Call the list_game_server_configs method.
228
- # result = client.list_game_server_configs request
229
- #
230
- # # The returned object is of type Gapic::PagedEnumerable. You can iterate
231
- # # over elements, and API calls will be issued to fetch pages as needed.
232
- # result.each do |item|
233
- # # Each element is of type ::Google::Cloud::Gaming::V1::GameServerConfig.
234
- # p item
235
- # end
236
- #
237
- def list_game_server_configs request, options = nil
238
- raise ::ArgumentError, "request must be provided" if request.nil?
239
-
240
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::ListGameServerConfigsRequest
241
-
242
- # Converts hash and nil to an options object
243
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
244
-
245
- # Customize the options with defaults
246
- metadata = @config.rpcs.list_game_server_configs.metadata.to_h
247
-
248
- # Set x-goog-api-client and x-goog-user-project headers
249
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
250
- lib_name: @config.lib_name, lib_version: @config.lib_version,
251
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
252
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
253
-
254
- header_params = {}
255
- if request.parent
256
- header_params["parent"] = request.parent
257
- end
258
-
259
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
260
- metadata[:"x-goog-request-params"] ||= request_params_header
261
-
262
- options.apply_defaults timeout: @config.rpcs.list_game_server_configs.timeout,
263
- metadata: metadata,
264
- retry_policy: @config.rpcs.list_game_server_configs.retry_policy
265
-
266
- options.apply_defaults timeout: @config.timeout,
267
- metadata: @config.metadata,
268
- retry_policy: @config.retry_policy
269
-
270
- @game_server_configs_service_stub.call_rpc :list_game_server_configs, request, options: options do |response, operation|
271
- response = ::Gapic::PagedEnumerable.new @game_server_configs_service_stub, :list_game_server_configs, request, response, operation, options
272
- yield response, operation if block_given?
273
- return response
274
- end
275
- rescue ::GRPC::BadStatus => e
276
- raise ::Google::Cloud::Error.from_error(e)
277
- end
278
-
279
- ##
280
- # Gets details of a single game server config.
281
- #
282
- # @overload get_game_server_config(request, options = nil)
283
- # Pass arguments to `get_game_server_config` via a request object, either of type
284
- # {::Google::Cloud::Gaming::V1::GetGameServerConfigRequest} or an equivalent Hash.
285
- #
286
- # @param request [::Google::Cloud::Gaming::V1::GetGameServerConfigRequest, ::Hash]
287
- # A request object representing the call parameters. Required. To specify no
288
- # parameters, or to keep all the default parameter values, pass an empty Hash.
289
- # @param options [::Gapic::CallOptions, ::Hash]
290
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
291
- #
292
- # @overload get_game_server_config(name: nil)
293
- # Pass arguments to `get_game_server_config` via keyword arguments. Note that at
294
- # least one keyword argument is required. To specify no parameters, or to keep all
295
- # the default parameter values, pass an empty Hash as a request object (see above).
296
- #
297
- # @param name [::String]
298
- # Required. The name of the game server config to retrieve, in the following form:
299
- # `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`.
300
- #
301
- # @yield [response, operation] Access the result along with the RPC operation
302
- # @yieldparam response [::Google::Cloud::Gaming::V1::GameServerConfig]
303
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
304
- #
305
- # @return [::Google::Cloud::Gaming::V1::GameServerConfig]
306
- #
307
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
308
- #
309
- # @example Basic example
310
- # require "google/cloud/gaming/v1"
311
- #
312
- # # Create a client object. The client can be reused for multiple calls.
313
- # client = Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new
314
- #
315
- # # Create a request. To set request fields, pass in keyword arguments.
316
- # request = Google::Cloud::Gaming::V1::GetGameServerConfigRequest.new
317
- #
318
- # # Call the get_game_server_config method.
319
- # result = client.get_game_server_config request
320
- #
321
- # # The returned object is of type Google::Cloud::Gaming::V1::GameServerConfig.
322
- # p result
323
- #
324
- def get_game_server_config request, options = nil
325
- raise ::ArgumentError, "request must be provided" if request.nil?
326
-
327
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::GetGameServerConfigRequest
328
-
329
- # Converts hash and nil to an options object
330
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
331
-
332
- # Customize the options with defaults
333
- metadata = @config.rpcs.get_game_server_config.metadata.to_h
334
-
335
- # Set x-goog-api-client and x-goog-user-project headers
336
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
337
- lib_name: @config.lib_name, lib_version: @config.lib_version,
338
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
339
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
340
-
341
- header_params = {}
342
- if request.name
343
- header_params["name"] = request.name
344
- end
345
-
346
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
347
- metadata[:"x-goog-request-params"] ||= request_params_header
348
-
349
- options.apply_defaults timeout: @config.rpcs.get_game_server_config.timeout,
350
- metadata: metadata,
351
- retry_policy: @config.rpcs.get_game_server_config.retry_policy
352
-
353
- options.apply_defaults timeout: @config.timeout,
354
- metadata: @config.metadata,
355
- retry_policy: @config.retry_policy
356
-
357
- @game_server_configs_service_stub.call_rpc :get_game_server_config, request, options: options do |response, operation|
358
- yield response, operation if block_given?
359
- return response
360
- end
361
- rescue ::GRPC::BadStatus => e
362
- raise ::Google::Cloud::Error.from_error(e)
363
- end
364
-
365
- ##
366
- # Creates a new game server config in a given project, location, and game
367
- # server deployment. Game server configs are immutable, and are not applied
368
- # until referenced in the game server deployment rollout resource.
369
- #
370
- # @overload create_game_server_config(request, options = nil)
371
- # Pass arguments to `create_game_server_config` via a request object, either of type
372
- # {::Google::Cloud::Gaming::V1::CreateGameServerConfigRequest} or an equivalent Hash.
373
- #
374
- # @param request [::Google::Cloud::Gaming::V1::CreateGameServerConfigRequest, ::Hash]
375
- # A request object representing the call parameters. Required. To specify no
376
- # parameters, or to keep all the default parameter values, pass an empty Hash.
377
- # @param options [::Gapic::CallOptions, ::Hash]
378
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
379
- #
380
- # @overload create_game_server_config(parent: nil, config_id: nil, game_server_config: nil)
381
- # Pass arguments to `create_game_server_config` via keyword arguments. Note that at
382
- # least one keyword argument is required. To specify no parameters, or to keep all
383
- # the default parameter values, pass an empty Hash as a request object (see above).
384
- #
385
- # @param parent [::String]
386
- # Required. The parent resource name, in the following form:
387
- # `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`.
388
- # @param config_id [::String]
389
- # Required. The ID of the game server config resource to be created.
390
- # @param game_server_config [::Google::Cloud::Gaming::V1::GameServerConfig, ::Hash]
391
- # Required. The game server config resource to be created.
392
- #
393
- # @yield [response, operation] Access the result along with the RPC operation
394
- # @yieldparam response [::Gapic::Operation]
395
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
396
- #
397
- # @return [::Gapic::Operation]
398
- #
399
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
400
- #
401
- # @example Basic example
402
- # require "google/cloud/gaming/v1"
403
- #
404
- # # Create a client object. The client can be reused for multiple calls.
405
- # client = Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new
406
- #
407
- # # Create a request. To set request fields, pass in keyword arguments.
408
- # request = Google::Cloud::Gaming::V1::CreateGameServerConfigRequest.new
409
- #
410
- # # Call the create_game_server_config method.
411
- # result = client.create_game_server_config request
412
- #
413
- # # The returned object is of type Gapic::Operation. You can use it to
414
- # # check the status of an operation, cancel it, or wait for results.
415
- # # Here is how to wait for a response.
416
- # result.wait_until_done! timeout: 60
417
- # if result.response?
418
- # p result.response
419
- # else
420
- # puts "No response received."
421
- # end
422
- #
423
- def create_game_server_config request, options = nil
424
- raise ::ArgumentError, "request must be provided" if request.nil?
425
-
426
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::CreateGameServerConfigRequest
427
-
428
- # Converts hash and nil to an options object
429
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
430
-
431
- # Customize the options with defaults
432
- metadata = @config.rpcs.create_game_server_config.metadata.to_h
433
-
434
- # Set x-goog-api-client and x-goog-user-project headers
435
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
436
- lib_name: @config.lib_name, lib_version: @config.lib_version,
437
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
438
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
439
-
440
- header_params = {}
441
- if request.parent
442
- header_params["parent"] = request.parent
443
- end
444
-
445
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
446
- metadata[:"x-goog-request-params"] ||= request_params_header
447
-
448
- options.apply_defaults timeout: @config.rpcs.create_game_server_config.timeout,
449
- metadata: metadata,
450
- retry_policy: @config.rpcs.create_game_server_config.retry_policy
451
-
452
- options.apply_defaults timeout: @config.timeout,
453
- metadata: @config.metadata,
454
- retry_policy: @config.retry_policy
455
-
456
- @game_server_configs_service_stub.call_rpc :create_game_server_config, request, options: options do |response, operation|
457
- response = ::Gapic::Operation.new response, @operations_client, options: options
458
- yield response, operation if block_given?
459
- return response
460
- end
461
- rescue ::GRPC::BadStatus => e
462
- raise ::Google::Cloud::Error.from_error(e)
463
- end
464
-
465
- ##
466
- # Deletes a single game server config. The deletion will fail if the game
467
- # server config is referenced in a game server deployment rollout.
468
- #
469
- # @overload delete_game_server_config(request, options = nil)
470
- # Pass arguments to `delete_game_server_config` via a request object, either of type
471
- # {::Google::Cloud::Gaming::V1::DeleteGameServerConfigRequest} or an equivalent Hash.
472
- #
473
- # @param request [::Google::Cloud::Gaming::V1::DeleteGameServerConfigRequest, ::Hash]
474
- # A request object representing the call parameters. Required. To specify no
475
- # parameters, or to keep all the default parameter values, pass an empty Hash.
476
- # @param options [::Gapic::CallOptions, ::Hash]
477
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
478
- #
479
- # @overload delete_game_server_config(name: nil)
480
- # Pass arguments to `delete_game_server_config` via keyword arguments. Note that at
481
- # least one keyword argument is required. To specify no parameters, or to keep all
482
- # the default parameter values, pass an empty Hash as a request object (see above).
483
- #
484
- # @param name [::String]
485
- # Required. The name of the game server config to delete, in the following form:
486
- # `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`.
487
- #
488
- # @yield [response, operation] Access the result along with the RPC operation
489
- # @yieldparam response [::Gapic::Operation]
490
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
491
- #
492
- # @return [::Gapic::Operation]
493
- #
494
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
495
- #
496
- # @example Basic example
497
- # require "google/cloud/gaming/v1"
498
- #
499
- # # Create a client object. The client can be reused for multiple calls.
500
- # client = Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new
501
- #
502
- # # Create a request. To set request fields, pass in keyword arguments.
503
- # request = Google::Cloud::Gaming::V1::DeleteGameServerConfigRequest.new
504
- #
505
- # # Call the delete_game_server_config method.
506
- # result = client.delete_game_server_config request
507
- #
508
- # # The returned object is of type Gapic::Operation. You can use it to
509
- # # check the status of an operation, cancel it, or wait for results.
510
- # # Here is how to wait for a response.
511
- # result.wait_until_done! timeout: 60
512
- # if result.response?
513
- # p result.response
514
- # else
515
- # puts "No response received."
516
- # end
517
- #
518
- def delete_game_server_config request, options = nil
519
- raise ::ArgumentError, "request must be provided" if request.nil?
520
-
521
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::DeleteGameServerConfigRequest
522
-
523
- # Converts hash and nil to an options object
524
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
525
-
526
- # Customize the options with defaults
527
- metadata = @config.rpcs.delete_game_server_config.metadata.to_h
528
-
529
- # Set x-goog-api-client and x-goog-user-project headers
530
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
531
- lib_name: @config.lib_name, lib_version: @config.lib_version,
532
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
533
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
534
-
535
- header_params = {}
536
- if request.name
537
- header_params["name"] = request.name
538
- end
539
-
540
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
541
- metadata[:"x-goog-request-params"] ||= request_params_header
542
-
543
- options.apply_defaults timeout: @config.rpcs.delete_game_server_config.timeout,
544
- metadata: metadata,
545
- retry_policy: @config.rpcs.delete_game_server_config.retry_policy
546
-
547
- options.apply_defaults timeout: @config.timeout,
548
- metadata: @config.metadata,
549
- retry_policy: @config.retry_policy
550
-
551
- @game_server_configs_service_stub.call_rpc :delete_game_server_config, request, options: options do |response, operation|
552
- response = ::Gapic::Operation.new response, @operations_client, options: options
553
- yield response, operation if block_given?
554
- return response
555
- end
556
- rescue ::GRPC::BadStatus => e
557
- raise ::Google::Cloud::Error.from_error(e)
558
- end
559
-
560
- ##
561
- # Configuration class for the GameServerConfigsService API.
562
- #
563
- # This class represents the configuration for GameServerConfigsService,
564
- # providing control over timeouts, retry behavior, logging, transport
565
- # parameters, and other low-level controls. Certain parameters can also be
566
- # applied individually to specific RPCs. See
567
- # {::Google::Cloud::Gaming::V1::GameServerConfigsService::Client::Configuration::Rpcs}
568
- # for a list of RPCs that can be configured independently.
569
- #
570
- # Configuration can be applied globally to all clients, or to a single client
571
- # on construction.
572
- #
573
- # @example
574
- #
575
- # # Modify the global config, setting the timeout for
576
- # # list_game_server_configs to 20 seconds,
577
- # # and all remaining timeouts to 10 seconds.
578
- # ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.configure do |config|
579
- # config.timeout = 10.0
580
- # config.rpcs.list_game_server_configs.timeout = 20.0
581
- # end
582
- #
583
- # # Apply the above configuration only to a new client.
584
- # client = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new do |config|
585
- # config.timeout = 10.0
586
- # config.rpcs.list_game_server_configs.timeout = 20.0
587
- # end
588
- #
589
- # @!attribute [rw] endpoint
590
- # The hostname or hostname:port of the service endpoint.
591
- # Defaults to `"gameservices.googleapis.com"`.
592
- # @return [::String]
593
- # @!attribute [rw] credentials
594
- # Credentials to send with calls. You may provide any of the following types:
595
- # * (`String`) The path to a service account key file in JSON format
596
- # * (`Hash`) A service account key as a Hash
597
- # * (`Google::Auth::Credentials`) A googleauth credentials object
598
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
599
- # * (`Signet::OAuth2::Client`) A signet oauth2 client object
600
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
601
- # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
602
- # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
603
- # * (`nil`) indicating no credentials
604
- # @return [::Object]
605
- # @!attribute [rw] scope
606
- # The OAuth scopes
607
- # @return [::Array<::String>]
608
- # @!attribute [rw] lib_name
609
- # The library name as recorded in instrumentation and logging
610
- # @return [::String]
611
- # @!attribute [rw] lib_version
612
- # The library version as recorded in instrumentation and logging
613
- # @return [::String]
614
- # @!attribute [rw] channel_args
615
- # Extra parameters passed to the gRPC channel. Note: this is ignored if a
616
- # `GRPC::Core::Channel` object is provided as the credential.
617
- # @return [::Hash]
618
- # @!attribute [rw] interceptors
619
- # An array of interceptors that are run before calls are executed.
620
- # @return [::Array<::GRPC::ClientInterceptor>]
621
- # @!attribute [rw] timeout
622
- # The call timeout in seconds.
623
- # @return [::Numeric]
624
- # @!attribute [rw] metadata
625
- # Additional gRPC headers to be sent with the call.
626
- # @return [::Hash{::Symbol=>::String}]
627
- # @!attribute [rw] retry_policy
628
- # The retry policy. The value is a hash with the following keys:
629
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
630
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
631
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
632
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
633
- # trigger a retry.
634
- # @return [::Hash]
635
- # @!attribute [rw] quota_project
636
- # A separate project against which to charge quota.
637
- # @return [::String]
638
- #
639
- class Configuration
640
- extend ::Gapic::Config
641
-
642
- config_attr :endpoint, "gameservices.googleapis.com", ::String
643
- config_attr :credentials, nil do |value|
644
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
645
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
646
- allowed.any? { |klass| klass === value }
647
- end
648
- config_attr :scope, nil, ::String, ::Array, nil
649
- config_attr :lib_name, nil, ::String, nil
650
- config_attr :lib_version, nil, ::String, nil
651
- config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
652
- config_attr :interceptors, nil, ::Array, nil
653
- config_attr :timeout, nil, ::Numeric, nil
654
- config_attr :metadata, nil, ::Hash, nil
655
- config_attr :retry_policy, nil, ::Hash, ::Proc, nil
656
- config_attr :quota_project, nil, ::String, nil
657
-
658
- # @private
659
- def initialize parent_config = nil
660
- @parent_config = parent_config unless parent_config.nil?
661
-
662
- yield self if block_given?
663
- end
664
-
665
- ##
666
- # Configurations for individual RPCs
667
- # @return [Rpcs]
668
- #
669
- def rpcs
670
- @rpcs ||= begin
671
- parent_rpcs = nil
672
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
673
- Rpcs.new parent_rpcs
674
- end
675
- end
676
-
677
- ##
678
- # Configuration RPC class for the GameServerConfigsService API.
679
- #
680
- # Includes fields providing the configuration for each RPC in this service.
681
- # Each configuration object is of type `Gapic::Config::Method` and includes
682
- # the following configuration fields:
683
- #
684
- # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
685
- # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
686
- # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
687
- # include the following keys:
688
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
689
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
690
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
691
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
692
- # trigger a retry.
693
- #
694
- class Rpcs
695
- ##
696
- # RPC-specific configuration for `list_game_server_configs`
697
- # @return [::Gapic::Config::Method]
698
- #
699
- attr_reader :list_game_server_configs
700
- ##
701
- # RPC-specific configuration for `get_game_server_config`
702
- # @return [::Gapic::Config::Method]
703
- #
704
- attr_reader :get_game_server_config
705
- ##
706
- # RPC-specific configuration for `create_game_server_config`
707
- # @return [::Gapic::Config::Method]
708
- #
709
- attr_reader :create_game_server_config
710
- ##
711
- # RPC-specific configuration for `delete_game_server_config`
712
- # @return [::Gapic::Config::Method]
713
- #
714
- attr_reader :delete_game_server_config
715
-
716
- # @private
717
- def initialize parent_rpcs = nil
718
- list_game_server_configs_config = parent_rpcs.list_game_server_configs if parent_rpcs.respond_to? :list_game_server_configs
719
- @list_game_server_configs = ::Gapic::Config::Method.new list_game_server_configs_config
720
- get_game_server_config_config = parent_rpcs.get_game_server_config if parent_rpcs.respond_to? :get_game_server_config
721
- @get_game_server_config = ::Gapic::Config::Method.new get_game_server_config_config
722
- create_game_server_config_config = parent_rpcs.create_game_server_config if parent_rpcs.respond_to? :create_game_server_config
723
- @create_game_server_config = ::Gapic::Config::Method.new create_game_server_config_config
724
- delete_game_server_config_config = parent_rpcs.delete_game_server_config if parent_rpcs.respond_to? :delete_game_server_config
725
- @delete_game_server_config = ::Gapic::Config::Method.new delete_game_server_config_config
726
-
727
- yield self if block_given?
728
- end
729
- end
730
- end
731
- end
732
- end
733
- end
734
- end
735
- end
736
- end