-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial ServiceHistoryResponseModel
- Loading branch information
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
"""Toyota Connected Services API - Service History Models.""" | ||
|
||
from typing import Any, List, Optional | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
|
||
class ServiceHistoryModel(BaseModel): | ||
"""Represents a service history record. | ||
Attributes | ||
---------- | ||
customer_created_record (bool): Indicates if the record was created by the customer. | ||
mileage (Optional[str]): The mileage at the time of the service. | ||
notes (Any): Additional notes about the service. | ||
operations_performed (Any): The operations performed during the service. | ||
ro_number (Any): The RO (Repair Order) number associated with the service. | ||
service_category (str): The category of the service. | ||
service_date (str): The date of the service. | ||
service_history_id (str): The ID of the service history record. | ||
service_provider (str): The service provider. | ||
servicing_dealer (Any): The dealer that performed the service. | ||
unit (Optional[str]): The unit associated with the service mileage. | ||
""" | ||
|
||
customer_created_record: bool = Field(alias="customerCreatedRecord") | ||
mileage: Optional[str] | ||
notes: Any | ||
operations_performed: Any = Field(alias="operationsPerformed") | ||
ro_number: Any = Field(alias="roNumber") | ||
service_category: str = Field(alias="customerCreatedRecord") | ||
service_date: str = Field(alias="serviceCategory") | ||
service_history_id: str = Field(alias="serviceHistoryId") | ||
service_provider: str = Field(alias="serviceProvider") | ||
servicing_dealer: Any = Field(alias="servicingDealer") | ||
unit: Optional[str] | ||
|
||
|
||
class ServiceHistoriesModel(BaseModel): | ||
r"""Model representing a list of service histories. | ||
Attributes | ||
---------- | ||
service_histories (List[Optional[ServiceHistoryModel]]): A list of all service histories. | ||
Defaults to []. | ||
""" | ||
|
||
service_histories: List[Optional[ServiceHistoryModel]] = Field( | ||
alias="serviceHistories", default=[] | ||
) | ||
|
||
|
||
class ServiceHistoryResponseModel(BaseModel): | ||
"""Model representing a service history response. | ||
Inherits from BaseModel. | ||
Attributes | ||
---------- | ||
payload (Optional[ServiceHistoriesModel]): The service history payload. Defaults to None. | ||
""" | ||
|
||
payload: Optional[ServiceHistoriesModel] = None |