# Discovery Engine V1BETA API - Class Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::Rest::Client (v0.28.0)

0.28.0 (latest) 0.27.0 0.26.0 0.25.0 0.24.0 0.23.1 0.22.0 0.21.0 0.20.1 0.19.1 0.18.0 0.17.0 0.16.0 0.15.0 0.14.2 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.2 0.6.0 0.5.0 0.4.0 0.3.0 0.2.1 0.1.0 Reference documentation and code samples for the Discovery Engine V1BETA API class Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::Rest::Client.

REST client for the UserLicenseService service.


<br />

Service for managing User Licenses.

## Inherits

- Object

## Includes

- [Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicenseService-Paths)

## Methods

### .configure

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

Configure the UserLicenseService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicenseService-Rest-Client-Configuration "Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::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-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicenseService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicenseService-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all UserLicenseService clients
::Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #batch_update_user_licenses

    def batch_update_user_licenses(request, options = nil) -> ::Gapic::Operation
    def batch_update_user_licenses(inline_source: nil, parent: nil, delete_unassigned_user_licenses: nil) -> ::Gapic::Operation

Updates the User License.
This method is used for batch assign/unassign licenses to users.
**Overloads**

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

Pass arguments to `batch_update_user_licenses` via a request object, either of type [BatchUpdateUserLicensesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-BatchUpdateUserLicensesRequest "Google::Cloud::DiscoveryEngine::V1beta::BatchUpdateUserLicensesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::BatchUpdateUserLicensesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-BatchUpdateUserLicensesRequest), ::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 batch_update_user_licenses(inline_source: nil, parent: nil, delete_unassigned_user_licenses: nil) -> ::Gapic::Operation

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

- **inline_source** ([::Google::Cloud::DiscoveryEngine::V1beta::BatchUpdateUserLicensesRequest::InlineSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-BatchUpdateUserLicensesRequest-InlineSource), ::Hash) --- The inline source for the input content for document embeddings.
- **parent** (::String) --- Required. The parent [UserStore](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserStore "Google::Cloud::DiscoveryEngine::V1beta::UserStore (class)") resource name, format: `projects/{project}/locations/{location}/userStores/{user_store_id}`.
- **delete_unassigned_user_licenses** (::Boolean) --- Optional. If true, if user licenses removed associated license config, the user license will be deleted. By default which is false, the user license will be updated to unassigned state.
**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.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::BatchUpdateUserLicensesRequest.new

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #configure

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

Configure the UserLicenseService 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-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicenseService-Rest-Client#Google__Cloud__DiscoveryEngine__V1beta__UserLicenseService__Rest__Client_configure_class_ "Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicenseService-Rest-Client-Configuration "Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::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-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicenseService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicenseService-Rest-Client-Configuration))

### #initialize

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

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

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

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicenseService-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicenseService-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_license_configs_usage_stats

    def list_license_configs_usage_stats(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ListLicenseConfigsUsageStatsResponse
    def list_license_configs_usage_stats(parent: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ListLicenseConfigsUsageStatsResponse

Lists all the
{::Google::Cloud::DiscoveryEngine::V1beta::LicenseConfigUsageStats LicenseConfigUsageStats}s
associated with the project.
**Overloads**

    def list_license_configs_usage_stats(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ListLicenseConfigsUsageStatsResponse

Pass arguments to `list_license_configs_usage_stats` via a request object, either of type [ListLicenseConfigsUsageStatsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListLicenseConfigsUsageStatsRequest "Google::Cloud::DiscoveryEngine::V1beta::ListLicenseConfigsUsageStatsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::ListLicenseConfigsUsageStatsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListLicenseConfigsUsageStatsRequest), ::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_license_configs_usage_stats(parent: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ListLicenseConfigsUsageStatsResponse

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

- **parent** (::String) --- Required. The parent branch resource name, such as `projects/{project}/locations/{location}/userStores/{user_store_id}`.
**Yields**

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

- **result** ([::Google::Cloud::DiscoveryEngine::V1beta::ListLicenseConfigsUsageStatsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListLicenseConfigsUsageStatsResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::ListLicenseConfigsUsageStatsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListLicenseConfigsUsageStatsResponse))
**Raises**

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

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::ListLicenseConfigsUsageStatsRequest.new

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

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::ListLicenseConfigsUsageStatsResponse.
p result
```

### #list_user_licenses

    def list_user_licenses(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::UserLicense>
    def list_user_licenses(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::UserLicense>

Lists the User Licenses.
**Overloads**

    def list_user_licenses(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::UserLicense>

Pass arguments to `list_user_licenses` via a request object, either of type [ListUserLicensesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListUserLicensesRequest "Google::Cloud::DiscoveryEngine::V1beta::ListUserLicensesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::ListUserLicensesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListUserLicensesRequest), ::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_user_licenses(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::UserLicense>

Pass arguments to `list_user_licenses` 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 [UserStore](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserStore "Google::Cloud::DiscoveryEngine::V1beta::UserStore (class)") resource name, format: `projects/{project}/locations/{location}/userStores/{user_store_id}`.
- **page_size** (::Integer) --- Optional. Requested page size. Server may return fewer items than requested. If unspecified, defaults to 10. The maximum value is 50; values above 50 will be coerced to 50.


  If this field is negative, an INVALID_ARGUMENT error is returned.
- **page_token** (::String) --- Optional. A page token, received from a previous `ListUserLicenses` call. Provide this to retrieve the subsequent page.


  When paginating, all other parameters provided to `ListUserLicenses`
  must match the call that provided the page token.
- **filter** (::String) ---

  Optional. Filter for the list request.

  Supported fields:
  - `license_assignment_state`
  - `user_principal`
    \*
    Examples:

  - `license_assignment_state = ASSIGNED` to list assigned user licenses.

  - `license_assignment_state = NO_LICENSE` to list not licensed users.

  - `license_assignment_state = NO_LICENSE_ATTEMPTED_LOGIN` to list users
    who attempted login but no license assigned.

  - `license_assignment_state != NO_LICENSE_ATTEMPTED_LOGIN` to filter
    out users who attempted login but no license assigned.

  - `user_principal = user1@example.com` to list user license for
    `user1@example.com`.

- **order_by** (::String) ---

  Optional. The order in which the
  [UserLicense](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicense "Google::Cloud::DiscoveryEngine::V1beta::UserLicense (class)")s are listed.
  The value must be a comma-separated list of fields. Default sorting order
  is ascending. To specify descending order for a field, append a " desc"
  suffix. Redundant space characters in the syntax are insignificant.

  Supported fields (only `user_principal` is supported for now):
  - `user_principal`

  If not set, the default ordering is by `user_principal`.

  Examples:
  - `user_principal` to order by `user_principal` in ascending order.
  - `user_principal desc` to order by `user_principal` in descending order.
**Yields**

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

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DiscoveryEngine::V1beta::UserLicense](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicense)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DiscoveryEngine::V1beta::UserLicense](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicense)\>)
**Raises**

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

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::ListUserLicensesRequest.new

# Call the list_user_licenses method.
result = client.list_user_licenses 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::DiscoveryEngine::V1beta::UserLicense.
  p item
end
```

### #location_client

    def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.
**Returns**

- (Google::Cloud::Location::Locations::Rest::Client)

### #logger

    def logger() -> Logger

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

- (Logger)

### #operations_client

    def operations_client() -> ::Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::Rest::Operations

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

- ([::Google::Cloud::DiscoveryEngine::V1beta::UserLicenseService::Rest::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UserLicenseService-Rest-Operations))

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)