Reference documentation and code samples for the Cloud Gaming V1 API class Google::Cloud::Gaming::V1::RealmsService::Client.
Client for the RealmsService service.
A realm is a grouping of game server clusters that are considered interchangeable.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the RealmsService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all RealmsService clients ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the RealmsService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_realm
def create_realm(request, options = nil) -> ::Gapic::Operation
def create_realm(parent: nil, realm_id: nil, realm: nil) -> ::Gapic::Operation
Creates a new realm in a given project and location.
def create_realm(request, options = nil) -> ::Gapic::Operation
create_realm
via a request object, either of type
CreateRealmRequest or an equivalent Hash.
- request (::Google::Cloud::Gaming::V1::CreateRealmRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_realm(parent: nil, realm_id: nil, realm: nil) -> ::Gapic::Operation
create_realm
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The parent resource name, in the following form:
projects/{project}/locations/{location}
. - realm_id (::String) — Required. The ID of the realm resource to be created.
- realm (::Google::Cloud::Gaming::V1::Realm, ::Hash) — Required. The realm resource to be created.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/gaming/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Gaming::V1::RealmsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Gaming::V1::CreateRealmRequest.new # Call the create_realm method. result = client.create_realm request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#delete_realm
def delete_realm(request, options = nil) -> ::Gapic::Operation
def delete_realm(name: nil) -> ::Gapic::Operation
Deletes a single realm.
def delete_realm(request, options = nil) -> ::Gapic::Operation
delete_realm
via a request object, either of type
DeleteRealmRequest or an equivalent Hash.
- request (::Google::Cloud::Gaming::V1::DeleteRealmRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_realm(name: nil) -> ::Gapic::Operation
delete_realm
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The name of the realm to delete, in the following form:
projects/{project}/locations/{location}/realms/{realm}
.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/gaming/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Gaming::V1::RealmsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Gaming::V1::DeleteRealmRequest.new # Call the delete_realm method. result = client.delete_realm request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#get_realm
def get_realm(request, options = nil) -> ::Google::Cloud::Gaming::V1::Realm
def get_realm(name: nil) -> ::Google::Cloud::Gaming::V1::Realm
Gets details of a single realm.
def get_realm(request, options = nil) -> ::Google::Cloud::Gaming::V1::Realm
get_realm
via a request object, either of type
GetRealmRequest or an equivalent Hash.
- request (::Google::Cloud::Gaming::V1::GetRealmRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_realm(name: nil) -> ::Google::Cloud::Gaming::V1::Realm
get_realm
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The name of the realm to retrieve, in the following form:
projects/{project}/locations/{location}/realms/{realm}
.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Gaming::V1::Realm)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/gaming/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Gaming::V1::RealmsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Gaming::V1::GetRealmRequest.new # Call the get_realm method. result = client.get_realm request # The returned object is of type Google::Cloud::Gaming::V1::Realm. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new RealmsService client object.
- (config) — Configure the RealmsService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config| config.timeout = 10.0 end
#list_realms
def list_realms(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::Realm>
def list_realms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::Realm>
Lists realms in a given project and location.
def list_realms(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::Realm>
list_realms
via a request object, either of type
ListRealmsRequest or an equivalent Hash.
- request (::Google::Cloud::Gaming::V1::ListRealmsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_realms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::Realm>
list_realms
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The parent resource name, in the following form:
projects/{project}/locations/{location}
. - page_size (::Integer) — Optional. The maximum number of items to return. If unspecified, server will pick an appropriate default. Server may return fewer items than requested. A caller should only rely on response's next_page_token to determine if there are more realms left to be queried.
- page_token (::String) — Optional. The next_page_token value returned from a previous List request, if any.
- filter (::String) — Optional. The filter to apply to list results.
- order_by (::String) — Optional. Specifies the ordering of results following syntax at https://cloud.google.com/apis/design/design_patterns#sorting_order.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::Realm>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::Realm>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/gaming/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Gaming::V1::RealmsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Gaming::V1::ListRealmsRequest.new # Call the list_realms method. result = client.list_realms request # The returned object is of type Gapic::PagedEnumerable. You can # iterate over all elements by calling #each, and the enumerable # will lazily make API calls to fetch subsequent pages. Other # methods are also available for managing paging directly. result.each do |response| # Each element is of type ::Google::Cloud::Gaming::V1::Realm. p response end
#operations_client
def operations_client() -> ::Google::Cloud::Gaming::V1::RealmsService::Operations
Get the associated client for long-running operations.
#preview_realm_update
def preview_realm_update(request, options = nil) -> ::Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse
def preview_realm_update(realm: nil, update_mask: nil, preview_time: nil) -> ::Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse
Previews patches to a single realm.
def preview_realm_update(request, options = nil) -> ::Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse
preview_realm_update
via a request object, either of type
PreviewRealmUpdateRequest or an equivalent Hash.
- request (::Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def preview_realm_update(realm: nil, update_mask: nil, preview_time: nil) -> ::Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse
preview_realm_update
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- realm (::Google::Cloud::Gaming::V1::Realm, ::Hash) — Required. The realm to be updated. Only fields specified in update_mask are updated.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. The update mask applies to the resource. For the
FieldMask
definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - preview_time (::Google::Protobuf::Timestamp, ::Hash) — Optional. The target timestamp to compute the preview.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/gaming/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Gaming::V1::RealmsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest.new # Call the preview_realm_update method. result = client.preview_realm_update request # The returned object is of type Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse. p result
#update_realm
def update_realm(request, options = nil) -> ::Gapic::Operation
def update_realm(realm: nil, update_mask: nil) -> ::Gapic::Operation
Patches a single realm.
def update_realm(request, options = nil) -> ::Gapic::Operation
update_realm
via a request object, either of type
UpdateRealmRequest or an equivalent Hash.
- request (::Google::Cloud::Gaming::V1::UpdateRealmRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_realm(realm: nil, update_mask: nil) -> ::Gapic::Operation
update_realm
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- realm (::Google::Cloud::Gaming::V1::Realm, ::Hash) — Required. The realm to be updated. Only fields specified in update_mask are updated.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. The update mask applies to the resource. For the
FieldMask
definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/gaming/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Gaming::V1::RealmsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Gaming::V1::UpdateRealmRequest.new # Call the update_realm method. result = client.update_realm request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end