10Duke Scale C++ Client
Loading...
Searching...
No Matches
DefaultLicenseCheckoutRequest.h
1#ifndef TENDUKE_SE_LICENSING_REST_DEFAULTLICENSECHECKOUTREQUEST_H
2#define TENDUKE_SE_LICENSING_REST_DEFAULTLICENSECHECKOUTREQUEST_H
3
4#include "./AbstractLicenseRequest.h"
5#include "./LicenseCheckoutRequest.h"
6#include "../../api/licenses/JWTToLease.h"
7#include "../../api/licenses/checkout/LicenseCheckoutParameters.h"
8#include "../../api/licenses/checkout/LicenseCheckoutResponse.h"
9#include "../../../config/BackendConfiguration.h"
10#include "../../../config/ClientProperties.h"
11#include "http/HTTPClient.h"
12#include "http/HTTPRequestAuthenticator.h"
13#include "http/HTTPResponseToException.h"
14#include "json/JSONParser.h"
15#include "jwt/JWTParser.h"
16#include <memory>
17
18namespace tenduke { namespace se { namespace licensing { namespace rest {
19
25{
26public:
43 const std::shared_ptr<const ::tenduke::se::ClientProperties> &clientProperties,
44 const std::shared_ptr<const ::tenduke::se::BackendConfiguration> &configuration,
45 const std::shared_ptr<const ::tenduke::http::HTTPClient> &httpClient,
46 const std::shared_ptr<const ::tenduke::http::HTTPRequestAuthenticator>& httpRequestAuthenticator,
47 const std::shared_ptr<const ::tenduke::http::HTTPResponseToException> &throwException,
48 const std::shared_ptr<const ::tenduke::json::JSONParser> &jsonParser,
49 const std::shared_ptr<const ::tenduke::jwt::JWTParser> &jwtParser,
50 const std::shared_ptr<const ::tenduke::se::licensing::JWTToLease> &jwtToLease,
53 );
54
55 // tenduke::se::licensing::LicenseCheckoutRequest implementation
56public:
58
59protected:
62
63private:
64 const ::tenduke::se::licensing::LicenseCheckoutParameters parameters;
65
66 const std::shared_ptr<const ::tenduke::se::licensing::JWTToLease> createLease;
67 const std::shared_ptr<const ::tenduke::jwt::JWTParser> parseJWT;
68};
69
70
71}}}}
72
73#endif //TENDUKE_SE_LICENSING_REST_DEFAULTLICENSECHECKOUTREQUEST_H
Interface for 10Duke Scale API-requests.
Definition APIRequest.h:12
A tenduke::se::APIRequest, which uses tenduke::oidc::OIDCSession to maintain request authorization.
Definition StatefulAPIRequest.h:27
Parameters for license checkout request.
Definition LicenseCheckoutParameters.h:14
Response from license checkout call.
Definition LicenseCheckoutResponse.h:17
Abstract base class for license-related requests.
Definition AbstractLicenseRequest.h:20
static const bool NON_METERED
Magic value to indicate that this is normal (not metered) license request.
Definition AbstractLicenseRequest.h:28
static const std::string NO_LICENSE_KEY
Magic value to indicate that this is not a license key request.
Definition AbstractLicenseRequest.h:23
const std::shared_ptr< const ::tenduke::http::HTTPRequestAuthenticator > httpRequestAuthenticator
HTTP-request authenticator.
Definition AbstractLicenseRequest.h:85
const std::shared_ptr< const ::tenduke::http::HTTPResponseToException > throwException
Throw-exception.
Definition AbstractLicenseRequest.h:87
const std::shared_ptr< const ::tenduke::se::ClientProperties > clientProperties
Client properties.
Definition AbstractLicenseRequest.h:77
const std::shared_ptr< const ::tenduke::se::BackendConfiguration > configuration
Config.
Definition AbstractLicenseRequest.h:79
Default implementation of tenduke::se::licensing::rest::LicenseCheckoutRequest.
Definition DefaultLicenseCheckoutRequest.h:25
::tenduke::se::licensing::LicenseCheckoutResponse fromJSON(const std::string &jsonDocument) const
Maps the request entity from JSON message payload.
Definition DefaultLicenseCheckoutRequest.cpp:43
::tenduke::se::licensing::LicenseCheckoutResponse execute() override
Execute the request synchronously.
Definition DefaultLicenseCheckoutRequest.cpp:78
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7