BaasTokenService
Table of Contents
Constants
- KEY_REQUEST_CONSUMPTION = 'consumptionId'
- Key consumption from consume response
- SERVICE_CODE = 'ai_copilot_token'
- Code service
Methods
- canConsume() : bool
- consume() : Result
- hasPackage() : bool
- Returns true if the package is available and active depending on the license.
- isActive() : bool
- isActualExpirationDate() : bool
- isAvailable() : bool
- rollbackConsumption() : Result
Constants
KEY_REQUEST_CONSUMPTION
Key consumption from consume response
public
mixed
KEY_REQUEST_CONSUMPTION
= 'consumptionId'
SERVICE_CODE
Code service
public
mixed
SERVICE_CODE
= 'ai_copilot_token'
Methods
canConsume()
public
canConsume([int $tokens = 1 ]) : bool
Parameters
- $tokens : int = 1
Return values
boolconsume()
public
consume([int $tokens = 1 ]) : Result
Parameters
- $tokens : int = 1
Tags
Return values
ResulthasPackage()
Returns true if the package is available and active depending on the license.
public
hasPackage() : bool
Return values
boolisActive()
public
isActive() : bool
Return values
boolisActualExpirationDate()
public
isActualExpirationDate() : bool
Return values
boolisAvailable()
public
isAvailable() : bool
Return values
boolrollbackConsumption()
public
rollbackConsumption(string $consumptionId) : Result
Parameters
- $consumptionId : string