10Duke Enterprise C++ Client
Loading...
Searching...
No Matches
Lease.h
1#ifndef TENDUKE_EE_LICENSING_LEASE_H
2#define TENDUKE_EE_LICENSING_LEASE_H
3
4#include "./checkout/LicenseCheckoutItem.h"
5
6#include <cstdint>
7#include <map>
8#include <string>
9#include <utility>
10#include <vector>
11
12namespace tenduke { namespace ee { namespace licensing {
13
15const std::int64_t LEASE_DOES_NOT_EXPIRE = -1;
16
20class Lease
21{
22public:
26 Lease() : Lease("", "", "", "", "", 0) {}
27
49 std::string name,
50 std::string token,
51 std::string consumedVersion,
52 std::string licenseId,
53 std::string leaseId,
54 std::int64_t leaseExpiresEpochS,
55 std::string requestedVersion = "",
56 std::string hardwareId = "",
57 std::int64_t issuedAtEpochS = 0,
58 std::string issuer = "",
59 const std::map<std::string, std::string> &licenseProperties = {},
60 std::int64_t licenseValidFromEpochS = 0,
61 std::int64_t licenseValidUntilEpochS = INT64_MAX,
62 std::int64_t recommendedRefreshTimeEpochS = 0,
63 std::string subject = "",
64 const std::vector<std::string> aggregatedItems = {},
65 const std::map<std::string, std::string> &additionalClaims = {}
69 , hardwareId(std::move(hardwareId))
71 , issuer(std::move(issuer))
73 , leaseId(std::move(leaseId))
74 , licenseId(std::move(licenseId))
78 , name(std::move(name))
81 , subject(std::move(subject))
82 , token(std::move(token))
83 {}
84
85public:
95 const std::map<std::string, std::string> additionalClaims;
97 const std::vector<std::string> aggregatedItems;
99 const std::string consumedVersion;
101 const std::string hardwareId;
103 const std::int64_t issuedAtEpochS;
105 const std::string issuer;
107 const std::int64_t leaseExpiresEpochS;
109 const std::string leaseId;
111 const std::string licenseId;
113 const std::map<std::string, std::string> licenseProperties;
115 const std::int64_t licenseValidFromEpochS;
117 const std::int64_t licenseValidUntilEpochS;
119 const std::string name;
123 const std::string requestedVersion;
125 const std::string subject;
127 const std::string token;
128};
129
130
131}}}
132
133#endif // TENDUKE_EE_LICENSING_LEASE_H
Describes checked out licensed item.
Definition Lease.h:21
Lease()
Constructs new instance.
Definition Lease.h:26
const std::string leaseId
Id of the lease.
Definition Lease.h:109
const std::int64_t licenseValidUntilEpochS
The validity end time of the license that this token is consuming.
Definition Lease.h:117
const std::int64_t recommendedRefreshTimeEpochS
The recommended token refresh time.
Definition Lease.h:121
const std::string consumedVersion
Consumed version.
Definition Lease.h:99
const std::string name
Name of the licensed item.
Definition Lease.h:119
const std::int64_t issuedAtEpochS
The time when the token was issued (the lease was created).
Definition Lease.h:103
const std::string licenseId
Id of the license.
Definition Lease.h:111
const std::map< std::string, std::string > licenseProperties
If available, license properties defined for the license as custom name-value pairs.
Definition Lease.h:113
const std::int64_t licenseValidFromEpochS
The validity start time of the license that this token is consuming.
Definition Lease.h:115
const std::string requestedVersion
Requested version.
Definition Lease.h:123
const std::string hardwareId
The ID of the computer or hardware on which the license is being consumed.
Definition Lease.h:101
const std::map< std::string, std::string > additionalClaims
Additional claims.
Definition Lease.h:95
Lease(std::string name, std::string token, std::string consumedVersion, std::string licenseId, std::string leaseId, std::int64_t leaseExpiresEpochS, std::string requestedVersion="", std::string hardwareId="", std::int64_t issuedAtEpochS=0, std::string issuer="", const std::map< std::string, std::string > &licenseProperties={}, std::int64_t licenseValidFromEpochS=0, std::int64_t licenseValidUntilEpochS=INT64_MAX, std::int64_t recommendedRefreshTimeEpochS=0, std::string subject="", const std::vector< std::string > aggregatedItems={}, const std::map< std::string, std::string > &additionalClaims={})
Constructs new instance.
Definition Lease.h:48
const std::string subject
The ID of the end user’s user account or the unique ID of the client.
Definition Lease.h:125
const std::string issuer
The URL of your 10Duke Enterprise deployment, the issuer of the token.
Definition Lease.h:105
const std::int64_t leaseExpiresEpochS
Expiration time of the the lease in epoch-seconds.
Definition Lease.h:107
const std::string token
The full JWT from which this data were parsed from.
Definition Lease.h:127
const std::vector< std::string > aggregatedItems
Aggregated licensed items, if any.
Definition Lease.h:97
const std::int64_t LEASE_DOES_NOT_EXPIRE
Magic value for "lease expires epoch seconds" to denote that lease does not expire.
Definition Lease.h:15
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4