Documentation
¶
Index ¶
- Constants
- Variables
- type ConnectedVehicle
- func (v *ConnectedVehicle) GetDistanceDriven(ctx context.Context) (DistanceDrivenResponse, error)
- func (v *ConnectedVehicle) GetDoorStatus(ctx context.Context) (Doors, error)
- func (v *ConnectedVehicle) GetFuelLevel(ctx context.Context) (FuelLevelResponse, error)
- func (v *ConnectedVehicle) GetLocation(ctx context.Context) (Location, error)
- func (v *ConnectedVehicle) GetStateOfCharge(ctx context.Context) (StateOfChargeResponse, error)
- func (v *ConnectedVehicle) GetTirePressure(ctx context.Context) (Tires, error)
- func (v *ConnectedVehicle) GetVehicleDetail(ctx context.Context) (VehicleDetail, error)
- func (v *ConnectedVehicle) LockDoors(ctx context.Context) error
- func (v *ConnectedVehicle) UnlockDoors(ctx context.Context) error
- type ConnectedVehicleClient
- type DistanceDriven
- type DistanceDrivenResponse
- type DistanceUnit
- type DoorLockChangeRequestBody
- type DoorLockCommand
- type DoorLockState
- type DoorLockStatus
- type DoorOpenStatus
- type DoorState
- type Doors
- type FuelLevel
- type FuelLevelResponse
- type Location
- type LocationCoordinate
- type PercentUnit
- type PressureUnit
- type RetrievalStatus
- type StateOfCharge
- type StateOfChargeResponse
- type TirePressureStatus
- type Tires
- type Vehicle
- type VehicleDetail
Constants ¶
View Source
const ( Valid RetrievalStatus = "VALID" Initialized = "INITIALIZED" Invalid = "INVALID" NotSupported = "NOT_SUPPORTED" )
Variables ¶
View Source
var ( DefaultScopes = []string{"mb:user:pool:reader", "mb:vehicle:status:general"} Endpoint = oauth2.Endpoint{ AuthURL: "https://api.secure.mercedes-benz.com/oidc10/auth/oauth/v2/authorize", TokenURL: "https://api.secure.mercedes-benz.com/oidc10/auth/oauth/v2/token", } )
Functions ¶
This section is empty.
Types ¶
type ConnectedVehicle ¶
type ConnectedVehicle struct { VehicleID string // contains filtered or unexported fields }
func (*ConnectedVehicle) GetDistanceDriven ¶
func (v *ConnectedVehicle) GetDistanceDriven(ctx context.Context) (DistanceDrivenResponse, error)
func (*ConnectedVehicle) GetDoorStatus ¶
func (v *ConnectedVehicle) GetDoorStatus(ctx context.Context) (Doors, error)
func (*ConnectedVehicle) GetFuelLevel ¶
func (v *ConnectedVehicle) GetFuelLevel(ctx context.Context) (FuelLevelResponse, error)
func (*ConnectedVehicle) GetLocation ¶
func (v *ConnectedVehicle) GetLocation(ctx context.Context) (Location, error)
func (*ConnectedVehicle) GetStateOfCharge ¶
func (v *ConnectedVehicle) GetStateOfCharge(ctx context.Context) (StateOfChargeResponse, error)
func (*ConnectedVehicle) GetTirePressure ¶
func (v *ConnectedVehicle) GetTirePressure(ctx context.Context) (Tires, error)
func (*ConnectedVehicle) GetVehicleDetail ¶
func (v *ConnectedVehicle) GetVehicleDetail(ctx context.Context) (VehicleDetail, error)
func (*ConnectedVehicle) LockDoors ¶
func (v *ConnectedVehicle) LockDoors(ctx context.Context) error
func (*ConnectedVehicle) UnlockDoors ¶
func (v *ConnectedVehicle) UnlockDoors(ctx context.Context) error
type ConnectedVehicleClient ¶
type ConnectedVehicleClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(apiKey string, productionMode bool) *ConnectedVehicleClient
func (*ConnectedVehicleClient) GetVehicles ¶
func (m *ConnectedVehicleClient) GetVehicles(ctx context.Context) ([]Vehicle, error)
func (*ConnectedVehicleClient) NewVehicle ¶
func (m *ConnectedVehicleClient) NewVehicle(vehicleId string) *ConnectedVehicle
type DistanceDriven ¶
type DistanceDriven struct { Unit DistanceUnit `json:"unit"` Value int `json:"value"` RetrievalStatus RetrievalStatus `json:"retrievalstatus"` Timestamp int64 `json:"timestamp"` }
type DistanceDrivenResponse ¶
type DistanceDrivenResponse struct { Odometer DistanceDriven `json:"odometer"` DistanceSinceReset DistanceDriven `json:"distancesincereset"` DistanceSinceStart DistanceDriven `json:"distancesincestart"` }
type DistanceUnit ¶
type DistanceUnit string
const (
Kilometers DistanceUnit = "KILOMETERS"
)
func (*DistanceUnit) UnmarshalJSON ¶
func (du *DistanceUnit) UnmarshalJSON(b []byte) error
type DoorLockChangeRequestBody ¶
type DoorLockChangeRequestBody struct {
Command DoorLockCommand `json:"command"`
}
type DoorLockCommand ¶
type DoorLockCommand string
const ( Lock DoorLockCommand = "LOCK" Unlock = "UNLOCK" )
func (*DoorLockCommand) UnmarshalJSON ¶
func (dl *DoorLockCommand) UnmarshalJSON(b []byte) error
type DoorLockState ¶
type DoorLockState string
const ( Locked DoorLockState = "LOCKED" Unlocked = "UNLOCKED" )
func (*DoorLockState) UnmarshalJSON ¶
func (ds *DoorLockState) UnmarshalJSON(b []byte) error
type DoorLockStatus ¶
type DoorLockStatus struct { Value DoorLockState `json:"value"` RetrievalStatus RetrievalStatus `json:"retrievalstatus"` Timestamp int64 `json:"timestamp"` }
type DoorOpenStatus ¶
type DoorOpenStatus struct { Value DoorState `json:"value"` RetrievalStatus RetrievalStatus `json:"retrievalstatus"` Timestamp int64 `json:"timestamp"` }
type DoorState ¶
type DoorState string
const ( Open DoorState = "OPEN" Closed = "CLOSED" )
func (*DoorState) UnmarshalJSON ¶
type Doors ¶
type Doors struct { DoorStatusFrontLeft DoorOpenStatus `json:"doorstatusfrontleft"` DoorStatusFrontRight DoorOpenStatus `json:"doorstatusfrontright"` DoorStatusRearLeft DoorOpenStatus `json:"doorstatusrearleft"` DoorStatusRearRight DoorOpenStatus `json:"doorstatusrearright"` DoorLockStatusFrontLeft DoorLockStatus `json:"doorlockstatusfrontleft"` DoorLockStatusFrontRight DoorLockStatus `json:"doorlockstatusfrontright"` DoorLockStatusRearLeft DoorLockStatus `json:"doorlockstatusrearleft"` DoorLockStatusRearRight DoorLockStatus `json:"doorlockstatusrearright"` DoorLockStatusDeckLid DoorLockStatus `json:"doorlockstatusdecklid"` DoorLockStatusGas DoorLockStatus `json:"doorlockstatusgas"` DoorLockStatusVehicle DoorLockStatus `json:"doorlockstatusvehicle"` }
type FuelLevel ¶
type FuelLevel struct { Unit PercentUnit `json:"unit"` Value int `json:"value"` RetrievalStatus RetrievalStatus `json:"retrievalstatus"` Timestamp int64 `json:"timestamp"` }
type FuelLevelResponse ¶
type FuelLevelResponse struct {
FuelLevelPercent FuelLevel `json:"fuellevelpercent"`
}
type Location ¶
type Location struct { Latitude LocationCoordinate `json:"latitude"` Longitude LocationCoordinate `json:"longitude"` Heading LocationCoordinate `json:"heading"` }
type LocationCoordinate ¶
type LocationCoordinate struct { Value float64 `json:"value"` RetrievalStatus RetrievalStatus `json:"retrievalstatus"` Timestamp int64 `json:"timestamp"` }
type PercentUnit ¶
type PercentUnit string
const (
Percent PercentUnit = "PERCENT"
)
func (*PercentUnit) UnmarshalJSON ¶
func (pu *PercentUnit) UnmarshalJSON(b []byte) error
type PressureUnit ¶
type PressureUnit string
const (
KiloPascal PressureUnit = "KILOPASCAL"
)
func (*PressureUnit) UnmarshalJSON ¶
func (pu *PressureUnit) UnmarshalJSON(b []byte) error
type RetrievalStatus ¶
type RetrievalStatus string
func (*RetrievalStatus) UnmarshalJSON ¶
func (rs *RetrievalStatus) UnmarshalJSON(b []byte) error
type StateOfCharge ¶
type StateOfCharge struct { Unit PercentUnit `json:"unit"` Value int `json:"value"` RetrievalStatus RetrievalStatus `json:"retrievalstatus"` Timestamp int64 `json:"timestamp"` }
type StateOfChargeResponse ¶
type StateOfChargeResponse struct {
StateOfCharge StateOfCharge `json:"stateofcharge"`
}
type TirePressureStatus ¶
type TirePressureStatus struct { Unit PressureUnit `json:"unit"` Value float64 `json:"value"` RetrievalStatus RetrievalStatus `json:"retrievalstatus"` Timestamp int64 `json:"timestamp"` }
type Tires ¶
type Tires struct { TirePressureFrontLeft TirePressureStatus `json:"tirepressurefrontleft"` TirePressureFrontRight TirePressureStatus `json:"tirepressurefrontright"` TirePressureRearLeft TirePressureStatus `json:"tirepressurerearleft"` TirePressureRearRight TirePressureStatus `json:"tirepressurerearright"` }
type VehicleDetail ¶
type VehicleDetail struct { Id string `json:"id"` LicensePlate string `json:"licenseplate"` SalesDesignation string `json:"salesdesignation"` VIN string `json:"finorvin"` ModelYear string `json:"modelyear"` ColorName string `json:"colorname"` FuelType string `json:"fueltype"` PowerHP string `json:"powerhp"` PowerKW string `json:"powerkw"` NumberOfDoors string `json:"numberofdoors"` NumberOfSeats string `json:"numberofseats"` }
Click to show internal directories.
Click to hide internal directories.