Reference documentation and code samples for the Cloud Commerce Consumer Procurement V1 API class Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Client.
Client for the LicenseManagementService service.
Service for managing licenses.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the LicenseManagementService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all LicenseManagementService clients ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::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::AssignResponseAssigns a license to a user.
def assign(request, options = nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::AssignResponseassign via a request object, either of type
AssignRequest or an equivalent Hash.
- 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::AssignResponseassign 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).
- parent (::String) — Required. License pool name.
-
usernames (::Array<::String>) — Required. Username.
Format:
name@domain.com.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Commerce::Consumer::Procurement::V1::AssignResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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::ConfigurationConfigure 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#enumerate_licensed_users
def enumerate_licensed_users(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensedUser>
def enumerate_licensed_users(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensedUser>Enumerates all users assigned a license.
def enumerate_licensed_users(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensedUser>enumerate_licensed_users via a request object, either of type
EnumerateLicensedUsersRequest or an equivalent Hash.
- request (::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::PagedEnumerable<::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensedUser>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).
- 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
EnumerateLicensedUserscall. Provide this to retrieve the subsequent page.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensedUser>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensedUser>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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::LicensePoolGets the license pool.
def get_license_pool(request, options = nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePoolget_license_pool via a request object, either of type
GetLicensePoolRequest or an equivalent Hash.
- 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::LicensePoolget_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).
-
name (::String) — Required. The name of the license pool to get.
Format:
billingAccounts/{billing_account}/orders/{order}/licensePool
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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| ... } -> ClientCreate a new LicenseManagementService client object.
- (config) — Configure the LicenseManagementService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Client.new do |config| config.timeout = 10.0 end
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (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::UnassignResponseUnassigns a license from a user.
def unassign(request, options = nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::UnassignResponseunassign via a request object, either of type
UnassignRequest or an equivalent Hash.
- 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::UnassignResponseunassign 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).
- parent (::String) — Required. License pool name.
-
usernames (::Array<::String>) — Required. Username.
Format:
name@domain.com.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Commerce::Consumer::Procurement::V1::UnassignResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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() -> StringThe effective universe domain
- (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::LicensePoolUpdates the license pool if one exists for this Order.
def update_license_pool(request, options = nil) -> ::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePoolupdate_license_pool via a request object, either of type
UpdateLicensePoolRequest or an equivalent Hash.
- request (::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::LicensePoolupdate_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).
-
license_pool (::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, ::Hash) — Required. The list of fields to update.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Commerce::Consumer::Procurement::V1::LicensePool)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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