Contains the Filter models, used to add url params to requests.
__all__ = ['Filter', 'VehicleClusterFilter']
module-attribute
filter
The Filter Base class is extended by specific filters.
It provides some common functionality to convert the filter to request parameters.
EmptyFilter
Filter
Bases: BaseModel
Base class for filters.
bool_to_str(value)
staticmethod
Convert a boolean value to a string, as understood by the API.
to_request_params()
Return the filter as request parameters, to be provied to api request.
vehicle_cluster_filter
Used to filter what VehicleClusters should be loaded from the API.
In most cases, this filter is created based on the user's profile settings. This results in the same set of Vehicles that is shown in the web app.
AllVehicleClusters
Bases: VehicleClusterFilter
Empty filter for loading all items.
Using this filter would load all available VehicleClusters, irregarding of whether the user can lease them. This is equivalent to opening the showroom web app without being logged in.
VehicleClusterFilter
Bases: Filter
Filters for loading the Vehicle Clusters.
IncludeFuelCostsInPricing: bool | None = None
class-attribute
instance-attribute
IncludeMileageCostsInPricing: bool | None = None
class-attribute
instance-attribute
IncludeTaxInPrices: bool | None = None
class-attribute
instance-attribute
NumberOfKmPerMonth: int | None = None
class-attribute
instance-attribute
Segment: str | None = 'Cars'
class-attribute
instance-attribute
from_profile(profile)
staticmethod
Create a filter from a profile.
vehicle_filter
A VehicleFilter is used to filter what Vehicles should be loaded from the API.
In most cases, this filter is created based on the user's profile settings.
VehicleFilter
Bases: Filter
Filters for loading the Vehicle Clusters.
| Attributes: |
|
|---|
ActualBudgetPerMonth: int | float | None = None
class-attribute
instance-attribute
IncludeFuelCostsInPricing: bool | None = None
class-attribute
instance-attribute
IncludeMileageCostsInPricing: bool | None = None
class-attribute
instance-attribute
IncludeTaxInPrices: bool | None = None
class-attribute
instance-attribute
Make: str | None = None
class-attribute
instance-attribute
MaxPricePerMonth: int | float | None = None
class-attribute
instance-attribute
Model: str | None = None
class-attribute
instance-attribute
NumberOfKmPerMonth: int | None = None
class-attribute
instance-attribute
Segment: str = 'Cars'
class-attribute
instance-attribute
SortBy: str = 'PriceInEuro'
class-attribute
instance-attribute
VehicleId: str | None = None
class-attribute
instance-attribute
from_profile(make, model, profile)
staticmethod
Create a filter from a profile.