10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
tenduke::ee::licensing::FluentLicenseCheckoutBuilder< BUILDER > Class Template Reference

#include <FluentLicenseCheckoutBuilder.h>

Detailed Description

template<typename BUILDER>
class tenduke::ee::licensing::FluentLicenseCheckoutBuilder< BUILDER >

Inheritable base class building checkout request parameters fluently.

Template Parameters
BUILDERtype of the concrete builder class

Public Member Functions

 FluentLicenseCheckoutBuilder (::tenduke::ee::ClientProperties clientProperties)
 Constructs new instance.
BUILDER & seat (const std::string &productName, const std::string &requestedVersion="", const std::string &licenseId="")
 Adds "checkout one seat for product" to the request.
BUILDER & item (const std::string &itemName, const std::string &requestedVersion="", const std::string &licenseId="")
 Adds an item to checkout.
BUILDER & count (std::uint64_t pConsumeCount)
 Sets "The requested number of units to be consumed from the license’s use count.".
BUILDER & duration (std::uint64_t pConsumeDuration)
 Sets "The requested duration of the license token (and the lease) in milliseconds.".
BUILDER & fromEntitlement (const std::string &pEntitlementId)
 Sets id of the Entitlement, from which the licenses will be checked from.
BUILDER & fromOrganization (const std::string &pOrganizationId)
 Sets id of the Organization, from which the licenses will be checked from.
BUILDER & mode (enum tenduke::ee::licensing::LicenseCheckoutParameters::ConsumptionMode pConsumptionMode)
 Sets "The license consumption mode requested." (See the enumeration for the documentation of the values).
BUILDER & version (const std::string &pGlobalVersion)
 Sets default version to checkout.

Protected Member Functions

virtual tenduke::ee::licensing::LicenseCheckoutParameters buildParameters ()
 Builds the parameters.

Constructor & Destructor Documentation

◆ FluentLicenseCheckoutBuilder()

template<typename BUILDER>
tenduke::ee::licensing::FluentLicenseCheckoutBuilder< BUILDER >::FluentLicenseCheckoutBuilder ( ::tenduke::ee::ClientProperties clientProperties)
inlineexplicit

Constructs new instance.

Parameters
clientPropertiesclient properties

Member Function Documentation

◆ buildParameters()

template<typename BUILDER>
virtual tenduke::ee::licensing::LicenseCheckoutParameters tenduke::ee::licensing::FluentLicenseCheckoutBuilder< BUILDER >::buildParameters ( )
inlineprotectedvirtual

Builds the parameters.

Returns
-

◆ count()

template<typename BUILDER>
BUILDER & tenduke::ee::licensing::FluentLicenseCheckoutBuilder< BUILDER >::count ( std::uint64_t pConsumeCount)
inline

Sets "The requested number of units to be consumed from the license’s use count.".

Parameters
pConsumeCount-
Returns
this for method chaining

◆ duration()

template<typename BUILDER>
BUILDER & tenduke::ee::licensing::FluentLicenseCheckoutBuilder< BUILDER >::duration ( std::uint64_t pConsumeDuration)
inline

Sets "The requested duration of the license token (and the lease) in milliseconds.".

Parameters
pConsumeDuration-
Returns
this for method chaining

◆ fromEntitlement()

template<typename BUILDER>
BUILDER & tenduke::ee::licensing::FluentLicenseCheckoutBuilder< BUILDER >::fromEntitlement ( const std::string & pEntitlementId)
inline

Sets id of the Entitlement, from which the licenses will be checked from.

All the items in the request will be checked out from this Entitlement, with following exception: A tenduke::ee::licensing::LicenseCheckoutItem, which has the license-id set, ignores this.

Parameters
pEntitlementIdid of the entitlement
Returns
this for method chaining

◆ fromOrganization()

template<typename BUILDER>
BUILDER & tenduke::ee::licensing::FluentLicenseCheckoutBuilder< BUILDER >::fromOrganization ( const std::string & pOrganizationId)
inline

Sets id of the Organization, from which the licenses will be checked from.

All the items in the request will be checked out from this Organization, with following exception: A tenduke::ee::licensing::LicenseCheckoutItem, which has the license-id set, ignores this.

Parameters
pOrganizationIdid of the organization
Returns
this for method chaining

◆ item()

template<typename BUILDER>
BUILDER & tenduke::ee::licensing::FluentLicenseCheckoutBuilder< BUILDER >::item ( const std::string & itemName,
const std::string & requestedVersion = "",
const std::string & licenseId = "" )
inline

Adds an item to checkout.

A response has at most one lease per licensed item: if the same item name is added several times, only the last one is checked out, and a warning is logged.

Parameters
itemName-
requestedVersionThe version of the software that is running on the device, typically expressed as a version number (for example, 1.6.14). Empty string means no version will be requested. Optional, defaults to none.
licenseIdID of the license to be checked out (NOTE: itemName must still be given). Optional, if not given the licensing service will choose the license by itemName
Returns
this for method chaining
Exceptions
std::invalid_argumentif the item name is empty

◆ mode()

template<typename BUILDER>
BUILDER & tenduke::ee::licensing::FluentLicenseCheckoutBuilder< BUILDER >::mode ( enum tenduke::ee::licensing::LicenseCheckoutParameters::ConsumptionMode pConsumptionMode)
inline

Sets "The license consumption mode requested." (See the enumeration for the documentation of the values).

Parameters
pConsumptionMode-
Returns
this for method chaining

◆ seat()

template<typename BUILDER>
BUILDER & tenduke::ee::licensing::FluentLicenseCheckoutBuilder< BUILDER >::seat ( const std::string & productName,
const std::string & requestedVersion = "",
const std::string & licenseId = "" )
inline

Adds "checkout one seat for product" to the request.

This is the same as item(): if the same product is added several times, only the last one is checked out. To consume several units, use count().

Parameters
productNamename of the product (licensed item). See Licensed items in our documentation.

The licensed item can be either a top-level item (usually representing a product) or an aggregated licensed item (usually representing a feature).

Parameters
requestedVersionThe version of the software that is running on the device, typically expressed as a version number (for example, 1.6.14). Empty string means no version will be requested. Optional, defaults to none.
licenseIdID of the license to be checked out (NOTE: itemName must still be given). Optional, if not given the licensing service will choose the license by itemName
Returns
this instance for method chaining
Exceptions
std::invalid_argumentif the product name is empty

◆ version()

template<typename BUILDER>
BUILDER & tenduke::ee::licensing::FluentLicenseCheckoutBuilder< BUILDER >::version ( const std::string & pGlobalVersion)
inline

Sets default version to checkout.

This version will be applied on all items, but individual items can override it by setting the version on item-level.

Parameters
pGlobalVersion-
Returns
this for method chaining

The documentation for this class was generated from the following file: