Refactor some functions
This commit is contained in:
43
mysubaru.go
43
mysubaru.go
@ -25,6 +25,27 @@ type Response struct {
|
||||
// Unmarshal .
|
||||
// func (r *Response) Unmarshal(b []byte) {}
|
||||
|
||||
// Request .
|
||||
type Request struct {
|
||||
Vin string `json:"vin"` //
|
||||
Pin string `json:"pin"` //
|
||||
Delay int `json:"delay,string,omitempty"` //
|
||||
ForceKeyInCar *bool `json:"forceKeyInCar,string,omitempty"` //
|
||||
UnlockDoorType *string `json:"unlockDoorType,omitempty"` // [ ALL_DOORS_CMD | FRONT_LEFT_DOOR_CMD | ALL_DOORS_CMD ]
|
||||
Horn *string `json:"horn,omitempty"` //
|
||||
ClimateSettings *string `json:"climateSettings,omitempty"` //
|
||||
ClimateZoneFrontTemp *string `json:"climateZoneFrontTemp,omitempty"` //
|
||||
ClimateZoneFrontAirMode *string `json:"climateZoneFrontAirMode,omitempty"` //
|
||||
ClimateZoneFrontAirVolume *string `json:"climateZoneFrontAirVolume,omitempty"` //
|
||||
HeatedSeatFrontLeft *string `json:"heatedSeatFrontLeft,omitempty"` //
|
||||
HeatedSeatFrontRight *string `json:"heatedSeatFrontRight,omitempty"` //
|
||||
HeatedRearWindowActive *string `json:"heatedRearWindowActive,omitempty"` //
|
||||
OuterAirCirculation *string `json:"outerAirCirculation,omitempty"` //
|
||||
AirConditionOn *string `json:"airConditionOn,omitempty"` //
|
||||
RunTimeMinutes *string `json:"runTimeMinutes,omitempty"` //
|
||||
StartConfiguration *string `json:"startConfiguration,omitempty"` //
|
||||
}
|
||||
|
||||
// Account .
|
||||
type Account struct {
|
||||
MarketID int `json:"marketId"`
|
||||
@ -277,17 +298,6 @@ type ServiceRequest struct {
|
||||
Vin string `json:"vin"` // 4S4BTGND8L3137058
|
||||
}
|
||||
|
||||
// ErrorResponse .
|
||||
// "dataName":"errorResponse"
|
||||
// {"success":false,"errorCode":"404-soa-unableToParseResponseBody","dataName":"errorResponse","data":{"errorLabel":"404-soa-unableToParseResponseBody","errorDescription":null}}
|
||||
// {"success":false,"errorCode":"vehicleNotInAccount","dataName":null,"data":null}
|
||||
// {"httpCode":500,"errorCode":"error","errorMessage":"java.lang.NullPointerException - null"}
|
||||
// {"success":false,"errorCode":"InvalidCredentials","dataName":"remoteServiceStatus","data":{"serviceRequestId":null,"success":false,"cancelled":false,"remoteServiceType":null,"remoteServiceState":null,"subState":null,"errorCode":null,"result":null,"updateTime":null,"vin":null,"errorDescription":"The credentials supplied are invalid, tries left 2"}}
|
||||
type ErrorResponse struct {
|
||||
ErrorLabel string `json:"errorLabel"` // "404-soa-unableToParseResponseBody"
|
||||
ErrorDescription string `json:"errorDescription,omitempty"` // null
|
||||
}
|
||||
|
||||
// climateSettings: [ climateSettings ]
|
||||
// climateZoneFrontTempCelsius: [for _ in range(15, 30 + 1)]
|
||||
// climateZoneFrontTemp: [for _ in range(60, 85 + 1)]
|
||||
@ -313,3 +323,14 @@ type VehicleHealthItem struct {
|
||||
OnDates []int64 `json:"onDates,omitempty"` // List of the timestamps
|
||||
WarningCode int `json:"warningCode"`
|
||||
}
|
||||
|
||||
// ErrorResponse .
|
||||
// "dataName":"errorResponse"
|
||||
// {"success":false,"errorCode":"404-soa-unableToParseResponseBody","dataName":"errorResponse","data":{"errorLabel":"404-soa-unableToParseResponseBody","errorDescription":null}}
|
||||
// {"success":false,"errorCode":"vehicleNotInAccount","dataName":null,"data":null}
|
||||
// {"httpCode":500,"errorCode":"error","errorMessage":"java.lang.NullPointerException - null"}
|
||||
// {"success":false,"errorCode":"InvalidCredentials","dataName":"remoteServiceStatus","data":{"serviceRequestId":null,"success":false,"cancelled":false,"remoteServiceType":null,"remoteServiceState":null,"subState":null,"errorCode":null,"result":null,"updateTime":null,"vin":null,"errorDescription":"The credentials supplied are invalid, tries left 2"}}
|
||||
type ErrorResponse struct {
|
||||
ErrorLabel string `json:"errorLabel"` // "404-soa-unableToParseResponseBody"
|
||||
ErrorDescription string `json:"errorDescription,omitempty"` // null
|
||||
}
|
||||
|
Reference in New Issue
Block a user