mirror of
https://github.com/Luzifer/mercedes-byocar-exporter.git
synced 2024-11-08 22:10:07 +00:00
27 lines
495 B
Go
27 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
|
||
|
}
|