1#ifndef TENDUKE_EE_LICENSING_FLUENTCHECKOUTBUILDER_H
2#define TENDUKE_EE_LICENSING_FLUENTCHECKOUTBUILDER_H
4#include "../../config/ClientProperties.h"
5#include "./LicenseCheckoutParameters.h"
11namespace tenduke {
namespace ee {
namespace licensing {
17template<
typename BUILDER>
26 : clientProperties(std::move(clientProperties))
49 const std::string &productName,
50 const std::string &requestedVersion =
"",
51 const std::string &licenseId =
""
53 return item(productName, requestedVersion, licenseId);
67 const std::string &itemName,
68 const std::string &requestedVersion =
"",
69 const std::string &licenseId =
""
71 items.emplace_back(itemName, requestedVersion, licenseId);
72 return static_cast<BUILDER&
>(*this);
81 BUILDER &
count(std::uint64_t pConsumeCount)
83 this->consumeCount = pConsumeCount;
84 return static_cast<BUILDER&
>(*this);
93 BUILDER &
duration(std::uint64_t pConsumeDuration)
95 this->consumeDuration = pConsumeDuration;
96 return static_cast<BUILDER&
>(*this);
109 this->entitlementId = pEntitlementId;
110 return static_cast<BUILDER&
>(*this);
123 this->organizationId = pOrganizationId;
124 return static_cast<BUILDER&
>(*this);
136 this->consumptionMode = pConsumptionMode;
137 return static_cast<BUILDER&
>(*this);
148 BUILDER &
version(
const std::string &pGlobalVersion)
150 this->globalVersion = pGlobalVersion;
151 return static_cast<BUILDER&
>(*this);
176 std::uint64_t consumeCount;
177 std::uint64_t consumeDuration;
179 std::string entitlementId;
180 std::string globalVersion;
181 std::string organizationId;
182 std::vector<tenduke::ee::licensing::LicenseCheckoutItem> items;
Inheritable base class building checkout request parameters fluently.
Definition FluentLicenseCheckoutBuilder.h:19
BUILDER & count(std::uint64_t pConsumeCount)
Sets "The requested number of units to be consumed from the license’s use count.".
Definition FluentLicenseCheckoutBuilder.h:81
FluentLicenseCheckoutBuilder(::tenduke::ee::ClientProperties clientProperties)
Constructs new instance.
Definition FluentLicenseCheckoutBuilder.h:25
BUILDER & mode(enum tenduke::ee::licensing::LicenseCheckoutParameters::ConsumptionMode pConsumptionMode)
Sets "The license consumption mode requested." (See the enumeration for the documentation of the valu...
Definition FluentLicenseCheckoutBuilder.h:134
BUILDER & fromEntitlement(const std::string &pEntitlementId)
Sets id of the Entitlement, from which the licenses will be checked from.
Definition FluentLicenseCheckoutBuilder.h:107
BUILDER & item(const std::string &itemName, const std::string &requestedVersion="", const std::string &licenseId="")
Adds an item to checkout.
Definition FluentLicenseCheckoutBuilder.h:66
BUILDER & duration(std::uint64_t pConsumeDuration)
Sets "The requested duration of the license token (and the lease) in milliseconds....
Definition FluentLicenseCheckoutBuilder.h:93
BUILDER & version(const std::string &pGlobalVersion)
Sets default version to checkout.
Definition FluentLicenseCheckoutBuilder.h:148
virtual tenduke::ee::licensing::LicenseCheckoutParameters buildParameters()
Builds the parameters.
Definition FluentLicenseCheckoutBuilder.h:160
BUILDER & seat(const std::string &productName, const std::string &requestedVersion="", const std::string &licenseId="")
Adds "checkout one seat for product" to the request.
Definition FluentLicenseCheckoutBuilder.h:48
BUILDER & fromOrganization(const std::string &pOrganizationId)
Sets id of the Organization, from which the licenses will be checked from.
Definition FluentLicenseCheckoutBuilder.h:121
Parameters for license checkout request.
Definition LicenseCheckoutParameters.h:18
ConsumptionMode
License consumption modes.
Definition LicenseCheckoutParameters.h:21
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4
Client properties.
Definition ClientProperties.h:14