models

package
v1.2.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateDeviceTypeAttribute added in v0.2.3

type CreateDeviceTypeAttribute struct {
	Name         string   `json:"name"`
	Label        string   `json:"label"`
	Description  string   `json:"description"`
	Type         string   `json:"type"`
	Required     bool     `json:"required"`
	DefaultValue string   `json:"default_value"` //nolint
	Options      []string `json:"options"`
}

type DecodeProviderEnum added in v0.8.6

type DecodeProviderEnum string
const (
	DrivlyProvider   DecodeProviderEnum = "drivly"
	VincarioProvider DecodeProviderEnum = "vincario"
	AutoIsoProvider  DecodeProviderEnum = "autoiso"
	DATGroupProvider DecodeProviderEnum = "dat"
	AllProviders     DecodeProviderEnum = ""
)

type DeviceIntegration added in v0.1.24

type DeviceIntegration struct {
	ID       string                     `json:"id"`
	Type     string                     `json:"type"`
	Style    string                     `json:"style"`
	Vendor   string                     `json:"vendor"`
	Region   string                     `json:"region"`
	Features []DeviceIntegrationFeature `json:"features"`
}

type DeviceIntegrationFeature added in v0.5.6

type DeviceIntegrationFeature struct {
	FeatureKey   string `json:"featureKey"`
	SupportLevel int    `json:"supportLevel"`
}

type DeviceMake

type DeviceMake struct {
	ID                 string              `json:"id"`
	Name               string              `json:"name"`
	LogoURL            null.String         `json:"logo_url"`
	OemPlatformName    null.String         `json:"oem_platform_name"`
	TokenID            *big.Int            `json:"tokenId,omitempty"`
	NameSlug           string              `json:"nameSlug"`
	ExternalIDs        json.RawMessage     `json:"external_ids"`
	ExternalIDsTyped   []*ExternalID       `json:"externalIdsTyped"`
	Metadata           json.RawMessage     `json:"metadata"`
	MetadataTyped      *DeviceMakeMetadata `json:"metadataTyped"`
	HardwareTemplateID null.String         `json:"hardware_template_id"`
	CreatedAt          time.Time           `json:"created_at,omitempty"`
	UpdatedAt          time.Time           `json:"updated_at,omitempty"`
}

type DeviceMakeMetadata added in v0.5.1

type DeviceMakeMetadata struct {
	RideGuideLink string `json:"ride_guide_link"`
}

type DeviceStyle added in v0.1.24

type DeviceStyle struct {
	ID                 string                `json:"id"`
	DeviceDefinitionID string                `json:"deviceDefinitionId"`
	Name               string                `json:"name"`
	ExternalStyleID    string                `json:"externalStyleId"`
	Source             string                `json:"source"`
	SubModel           string                `json:"subModel"`
	HardwareTemplateID string                `json:"hardware_template_id"`
	Metadata           []DeviceTypeAttribute `json:"metadata"`
}

type DeviceType

type DeviceType struct {
	// Type is eg. Vehicle, E-bike, roomba
	Type      string   `json:"type"`
	Make      string   `json:"make"`
	Model     string   `json:"model"`
	Year      int      `json:"year"`
	SubModels []string `json:"subModels"`
	MakeSlug  string   `json:"makeSlug"`
	ModelSlug string   `json:"modelSlug"`
}

DeviceType whether it is a vehicle or other type and basic information

type DeviceTypeAttribute added in v0.2.0

type DeviceTypeAttribute struct {
	Name        string   `json:"name"`
	Label       string   `json:"label"`
	Description string   `json:"description"`
	Type        string   `json:"type"`
	Required    bool     `json:"required"`
	Value       string   `json:"value"`
	Option      []string `json:"options"`
}

type DrivlyData added in v1.0.14

type DrivlyData struct {
	VIN   string `json:"vin"`
	Make  string `json:"make"`
	Model string `json:"model"`
	Fuel  string `json:"fuel"`
}

type ExternalID added in v0.3.3

