google-cloud-gaming-v1 0.7.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -143
  3. data/lib/google/cloud/gaming/v1/version.rb +3 -8
  4. metadata +16 -229
  5. data/.yardopts +0 -12
  6. data/AUTHENTICATION.md +0 -151
  7. data/lib/google/cloud/gaming/v1/common_pb.rb +0 -63
  8. data/lib/google/cloud/gaming/v1/game_server_clusters_pb.rb +0 -68
  9. data/lib/google/cloud/gaming/v1/game_server_clusters_service/client.rb +0 -1168
  10. data/lib/google/cloud/gaming/v1/game_server_clusters_service/credentials.rb +0 -51
  11. data/lib/google/cloud/gaming/v1/game_server_clusters_service/operations.rb +0 -770
  12. data/lib/google/cloud/gaming/v1/game_server_clusters_service/paths.rb +0 -73
  13. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest/client.rb +0 -938
  14. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest/operations.rb +0 -795
  15. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest/service_stub.rb +0 -524
  16. data/lib/google/cloud/gaming/v1/game_server_clusters_service/rest.rb +0 -54
  17. data/lib/google/cloud/gaming/v1/game_server_clusters_service.rb +0 -57
  18. data/lib/google/cloud/gaming/v1/game_server_clusters_service_pb.rb +0 -46
  19. data/lib/google/cloud/gaming/v1/game_server_clusters_service_services_pb.rb +0 -61
  20. data/lib/google/cloud/gaming/v1/game_server_configs_pb.rb +0 -56
  21. data/lib/google/cloud/gaming/v1/game_server_configs_service/client.rb +0 -738
  22. data/lib/google/cloud/gaming/v1/game_server_configs_service/credentials.rb +0 -51
  23. data/lib/google/cloud/gaming/v1/game_server_configs_service/operations.rb +0 -770
  24. data/lib/google/cloud/gaming/v1/game_server_configs_service/paths.rb +0 -73
  25. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest/client.rb +0 -607
  26. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest/operations.rb +0 -795
  27. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest/service_stub.rb +0 -285
  28. data/lib/google/cloud/gaming/v1/game_server_configs_service/rest.rb +0 -53
  29. data/lib/google/cloud/gaming/v1/game_server_configs_service.rb +0 -56
  30. data/lib/google/cloud/gaming/v1/game_server_configs_service_pb.rb +0 -46
  31. data/lib/google/cloud/gaming/v1/game_server_configs_service_services_pb.rb +0 -55
  32. data/lib/google/cloud/gaming/v1/game_server_deployments_pb.rb +0 -66
  33. data/lib/google/cloud/gaming/v1/game_server_deployments_service/client.rb +0 -1259
  34. data/lib/google/cloud/gaming/v1/game_server_deployments_service/credentials.rb +0 -51
  35. data/lib/google/cloud/gaming/v1/game_server_deployments_service/operations.rb +0 -770
  36. data/lib/google/cloud/gaming/v1/game_server_deployments_service/paths.rb +0 -88
  37. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest/client.rb +0 -999
  38. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest/operations.rb +0 -795
  39. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest/service_stub.rb +0 -584
  40. data/lib/google/cloud/gaming/v1/game_server_deployments_service/rest.rb +0 -54
  41. data/lib/google/cloud/gaming/v1/game_server_deployments_service.rb +0 -57
  42. data/lib/google/cloud/gaming/v1/game_server_deployments_service_pb.rb +0 -46
  43. data/lib/google/cloud/gaming/v1/game_server_deployments_service_services_pb.rb +0 -70
  44. data/lib/google/cloud/gaming/v1/realms_pb.rb +0 -59
  45. data/lib/google/cloud/gaming/v1/realms_service/client.rb +0 -947
  46. data/lib/google/cloud/gaming/v1/realms_service/credentials.rb +0 -51
  47. data/lib/google/cloud/gaming/v1/realms_service/operations.rb +0 -770
  48. data/lib/google/cloud/gaming/v1/realms_service/paths.rb +0 -69
  49. data/lib/google/cloud/gaming/v1/realms_service/rest/client.rb +0 -763
  50. data/lib/google/cloud/gaming/v1/realms_service/rest/operations.rb +0 -795
  51. data/lib/google/cloud/gaming/v1/realms_service/rest/service_stub.rb +0 -405
  52. data/lib/google/cloud/gaming/v1/realms_service/rest.rb +0 -54
  53. data/lib/google/cloud/gaming/v1/realms_service.rb +0 -57
  54. data/lib/google/cloud/gaming/v1/realms_service_pb.rb +0 -46
  55. data/lib/google/cloud/gaming/v1/realms_service_services_pb.rb +0 -56
  56. data/lib/google/cloud/gaming/v1/rest.rb +0 -40
  57. data/lib/google/cloud/gaming/v1.rb +0 -48
  58. data/lib/google-cloud-gaming-v1.rb +0 -21
  59. data/proto_docs/README.md +0 -4
  60. data/proto_docs/google/api/client.rb +0 -381
  61. data/proto_docs/google/api/field_behavior.rb +0 -71
  62. data/proto_docs/google/api/launch_stage.rb +0 -71
  63. data/proto_docs/google/api/resource.rb +0 -222
  64. data/proto_docs/google/cloud/gaming/v1/common.rb +0 -302
  65. data/proto_docs/google/cloud/gaming/v1/game_server_clusters.rb +0 -386
  66. data/proto_docs/google/cloud/gaming/v1/game_server_configs.rb +0 -180
  67. data/proto_docs/google/cloud/gaming/v1/game_server_deployments.rb +0 -301
  68. data/proto_docs/google/cloud/gaming/v1/realms.rb +0 -191
  69. data/proto_docs/google/longrunning/operations.rb +0 -164
  70. data/proto_docs/google/protobuf/any.rb +0 -144
  71. data/proto_docs/google/protobuf/duration.rb +0 -98
  72. data/proto_docs/google/protobuf/empty.rb +0 -34
  73. data/proto_docs/google/protobuf/field_mask.rb +0 -229
  74. data/proto_docs/google/protobuf/timestamp.rb +0 -127
  75. data/proto_docs/google/rpc/status.rb +0 -48
