# Cloud Talent Solution V4beta1 API - Class Google::Cloud::Talent::V4beta1::TenantService::Rest::Client (v0.19.0)

0.19.0 (latest) 0.18.1 0.17.1 0.16.0 0.15.0 0.14.1 0.13.0 0.12.0 0.11.1 0.10.2 0.9.0 0.8.1 0.7.0 0.6.1 0.5.0 0.4.6 Reference documentation and code samples for the Cloud Talent Solution V4beta1 API class Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.

REST client for the TenantService service.


<br />

A service that handles tenant management, including CRUD and enumeration.

## Inherits

- Object

## Includes

- [Google::Cloud::Talent::V4beta1::TenantService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-TenantService-Paths)

## Methods

### .configure

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

Configure the TenantService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-TenantService-Rest-Client-Configuration "Google::Cloud::Talent::V4beta1::TenantService::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-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-TenantService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-TenantService-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all TenantService clients
::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

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

Configure the TenantService 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-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-TenantService-Rest-Client#Google__Cloud__Talent__V4beta1__TenantService__Rest__Client_configure_class_ "Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-TenantService-Rest-Client-Configuration "Google::Cloud::Talent::V4beta1::TenantService::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-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-TenantService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-TenantService-Rest-Client-Configuration))

### #create_tenant

    def create_tenant(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Tenant
    def create_tenant(parent: nil, tenant: nil) -> ::Google::Cloud::Talent::V4beta1::Tenant

Creates a new tenant entity.
**Overloads**

    def create_tenant(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Tenant

Pass arguments to `create_tenant` via a request object, either of type [CreateTenantRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-CreateTenantRequest "Google::Cloud::Talent::V4beta1::CreateTenantRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Talent::V4beta1::CreateTenantRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-CreateTenantRequest), ::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_tenant(parent: nil, tenant: nil) -> ::Google::Cloud::Talent::V4beta1::Tenant

Pass arguments to `create_tenant` 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. Resource name of the project under which the tenant is created.


  The format is "projects/{project_id}", for example,
  "projects/foo".
- **tenant** ([::Google::Cloud::Talent::V4beta1::Tenant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-Tenant), ::Hash) --- Required. The tenant to be created.
**Yields**

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

- **result** ([::Google::Cloud::Talent::V4beta1::Tenant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-Tenant))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Talent::V4beta1::Tenant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-Tenant))
**Raises**

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

Basic example

```ruby
require "google/cloud/talent/v4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Talent::V4beta1::CreateTenantRequest.new

# Call the create_tenant method.
result = client.create_tenant request

# The returned object is of type Google::Cloud::Talent::V4beta1::Tenant.
p result
```

### #delete_tenant

    def delete_tenant(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_tenant(name: nil) -> ::Google::Protobuf::Empty

Deletes specified tenant.
**Overloads**

    def delete_tenant(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_tenant` via a request object, either of type [DeleteTenantRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-DeleteTenantRequest "Google::Cloud::Talent::V4beta1::DeleteTenantRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Talent::V4beta1::DeleteTenantRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-DeleteTenantRequest), ::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_tenant(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_tenant` 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 resource name of the tenant to be deleted.


  The format is "projects/{project_id}/tenants/{tenant_id}", for example,
  "projects/foo/tenants/bar".
**Yields**

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

- **result** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Protobuf-Empty))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Protobuf-Empty))
**Raises**

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

Basic example

