Metered class

Metered class

Provides methods to work with metered licensing.

A metered license is applied with the public and private keys of your subscription. Use set_metered_key before using the API, then read consumption via get_consumption_quantity and get_consumption_credit.

The Metered type exposes the following members:

Constructors

Constructor Description
init Initializes a new Metered instance.

Methods

Method Description
get_consumption_credit Returns the currently consumed number of credits.
get_consumption_quantity Returns the currently consumed number of megabytes.
set_metered_key Enables metered licensing for the component by specifying appropriate public and private metered keys.

Example

from groupdocs.assembly import Metered

# Apply metered license
Metered().set_metered_key("PublicKey", "PrivateKey")

# Read consumption data
print("Quantity:", Metered.get_consumption_quantity())
print("Credit:", Metered.get_consumption_credit())

See Also