models

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataPullStatusEnum added in v0.2.13

type DataPullStatusEnum string
const (
	// PulledInfoAndValuationStatus means we pulled vin, edmunds, build and valuations
	PulledInfoAndValuationStatus DataPullStatusEnum = "PulledAll"
	// PulledValuationDrivlyStatus means we only pulled offers and pricing
	PulledValuationDrivlyStatus   DataPullStatusEnum = "PulledValuations"
	PulledValuationVincarioStatus DataPullStatusEnum = "PulledValuationVincario"
	SkippedDataPullStatus         DataPullStatusEnum = "Skipped"
	ErrorDataPullStatus           DataPullStatusEnum = "Error"
)

type DeviceDefinition added in v0.5.3

type DeviceDefinition struct {
	Model        string       `json:"model"`
	Year         int          `json:"year"`
	Manufacturer Manufacturer `json:"manufacturer"`
	ImageURI     string       `json:"imageURI"`
	Attributes   []struct {
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"attributes"`
}

type DeviceOffer added in v0.2.0

type DeviceOffer struct {
	// Contains a list of offer sets, one for each source
	OfferSets []OfferSet `json:"offerSets"`
}

type DeviceValuation added in v0.2.0

type DeviceValuation struct {
	// Contains a list of valuation sets, one for each vendor
	ValuationSets []ValuationSet `json:"valuationSets"`
}

type DrivlyVINSummary added in v0.5.3

type DrivlyVINSummary struct {
	Pricing   map[string]interface{}
	Offers    map[string]interface{}
	AutoCheck map[string]interface{}
	Build     map[string]interface{}
	Cargurus  map[string]interface{}
	Carvana   map[string]interface{}
	Carmax    map[string]interface{}
	Carstory  map[string]interface{}
	Edmunds   map[string]interface{}
	TMV       map[string]interface{}
	KBB       map[string]interface{}
	VRoom     map[string]interface{}
}

type GraphQLRequest added in v0.5.3

type GraphQLRequest struct {
	Query string `json:"query"`
}

type LocationResponse added in v0.5.3

type LocationResponse struct {
	// PostalCode is the postal code of the location or ZIP Code in the USA
	PostalCode string `json:"postalCode"`
	// CountryCode is the ISO 3166-1 alpha-2 country code
	CountryCode string `json:"countryCode"`
}

type Manufacturer added in v0.5.3

type Manufacturer struct {
	TokenID int    `json:"tokenId"`
	Name    string `json:"name"`
	TableID int    `json:"tableId"`
	Owner   string `json:"owner"`
}

type OdometerMeasurementEnum added in v0.3.9

type OdometerMeasurementEnum string

OdometerMeasurementEnum is a custom type for representing different types of odometer measurements.

const (
	// Real indicates the odometer measurement is actual.
	Real OdometerMeasurementEnum = "Real"

	// Estimated indicates the odometer measurement is an estimate.
	Estimated OdometerMeasurementEnum = "Estimated"

	// Market indicates the odometer measurement is based on market trends.
	Market OdometerMeasurementEnum = "Market"
)

func (OdometerMeasurementEnum) String added in v0.3.9

func (ome OdometerMeasurementEnum) String() string

String returns the string representation of the OdometerMeasurementEnum.

type Offer added in v0.2.0

type Offer struct {
	// The vendor of the offer (eg. "carmax", "carvana", etc.)
	Vendor string `json:"vendor"`
	// The offer price from the vendor
	Price int `json:"price,omitempty"`
	// The offer URL from the vendor
	URL string `json:"url,omitempty"`
	// An error from the vendor (eg. when the VIN is invalid)
	Error string `json:"error,omitempty"`
	// The grade of the offer from the vendor (eg. "RETAIL")
	Grade string `json:"grade,omitempty"`
	// The reason the offer was declined from the vendor
	DeclineReason string `json:"declineReason,omitempty"`
}

type OfferSet added in v0.2.0

type OfferSet struct {
	// The source of the offers (eg. "drivly")
	Source string `json:"source"`
	// The time the offers were pulled
	Updated string `json:"updated,omitempty"`
	// The mileage used for the offers
	Mileage int `json:"mileage,omitempty"`
	// Whether estimated, real, or from the market (eg. vincario). Market, Estimated, Real
	OdometerMeasurementType OdometerMeasurementEnum `json:"odometerMeasurementType"`
	// This will be the zip code used (if any) for the offers request regardless if the source uses it
	ZipCode string `json:"zipCode,omitempty"`
	// Contains a list of offers from the source
	Offers []Offer `json:"offers"`
}

func DecodeOfferFromJSON added in v0.2.3

func DecodeOfferFromJSON(drivlyJSON []byte) OfferSet

type SignalsLatest added in v0.5.3

type SignalsLatest struct {
	PowertrainTransmissionTravelledDistance TimeFloatValue `json:"powertrainTransmissionTravelledDistance"`
	CurrentLocationLatitude                 TimeFloatValue `json:"currentLocationLatitude"`
	CurrentLocationLongitude                TimeFloatValue `json:"currentLocationLongitude"`
}

type TimeFloatValue added in v0.5.3

type TimeFloatValue struct {
	Timestamp time.Time `json:"timestamp"`
	Value     float64   `json:"value"`
}

type ValuationRequestData added in v0.5.3

type ValuationRequestData struct {
	Mileage *float64 `json:"mileage,omitempty"`
	ZipCode *string  `json:"zipCode,omitempty"`
}

type ValuationSet added in v0.2.0

type ValuationSet struct {
	// The source of the valuation (eg. "drivly" or "blackbook")
	Vendor string `json:"vendor"`
	// The time the valuation was pulled or in the case of blackbook, this may be the event time of the device odometer which was used for the valuation
	Updated string `json:"updated,omitempty"`
	// The mileage used for the valuation
	Mileage int `json:"mileage,omitempty"`
	// This will be the zip code used (if any) for the valuation request regardless if the vendor uses it
	ZipCode string `json:"zipCode,omitempty"`
	// Useful when Drivly returns multiple vendors and we've selected one (eg. "drivly:blackbook")
	TradeInSource string `json:"tradeInSource,omitempty"`
	// tradeIn is equal to tradeInAverage when available
	TradeIn int `json:"tradeIn,omitempty"`
	// tradeInClean, tradeInAverage, and tradeInRough my not always be available
	TradeInClean   int `json:"tradeInClean,omitempty"`
	TradeInAverage int `json:"tradeInAverage,omitempty"`
	TradeInRough   int `json:"tradeInRough,omitempty"`
	// Useful when Drivly returns multiple vendors and we've selected one (eg. "drivly:blackbook")
	RetailSource string `json:"retailSource,omitempty"`
	// retail is equal to retailAverage when available
	Retail int `json:"retail,omitempty"`
	// retailClean, retailAverage, and retailRough my not always be available
	RetailClean   int    `json:"retailClean,omitempty"`
	RetailAverage int    `json:"retailAverage,omitempty"`
	RetailRough   int    `json:"retailRough,omitempty"`
	OdometerUnit  string `json:"odometerUnit"`
	// Odometer used for calculating values
	Odometer int `json:"odometer"`
	// whether estimated, real, or from the market (eg. vincario). Market, Estimated, Real
	OdometerMeasurementType OdometerMeasurementEnum `json:"odometerMeasurementType"`
	// UserDisplayPrice the top level value to show to users in mobile app
	UserDisplayPrice int `json:"userDisplayPrice"`
	// eg. USD or EUR
	Currency string `json:"currency"`
}

type Vehicle added in v0.5.3

type Vehicle struct {
	ID         string `json:"id"`
	Definition struct {
		ID    string `json:"id"`
		Make  string `json:"make"`
		Model string `json:"model"`
		Year  int    `json:"year"`
	} `json:"definition"`
	Owner string `json:"owner"`
}

type VinVCLatest added in v0.5.3

type VinVCLatest struct {
	Vin         string    `json:"vin"`
	RecordedBy  string    `json:"recordedBy"`
	RecordedAt  time.Time `json:"recordedAt"`
	CountryCode string    `json:"countryCode"`
	ValidFrom   time.Time `json:"validFrom"`
	ValidTo     time.Time `json:"validTo"`
}

type VincarioMarketValueResponse added in v0.5.3

type VincarioMarketValueResponse struct {
	Vin           string `json:"vin"`
	Price         int    `json:"price"`
	PriceCurrency string `json:"price_currency"`
	Balance       struct {
		APIDecode             int `json:"API Decode"`
		APIStolenCheck        int `json:"API Stolen Check"`
		APIVehicleMarketValue int `json:"API Vehicle Market Value"`
		APIOEMVINLookup       int `json:"API OEM VIN Lookup"`
	} `json:"balance"`
	// nolint
	Vehicle struct {
		VehicleId int    `json:"vehicle_id"`
		Make      string `json:"make"`
		MakeId    int    `json:"make_id"`
		Model     string `json:"model"`
		ModelId   int    `json:"model_id"`
		ModelYear int    `json:"model_year"`
	} `json:"vehicle"`
	Period struct {
		From string `json:"from"`
		To   string `json:"to"`
	} `json:"period"`
	MarketPrice struct {
		Europe struct {
			PriceCount    int    `json:"price_count"`
			PriceCurrency string `json:"price_currency"`
			PriceBelow    int    `json:"price_below"`
			PriceMedian   int    `json:"price_median"`
			PriceAvg      int    `json:"price_avg"`
			PriceAbove    int    `json:"price_above"`
			PriceStdev    int    `json:"price_stdev"`
		} `json:"europe"`
		NorthAmerica struct {
			PriceCount    int    `json:"price_count"`
			PriceCurrency string `json:"price_currency"`
			PriceBelow    int    `json:"price_below"`
			PriceMedian   int    `json:"price_median"`
			PriceAvg      int    `json:"price_avg"`
			PriceAbove    int    `json:"price_above"`
			PriceStdev    int    `json:"price_stdev"`
		} `json:"north_america"`
	} `json:"market_price"`
	MarketOdometer struct {
		Europe struct {
			OdometerCount  int    `json:"odometer_count"`
			OdometerUnit   string `json:"odometer_unit"`
			OdometerMedian int    `json:"odometer_median"`
			OdometerAvg    int    `json:"odometer_avg"`
			OdometerStdev  int    `json:"odometer_stdev"`
		} `json:"europe"`
		NorthAmerica struct {
			OdometerCount  int    `json:"odometer_count"`
			OdometerUnit   string `json:"odometer_unit"`
			OdometerMedian int    `json:"odometer_median"`
			OdometerAvg    int    `json:"odometer_avg"`
			OdometerStdev  int    `json:"odometer_stdev"`
		} `json:"north_america"`
	} `json:"market_odometer"`
	Records []struct {
		Market        string `json:"market"`
		Continent     string `json:"continent"`
		Price         int    `json:"price"`
		PriceCurrency string `json:"price_currency"`
		Odometer      int    `json:"odometer,omitempty"`
		OdometerUnit  string `json:"odometer_unit,omitempty"`
	} `json:"records"`
}

Jump to

Keyboard shortcuts

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