diff --git a/CHANGELOG.md b/CHANGELOG.md index cfe44ff..84dae60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.0.7 - 2024-10-12 - @gabrielg2020 +* Added support for structured responses +* Adapted tests to accept structured response +* Added support for structured responses (renew credentials) +* Added support for structured responses (bulk-download) + ## 1.0.6 - 2024-09-25 - @0xnu * Refinements diff --git a/mothistory.go b/mothistory.go index b7c91db..2f2f970 100644 --- a/mothistory.go +++ b/mothistory.go @@ -78,7 +78,7 @@ var errorMessages = map[int]string{ 504: "Gateway Timeout - The upstream server failed to send a request in the time allowed by the server", } -func doRequest[T any](c *Client, method, endpoint string, queryParams url.Values)(*T, error) { +func doRequest[T any](c *Client, method, endpoint string, queryParams url.Values) (*T, error) { limiterCtx := context.Background() if err := c.dayLimiter.Wait(limiterCtx); err != nil { return nil, fmt.Errorf("daily quota exceeded: %v", err) diff --git a/mothistory_test.go b/mothistory_test.go index b3d1909..59b603c 100644 --- a/mothistory_test.go +++ b/mothistory_test.go @@ -117,7 +117,7 @@ func TestRenewCredentials(t *testing.T) { t.Fatalf("RenewCredentials failed: %v", err) } - if len(data.ClientSecret) == 0 { + if len(data.ClientSecret) == 0 { t.Error("Expected 'clientSecret' length > 0") } } diff --git a/responses.go b/responses.go index 14cd3a0..42ac36b 100644 --- a/responses.go +++ b/responses.go @@ -1,8 +1,9 @@ package mothistory import ( - // "encoding/json" +// "encoding/json" ) + // Response for {baseURL}/[registration|vin]/ type VehicleDetailsResponse struct { Registration string `json:"registration"` @@ -52,4 +53,4 @@ type BulkDelta struct { // Response for v1/trade/[credentials] type ClientSecretResponse struct { ClientSecret string `json:"clientSecret"` -} \ No newline at end of file +}