mirror of
https://github.com/Luzifer/mercedes-byocar-exporter.git
synced 2024-11-08 14:00:09 +00:00
26 lines
495 B
Go
26 lines
495 B
Go
package mercedes
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
type (
|
|
PayAsYouDriveInsurance struct {
|
|
Odometer TimedInt `apiField:"odo"`
|
|
}
|
|
)
|
|
|
|
func (a APIClient) GetPayAsYouDriveInsurance(vehicleID string) (PayAsYouDriveInsurance, error) {
|
|
var (
|
|
path = fmt.Sprintf("/vehicles/%s/containers/payasyoudrive", vehicleID)
|
|
out PayAsYouDriveInsurance
|
|
)
|
|
|
|
if err := a.request(path, &out); err != nil {
|
|
return out, errors.Wrap(err, "getting pay-as-you-drive response")
|
|
}
|
|
|
|
return out, nil
|
|
}
|