type ExternalID struct {
	Vendor string `json:"vendor"`
	ID     string `json:"id"`
}

type GetDeviceDefinitionHardwareTemplateQueryResult added in v0.6.8

type GetDeviceDefinitionHardwareTemplateQueryResult struct {
	TemplateID string `json:"template_id"`
}

type GetDeviceDefinitionQueryResult

type GetDeviceDefinitionQueryResult struct {
	DeviceDefinitionID string        `json:"deviceDefinitionId"`
	NameSlug           string        `json:"nameSlug"`
	ExternalID         string        `json:"external_id"`
	Name               string        `json:"name"`
	ImageURL           string        `json:"imageUrl"`
	Source             string        `json:"source"`
	HardwareTemplateID string        `json:"hardware_template_id"`
	DeviceMake         DeviceMake    `json:"make"`
	Type               DeviceType    `json:"type"`
	VehicleInfo        VehicleInfo   `json:"vehicleData,omitempty"`
	Metadata           []byte        `json:"metadata"`
	Verified           bool          `json:"verified"`
	ExternalIDs        []*ExternalID `json:"externalIds"`
	// DeviceIntegrations has integrations this vehicle can integrate with, from table device_integrations
	DeviceIntegrations     []DeviceIntegration   `json:"deviceIntegrations"`
	CompatibleIntegrations []DeviceIntegration   `json:"compatibleIntegrations"`
	DeviceStyles           []DeviceStyle         `json:"deviceStyles"`
	DeviceAttributes       []DeviceTypeAttribute `json:"deviceAttributes"`
}

type GetDeviceDefinitionStyleQueryResult added in v1.0.15

type GetDeviceDefinitionStyleQueryResult struct {
	DeviceAttributes []DeviceTypeAttribute `json:"deviceAttributes"`
}

type GetDeviceStyleQueryResult added in v0.1.27

type GetDeviceStyleQueryResult struct {
	ID                 string                              `json:"id"`
	DeviceDefinitionID string                              `json:"device_definition_id"`
	DeviceDefinition   GetDeviceDefinitionStyleQueryResult `json:"device_definition"`
	Name               string                              `json:"name"`
	ExternalStyleID    string                              `json:"external_style_id"`
	Source             string                              `json:"source"`
	SubModel           string                              `json:"sub_model"`
	HardwareTemplateID string                              `json:"hardware_template_id"`
}

type GetDeviceTypeAttributeQueryResult added in v0.2.0

type GetDeviceTypeAttributeQueryResult struct {
	Name         string   `json:"name"`
	Label        string   `json:"label"`
	Description  string   `json:"description"`
	Type         string   `json:"type"`
	Required     bool     `json:"required"`
	DefaultValue string   `json:"default_value"` //nolint
	Options      []string `json:"options"`
}

type GetDeviceTypeQueryResult added in v0.2.0

type GetDeviceTypeQueryResult struct {
	ID          string                              `json:"id"`
	Name        string                              `json:"name"`
	Metadatakey string                              `json:"metadata_key"`
	Attributes  []GetDeviceTypeAttributeQueryResult `json:"attributes"`
}

type GetIntegrationFeatureQueryResult added in v0.3.5