```ruby
require "google/cloud/talent/v4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new

# Call the delete_tenant method.
result = client.delete_tenant request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #get_tenant

    def get_tenant(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Tenant
    def get_tenant(name: nil) -> ::Google::Cloud::Talent::V4beta1::Tenant

Retrieves specified tenant.
**Overloads**

    def get_tenant(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Tenant

Pass arguments to `get_tenant` via a request object, either of type [GetTenantRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-GetTenantRequest "Google::Cloud::Talent::V4beta1::GetTenantRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Talent::V4beta1::GetTenantRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-GetTenantRequest), ::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_tenant(name: nil) -> ::Google::Cloud::Talent::V4beta1::Tenant

Pass arguments to `get_tenant` 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 resource name of the tenant to be retrieved.


  The format is "projects/{project_id}/tenants/{tenant_id}", for example,
  "projects/foo/tenants/bar".
**Yields**

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

- **result** ([::Google::Cloud::Talent::V4beta1::Tenant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-Tenant))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Talent::V4beta1::Tenant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-Tenant))
**Raises**

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

Basic example

```ruby
require "google/cloud/talent/v4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Talent::V4beta1::GetTenantRequest.new

# Call the get_tenant method.
result = client.get_tenant request

# The returned object is of type Google::Cloud::Talent::V4beta1::Tenant.
p result
```

### #initialize

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

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

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

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-TenantService-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-TenantService-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_tenants

    def list_tenants(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>
    def list_tenants(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>

Lists all tenants associated with the project.
**Overloads**

    def list_tenants(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>

Pass arguments to `list_tenants` via a request object, either of type [ListTenantsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-ListTenantsRequest "Google::Cloud::Talent::V4beta1::ListTenantsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Talent::V4beta1::ListTenantsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-ListTenantsRequest), ::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_tenants(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>

Pass arguments to `list_tenants` 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. Resource name of the project under which the tenant is created.


  The format is "projects/{project_id}", for example,
  "projects/foo".
- **page_token** (::String) --- The starting indicator from which to return results.
- **page_size** (::Integer) --- The maximum number of tenants to be returned, at most 100. Default is 100 if a non-positive number is provided.
**Yields**

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

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Talent::V4beta1::Tenant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-Tenant)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Talent::V4beta1::Tenant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-Tenant)\>)
**Raises**

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

Basic example

```ruby
require "google/cloud/talent/v4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Talent::V4beta1::ListTenantsRequest.new

# Call the list_tenants method.
result = client.list_tenants request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Talent::V4beta1::Tenant.
  p item
end
```

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_tenant

    def update_tenant(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Tenant
    def update_tenant(tenant: nil, update_mask: nil) -> ::Google::Cloud::Talent::V4beta1::Tenant

Updates specified tenant.
**Overloads**

    def update_tenant(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Tenant

Pass arguments to `update_tenant` via a request object, either of type [UpdateTenantRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-UpdateTenantRequest "Google::Cloud::Talent::V4beta1::UpdateTenantRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Talent::V4beta1::UpdateTenantRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-UpdateTenantRequest), ::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_tenant(tenant: nil, update_mask: nil) -> ::Google::Cloud::Talent::V4beta1::Tenant

Pass arguments to `update_tenant` 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**

- **tenant** ([::Google::Cloud::Talent::V4beta1::Tenant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-Tenant), ::Hash) --- Required. The tenant resource to replace the current resource in the system.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Protobuf-FieldMask), ::Hash) --- Strongly recommended for the best service experience.


  If
  [update_mask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-UpdateTenantRequest#Google__Cloud__Talent__V4beta1__UpdateTenantRequest_update_mask_instance_ "Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask (method)")
  is provided, only the specified fields in
  [tenant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-UpdateTenantRequest#Google__Cloud__Talent__V4beta1__UpdateTenantRequest_tenant_instance_ "Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant (method)") are
  updated. Otherwise all the fields are updated.

  A field mask to specify the tenant fields to be updated. Only
  top level fields of [Tenant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-Tenant "Google::Cloud::Talent::V4beta1::Tenant (class)") are
  supported.
**Yields**

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

- **result** ([::Google::Cloud::Talent::V4beta1::Tenant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-Tenant))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Talent::V4beta1::Tenant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest/Google-Cloud-Talent-V4beta1-Tenant))
**Raises**

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

Basic example

```ruby
require "google/cloud/talent/v4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new

# Call the update_tenant method.
result = client.update_tenant request

# The returned object is of type Google::Cloud::Talent::V4beta1::Tenant.
p result
```