Skip to content

Commit

Permalink
feat(orders): add Approvals, ShipmentConfirmation
Browse files Browse the repository at this point in the history
Add new Amazon API changes of the orders-api and minor refactorings.

Changelog:

* fix: installation url in README.md

* feat: add Set in internal utils pkg

* feat: add approvals and shipmentConfirmation to OrdersAPI

* feat: add new types in orders model.go

* refactor: use enums in orders api with sets

* fix(orders)!: add missing callResponse return
  Applies to
  + `UpdateOrderItemsApprovals`
  + `ConfirmShipment`
  • Loading branch information
Coffeeri committed Apr 25, 2023
1 parent 547cffa commit ee099fd
Show file tree
Hide file tree
Showing 10 changed files with 554 additions and 126 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Golang client implementation to the [Amazon SP-API](https://developer-docs.amazo
## Installation

```shell
go get -u https://github.com/fond-of-vertigo/amazon-sp-api
go get -u github.com/fond-of-vertigo/amazon-sp-api
```

## API-Endpoints coverage
Expand Down
7 changes: 4 additions & 3 deletions apis/feeds/model.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package feeds

import (
"github.com/fond-of-vertigo/amazon-sp-api/internal/utils"
"net/url"
"strconv"
"strings"
Expand Down Expand Up @@ -100,13 +101,13 @@ type GetFeedsRequestFilter struct {
func (f *GetFeedsRequestFilter) GetQuery() url.Values {
q := url.Values{}

feedTypes := strings.Join(apis.FirstNElementsOfSlice(f.FeedTypes, 10), ",")
feedTypes := strings.Join(utils.FirstNElementsOfSlice(f.FeedTypes, 10), ",")
if feedTypes != "" {
q.Set("feedTypes", feedTypes)
}

topTenMarketplaceIDs := apis.FirstNElementsOfSlice(f.MarketplaceIDs, 10)
marketplaceIds := apis.MapToCommaString(topTenMarketplaceIDs)
topTenMarketplaceIDs := utils.FirstNElementsOfSlice(f.MarketplaceIDs, 10)
marketplaceIds := utils.MapToCommaString(topTenMarketplaceIDs)
if marketplaceIds != "" {
q.Set("marketplaceIds", marketplaceIds)
}
Expand Down
Loading

0 comments on commit ee099fd

Please sign in to comment.