type GetIntegrationFeatureQueryResult struct {
	FeatureKey      string    `json:"feature_key"`
	ElasticProperty string    `json:"elastic_property"`
	DisplayName     string    `json:"display_name"`
	CSSIcon         string    `json:"css_icon,omitempty"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
	FeatureWeight   float64   `json:"feature_weight,omitempty"`
}

type GetIntegrationQueryResult added in v0.1.26

type GetIntegrationQueryResult struct {
	ID                           string                 `json:"id"`
	Type                         string                 `json:"type"`
	Style                        string                 `json:"style"`
	Vendor                       string                 `json:"vendor"`
	AutoPiDefaultTemplateID      int                    `json:"auto_pi_default_template_id"`
	RefreshLimitSecs             int                    `json:"refresh_limit_secs"`
	AutoPiPowertrainToTemplateID map[PowertrainType]int `json:"auto_pi_power_train_to_template_id,omitempty"`
	TokenID                      int                    `json:"token_id"`
	Points                       int                    `json:"points"`
	ManufacturerTokenID          int                    `json:"manufacturer_token_id"`
}

type IntegrationsMetadata added in v0.1.10

type IntegrationsMetadata struct {
	AutoPiDefaultTemplateID      int                    `json:"autoPiDefaultTemplateId"`
	AutoPiPowertrainToTemplateID map[PowertrainType]int `json:"autoPiPowertrainToTemplateId,omitempty"`
}

IntegrationsMetadata represents json stored in integrations table metadata jsonb column

type PowerTrainType added in v1.0.14

type PowerTrainType struct {
	Name    string   `yaml:"name"`
	Type    string   `yaml:"type"`
	Default bool     `yaml:"default"`
	Makes   []string `yaml:"makes"`
	Models  []string `yaml:"models"`
}

type PowerTrainTypeOptionData added in v1.0.14

type PowerTrainTypeOptionData struct {
	Type   string   `yaml:"type"`
	Values []string `yaml:"values"`
}

type PowerTrainTypeRuleData added in v1.0.14

type PowerTrainTypeRuleData struct {
	PowerTrainTypeList []PowerTrainType           `yaml:"types"`
	DrivlyList         []PowerTrainTypeOptionData `yaml:"drivly"`
	VincarioList       []PowerTrainTypeOptionData `yaml:"vincario"`
}

type PowertrainType added in v0.1.10

type PowertrainType string
const (
	ICE  PowertrainType = "ICE"
	HEV  PowertrainType = "HEV"
	PHEV PowertrainType = "PHEV"
	BEV  PowertrainType = "BEV"
	FCEV PowertrainType = "FCEV"
)

func (PowertrainType) String added in v0.1.10

func (p PowertrainType) String() string

func (*PowertrainType) UnmarshalJSON added in v0.1.10

func (p *PowertrainType) UnmarshalJSON(b []byte) error

type UpdateDeviceIntegrationFeatureAttribute added in v0.5.6

type UpdateDeviceIntegrationFeatureAttribute struct {
	FeatureKey   string `json:"featureKey"`
	SupportLevel int16  `json:"supportLevel"`
}

type UpdateDeviceTypeAttribute added in v0.2.0

type UpdateDeviceTypeAttribute struct {
	// Name should match one of the name keys in the allowed device_types.properties
	Name  string `json:"name"`
	Value string `json:"value"`
}

type VINDecodingInfoData added in v0.7.9

type VINDecodingInfoData struct {
	VIN        string
	Make       string
	Model      string
	SubModel   string
	Year       int32
	StyleName  string
	Source     DecodeProviderEnum
	ExternalID string
	MetaData   null.JSON
	Raw        []byte
	FuelType   string
}

type VehicleInfo added in v0.1.24

type VehicleInfo struct {
	FuelType            string `json:"fuel_type,omitempty"`
	DrivenWheels        string `json:"driven_wheels,omitempty"`
	NumberOfDoors       string `json:"number_of_doors,omitempty"`
	BaseMSRP            int    `json:"base_msrp,omitempty"`
	EPAClass            string `json:"epa_class,omitempty"`
	VehicleType         string `json:"vehicle_type,omitempty"` // VehicleType PASSENGER CAR, from NHTSA
	MPGHighway          string `json:"mpg_highway,omitempty"`
	MPGCity             string `json:"mpg_city,omitempty"`
	FuelTankCapacityGal string `json:"fuel_tank_capacity_gal,omitempty"`
	MPG                 string `json:"mpg,omitempty"`
}

VehicleInfo represents some standard vehicle specific properties stored in the metadata json field in DB

type VincarioData added in v1.0.14

type VincarioData struct {
	VIN      string `json:"VIN"`
	Make     string `json:"Make"`
	Model    string `json:"Model"`
	FuelType string `json:"FuelType"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL