ChargingManagerImplementation
Hierarchy
- ChargingManager
- ChargingManagerImplementation
Index
Methods
__aenter__
Initialize the charging manager - this is called by the
Actor
class and shouldn't be invoked manually.Returns None
__aexit__
Parameters
exc_type: type[BaseException] | None
exc_value: BaseException | None
exc_traceback: TracebackType | None
Returns None
__init__
Parameters
configuration: Configuration
client: ApifyClientAsync
Returns None
calculate_max_event_charge_count_within_limit
Calculate how many instances of an event can be charged before we reach the configured limit.
Parameters
event_name: str
Name of the inspected event.
Returns int | None
calculate_total_charged_amount
Calculate the total amount of money charged for pay-per-event events so far.
Returns Decimal
charge
Charge for a specified number of events - sub-operations of the Actor.
This is relevant only for the pay-per-event pricing model.
Parameters
event_name: str
Name of the event to be charged for.
optionalcount: int = 1
Number of events to charge for.
Returns ChargeResult
get_pricing_info
Retrieve detailed information about the effective pricing of the current Actor run.
This can be used for instance when your code needs to support multiple pricing models in transition periods.
Returns ActorPricingInfo
Implementation of the
ChargingManager
Protocol - this is only meant to be instantiated internally.