LicenseSpring C++ SDK
Easily add Software Licensing to your application
Loading...
Searching...
No Matches
LicenseSpring::UserLicense Class Reference

Contains information about a user-based license for a given user. More...

#include <LicenseSpring/UserLicense.h>

Public Types

using ptr_t = std::shared_ptr< UserLicense >
 

Public Member Functions

 UserLicense ()
 Default constructor, creates empty user license object.
 
bool isActive () const
 Checker for if the license is active.
 
bool isEnabled () const
 Checker for if the license is enabled.
 
bool isTrial () const
 Checker for if the license is a trial.
 
bool isUnlimitedActivationsAllowed () const
 Checker if license allows unlimited activations.
 
bool isOveragesAllowed () const
 Checker if overage is allowed for Consumption license.
 
bool isFloating () const
 Checker for whether the license is floating or not.
 
bool isVMAllowed () const
 Checker for whether the license is allowed to work under virtual machine or not.
 
bool isHardwareKeyAuth () const
 Checker for whether the license works only with a hardware key dongle.
 
bool isAirGapped () const
 Checker for if the license is air gapped.
 
uint32_t maxLicenseUsers () const
 Maximum number of users that can be assigned to a license.
 
int32_t maxActivations () const
 How many times license can be activated.
 
uint32_t timesActivated () const
 How many times license already been activated.
 
uint32_t transferCount () const
 How many times license has been transferred between devices.
 
int32_t transferLimit () const
 Maximum number of allowed license transfers between devices.
 
uint32_t maxOverages () const
 Maximum overage allowed for the license.
 
uint32_t floatingTimeout () const
 Timeout of the floating license in minutes.
 
uint32_t maxBorrowTime () const
 Maximum borrowing period in hours.
 
uint32_t gracePeriod () const
 Grace period in hours.
 
uint64_t serverId () const
 Server-side license id, used for distinguishing user-based licenses of the same product.
 
const std::string & orderStoreId () const
 order store id of the license.
 
const std::string & startDate () const
 License start date.
 
const std::string & metadata () const
 License metadata.
 
LicenseType licenseType () const
 License type.
 
Customer owner () const
 License owner.
 
ProductDetails productDetails () const
 Product details.
 
std::vector< CustomFieldcustomFields () const
 List of custom fields associated with the license.
 
std::vector< LicenseFeaturefeatures () const
 List of license features associated with the license.
 
tm validityPeriod () const
 License validity period in UTC.
 
tm maintenancePeriod () const
 Maintenance period in UTC.
 

Static Public Member Functions

static UserLicense fromJsonString (const std::string &jsonString)
 Helper method, creates UserLicense object from JSON string.
 

Detailed Description

Contains information about a user-based license for a given user.

Definition at line 21 of file UserLicense.h.

Member Typedef Documentation

◆ ptr_t

Definition at line 24 of file UserLicense.h.

Constructor & Destructor Documentation

◆ UserLicense()

LicenseSpring::UserLicense::UserLicense ( )

Default constructor, creates empty user license object.

Member Function Documentation

◆ isActive()

bool LicenseSpring::UserLicense::isActive ( ) const

Checker for if the license is active.

Returns
True if active, false if not.

◆ isEnabled()

bool LicenseSpring::UserLicense::isEnabled ( ) const

Checker for if the license is enabled.

Returns
True if enabled, false if not.

◆ isTrial()

bool LicenseSpring::UserLicense::isTrial ( ) const

Checker for if the license is a trial.

Returns
True if it is a trial, false if not.

◆ isUnlimitedActivationsAllowed()

bool LicenseSpring::UserLicense::isUnlimitedActivationsAllowed ( ) const

Checker if license allows unlimited activations.

Returns
True if license allows unlimited activations, false if not.

◆ isOveragesAllowed()

bool LicenseSpring::UserLicense::isOveragesAllowed ( ) const

Checker if overage is allowed for Consumption license.

Meaningful only for Consumption license type.

◆ isFloating()

bool LicenseSpring::UserLicense::isFloating ( ) const

Checker for whether the license is floating or not.

Returns
True if floating, false if not.

◆ isVMAllowed()

bool LicenseSpring::UserLicense::isVMAllowed ( ) const

Checker for whether the license is allowed to work under virtual machine or not.

See product and license settings on the LicenseSpring platform for more details.

Returns
True if VM is allowed, false if not.

