ScaleLeap / amazon-advertising-api-sdk

Amazon Advertising API TypeScript and Node.js Unofficial SDK
https://npm.im/@scaleleap/amazon-advertising-api-sdk
MIT License
26 stars 21 forks source link

KeywordResponseStatusEnum is not used anywhere correctly #345

Closed moltar closed 4 years ago

moltar commented 4 years ago

It isn't used anywhere as a type, just only as a reference in tests.

https://github.com/ScaleLeap/amazon-advertising-api-sdk/blob/17d78d9d8ad2b8b9972c25b7ab69bca7dfb99bee/src/operations/keywords/types.ts#L53

E.g. used here:

https://github.com/ScaleLeap/amazon-advertising-api-sdk/blob/17d78d9d8ad2b8b9972c25b7ab69bca7dfb99bee/test/operations/keywords/sponsored-products-ad-group-keywords-operation.test.ts#L65

And res.code should be of KeywordResponseStatusEnum type.

Please fix this when refactoring enums to union of strings.

And please make sure to use discriminated union types.

moltar commented 4 years ago

Same for NegativeKeywordResponseStatusEnum.

nguyentoanit commented 4 years ago

I have resolved them in PR #341 already: