10Duke Enterprise C++ Client
Loading...
Searching...
No Matches
LicenseCheckoutParameters.h
1#ifndef TENDUKE_EE_LICENSING_LICENSECHECKOUTPARAMETERS_H
2#define TENDUKE_EE_LICENSING_LICENSECHECKOUTPARAMETERS_H
3
4#include "../../config/ClientProperties.h"
5#include "./LicenseCheckoutItem.h"
6
7#include <cstdint>
8#include <string>
9#include <vector>
10
11namespace tenduke { namespace ee { namespace licensing {
12
13
18{
19public:
22 UNKNOWN,
23 DEFAULT,
34 };
35
41 static std::string consumptionModeToString(enum ConsumptionMode mode);
42
44 static const std::uint64_t DEFAULT_CONSUME_DURATION = 0;
45
47 static const std::uint64_t DEFAULT_CONSUME_COUNT = 0;
48
49public:
68 const std::vector<tenduke::ee::licensing::LicenseCheckoutItem> &items,
69 enum ConsumptionMode consumptionMode = ConsumptionMode::DEFAULT,
70 std::string version = "",
73 std::uint64_t consumeCount = DEFAULT_CONSUME_COUNT,
74 std::string entitlementId = "",
75 std::string organizationId = ""
76 );
77 virtual ~LicenseCheckoutParameters() = default;
78
83 std::string consumptionModeAsString() const;
84
89 bool hasConsumeCount() const;
90
95 bool hasConsumeDuration() const;
96
101 bool hasConsumptionMode() const;
102
107 bool hasEntitlementId() const;
108
113 bool hasOrganizationId() const;
114
119 bool hasVersion() const;
120
121public:
123 const ::tenduke::ee::ClientProperties clientProperties;
125 const std::uint64_t consumeCount;
127 const std::uint64_t consumeDuration;
131 const std::string entitlementId;
133 const std::vector<tenduke::ee::licensing::LicenseCheckoutItem> items;
135 const std::string organizationId;
137 const std::string version;
138};
139
140
141}}}
142
143#endif // TENDUKE_EE_LICENSING_LICENSECHECKOUTPARAMETERS_H
Parameters for license checkout request.
Definition LicenseCheckoutParameters.h:18
std::string consumptionModeAsString() const
Returns the consumptionMode as string.
Definition LicenseCheckoutParameters.cpp:40
static const std::uint64_t DEFAULT_CONSUME_COUNT
Default consume count.
Definition LicenseCheckoutParameters.h:47
bool hasConsumptionMode() const
Checks if consumptionMode was provided.
Definition LicenseCheckoutParameters.cpp:58
bool hasOrganizationId() const
Checks if organizationId was provided.
Definition LicenseCheckoutParameters.cpp:77
const std::uint64_t consumeCount
(Optional) The requested number of units to be consumed from the license’s use count.
Definition LicenseCheckoutParameters.h:125
const std::vector< tenduke::ee::licensing::LicenseCheckoutItem > items
Items to checkout.
Definition LicenseCheckoutParameters.h:133
const std::string entitlementId
(Optional) Entitlement id.
Definition LicenseCheckoutParameters.h:131
bool hasConsumeCount() const
Checks if consumeCount was provided.
Definition LicenseCheckoutParameters.cpp:46
const std::uint64_t consumeDuration
(Optional) The requested duration of the license token (and the lease) in milliseconds.
Definition LicenseCheckoutParameters.h:127
static std::string consumptionModeToString(enum ConsumptionMode mode)
Converts ConsumptionMode to string.
Definition LicenseCheckoutParameters.cpp:7
const std::string version
(Optional) The version of the software that is running on the device, typically expressed as a versio...
Definition LicenseCheckoutParameters.h:137
static const std::uint64_t DEFAULT_CONSUME_DURATION
Default consume duration.
Definition LicenseCheckoutParameters.h:44
bool hasVersion() const
Checks if version was provided.
Definition LicenseCheckoutParameters.cpp:83
bool hasEntitlementId() const
Checks if entitlementId was provided.
Definition LicenseCheckoutParameters.cpp:71
bool hasConsumeDuration() const
Checks if consumeDuration was provided.
Definition LicenseCheckoutParameters.cpp:52
const ::tenduke::ee::ClientProperties clientProperties
Client properties.
Definition LicenseCheckoutParameters.h:123
enum ConsumptionMode consumptionMode
The license consumption mode requested.
Definition LicenseCheckoutParameters.h:129
const std::string organizationId
(Optional) Organization id.
Definition LicenseCheckoutParameters.h:135
ConsumptionMode
License consumption modes.
Definition LicenseCheckoutParameters.h:21
@ CACHE
Online mode.
Definition LicenseCheckoutParameters.h:29
@ CHECKOUT
Offline mode.
Definition LicenseCheckoutParameters.h:33
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4
Client properties.
Definition ClientProperties.h:14