◆ isHardwareKeyAuth()

bool LicenseSpring::UserLicense::isHardwareKeyAuth ( ) const

Checker for whether the license works only with a hardware key dongle.

Returns
True if license works only with a hardware key dongle, false if not.

◆ isAirGapped()

bool LicenseSpring::UserLicense::isAirGapped ( ) const

Checker for if the license is air gapped.

Returns
True if it is air gapped, false if not.

◆ maxLicenseUsers()

uint32_t LicenseSpring::UserLicense::maxLicenseUsers ( ) const

Maximum number of users that can be assigned to a license.

Returns
Maximum number of activations for the license.

◆ maxActivations()

int32_t LicenseSpring::UserLicense::maxActivations ( ) const

How many times license can be activated.

Returns
Maximum number of activations for the license, -1 if unlimited.

◆ timesActivated()

uint32_t LicenseSpring::UserLicense::timesActivated ( ) const

How many times license already been activated.

Returns
Current number of activations for the license.

◆ transferCount()

uint32_t LicenseSpring::UserLicense::transferCount ( ) const

How many times license has been transferred between devices.

Returns
Transfer count of the license.

◆ transferLimit()

int32_t LicenseSpring::UserLicense::transferLimit ( ) const

Maximum number of allowed license transfers between devices.

Returns
Maximum device transfer limit of the license, -1 for unlimited device transfers, 0 if device transfers are not allowed.

◆ maxOverages()

uint32_t LicenseSpring::UserLicense::maxOverages ( ) const

Maximum overage allowed for the license.

Meaningful only for Consumption license type, returns maximum possible value in case of unlimited overages.

◆ floatingTimeout()

uint32_t LicenseSpring::UserLicense::floatingTimeout ( ) const

Timeout of the floating license in minutes.

Returns
Timeout of the floating license in minutes.

◆ maxBorrowTime()

uint32_t LicenseSpring::UserLicense::maxBorrowTime ( ) const

Maximum borrowing period in hours.

Meaningful only for floating license.

Returns
Max borrow time or 0 if license borrowing is not allowed.

◆ gracePeriod()

uint32_t LicenseSpring::UserLicense::gracePeriod ( ) const

Grace period in hours.

Positive value if grace period enabled, and 0 if disabled.

◆ serverId()

uint64_t LicenseSpring::UserLicense::serverId ( ) const

Server-side license id, used for distinguishing user-based licenses of the same product.

Returns
server-side license id.

◆ orderStoreId()

const std::string & LicenseSpring::UserLicense::orderStoreId ( ) const

order store id of the license.

Returns
Order store id.

◆ startDate()

const std::string & LicenseSpring::UserLicense::startDate ( ) const

License start date.

See https://docs.licensespring.com/docs/license-start-date

Returns
License start date in a format Y-m-d, if start date is not set for the License the string is empty.

◆ metadata()

const std::string & LicenseSpring::UserLicense::metadata ( ) const

License metadata.

Returns
String of license metadata json.

◆ licenseType()

LicenseType LicenseSpring::UserLicense::licenseType ( ) const

License type.

Returns
LicenseType object.

◆ owner()

Customer LicenseSpring::UserLicense::owner ( ) const

License owner.

Returns
Information about license owner, commonly it's a person or organization associated with the license.

◆ productDetails()

ProductDetails LicenseSpring::UserLicense::productDetails ( ) const

Product details.

Returns
Information about the product.

◆ customFields()

std::vector< CustomField > LicenseSpring::UserLicense::customFields ( ) const

List of custom fields associated with the license.

Returns
List of CustomField objects associated with the license.

◆ features()

std::vector< LicenseFeature > LicenseSpring::UserLicense::features ( ) const

List of license features associated with the license.

Returns
List of LicenseFeature objects associated with the license.

◆ validityPeriod()

tm LicenseSpring::UserLicense::validityPeriod ( ) const

License validity period in UTC.

Returns
Time structure of license validity period in UTC.

◆ maintenancePeriod()

tm LicenseSpring::UserLicense::maintenancePeriod ( ) const

Maintenance period in UTC.

Returns
Time structure of maintenance period in UTC.

◆ fromJsonString()

static UserLicense LicenseSpring::UserLicense::fromJsonString ( const std::string &  jsonString)
static

Helper method, creates UserLicense object from JSON string.

Returns
UserLicense object from JSON string.

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