# Cloud Gaming V1 API - Class Google::Cloud::Gaming::V1::RealmsService::Rest::Client (v0.7.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [0.7.0 (latest)](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-RealmsService-Rest-Client)
- [0.6.0](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/0.6.0/Google-Cloud-Gaming-V1-RealmsService-Rest-Client)
- [0.5.0](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/0.5.0/Google-Cloud-Gaming-V1-RealmsService-Rest-Client)
- [0.4.4](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/0.4.4/Google-Cloud-Gaming-V1-RealmsService-Rest-Client)
Reference documentation and code samples for the Cloud Gaming V1 API class Google::Cloud::Gaming::V1::RealmsService::Rest::Client.

REST client for the RealmsService service.


<br />

A realm is a grouping of game server clusters that are considered
interchangeable.

## Inherits

- Object

## Includes

- [Google::Cloud::Gaming::V1::RealmsService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-RealmsService-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the RealmsService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-RealmsService-Rest-Client-Configuration "Google::Cloud::Gaming::V1::RealmsService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-RealmsService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-RealmsService-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all RealmsService clients
::Google::Cloud::Gaming::V1::RealmsService::Rest::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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-RealmsService-Rest-Client#Google__Cloud__Gaming__V1__RealmsService__Rest__Client_configure_class_ "Google::Cloud::Gaming::V1::RealmsService::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-RealmsService-Rest-Client-Configuration "Google::Cloud::Gaming::V1::RealmsService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-RealmsService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-RealmsService-Rest-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.
**Overloads**

    def create_realm(request, options = nil) -> ::Gapic::Operation

Pass arguments to `create_realm` via a request object, either of type [CreateRealmRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-CreateRealmRequest "Google::Cloud::Gaming::V1::CreateRealmRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Gaming::V1::CreateRealmRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/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

Pass arguments to `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). **Parameters**

- **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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-Realm), ::Hash) --- Required. The realm resource to be created.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.

### #delete_realm

    def delete_realm(request, options = nil) -> ::Gapic::Operation
    def delete_realm(name: nil) -> ::Gapic::Operation

Deletes a single realm.
**Overloads**

    def delete_realm(request, options = nil) -> ::Gapic::Operation

Pass arguments to `delete_realm` via a request object, either of type [DeleteRealmRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-DeleteRealmRequest "Google::Cloud::Gaming::V1::DeleteRealmRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Gaming::V1::DeleteRealmRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/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

Pass arguments to `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). **Parameter**

- **name** (::String) --- Required. The name of the realm to delete, in the following form: `projects/{project}/locations/{location}/realms/{realm}`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.

### #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.
**Overloads**

    def get_realm(request, options = nil) -> ::Google::Cloud::Gaming::V1::Realm

Pass arguments to `get_realm` via a request object, either of type [GetRealmRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-GetRealmRequest "Google::Cloud::Gaming::V1::GetRealmRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Gaming::V1::GetRealmRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/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

Pass arguments to `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). **Parameter**

- **name** (::String) --- Required. The name of the realm to retrieve, in the following form: `projects/{project}/locations/{location}/realms/{realm}`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Gaming::V1::Realm](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-Realm))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Gaming::V1::Realm](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-Realm))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.

### #initialize

    def initialize() { |config| ... } -> Client

Create a new RealmsService REST client object.
**Yields**

- (config) --- Configure the RealmsService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-RealmsService-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-RealmsService-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Gaming::V1::RealmsService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Gaming::V1::RealmsService::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_realms

    def list_realms(request, options = nil) -> ::Google::Cloud::Gaming::V1::ListRealmsResponse
    def list_realms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Google::Cloud::Gaming::V1::ListRealmsResponse

Lists realms in a given project and location.
**Overloads**

    def list_realms(request, options = nil) -> ::Google::Cloud::Gaming::V1::ListRealmsResponse

Pass arguments to `list_realms` via a request object, either of type [ListRealmsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-ListRealmsRequest "Google::Cloud::Gaming::V1::ListRealmsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Gaming::V1::ListRealmsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/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) -> ::Google::Cloud::Gaming::V1::ListRealmsResponse

Pass arguments to `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). **Parameters**

- **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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-ListRealmsResponse#Google__Cloud__Gaming__V1__ListRealmsResponse_next_page_token_instance_ "Google::Cloud::Gaming::V1::ListRealmsResponse#next_page_token (method)") 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.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Gaming::V1::ListRealmsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-ListRealmsResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Gaming::V1::ListRealmsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-ListRealmsResponse))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.

### #operations_client

    def operations_client() -> ::Google::Cloud::Gaming::V1::RealmsService::Rest::Operations

Get the associated client for long-running operations.
**Returns**

- ([::Google::Cloud::Gaming::V1::RealmsService::Rest::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-RealmsService-Rest-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.
**Overloads**

    def preview_realm_update(request, options = nil) -> ::Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse

Pass arguments to `preview_realm_update` via a request object, either of type [PreviewRealmUpdateRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-PreviewRealmUpdateRequest "Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/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

Pass arguments to `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). **Parameters**

- **realm** ([::Google::Cloud::Gaming::V1::Realm](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Protobuf-Timestamp), ::Hash) --- Optional. The target timestamp to compute the preview.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-PreviewRealmUpdateResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-PreviewRealmUpdateResponse))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.

### #update_realm

    def update_realm(request, options = nil) -> ::Gapic::Operation
    def update_realm(realm: nil, update_mask: nil) -> ::Gapic::Operation

Patches a single realm.
**Overloads**

    def update_realm(request, options = nil) -> ::Gapic::Operation

Pass arguments to `update_realm` via a request object, either of type [UpdateRealmRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/Google-Cloud-Gaming-V1-UpdateRealmRequest "Google::Cloud::Gaming::V1::UpdateRealmRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Gaming::V1::UpdateRealmRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/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

Pass arguments to `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). **Parameters**

- **realm** ([::Google::Cloud::Gaming::V1::Realm](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gaming-v1/latest/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
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.