This pull request introduces the service_history method in the Vehicle class, extending the Smartcar SDK to support fetching service records of vehicles. The new endpoint allows for optional filtering by date range. If no dates are specified, the endpoint defaults to returning records from the last year.
Changes include:
Definition of the ServiceRecord, ServiceTask, ServiceDetail, and ServiceCost classes in smartcar/types.py.
Addition of the service_history method in smartcar/vehicle.py, which utilizes these new data types.
Update to API request handling in smartcar/types.py to support the new service history endpoint.
Modification of scopes in test configurations to include the new read_service_history permission.
Addition of a new test case in tests/e2e/test_vehicle.py to ensure the correct functionality of the service_history method.
Changes
This pull request introduces the
service_history
method in theVehicle
class, extending the Smartcar SDK to support fetching service records of vehicles. The new endpoint allows for optional filtering by date range. If no dates are specified, the endpoint defaults to returning records from the last year.Changes include:
ServiceRecord
,ServiceTask
,ServiceDetail
, andServiceCost
classes insmartcar/types.py
.service_history
method insmartcar/vehicle.py
, which utilizes these new data types.smartcar/types.py
to support the new service history endpoint.read_service_history
permission.tests/e2e/test_vehicle.py
to ensure the correct functionality of theservice_history
method.