Athlon Flex API client.
T = TypeVar('T')
module-attribute
AthlonFlexClient
Bases: BaseModel
Athlon Flex API client.
Exposes functions to load the profile, vehicle clusters, vehicles & vehicle details. Uses the aiohttp library to interact with the API. All _async methods can also be accessed synchronously by removing the '_async' suffix.
| Attributes: |
|
|---|
BASE_URL: str = 'https://flex.athlon.com/api/v1'
class-attribute
TAX_RATES_PAGE_ID: str = '4ecf5f24-8985-450a-915d-919aa7ffa9df'
class-attribute
apply_loonheffingskorting: bool = True
class-attribute
instance-attribute
email: str | None = None
class-attribute
instance-attribute
gross_yearly_income: float | None = None
class-attribute
instance-attribute
logged_in: bool = Field(init=False, default=False)
class-attribute
instance-attribute
model_config = ConfigDict(ignored_types=(AsyncCachedPropertyDescriptor), arbitrary_types_allowed=True)
class-attribute
instance-attribute
password: str | None = None
class-attribute
instance-attribute
profile: Profile
cached
property
Synchronously get the profile of the user.
session: ClientSession = Field(init=False, optional=True, default=None)
class-attribute
instance-attribute
__del__()
Automatically close the session when the object is garbage collected.
__getattr__(name)
Allow synchronous access to async methods.
Any method that ends with '_async' can also be accessed synchronously by removing the '_async' suffix.
model_post_init(_)
Initialize the API client.
Create a new session and login to the API.
profile_async()
async
Get the profile of the user.
tax_rates_async()
async
Load the tax rates registered in Athlon Flex.
vehicle_clusters_async(filter_=None, detail_level=DetailLevel.INCLUDE_VEHICLE_DETAILS)
async
Load all clusters that have at least one vehicle available.
| Parameters: |
|
|---|
| Returns: |
|
|---|
vehicle_details_async(vehicle)
async
vehicles_async(make, model, *, filter_vehicles_by_profile=True)
async
Load all available vehicles a certain make and model (of a cluster).
If logged in, only load the vehicles that are available to the user.
| Parameters: |
|
|---|
| Returns: |
|
|---|