-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from gabrielg2020/structured-repsonses
feat: structured responses
- Loading branch information
Showing
5 changed files
with
94 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package mothistory | ||
|
||
import ( | ||
// "encoding/json" | ||
) | ||
// Response for {baseURL}/[registration|vin]/<registration|vin> | ||
type VehicleDetailsResponse struct { | ||
Registration string `json:"registration"` | ||
Make string `json:"make"` | ||
FirstUsedDate string `json:"firstUsedDate"` | ||
FuelType string `json:"fuelType"` | ||
PrimaryColour string `json:"primaryColour"` | ||
RegistrationDate string `json:"registrationDate"` | ||
ManufactureDate string `json:"manufactureDate"` | ||
EngineSize string `json:"engineSize"` | ||
HasOutstandingRecall string `json:"hasOutstandingRecall"` | ||
MotTests []MOTTest `json:"motTests"` | ||
} | ||
|
||
type MOTTest struct { | ||
CompletedDate string `json:"completedDate"` | ||
TestResult string `json:"testResult"` | ||
ExpiryDate string `json:"expiryDate"` | ||
OdometerValue string `json:"odometerValue"` | ||
OdometerUnit string `json:"odometerUnit"` | ||
OdometerResultType string `json:"odometerResultType"` | ||
MotTestNumber string `json:"motTestNumber"` | ||
DataSource string `json:"dataSource"` | ||
Location string `json:"location,omitempty"` // Optional field | ||
Defects []Defect `json:"defects,omitempty"` // Optional field | ||
} | ||
|
||
type Defect struct { | ||
Text string `json:"text"` | ||
TypeOfDefect string `json:"type"` | ||
Dangerous bool `json:"dangerous"` | ||
} | ||
|
||
// Response for {baseURL}/[bulk-download] | ||
type BulkDownloadResponse struct { | ||
Bulk []BulkDelta `json:"bulk"` | ||
Delta []BulkDelta `json:"delta"` | ||
} | ||
|
||
type BulkDelta struct { | ||
Filename string `json:"filename"` | ||
DownloadURL string `json:"downloadUrl"` | ||
FileSize int `json:"fileSize"` | ||
FileCreatedOn string `json:"fileCreatedOn"` | ||
} | ||
|
||
// Response for v1/trade/[credentials] | ||
type ClientSecretResponse struct { | ||
ClientSecret string `json:"clientSecret"` | ||
} |