ChargingManager
Index
Constructors
constructor
- Parameters- configuration: Configuration
- apifyClient: ApifyClient
 - Returns ChargingManager
Methods
calculateMaxEventChargeCountWithinLimit
- How many events of a given type can still be charged for before reaching the limit; If the event is not registered, returns Infinity (free of charge) - Parameters- eventName: string
 - Returns number
charge
- Charge for a specified number of events - sub-operations of the Actor. - This method attempts to charge for the specified number of events, but may charge fewer if doing so would exceed the total budget limit ( - maxTotalChargeUsd).- Parameters- options: ChargeOptions- The name of the event to charge for and the number of events to be charged. 
 - Returns Promise<ChargeResult>
getChargedEventCount
- Get the number of events with given name that the Actor has charged for so far. - Parameters- eventName: string
 - Returns number
getMaxTotalChargeUsd
- Get the maximum amount of money that the Actor is allowed to charge. - Returns number
getPricingInfo
- Get information about the pricing for this Actor. - Returns ActorPricingInfo
init
- Initialize the ChargingManager by loading pricing information and charging state via Apify API. - Returns Promise<void>
Handles pay-per-event charging.