@@ -1,947 +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/realms_service_pb"
21
-
22
- module Google
23
- module Cloud
24
- module Gaming
25
- module V1
26
- module RealmsService
27
- ##
28
- # Client for the RealmsService service.
29
- #
30
- # A realm is a grouping of game server clusters that are considered
31
- # interchangeable.
32
- #
33
- class Client
34
- include Paths
35
-
36
- # @private
37
- attr_reader :realms_service_stub
38
-
39
- ##
40
- # Configure the RealmsService Client class.
41
- #
42
- # See {::Google::Cloud::Gaming::V1::RealmsService::Client::Configuration}
43
- # for a description of the configuration fields.
44
- #
45
- # @example
46
- #
47
- # # Modify the configuration for all RealmsService clients
48
- # ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
51
- #
52
- # @yield [config] Configure the Client client.
53
- # @yieldparam config [Client::Configuration]
54
- #
55
- # @return [Client::Configuration]
56
- #
57
- def self.configure
58
- @configure ||= begin
59
- namespace = ["Google", "Cloud", "Gaming", "V1"]
60
- parent_config = while namespace.any?
61
- parent_name = namespace.join "::"
62
- parent_const = const_get parent_name
63
- break parent_const.configure if parent_const.respond_to? :configure
64
- namespace.pop
65
- end
66
- default_config = Client::Configuration.new parent_config
67
-
68
- default_config.rpcs.list_realms.timeout = 60.0
69
- default_config.rpcs.list_realms.retry_policy = {
70
- initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
71
- }
72
-
73
- default_config.rpcs.get_realm.timeout = 60.0
74
- default_config.rpcs.get_realm.retry_policy = {
75
- initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
76
- }
77
-
78
- default_config.rpcs.create_realm.timeout = 60.0
79
-
80
- default_config.rpcs.delete_realm.timeout = 60.0
81
-
82
- default_config.rpcs.update_realm.timeout = 60.0
83
-
84
- default_config.rpcs.preview_realm_update.timeout = 60.0
85
- default_config.rpcs.preview_realm_update.retry_policy = {
86
- initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
87
- }
88
-
89
- default_config
90
- end
91
- yield @configure if block_given?
92
- @configure
93
- end
94
-
95
- ##
96
- # Configure the RealmsService Client instance.
97
- #
98
- # The configuration is set to the derived mode, meaning that values can be changed,
99
- # but structural changes (adding new fields, etc.) are not allowed. Structural changes
100
- # should be made on {Client.configure}.
101
- #
102
- # See {::Google::Cloud::Gaming::V1::RealmsService::Client::Configuration}
103
- # for a description of the configuration fields.
104
- #
105
- # @yield [config] Configure the Client client.
106
- # @yieldparam config [Client::Configuration]
107
- #
108
- # @return [Client::Configuration]
109
- #
110
- def configure
111
- yield @config if block_given?
112
- @config
113
- end
114
-
115
- ##
116
- # Create a new RealmsService client object.
117
- #
118
- # @example
119
- #
120
- # # Create a client using the default configuration
121
- # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new
122
- #
123
- # # Create a client using a custom configuration
124
- # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config|
125
- # config.timeout = 10.0
126
- # end
127
- #
128
- # @yield [config] Configure the RealmsService client.
129
- # @yieldparam config [Client::Configuration]
130
- #
131
- def initialize
132
- # These require statements are intentionally placed here to initialize
133
- # the gRPC module only when it's required.
134
- # See https://github.com/googleapis/toolkit/issues/446
135
- require "gapic/grpc"
136
- require "google/cloud/gaming/v1/realms_service_services_pb"
137
-
138
- # Create the configuration object
139
- @config = Configuration.new Client.configure
140
-
141
- # Yield the configuration if needed
142
- yield @config if block_given?
143
-
144
- # Create credentials
145
- credentials = @config.credentials
146
- # Use self-signed JWT if the endpoint is unchanged from default,
147
- # but only if the default endpoint does not have a region prefix.
148
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
- !@config.endpoint.split(".").first.include?("-")
150
- credentials ||= Credentials.default scope: @config.scope,
151
- enable_self_signed_jwt: enable_self_signed_jwt
152
- if credentials.is_a?(::String) || credentials.is_a?(::Hash)
153
- credentials = Credentials.new credentials, scope: @config.scope
154
- end
155
- @quota_project_id = @config.quota_project
156
- @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
157
-
158
- @operations_client = Operations.new do |config|
159
- config.credentials = credentials
160
- config.quota_project = @quota_project_id
161
- config.endpoint = @config.endpoint
162
- end
163
-
164
- @realms_service_stub = ::Gapic::ServiceStub.new(
165
- ::Google::Cloud::Gaming::V1::RealmsService::Stub,
166
- credentials: credentials,
167
- endpoint: @config.endpoint,
168
- channel_args: @config.channel_args,
169
- interceptors: @config.interceptors
170
- )
171
- end
172
-
173
- ##
174
- # Get the associated client for long-running operations.
175
- #
176
- # @return [::Google::Cloud::Gaming::V1::RealmsService::Operations]
177
- #
178
- attr_reader :operations_client
179
-
180
- # Service calls
181
-
182
- ##
183
- # Lists realms in a given project and location.
184
- #
185
- # @overload list_realms(request, options = nil)
186
- # Pass arguments to `list_realms` via a request object, either of type
187
- # {::Google::Cloud::Gaming::V1::ListRealmsRequest} or an equivalent Hash.
188
- #
189
- # @param request [::Google::Cloud::Gaming::V1::ListRealmsRequest, ::Hash]
190
- # A request object representing the call parameters. Required. To specify no
191
- # parameters, or to keep all the default parameter values, pass an empty Hash.
192
- # @param options [::Gapic::CallOptions, ::Hash]
193
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
194
- #
195
- # @overload list_realms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
196
- # Pass arguments to `list_realms` via keyword arguments. Note that at
197
- # least one keyword argument is required. To specify no parameters, or to keep all
198
- # the default parameter values, pass an empty Hash as a request object (see above).
199
- #
200
- # @param parent [::String]
201
- # Required. The parent resource name, in the following form:
202
- # `projects/{project}/locations/{location}`.
203
- # @param page_size [::Integer]
204
- # Optional. The maximum number of items to return. If unspecified, server
205
- # will pick an appropriate default. Server may return fewer items than
206
- # requested. A caller should only rely on response's
207
- # {::Google::Cloud::Gaming::V1::ListRealmsResponse#next_page_token next_page_token} to
208
- # determine if there are more realms left to be queried.
209
- # @param page_token [::String]
210
- # Optional. The next_page_token value returned from a previous List request,
211
- # if any.
212
- # @param filter [::String]
213
- # Optional. The filter to apply to list results.
214
- # @param order_by [::String]
215
- # Optional. Specifies the ordering of results following syntax at
216
- # https://cloud.google.com/apis/design/design_patterns#sorting_order.
217
- #
218
- # @yield [response, operation] Access the result along with the RPC operation
219
- # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::Realm>]
220
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
221
- #
222
- # @return [::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::Realm>]
223
- #
224
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
225
- #
226
- # @example Basic example
227
- # require "google/cloud/gaming/v1"
228
- #
229
- # # Create a client object. The client can be reused for multiple calls.
230
- # client = Google::Cloud::Gaming::V1::RealmsService::Client.new
231
- #
232
- # # Create a request. To set request fields, pass in keyword arguments.
233
- # request = Google::Cloud::Gaming::V1::ListRealmsRequest.new
234
- #
235
- # # Call the list_realms method.
236
- # result = client.list_realms request
237
- #
238
- # # The returned object is of type Gapic::PagedEnumerable. You can iterate
239
- # # over elements, and API calls will be issued to fetch pages as needed.
240
- # result.each do |item|
241
- # # Each element is of type ::Google::Cloud::Gaming::V1::Realm.
242
- # p item
243
- # end
244
- #
245
- def list_realms request, options = nil
246
- raise ::ArgumentError, "request must be provided" if request.nil?
247
-
248
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::ListRealmsRequest
249
-
250
- # Converts hash and nil to an options object
251
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
252
-
253
- # Customize the options with defaults
254
- metadata = @config.rpcs.list_realms.metadata.to_h
255
-
256
- # Set x-goog-api-client and x-goog-user-project headers
257
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
258
- lib_name: @config.lib_name, lib_version: @config.lib_version,
259
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
260
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
261
-
262
- header_params = {}
263
- if request.parent
264
- header_params["parent"] = request.parent
265
- end
266
-
267
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
268
- metadata[:"x-goog-request-params"] ||= request_params_header
269
-
270
- options.apply_defaults timeout: @config.rpcs.list_realms.timeout,
271
- metadata: metadata,
272
- retry_policy: @config.rpcs.list_realms.retry_policy
273
-
274
- options.apply_defaults timeout: @config.timeout,
275
- metadata: @config.metadata,
276
- retry_policy: @config.retry_policy
277
-
278
- @realms_service_stub.call_rpc :list_realms, request, options: options do |response, operation|
279
- response = ::Gapic::PagedEnumerable.new @realms_service_stub, :list_realms, request, response, operation, options
280
- yield response, operation if block_given?
281
- return response
282
- end
283
- rescue ::GRPC::BadStatus => e
284
- raise ::Google::Cloud::Error.from_error(e)
285
- end
286
-
287
- ##
288
- # Gets details of a single realm.
289
- #
290
- # @overload get_realm(request, options = nil)
291
- # Pass arguments to `get_realm` via a request object, either of type
292
- # {::Google::Cloud::Gaming::V1::GetRealmRequest} or an equivalent Hash.
293
- #
294
- # @param request [::Google::Cloud::Gaming::V1::GetRealmRequest, ::Hash]
295
- # A request object representing the call parameters. Required. To specify no
296
- # parameters, or to keep all the default parameter values, pass an empty Hash.
297
- # @param options [::Gapic::CallOptions, ::Hash]
298
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
299
- #
300
- # @overload get_realm(name: nil)
301
- # Pass arguments to `get_realm` via keyword arguments. Note that at
302
- # least one keyword argument is required. To specify no parameters, or to keep all
303
- # the default parameter values, pass an empty Hash as a request object (see above).
304
- #
305
- # @param name [::String]
306
- # Required. The name of the realm to retrieve, in the following form:
307
- # `projects/{project}/locations/{location}/realms/{realm}`.
308
- #
309
- # @yield [response, operation] Access the result along with the RPC operation
310
- # @yieldparam response [::Google::Cloud::Gaming::V1::Realm]
311
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
312
- #
313
- # @return [::Google::Cloud::Gaming::V1::Realm]
314
- #
315
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
316
- #
317
- # @example Basic example
318
- # require "google/cloud/gaming/v1"
319
- #
320
- # # Create a client object. The client can be reused for multiple calls.
321
- # client = Google::Cloud::Gaming::V1::RealmsService::Client.new
322
- #
323
- # # Create a request. To set request fields, pass in keyword arguments.
324
- # request = Google::Cloud::Gaming::V1::GetRealmRequest.new
325
- #
326
- # # Call the get_realm method.
327
- # result = client.get_realm request
328
- #
329
- # # The returned object is of type Google::Cloud::Gaming::V1::Realm.
330
- # p result
331
- #
332
- def get_realm request, options = nil
333
- raise ::ArgumentError, "request must be provided" if request.nil?
334
-
335
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::GetRealmRequest
336
-
337
- # Converts hash and nil to an options object
338
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
339
-
340
- # Customize the options with defaults
341
- metadata = @config.rpcs.get_realm.metadata.to_h
342
-
343
- # Set x-goog-api-client and x-goog-user-project headers
344
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
345
- lib_name: @config.lib_name, lib_version: @config.lib_version,
346
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
347
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
348
-
349
- header_params = {}
350
- if request.name
351
- header_params["name"] = request.name
352
- end
353
-
354
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
355
- metadata[:"x-goog-request-params"] ||= request_params_header
356
-
357
- options.apply_defaults timeout: @config.rpcs.get_realm.timeout,
358
- metadata: metadata,
359
- retry_policy: @config.rpcs.get_realm.retry_policy
360
-
361
- options.apply_defaults timeout: @config.timeout,
362
- metadata: @config.metadata,
363
- retry_policy: @config.retry_policy
364
-
365
- @realms_service_stub.call_rpc :get_realm, request, options: options do |response, operation|
366
- yield response, operation if block_given?
367
- return response
368
- end
369
- rescue ::GRPC::BadStatus => e
370
- raise ::Google::Cloud::Error.from_error(e)
371
- end
372
-
373
- ##
374
- # Creates a new realm in a given project and location.
375
- #
376
- # @overload create_realm(request, options = nil)
377
- # Pass arguments to `create_realm` via a request object, either of type
378
- # {::Google::Cloud::Gaming::V1::CreateRealmRequest} or an equivalent Hash.
379
- #
380
- # @param request [::Google::Cloud::Gaming::V1::CreateRealmRequest, ::Hash]
381
- # A request object representing the call parameters. Required. To specify no
382
- # parameters, or to keep all the default parameter values, pass an empty Hash.
383
- # @param options [::Gapic::CallOptions, ::Hash]
384
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
385
- #
386
- # @overload create_realm(parent: nil, realm_id: nil, realm: nil)
387
- # Pass arguments to `create_realm` via keyword arguments. Note that at
388
- # least one keyword argument is required. To specify no parameters, or to keep all
389
- # the default parameter values, pass an empty Hash as a request object (see above).
390
- #
391
- # @param parent [::String]
392
- # Required. The parent resource name, in the following form:
393
- # `projects/{project}/locations/{location}`.
394
- # @param realm_id [::String]
395
- # Required. The ID of the realm resource to be created.
396
- # @param realm [::Google::Cloud::Gaming::V1::Realm, ::Hash]
397
- # Required. The realm resource to be created.
398
- #
399
- # @yield [response, operation] Access the result along with the RPC operation
400
- # @yieldparam response [::Gapic::Operation]
401
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
402
- #
403
- # @return [::Gapic::Operation]
404
- #
405
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
406
- #
407
- # @example Basic example
408
- # require "google/cloud/gaming/v1"
409
- #
410
- # # Create a client object. The client can be reused for multiple calls.
411
- # client = Google::Cloud::Gaming::V1::RealmsService::Client.new
412
- #
413
- # # Create a request. To set request fields, pass in keyword arguments.
414
- # request = Google::Cloud::Gaming::V1::CreateRealmRequest.new
415
- #
416
- # # Call the create_realm method.
417
- # result = client.create_realm request
418
- #
419
- # # The returned object is of type Gapic::Operation. You can use it to
420
- # # check the status of an operation, cancel it, or wait for results.
421
- # # Here is how to wait for a response.
422
- # result.wait_until_done! timeout: 60
423
- # if result.response?
424
- # p result.response
425
- # else
426
- # puts "No response received."
427
- # end
428
- #
429
- def create_realm request, options = nil
430
- raise ::ArgumentError, "request must be provided" if request.nil?
431
-
432
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::CreateRealmRequest
433
-
434
- # Converts hash and nil to an options object
435
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
436
-
437
- # Customize the options with defaults
438
- metadata = @config.rpcs.create_realm.metadata.to_h
439
-
440
- # Set x-goog-api-client and x-goog-user-project headers
441
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
442
- lib_name: @config.lib_name, lib_version: @config.lib_version,
443
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
444
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
445
-
446
- header_params = {}
447
- if request.parent
448
- header_params["parent"] = request.parent
449
- end
450
-
451
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
452
- metadata[:"x-goog-request-params"] ||= request_params_header
453
-
454
- options.apply_defaults timeout: @config.rpcs.create_realm.timeout,
455
- metadata: metadata,
456
- retry_policy: @config.rpcs.create_realm.retry_policy
457
-
458
- options.apply_defaults timeout: @config.timeout,
459
- metadata: @config.metadata,
460
- retry_policy: @config.retry_policy
461
-
462
- @realms_service_stub.call_rpc :create_realm, request, options: options do |response, operation|
463
- response = ::Gapic::Operation.new response, @operations_client, options: options
464
- yield response, operation if block_given?
465
- return response
466
- end
467
- rescue ::GRPC::BadStatus => e
468
- raise ::Google::Cloud::Error.from_error(e)
469
- end
470
-
471
- ##
472
- # Deletes a single realm.
473
- #
474
- # @overload delete_realm(request, options = nil)
475
- # Pass arguments to `delete_realm` via a request object, either of type
476
- # {::Google::Cloud::Gaming::V1::DeleteRealmRequest} or an equivalent Hash.
477
- #
478
- # @param request [::Google::Cloud::Gaming::V1::DeleteRealmRequest, ::Hash]
479
- # A request object representing the call parameters. Required. To specify no
480
- # parameters, or to keep all the default parameter values, pass an empty Hash.
481
- # @param options [::Gapic::CallOptions, ::Hash]
482
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
483
- #
484
- # @overload delete_realm(name: nil)
485
- # Pass arguments to `delete_realm` via keyword arguments. Note that at
486
- # least one keyword argument is required. To specify no parameters, or to keep all
487
- # the default parameter values, pass an empty Hash as a request object (see above).
488
- #
489
- # @param name [::String]
490
- # Required. The name of the realm to delete, in the following form:
491
- # `projects/{project}/locations/{location}/realms/{realm}`.
492
- #
493
- # @yield [response, operation] Access the result along with the RPC operation
494
- # @yieldparam response [::Gapic::Operation]
495
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
496
- #
497
- # @return [::Gapic::Operation]
498
- #
499
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
500
- #
501
- # @example Basic example
502
- # require "google/cloud/gaming/v1"
503
- #
504
- # # Create a client object. The client can be reused for multiple calls.
505
- # client = Google::Cloud::Gaming::V1::RealmsService::Client.new
506
- #
507
- # # Create a request. To set request fields, pass in keyword arguments.
508
- # request = Google::Cloud::Gaming::V1::DeleteRealmRequest.new
509
- #
510
- # # Call the delete_realm method.
511
- # result = client.delete_realm request
512
- #
513
- # # The returned object is of type Gapic::Operation. You can use it to
514
- # # check the status of an operation, cancel it, or wait for results.
515
- # # Here is how to wait for a response.
516
- # result.wait_until_done! timeout: 60
517
- # if result.response?
518
- # p result.response
519
- # else
520
- # puts "No response received."
521
- # end
522
- #
523
- def delete_realm request, options = nil
524
- raise ::ArgumentError, "request must be provided" if request.nil?
525
-
526
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::DeleteRealmRequest
527
-
528
- # Converts hash and nil to an options object
529
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
530
-
531
- # Customize the options with defaults
532
- metadata = @config.rpcs.delete_realm.metadata.to_h
533
-
534
- # Set x-goog-api-client and x-goog-user-project headers
535
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
536
- lib_name: @config.lib_name, lib_version: @config.lib_version,
537
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
538
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
539
-
540
- header_params = {}
541
- if request.name
542
- header_params["name"] = request.name
543
- end
544
-
545
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
546
- metadata[:"x-goog-request-params"] ||= request_params_header
547
-
548
- options.apply_defaults timeout: @config.rpcs.delete_realm.timeout,
549
- metadata: metadata,
550
- retry_policy: @config.rpcs.delete_realm.retry_policy
551
-
552
- options.apply_defaults timeout: @config.timeout,
553
- metadata: @config.metadata,
554
- retry_policy: @config.retry_policy
555
-
556
- @realms_service_stub.call_rpc :delete_realm, request, options: options do |response, operation|
557
- response = ::Gapic::Operation.new response, @operations_client, options: options
558
- yield response, operation if block_given?
559
- return response
560
- end
561
- rescue ::GRPC::BadStatus => e
562
- raise ::Google::Cloud::Error.from_error(e)
563
- end
564
-
565
- ##
566
- # Patches a single realm.
567
- #
568
- # @overload update_realm(request, options = nil)
569
- # Pass arguments to `update_realm` via a request object, either of type
570
- # {::Google::Cloud::Gaming::V1::UpdateRealmRequest} or an equivalent Hash.
571
- #
572
- # @param request [::Google::Cloud::Gaming::V1::UpdateRealmRequest, ::Hash]
573
- # A request object representing the call parameters. Required. To specify no
574
- # parameters, or to keep all the default parameter values, pass an empty Hash.
575
- # @param options [::Gapic::CallOptions, ::Hash]
576
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
577
- #
578
- # @overload update_realm(realm: nil, update_mask: nil)
579
- # Pass arguments to `update_realm` via keyword arguments. Note that at
580
- # least one keyword argument is required. To specify no parameters, or to keep all
581
- # the default parameter values, pass an empty Hash as a request object (see above).
582
- #
583
- # @param realm [::Google::Cloud::Gaming::V1::Realm, ::Hash]
584
- # Required. The realm to be updated.
585
- # Only fields specified in update_mask are updated.
586
- # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
587
- # Required. The update mask applies to the resource. For the `FieldMask`
588
- # definition, see
589
- # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
590
- #
591
- # @yield [response, operation] Access the result along with the RPC operation
592
- # @yieldparam response [::Gapic::Operation]
593
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
594
- #
595
- # @return [::Gapic::Operation]
596
- #
597
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
598
- #
599
- # @example Basic example
600
- # require "google/cloud/gaming/v1"
601
- #
602
- # # Create a client object. The client can be reused for multiple calls.
603
- # client = Google::Cloud::Gaming::V1::RealmsService::Client.new
604
- #
605
- # # Create a request. To set request fields, pass in keyword arguments.
606
- # request = Google::Cloud::Gaming::V1::UpdateRealmRequest.new
607
- #
608
- # # Call the update_realm method.
609
- # result = client.update_realm request
610
- #
611
- # # The returned object is of type Gapic::Operation. You can use it to
612
- # # check the status of an operation, cancel it, or wait for results.
613
- # # Here is how to wait for a response.
614
- # result.wait_until_done! timeout: 60
615
- # if result.response?
616
- # p result.response
617
- # else
618
- # puts "No response received."
619
- # end
620
- #
621
- def update_realm request, options = nil
622
- raise ::ArgumentError, "request must be provided" if request.nil?
623
-
624
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::UpdateRealmRequest
625
-
626
- # Converts hash and nil to an options object
627
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
628
-
629
- # Customize the options with defaults
630
- metadata = @config.rpcs.update_realm.metadata.to_h
631
-
632
- # Set x-goog-api-client and x-goog-user-project headers
633
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
634
- lib_name: @config.lib_name, lib_version: @config.lib_version,
635
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
636
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
637
-
638
- header_params = {}
639
- if request.realm&.name
640
- header_params["realm.name"] = request.realm.name
641
- end
642
-
643
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
644
- metadata[:"x-goog-request-params"] ||= request_params_header
645
-
646
- options.apply_defaults timeout: @config.rpcs.update_realm.timeout,
647
- metadata: metadata,
648
- retry_policy: @config.rpcs.update_realm.retry_policy
649
-
650
- options.apply_defaults timeout: @config.timeout,
651
- metadata: @config.metadata,
652
- retry_policy: @config.retry_policy
653
-
654
- @realms_service_stub.call_rpc :update_realm, request, options: options do |response, operation|
655
- response = ::Gapic::Operation.new response, @operations_client, options: options
656
- yield response, operation if block_given?
657
- return response
658
- end
659
- rescue ::GRPC::BadStatus => e
660
- raise ::Google::Cloud::Error.from_error(e)
661
- end
662
-
663
- ##
664
- # Previews patches to a single realm.
665
- #
666
- # @overload preview_realm_update(request, options = nil)
667
- # Pass arguments to `preview_realm_update` via a request object, either of type
668
- # {::Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest} or an equivalent Hash.
669
- #
670
- # @param request [::Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest, ::Hash]
671
- # A request object representing the call parameters. Required. To specify no
672
- # parameters, or to keep all the default parameter values, pass an empty Hash.
673
- # @param options [::Gapic::CallOptions, ::Hash]
674
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
675
- #
676
- # @overload preview_realm_update(realm: nil, update_mask: nil, preview_time: nil)
677
- # Pass arguments to `preview_realm_update` via keyword arguments. Note that at
678
- # least one keyword argument is required. To specify no parameters, or to keep all
679
- # the default parameter values, pass an empty Hash as a request object (see above).
680
- #
681
- # @param realm [::Google::Cloud::Gaming::V1::Realm, ::Hash]
682
- # Required. The realm to be updated.
683
- # Only fields specified in update_mask are updated.
684
- # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
685
- # Required. The update mask applies to the resource. For the `FieldMask`
686
- # definition, see
687
- # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
688
- # @param preview_time [::Google::Protobuf::Timestamp, ::Hash]
689
- # Optional. The target timestamp to compute the preview.
690
- #
691
- # @yield [response, operation] Access the result along with the RPC operation
692
- # @yieldparam response [::Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse]
693
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
694
- #
695
- # @return [::Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse]
696
- #
697
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
698
- #
699
- # @example Basic example
700
- # require "google/cloud/gaming/v1"
701
- #
702
- # # Create a client object. The client can be reused for multiple calls.
703
- # client = Google::Cloud::Gaming::V1::RealmsService::Client.new
704
- #
705
- # # Create a request. To set request fields, pass in keyword arguments.
706
- # request = Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest.new
707
- #
708
- # # Call the preview_realm_update method.
709
- # result = client.preview_realm_update request
710
- #
711
- # # The returned object is of type Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse.
712
- # p result
713
- #
714
- def preview_realm_update request, options = nil
715
- raise ::ArgumentError, "request must be provided" if request.nil?
716
-
717
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest
718
-
719
- # Converts hash and nil to an options object
720
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
721
-
722
- # Customize the options with defaults
723
- metadata = @config.rpcs.preview_realm_update.metadata.to_h
724
-
725
- # Set x-goog-api-client and x-goog-user-project headers
726
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
727
- lib_name: @config.lib_name, lib_version: @config.lib_version,
728
- gapic_version: ::Google::Cloud::Gaming::V1::VERSION
729
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
730
-
731
- header_params = {}
732
- if request.realm&.name
733
- header_params["realm.name"] = request.realm.name
734
- end
735
-
736
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
737
- metadata[:"x-goog-request-params"] ||= request_params_header
738
-
739
- options.apply_defaults timeout: @config.rpcs.preview_realm_update.timeout,
740
- metadata: metadata,
741
- retry_policy: @config.rpcs.preview_realm_update.retry_policy
742
-
743
- options.apply_defaults timeout: @config.timeout,
744
- metadata: @config.metadata,
745
- retry_policy: @config.retry_policy
746
-
747
- @realms_service_stub.call_rpc :preview_realm_update, request, options: options do |response, operation|
748
- yield response, operation if block_given?
749
- return response
750
- end
751
- rescue ::GRPC::BadStatus => e
752
- raise ::Google::Cloud::Error.from_error(e)
753
- end
754
-
755
- ##
756
- # Configuration class for the RealmsService API.
757
- #
758
- # This class represents the configuration for RealmsService,
759
- # providing control over timeouts, retry behavior, logging, transport
760
- # parameters, and other low-level controls. Certain parameters can also be
761
- # applied individually to specific RPCs. See
762
- # {::Google::Cloud::Gaming::V1::RealmsService::Client::Configuration::Rpcs}
763
- # for a list of RPCs that can be configured independently.
764
- #
765
- # Configuration can be applied globally to all clients, or to a single client
766
- # on construction.
767
- #
768
- # @example
769
- #
770
- # # Modify the global config, setting the timeout for
771
- # # list_realms to 20 seconds,
772
- # # and all remaining timeouts to 10 seconds.
773
- # ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config|
774
- # config.timeout = 10.0
775
- # config.rpcs.list_realms.timeout = 20.0
776
- # end
777
- #
778
- # # Apply the above configuration only to a new client.
779
- # client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config|
780
- # config.timeout = 10.0
781
- # config.rpcs.list_realms.timeout = 20.0
782
- # end
783
- #
784
- # @!attribute [rw] endpoint
785
- # The hostname or hostname:port of the service endpoint.
786
- # Defaults to `"gameservices.googleapis.com"`.
787
- # @return [::String]
788
- # @!attribute [rw] credentials
789
- # Credentials to send with calls. You may provide any of the following types:
790
- # * (`String`) The path to a service account key file in JSON format
791
- # * (`Hash`) A service account key as a Hash
792
- # * (`Google::Auth::Credentials`) A googleauth credentials object
793
- # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
794
- # * (`Signet::OAuth2::Client`) A signet oauth2 client object
795
- # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
796
- # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
797
- # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
798
- # * (`nil`) indicating no credentials
799
- # @return [::Object]
800
- # @!attribute [rw] scope
801
- # The OAuth scopes
802
- # @return [::Array<::String>]
803
- # @!attribute [rw] lib_name
804
- # The library name as recorded in instrumentation and logging
805
- # @return [::String]
806
- # @!attribute [rw] lib_version
807
- # The library version as recorded in instrumentation and logging
808
- # @return [::String]
809
- # @!attribute [rw] channel_args
810
- # Extra parameters passed to the gRPC channel. Note: this is ignored if a
811
- # `GRPC::Core::Channel` object is provided as the credential.
812
- # @return [::Hash]
813
- # @!attribute [rw] interceptors
814
- # An array of interceptors that are run before calls are executed.
815
- # @return [::Array<::GRPC::ClientInterceptor>]
816
- # @!attribute [rw] timeout
817
- # The call timeout in seconds.
818
- # @return [::Numeric]
819
- # @!attribute [rw] metadata
820
- # Additional gRPC headers to be sent with the call.
821
- # @return [::Hash{::Symbol=>::String}]
822
- # @!attribute [rw] retry_policy
823
- # The retry policy. The value is a hash with the following keys:
824
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
825
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
826
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
827
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
828
- # trigger a retry.
829
- # @return [::Hash]
830
- # @!attribute [rw] quota_project
831
- # A separate project against which to charge quota.
832
- # @return [::String]
833
- #
834
- class Configuration
835
- extend ::Gapic::Config
836
-
837
- DEFAULT_ENDPOINT = "gameservices.googleapis.com"
838
-
839
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
840
- config_attr :credentials, nil do |value|
841
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
842
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
843
- allowed.any? { |klass| klass === value }
844
- end
845
- config_attr :scope, nil, ::String, ::Array, nil
846
- config_attr :lib_name, nil, ::String, nil
847
- config_attr :lib_version, nil, ::String, nil
848
- config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
849
- config_attr :interceptors, nil, ::Array, nil
850
- config_attr :timeout, nil, ::Numeric, nil
851
- config_attr :metadata, nil, ::Hash, nil
852
- config_attr :retry_policy, nil, ::Hash, ::Proc, nil
853
- config_attr :quota_project, nil, ::String, nil
854
-
855
- # @private
856
- def initialize parent_config = nil
857
- @parent_config = parent_config unless parent_config.nil?
858
-
859
- yield self if block_given?
860
- end
861
-
862
- ##
863
- # Configurations for individual RPCs
864
- # @return [Rpcs]
865
- #
866
- def rpcs
867
- @rpcs ||= begin
868
- parent_rpcs = nil
869
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
870
- Rpcs.new parent_rpcs
871
- end
872
- end
873
-
874
- ##
875
- # Configuration RPC class for the RealmsService API.
876
- #
877
- # Includes fields providing the configuration for each RPC in this service.
878
- # Each configuration object is of type `Gapic::Config::Method` and includes
879
- # the following configuration fields:
880
- #
881
- # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
882
- # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
883
- # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
884
- # include the following keys:
885
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
886
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
887
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
888
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
889
- # trigger a retry.
890
- #
891
- class Rpcs
892
- ##
893
- # RPC-specific configuration for `list_realms`
894
- # @return [::Gapic::Config::Method]
895
- #
896
- attr_reader :list_realms
897
- ##
898
- # RPC-specific configuration for `get_realm`
899
- # @return [::Gapic::Config::Method]
900
- #
901
- attr_reader :get_realm
902
- ##
903
- # RPC-specific configuration for `create_realm`
904
- # @return [::Gapic::Config::Method]
905
- #
906
- attr_reader :create_realm
907
- ##
908
- # RPC-specific configuration for `delete_realm`
909
- # @return [::Gapic::Config::Method]
910
- #
911
- attr_reader :delete_realm
912
- ##
913
- # RPC-specific configuration for `update_realm`
914
- # @return [::Gapic::Config::Method]
915
- #
916
- attr_reader :update_realm
917
- ##
918
- # RPC-specific configuration for `preview_realm_update`
919
- # @return [::Gapic::Config::Method]
920
- #
921
- attr_reader :preview_realm_update
922
-
923
- # @private
924
- def initialize parent_rpcs = nil
925
- list_realms_config = parent_rpcs.list_realms if parent_rpcs.respond_to? :list_realms
926
- @list_realms = ::Gapic::Config::Method.new list_realms_config
927
- get_realm_config = parent_rpcs.get_realm if parent_rpcs.respond_to? :get_realm
928
- @get_realm = ::Gapic::Config::Method.new get_realm_config
929
- create_realm_config = parent_rpcs.create_realm if parent_rpcs.respond_to? :create_realm
930
- @create_realm = ::Gapic::Config::Method.new create_realm_config
931
- delete_realm_config = parent_rpcs.delete_realm if parent_rpcs.respond_to? :delete_realm
932
- @delete_realm = ::Gapic::Config::Method.new delete_realm_config
933
- update_realm_config = parent_rpcs.update_realm if parent_rpcs.respond_to? :update_realm
934
- @update_realm = ::Gapic::Config::Method.new update_realm_config
935
- preview_realm_update_config = parent_rpcs.preview_realm_update if parent_rpcs.respond_to? :preview_realm_update
936
- @preview_realm_update = ::Gapic::Config::Method.new preview_realm_update_config
937
-
938
- yield self if block_given?
939
- end
940
- end
941
- end
942
- end
943
- end
944
- end
945
- end
946
- end
947
- end