Cloud Commerce Consumer Procurement V1 API - Class Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Rest::Client (v1.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.

Service for managing licenses.

Inherits

  • Object

Methods

.configure

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

Configure the LicenseManagementService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# 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 or an equivalent Hash.
Parameters
  • request (::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
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

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.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#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 or an equivalent Hash.
Parameters
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
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

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 or an equivalent Hash.
Parameters
  • request (::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
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

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
Returns
  • (Client) — a new instance of Client
Example
# 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

#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 or an equivalent Hash.
Parameters
  • request (::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
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

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 or an equivalent Hash.
Parameters
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
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

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