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