# Cloud Commerce Consumer Procurement V1 API - Class Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Rest::Client (v1.8.0)

1.8.0 (latest) 1.7.0 1.6.1 1.5.0 1.4.1 1.3.1 1.2.0 1.1.0 1.0.2 0.4.0 0.3.2 0.2.0 0.1.0 Reference documentation and code samples for the Cloud Commerce Consumer Procurement V1 API class Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Rest::Client.

REST client for the LicenseManagementService service.


<br />

Service for managing licenses.

## Inherits

- Object

## Includes

- [Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicenseManagementService-Paths)

## Methods

### .configure

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

Configure the LicenseManagementService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicenseManagementService-Rest-Client-Configuration "Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::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-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicenseManagementService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicenseManagementService-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all LicenseManagementService clients
::Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #assign

    def assign(request, options = nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::AssignResponse
    def assign(parent: nil, usernames: nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::AssignResponse

Assigns a license to a user.
**Overloads**

    def assign(request, options = nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::AssignResponse

Pass arguments to `assign` via a request object, either of type [AssignRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-AssignRequest "Google::Cloud::Commerce::Consumer::Procurement::V1::AssignRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Commerce::Consumer::Procurement::V1::AssignRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-AssignRequest), ::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 assign(parent: nil, usernames: nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::AssignResponse

Pass arguments to `assign` 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. License pool name.
- **usernames** (::Array\<::String\>) --- Required. Username. Format: `name@domain.com`.
**Yields**

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

- **result** ([::Google::Cloud::Commerce::Consumer::Procurement::V1::AssignResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-AssignResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Commerce::Consumer::Procurement::V1::AssignResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-AssignResponse))
**Raises**

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

Basic example

```ruby
require "google/cloud/commerce/consumer/procurement/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Commerce::Consumer::Procurement::V1::AssignRequest.new

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

# The returned object is of type Google::Cloud::Commerce::Consumer::Procurement::V1::AssignResponse.
p result
```

### #configure

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

Configure the LicenseManagementService 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-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicenseManagementService-Rest-Client#Google__Cloud__Commerce__Consumer__Procurement__V1__LicenseManagementService__Rest__Client_configure_class_ "Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicenseManagementService-Rest-Client-Configuration "Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::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-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicenseManagementService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicenseManagementService-Rest-Client-Configuration))

### #enumerate_licensed_users

    def enumerate_licensed_users(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensedUser>
    def enumerate_licensed_users(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensedUser>

Enumerates all users assigned a license.
**Overloads**

    def enumerate_licensed_users(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensedUser>

Pass arguments to `enumerate_licensed_users` via a request object, either of type [EnumerateLicensedUsersRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-EnumerateLicensedUsersRequest "Google::Cloud::Commerce::Consumer::Procurement::V1::EnumerateLicensedUsersRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Commerce::Consumer::Procurement::V1::EnumerateLicensedUsersRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-EnumerateLicensedUsersRequest), ::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 enumerate_licensed_users(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensedUser>

Pass arguments to `enumerate_licensed_users` 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. License pool name.
- **page_size** (::Integer) --- Optional. The maximum number of users to return. The service may return fewer than this value.
- **page_token** (::String) --- Optional. A page token, received from a previous `EnumerateLicensedUsers` call. Provide this to retrieve the subsequent page.
**Yields**

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

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensedUser](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicensedUser)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensedUser](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicensedUser)\>)
**Raises**

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

Basic example

```ruby
require "google/cloud/commerce/consumer/procurement/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Commerce::Consumer::Procurement::V1::EnumerateLicensedUsersRequest.new

# Call the enumerate_licensed_users method.
result = client.enumerate_licensed_users 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::Commerce::Consumer::Procurement::V1::LicensedUser.
  p item
end
```

### #get_license_pool

    def get_license_pool(request, options = nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool
    def get_license_pool(name: nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool

Gets the license pool.
**Overloads**

    def get_license_pool(request, options = nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool

Pass arguments to `get_license_pool` via a request object, either of type [GetLicensePoolRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-GetLicensePoolRequest "Google::Cloud::Commerce::Consumer::Procurement::V1::GetLicensePoolRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Commerce::Consumer::Procurement::V1::GetLicensePoolRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-GetLicensePoolRequest), ::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_license_pool(name: nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool

Pass arguments to `get_license_pool` 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 license pool to get. Format: `billingAccounts/{billing_account}/orders/{order}/licensePool`
**Yields**

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

- **result** ([::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicensePool))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicensePool))
**Raises**

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

Basic example

```ruby
require "google/cloud/commerce/consumer/procurement/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Commerce::Consumer::Procurement::V1::GetLicensePoolRequest.new

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

# The returned object is of type Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool.
p result
```

### #initialize

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

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

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

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicenseManagementService-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicenseManagementService-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #logger

    def logger() -> Logger

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

- (Logger)

### #unassign

    def unassign(request, options = nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::UnassignResponse
    def unassign(parent: nil, usernames: nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::UnassignResponse

Unassigns a license from a user.
**Overloads**

    def unassign(request, options = nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::UnassignResponse

Pass arguments to `unassign` via a request object, either of type [UnassignRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-UnassignRequest "Google::Cloud::Commerce::Consumer::Procurement::V1::UnassignRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Commerce::Consumer::Procurement::V1::UnassignRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-UnassignRequest), ::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 unassign(parent: nil, usernames: nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::UnassignResponse

Pass arguments to `unassign` 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. License pool name.
- **usernames** (::Array\<::String\>) --- Required. Username. Format: `name@domain.com`.
**Yields**

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

- **result** ([::Google::Cloud::Commerce::Consumer::Procurement::V1::UnassignResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-UnassignResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Commerce::Consumer::Procurement::V1::UnassignResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-UnassignResponse))
**Raises**

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

Basic example

```ruby
require "google/cloud/commerce/consumer/procurement/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Commerce::Consumer::Procurement::V1::UnassignRequest.new

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

# The returned object is of type Google::Cloud::Commerce::Consumer::Procurement::V1::UnassignResponse.
p result
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_license_pool

    def update_license_pool(request, options = nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool
    def update_license_pool(license_pool: nil, update_mask: nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool

Updates the license pool if one exists for this Order.
**Overloads**

    def update_license_pool(request, options = nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool

Pass arguments to `update_license_pool` via a request object, either of type [UpdateLicensePoolRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-UpdateLicensePoolRequest "Google::Cloud::Commerce::Consumer::Procurement::V1::UpdateLicensePoolRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Commerce::Consumer::Procurement::V1::UpdateLicensePoolRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-UpdateLicensePoolRequest), ::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_license_pool(license_pool: nil, update_mask: nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool

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

- **license_pool** ([::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicensePool), ::Hash) --- Required. The license pool to update.


  The license pool's name field is used to identify the license pool to
  update. Format:
  `billingAccounts/{billing_account}/orders/{order}/licensePool`.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Protobuf-FieldMask), ::Hash) --- Required. The list of fields to update.
**Yields**

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

- **result** ([::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicensePool))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicensePool))
**Raises**

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

Basic example

```ruby
require "google/cloud/commerce/consumer/procurement/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Commerce::Consumer::Procurement::V1::UpdateLicensePoolRequest.new

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

# The returned object is of type Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool.
p result
```