Skip to content

Commit

Permalink
Merge pull request #26 from 0xnu/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
0xnu authored Oct 12, 2024
2 parents fd8d215 + 88d9cdd commit abda9b0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion mothistory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion mothistory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand Down
5 changes: 3 additions & 2 deletions responses.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package mothistory

import (
// "encoding/json"
// "encoding/json"
)

// Response for {baseURL}/[registration|vin]/<registration|vin>
type VehicleDetailsResponse struct {
Registration string `json:"registration"`
Expand Down Expand Up @@ -52,4 +53,4 @@ type BulkDelta struct {
// Response for v1/trade/[credentials]
type ClientSecretResponse struct {
ClientSecret string `json:"clientSecret"`
}
}

0 comments on commit abda9b0

Please sign in to comment.