Documentation ¶
Overview ¶
Package mykubota implements an API SDK matching the MyKubota app
Index ¶
- Variables
- type AddEquipmentRequest
- type Category
- type CategoryNode
- type Client
- func (c *Client) Authenticate(ctx context.Context, username, password string) (*Session, error)
- func (c *Client) GetModelTree(ctx context.Context) ([]*CategoryNode, error)
- func (s *Client) ListCategories(ctx context.Context) ([]Category, error)
- func (c *Client) ListModels(ctx context.Context) ([]Model, error)
- func (c *Client) MaintenanceSchedule(model string) ([]Maintenance, error)
- func (c *Client) SearchMachine(ctx context.Context, request SearchMachineRequest) (*Model, error)
- func (c *Client) SessionFromToken(ctx context.Context, t *oauth2.Token) (*Session, error)
- type Equipment
- type EquipmentLocation
- type EquipmentRestartInhibitStatus
- type EquipmentTelematics
- type Maintenance
- type MaintenanceHistory
- type ManualEntries
- type ManualEntry
- type Model
- type SearchMachineRequest
- type Session
- func (s *Session) AddEquipment(ctx context.Context, request AddEquipmentRequest) error
- func (s *Session) DeleteEquipment(ctx context.Context, id string) error
- func (s *Session) GetEquipment(ctx context.Context, id string) (*Equipment, error)
- func (s *Session) ListEquipment(ctx context.Context) ([]Equipment, error)
- func (s *Session) MaintenanceHistory(equipmentID string) ([]MaintenanceHistory, error)
- func (s *Session) RecordMaintenance(equipmentID string, entry MaintenanceHistory) error
- func (s *Session) Settings(ctx context.Context) (*Settings, error)
- func (s *Session) UpdateEquipment(ctx context.Context, req UpdateEquipmentRequest) (*Equipment, error)
- func (s *Session) User(ctx context.Context) (*User, error)
- type Settings
- type UpdateEquipmentRequest
- type User
- type VideoEntries
- type VideoEntry
Constants ¶
This section is empty.
Variables ¶
var ( AppEndpoint = "https://app.mykubota.com" AppClientID = "1e74fe67-9753-4f65-b6e4-dd65a8132ea2" AppClientSecret = "TCDx0qg5kFQhIdCxW0t1iFlESodtWfaR49vy4JdbYjc" )
taken from MyKubota app on iOS
Functions ¶
This section is empty.
Types ¶
type AddEquipmentRequest ¶
type CategoryNode ¶
type CategoryNode struct { ID int Name string ParentID *int SubCategories []*CategoryNode Models []Model }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client allows location specific access to public content from the MyKubota app
func New ¶
New creates a new MyKubota client for public content in the region specified by the locale locale must be of format `{ISO 639-1}-{ISO 3166}`, ie en-US or en-CA
func (*Client) Authenticate ¶
Authenticate performs a password authentication with the MyKubota oauth API
func (*Client) GetModelTree ¶
func (c *Client) GetModelTree(ctx context.Context) ([]*CategoryNode, error)
GetModelTree returns a category tree containing all machines/ attachments currently offered by Kubota
func (*Client) ListCategories ¶
Listcategories returns all product categories offered by Kubota
func (*Client) ListModels ¶
ListModels returns all machines/ attachments offered by Kubota
func (*Client) MaintenanceSchedule ¶
func (c *Client) MaintenanceSchedule(model string) ([]Maintenance, error)
func (*Client) SearchMachine ¶
SearchMachine performs a location aware search in Kubotas registry for a matching model/ serial combination
type Equipment ¶
type Equipment struct { ID string `json:"id"` Model string `json:"model"` CategoryID int `json:"categoryId"` Category string `json:"category"` SubCategory string `json:"subcategory"` IdentifierType string `json:"identifierType"` Type string `json:"type"` PinOrSerial string `json:"pinOrSerial"` Pin string `json:"pin"` Serial string `json:"serial"` Nickname string `json:"nickName"` UserEnteredEngineHours float64 `json:"userEnteredEngineHours"` HasTelematics bool `json:"hasTelematics"` HasFaultCodes bool `json:"hasFaultCodes"` HasMaintenanceSchedules bool `json:"hasMaintenanceSchedules"` // TODO - no use for these today, but they exist // "modelHeroUrl" // "modelFullUrl" // "modelIconUrl" // "warrantyUrl" // "guideUrl" ManualEntries ManualEntries `json:"manualEntries"` VideoEntries VideoEntries `json:"videoEntries"` Telematics EquipmentTelematics `json:"telematics"` }
type EquipmentLocation ¶
type EquipmentLocation struct { Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` AltitudeMeters float64 `json:"altitudeMeters"` PositionHeadingAngle float64 `json:"positionHeadingAngle"` }
EquipmentLocation contains location information for telematics enabled equipment
type EquipmentRestartInhibitStatus ¶
type EquipmentRestartInhibitStatus struct { CanModify bool `json:"canModify"` CommandStatus string `json:"commandStatus"` EquipmentStatus string `json:"equipmentStatus"` }
EquipmentRestartInhibitStatus contains restart inhibit information for telematics enabled equipment
type EquipmentTelematics ¶
type EquipmentTelematics struct { LocationTime time.Time `json:"locationTime"` CumulativeOperatingHours float64 `json:"cumulativeOperatingHours"` Location EquipmentLocation `json:"location"` EngineRunning bool `json:"engineRunning"` FuelTempCelsius int `json:"fuelTempCelsius"` FuelRemainingPercent int `json:"fuelRemainingPercent"` DEFTempCelsius int `json:"defTempCelsius"` DEFQualityPercent float64 `json:"defQualityPercent"` DEFRemainingPercent float64 `json:"defRemainingPercent"` DEFPressureKPascal float64 `json:"defPressureKPascal"` EngineRPM int `json:"engineRPM"` CoolantTempCelsius int `json:"coolantTempCelsius"` HydraulicTempCelsius int `json:"hydraulicTempCelsius"` ExtPowerVolts float64 `json:"extPowerVolts"` AirInletTempCelsius float64 `json:"airInletTempCelsius"` AmbientAirTempCelsius float64 `json:"ambientAirTempCelsius"` RunNumber int `json:"runNumber"` MotionState string `json:"motionState"` FaultCodes []interface{} `json:"faultCodes"` RestartInhibitStatus EquipmentRestartInhibitStatus `json:"restartInhibitStatus"` InsideGeofences []interface{} `json:"insideGeofences"` }
EquipmentTelematics contains basic telematics data for telematics enabled equipment
type Maintenance ¶
type Maintenance struct { ID string `json:"id"` CheckPoint string `json:"checkPoint"` Measures string `json:"measures"` FirstCheckValue int `json:"firstCheckValue"` DisplayIntervalType string `json:"displayIntervalType"` IntervalTyp string `json:"intervalType"` IntervalValue int `json:"intervalValue"` SortOrder int `json:"sortOrder"` }
Maintenance contains required maintenance including intervals for a specific model
type MaintenanceHistory ¶
type MaintenanceHistory struct { ID string `json:"id"` IntervalType string `json:"intervalType"` IntervalValue int `json:"intervalValue"` CompletedEngineHours float32 `json:"completedEngineHours"` Notes string `json:"notes"` UpdatedDate time.Time `json:"updatedDate"` // map of MaintenanceSchedule id to performed <Y/N> MaintenanceCheckList map[string]bool `json:"maintenanceCheckList"` }
type ManualEntries ¶
type ManualEntries []ManualEntry
type ManualEntry ¶
type Model ¶
type Model struct { CategoryID int `json:"categoryId"` Type string `json:"type"` CompatibleAttachments []string `json:"compatibleAttachments"` // categoryFullUrl, categoryHeroUrl, categoryIconUrl, guideUrl string HasFaultCodes bool `json:"hasFaultCodes"` HasMaintenanceSchedules bool `json:"hasMaintenanceSchedules"` ManualEntries []ManualEntry `json:"manualEntries"` VideoEntries []VideoEntry `json:"videoEntries"` Model string `json:"model"` }
type SearchMachineRequest ¶
type Session ¶
Session allows location specific access to authenticated content
func (*Session) AddEquipment ¶
func (s *Session) AddEquipment(ctx context.Context, request AddEquipmentRequest) error
AddEquipment adds equipment associations for the current user
func (*Session) DeleteEquipment ¶
DeleteEquipment removes equipment associations for the current user
func (*Session) GetEquipment ¶
GetEquipment fetches a particular equipment by its ID
func (*Session) ListEquipment ¶
ListEquipment retrieves all equipment registered with the MyKubota app
func (*Session) MaintenanceHistory ¶
func (s *Session) MaintenanceHistory(equipmentID string) ([]MaintenanceHistory, error)
func (*Session) RecordMaintenance ¶
func (s *Session) RecordMaintenance(equipmentID string, entry MaintenanceHistory) error
func (*Session) UpdateEquipment ¶
type UpdateEquipmentRequest ¶
type User ¶
type User struct { Email string `json:"email"` PhoneNumber string `json:"phone_number"` EmailVerified bool `json:"email_verified"` MfaEnabled bool `json:"mfa_enabled"` }
User contains basic informations about your MyKubota registration
type VideoEntries ¶
type VideoEntries []VideoEntry