diff --git a/__MACOSX/._paapi5-nodejs-sdk-example b/__MACOSX/._paapi5-nodejs-sdk-example new file mode 100644 index 0000000..a4ad555 Binary files /dev/null and b/__MACOSX/._paapi5-nodejs-sdk-example differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/._COPYING.txt b/__MACOSX/paapi5-nodejs-sdk-example/._COPYING.txt new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/._COPYING.txt differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/._LICENSE.txt b/__MACOSX/paapi5-nodejs-sdk-example/._LICENSE.txt new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/._LICENSE.txt differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/._NOTICE.txt b/__MACOSX/paapi5-nodejs-sdk-example/._NOTICE.txt new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/._NOTICE.txt differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/._README.md b/__MACOSX/paapi5-nodejs-sdk-example/._README.md new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/._README.md differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/._package.json b/__MACOSX/paapi5-nodejs-sdk-example/._package.json new file mode 100644 index 0000000..133c544 Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/._package.json differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/._sampleGetBrowseNodesApi.js b/__MACOSX/paapi5-nodejs-sdk-example/._sampleGetBrowseNodesApi.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/._sampleGetBrowseNodesApi.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/._sampleGetItemsApi.js b/__MACOSX/paapi5-nodejs-sdk-example/._sampleGetItemsApi.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/._sampleGetItemsApi.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/._sampleGetVariationsApi.js b/__MACOSX/paapi5-nodejs-sdk-example/._sampleGetVariationsApi.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/._sampleGetVariationsApi.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/._sampleSearchItemsApi.js b/__MACOSX/paapi5-nodejs-sdk-example/._sampleSearchItemsApi.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/._sampleSearchItemsApi.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/._src b/__MACOSX/paapi5-nodejs-sdk-example/._src new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/._src differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/._test b/__MACOSX/paapi5-nodejs-sdk-example/._test new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/._test differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/._ApiClient.js b/__MACOSX/paapi5-nodejs-sdk-example/src/._ApiClient.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/._ApiClient.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/._api b/__MACOSX/paapi5-nodejs-sdk-example/src/._api new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/._api differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/._auth b/__MACOSX/paapi5-nodejs-sdk-example/src/._auth new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/._auth differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/._index.js b/__MACOSX/paapi5-nodejs-sdk-example/src/._index.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/._index.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/._model b/__MACOSX/paapi5-nodejs-sdk-example/src/._model new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/._model differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/api/._DefaultApi.js b/__MACOSX/paapi5-nodejs-sdk-example/src/api/._DefaultApi.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/api/._DefaultApi.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/auth/._SignHelper.js b/__MACOSX/paapi5-nodejs-sdk-example/src/auth/._SignHelper.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/auth/._SignHelper.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Availability.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Availability.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Availability.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNode.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNode.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNode.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNodeAncestor.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNodeAncestor.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNodeAncestor.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNodeChild.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNodeChild.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNodeChild.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNodeInfo.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNodeInfo.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNodeInfo.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNodesResult.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNodesResult.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._BrowseNodesResult.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ByLineInfo.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ByLineInfo.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ByLineInfo.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Classifications.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Classifications.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Classifications.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Condition.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Condition.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Condition.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ContentInfo.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ContentInfo.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ContentInfo.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ContentRating.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ContentRating.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ContentRating.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Contributor.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Contributor.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Contributor.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._CustomerReviews.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._CustomerReviews.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._CustomerReviews.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._DeliveryFlag.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._DeliveryFlag.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._DeliveryFlag.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._DimensionBasedAttribute.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._DimensionBasedAttribute.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._DimensionBasedAttribute.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._DurationPrice.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._DurationPrice.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._DurationPrice.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ErrorData.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ErrorData.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ErrorData.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ExternalIds.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ExternalIds.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ExternalIds.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetBrowseNodesRequest.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetBrowseNodesRequest.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetBrowseNodesRequest.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetBrowseNodesResource.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetBrowseNodesResource.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetBrowseNodesResource.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetBrowseNodesResponse.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetBrowseNodesResponse.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetBrowseNodesResponse.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetItemsRequest.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetItemsRequest.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetItemsRequest.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetItemsResource.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetItemsResource.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetItemsResource.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetItemsResponse.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetItemsResponse.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetItemsResponse.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetVariationsRequest.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetVariationsRequest.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetVariationsRequest.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetVariationsResource.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetVariationsResource.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetVariationsResource.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetVariationsResponse.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetVariationsResponse.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._GetVariationsResponse.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ImageSize.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ImageSize.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ImageSize.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ImageType.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ImageType.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ImageType.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Images.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Images.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Images.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Item.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Item.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Item.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ItemIdType.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ItemIdType.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ItemIdType.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ItemInfo.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ItemInfo.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ItemInfo.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ItemsResult.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ItemsResult.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ItemsResult.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._LanguageType.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._LanguageType.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._LanguageType.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Languages.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Languages.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Languages.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ManufactureInfo.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ManufactureInfo.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ManufactureInfo.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MaxPrice.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MaxPrice.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MaxPrice.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Merchant.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Merchant.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Merchant.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MinPrice.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MinPrice.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MinPrice.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MinReviewsRating.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MinReviewsRating.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MinReviewsRating.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MinSavingPercent.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MinSavingPercent.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MinSavingPercent.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MultiValuedAttribute.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MultiValuedAttribute.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._MultiValuedAttribute.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferAvailability.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferAvailability.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferAvailability.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferCondition.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferCondition.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferCondition.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferConditionNote.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferConditionNote.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferConditionNote.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferCount.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferCount.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferCount.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferDeliveryInfo.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferDeliveryInfo.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferDeliveryInfo.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferListing.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferListing.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferListing.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferLoyaltyPoints.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferLoyaltyPoints.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferLoyaltyPoints.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferMerchantInfo.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferMerchantInfo.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferMerchantInfo.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferPrice.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferPrice.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferPrice.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferProgramEligibility.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferProgramEligibility.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferProgramEligibility.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferPromotion.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferPromotion.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferPromotion.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferSavings.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferSavings.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferSavings.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferShippingCharge.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferShippingCharge.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferShippingCharge.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferSubCondition.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferSubCondition.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferSubCondition.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferSummary.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferSummary.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._OfferSummary.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Offers.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Offers.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Offers.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._PartnerType.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._PartnerType.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._PartnerType.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Price.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Price.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Price.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._PriceType.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._PriceType.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._PriceType.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ProductAdvertisingAPIClientException.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ProductAdvertisingAPIClientException.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ProductAdvertisingAPIClientException.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ProductAdvertisingAPIServiceException.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ProductAdvertisingAPIServiceException.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ProductAdvertisingAPIServiceException.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ProductInfo.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ProductInfo.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._ProductInfo.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Properties.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Properties.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Properties.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Rating.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Rating.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Rating.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Refinement.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Refinement.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._Refinement.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._RefinementBin.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._RefinementBin.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._RefinementBin.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._RentalOfferListing.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._RentalOfferListing.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._RentalOfferListing.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._RentalOffers.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._RentalOffers.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._RentalOffers.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchItemsRequest.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchItemsRequest.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchItemsRequest.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchItemsResource.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchItemsResource.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchItemsResource.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchItemsResponse.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchItemsResponse.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchItemsResponse.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchRefinements.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchRefinements.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchRefinements.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchResult.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchResult.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SearchResult.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SingleBooleanValuedAttribute.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SingleBooleanValuedAttribute.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SingleBooleanValuedAttribute.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SingleIntegerValuedAttribute.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SingleIntegerValuedAttribute.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SingleIntegerValuedAttribute.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SingleStringValuedAttribute.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SingleStringValuedAttribute.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SingleStringValuedAttribute.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SortBy.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SortBy.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._SortBy.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._TechnicalInfo.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._TechnicalInfo.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._TechnicalInfo.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._TradeInInfo.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._TradeInInfo.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._TradeInInfo.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._TradeInPrice.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._TradeInPrice.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._TradeInPrice.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._UnitBasedAttribute.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._UnitBasedAttribute.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._UnitBasedAttribute.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._VariationAttribute.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._VariationAttribute.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._VariationAttribute.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._VariationDimension.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._VariationDimension.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._VariationDimension.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._VariationSummary.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._VariationSummary.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._VariationSummary.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._VariationsResult.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._VariationsResult.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._VariationsResult.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/src/model/._WebsiteSalesRank.js b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._WebsiteSalesRank.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/src/model/._WebsiteSalesRank.js differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/test/._api b/__MACOSX/paapi5-nodejs-sdk-example/test/._api new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/test/._api differ diff --git a/__MACOSX/paapi5-nodejs-sdk-example/test/api/._DefaultApi.spec.js b/__MACOSX/paapi5-nodejs-sdk-example/test/api/._DefaultApi.spec.js new file mode 100644 index 0000000..f92f7ec Binary files /dev/null and b/__MACOSX/paapi5-nodejs-sdk-example/test/api/._DefaultApi.spec.js differ diff --git a/paapi5-nodejs-sdk-example/COPYING.txt b/paapi5-nodejs-sdk-example/COPYING.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/paapi5-nodejs-sdk-example/COPYING.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/paapi5-nodejs-sdk-example/LICENSE.txt b/paapi5-nodejs-sdk-example/LICENSE.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/paapi5-nodejs-sdk-example/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/paapi5-nodejs-sdk-example/NOTICE.txt b/paapi5-nodejs-sdk-example/NOTICE.txt new file mode 100644 index 0000000..648f0ea --- /dev/null +++ b/paapi5-nodejs-sdk-example/NOTICE.txt @@ -0,0 +1,2 @@ +Product Advertising API 5.0 SDK for NodeJS +Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. \ No newline at end of file diff --git a/paapi5-nodejs-sdk-example/README.md b/paapi5-nodejs-sdk-example/README.md new file mode 100644 index 0000000..7a1b3fd --- /dev/null +++ b/paapi5-nodejs-sdk-example/README.md @@ -0,0 +1,165 @@ +# Product Advertising API 5.0 SDK for NodeJS + +[![NPM](https://nodei.co/npm/paapi5-nodejs-sdk.svg?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/paapi5-nodejs-sdk/) + +[![Version](https://badge.fury.io/js/paapi5-nodejs-sdk.svg)](http://badge.fury.io/js/paapi5-nodejs-sdk) [![npm](https://img.shields.io/npm/dt/paapi5-nodejs-sdk.svg)](https://www.npmjs.com/package/paapi5-nodejs-sdk) + +This repository contains the official Product Advertising API 5.0 NodeJS SDK called **paapi5-nodejs-sdk** that allows you to access the [Product Advertising API](https://webservices.amazon.com/paapi5/documentation/index.html) from your NodeJS app. + +## Installation + +### For [Node.js](https://nodejs.org/) + +The Product Advertising API NodeJS SDK can be installed via [npm](https://www.npmjs.com/package/paapi5-nodejs-sdk): + +```shell +npm install paapi5-nodejs-sdk --save +``` + +You should now be able to `require('paapi5-nodejs-sdk')` in javascript files. + +### For browser + +The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following +the above steps with Node.js and installing browserify with `npm install -g browserify`, +perform the following (assuming *main.js* is your entry file, that's to say your javascript file where you actually +use this library): + +```shell +browserify main.js > bundle.js +``` + +Then include *bundle.js* in the HTML pages. + +### Webpack Configuration + +Using Webpack you may encounter the following error: "Module not found: Error: +Cannot resolve module", most certainly you should disable AMD loader. Add/merge +the following section to your webpack config: + +```javascript +module: { + rules: [ + { + parser: { + amd: false + } + } + ] +} +``` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following JS code: + +Simple example for [SearchItems](https://webservices.amazon.com/paapi5/documentation/search-items.html) to discover Amazon products with the keyword 'Harry Potter' in Books category: + +```javascript +var ProductAdvertisingAPIv1 = require('paapi5-nodejs-sdk'); + +var defaultClient = ProductAdvertisingAPIv1.ApiClient.instance; + +// Specify your credentials here. These are used to create and sign the request. +defaultClient.accessKey = ''; +defaultClient.secretKey = ''; + +/** + * PAAPI Host and Region to which you want to send request. + * For more details refer: https://webservices.amazon.com/paapi5/documentation/common-request-parameters.html#host-and-region + */ +defaultClient.host = 'webservices.amazon.com'; +defaultClient.region = 'us-east-1'; + +var api = new ProductAdvertisingAPIv1.DefaultApi(); + +// Request Initialization + +var searchItemsRequest = new ProductAdvertisingAPIv1.SearchItemsRequest(); + +/** Enter your partner tag (store/tracking id) and partner type */ +searchItemsRequest['PartnerTag'] = ''; +searchItemsRequest['PartnerType'] = 'Associates'; + +/** Specify Keywords */ +searchItemsRequest['Keywords'] = 'Harry Potter'; + +/** + * Specify the category in which search request is to be made + * For more details, refer: https://webservices.amazon.com/paapi5/documentation/use-cases/organization-of-items-on-amazon/search-index.html + */ +searchItemsRequest['SearchIndex'] = 'Books'; + +/** Specify item count to be returned in search result */ +searchItemsRequest['ItemCount'] = 2; + +/** + * Choose resources you want from SearchItemsResource enum + * For more details, refer: https://webservices.amazon.com/paapi5/documentation/search-items.html#resources-parameter + */ +searchItemsRequest['Resources'] = ['Images.Primary.Medium', 'ItemInfo.Title', 'Offers.Listings.Price']; + +function onSuccess(data) { + console.log('API called successfully.'); + var searchItemsResponse = ProductAdvertisingAPIv1.SearchItemsResponse.constructFromObject(data); + console.log('Complete Response: \n' + JSON.stringify(searchItemsResponse, null, 1)); + if (searchItemsResponse['SearchResult'] !== undefined) { + console.log('Printing First Item Information in SearchResult:'); + var item_0 = searchItemsResponse['SearchResult']['Items'][0]; + if (item_0 !== undefined) { + if (item_0['ASIN'] !== undefined) { + console.log('ASIN: ' + item_0['ASIN']); + } + if (item_0['DetailPageURL'] !== undefined) { + console.log('DetailPageURL: ' + item_0['DetailPageURL']); + } + if ( + item_0['ItemInfo'] !== undefined && + item_0['ItemInfo']['Title'] !== undefined && + item_0['ItemInfo']['Title']['DisplayValue'] !== undefined + ) { + console.log('Title: ' + item_0['ItemInfo']['Title']['DisplayValue']); + } + if ( + item_0['Offers'] !== undefined && + item_0['Offers']['Listings'] !== undefined && + item_0['Offers']['Listings'][0]['Price'] !== undefined && + item_0['Offers']['Listings'][0]['Price']['DisplayAmount'] !== undefined + ) { + console.log('Buying Price: ' + item_0['Offers']['Listings'][0]['Price']['DisplayAmount']); + } + } + } + if (searchItemsResponse['Errors'] !== undefined) { + console.log('Errors:'); + console.log('Complete Error Response: ' + JSON.stringify(searchItemsResponse['Errors'], null, 1)); + console.log('Printing 1st Error:'); + var error_0 = searchItemsResponse['Errors'][0]; + console.log('Error Code: ' + error_0['Code']); + console.log('Error Message: ' + error_0['Message']); + } +} + +function onError(error) { + console.log('Error calling PA-API 5.0!'); + console.log('Printing Full Error Object:\n' + JSON.stringify(error, null, 1)); + console.log('Status Code: ' + error['status']); + if (error['response'] !== undefined && error['response']['text'] !== undefined) { + console.log('Error Object: ' + JSON.stringify(error['response']['text'], null, 1)); + } +} + +api.searchItems(searchItemsRequest).then( + function(data) { + onSuccess(data); + }, + function(error) { + onError(error); + } +); +``` + +Complete documentation, installation instructions, and examples are available [here](https://webservices.amazon.com/paapi5/documentation/index.html). + +## License +This SDK is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), see LICENSE.txt and NOTICE.txt for more information. diff --git a/paapi5-nodejs-sdk-example/package.json b/paapi5-nodejs-sdk-example/package.json new file mode 100644 index 0000000..0b9e697 --- /dev/null +++ b/paapi5-nodejs-sdk-example/package.json @@ -0,0 +1,47 @@ +{ + "name": "paapi5-nodejs-sdk", + "version": "1.1.0", + "description": "ProductAdvertisingAPI 5.0 NodeJS SDK", + "license": "Apache-2.0", + "main": "src/index.js", + "scripts": { + "test": "./node_modules/mocha/bin/mocha --recursive", + "lint": "eslint sampleGetBrowseNodesApi.js sampleGetItemsApi.js sampleSearchItemsApi.js sampleGetVariationsApi.js src/auth/*.js" + }, + "author": { + "name": "Product Advertising API", + "email": "", + "url": "https://webservices.amazon.com/paapi5/documentation/index.html" + }, + "homepage": "https://github.com/amzn/paapi5-nodejs-sdk", + "repository": { + "type": "git", + "url": "https://github.com/amzn/paapi5-nodejs-sdk" + }, + "browser": { + "fs": false + }, + "dependencies": { + "superagent": "3.7.0", + "crypto-js": "^3.1.9-1" + }, + "devDependencies": { + "eslint": "^5.8.0", + "expect.js": "~0.3.1", + "mocha": "^10.0.0", + "sinon": "1.17.3" + }, + "keywords": [ + "amazon", + "pa-api", + "paapi", + "paapi5.0", + "paapi5", + "paapi5-nodejs-sdk", + "getitems", + "searchitems", + "getvariations", + "getbrowsenodes", + "ProductAdvertisingAPI" + ] +} diff --git a/paapi5-nodejs-sdk-example/sampleGetBrowseNodesApi.js b/paapi5-nodejs-sdk-example/sampleGetBrowseNodesApi.js new file mode 100644 index 0000000..cddd5c0 --- /dev/null +++ b/paapi5-nodejs-sdk-example/sampleGetBrowseNodesApi.js @@ -0,0 +1,134 @@ +/** + * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +// Run `npm install` locally before executing following code with `node sampleGetBrowseNodesApi.js` + +/** + * This sample code snippet is for ProductAdvertisingAPI 5.0's GetBrowseNodes API + * For more details, refer: + * https://webservices.amazon.com/paapi5/documentation/getbrowsenodes.html + */ + +var ProductAdvertisingAPIv1 = require('./src/index'); + +var defaultClient = ProductAdvertisingAPIv1.ApiClient.instance; + +// Specify your credentials here. These are used to create and sign the request. +defaultClient.accessKey = ''; +defaultClient.secretKey = ''; + +/** + * PAAPI Host and Region to which you want to send request. + * For more details refer: https://webservices.amazon.com/paapi5/documentation/common-request-parameters.html#host-and-region + */ +defaultClient.host = 'webservices.amazon.com'; +defaultClient.region = 'us-east-1'; + +var api = new ProductAdvertisingAPIv1.DefaultApi(); + +// Request Initialization + +var getBrowseNodesRequest = new ProductAdvertisingAPIv1.GetBrowseNodesRequest(); + +/** Enter your partner tag (store/tracking id) and partner type */ +getBrowseNodesRequest['PartnerTag'] = ''; +getBrowseNodesRequest['PartnerType'] = 'Associates'; + +/** Specify browse node id(s) */ +getBrowseNodesRequest['BrowseNodeIds'] = ['3040', '0', '3045']; + +/** Specify the item count to be returned in search result */ +/** + * Specify the language code in which you want the information to be returned. + * For more information and valid values for each locale, refer https://webservices.amazon.com/paapi5/documentation/locale-reference.html + */ +getBrowseNodesRequest['LanguagesOfPreference'] = ['es_US']; + +/** + * Choose resources you want from GetBrowseNodesResource enum + * For more details, refer: https://webservices.amazon.com/paapi5/documentation/getbrowsenodes.html#resources-parameter + */ +getBrowseNodesRequest['Resources'] = ['BrowseNodes.Ancestor', 'BrowseNodes.Children']; + +/** + * Function to parse GetBrowseNodesResponse into an object with key as BrowseNodeId + */ +function parseResponse(browseNodesResponseList) { + var mappedResponse = {}; + for (var i in browseNodesResponseList) { + if (browseNodesResponseList.hasOwnProperty(i)) { + mappedResponse[browseNodesResponseList[i]['Id']] = browseNodesResponseList[i]; + } + } + return mappedResponse; +} + +function onSuccess(data) { + console.log('API called successfully.'); + var getBrowseNodesResponse = ProductAdvertisingAPIv1.GetBrowseNodesResponse.constructFromObject(data); + console.log('Complete Response: \n' + JSON.stringify(getBrowseNodesResponse, null, 1)); + if (getBrowseNodesResponse['BrowseNodesResult'] !== undefined) { + console.log('Printing all browse node information in BrowseNodesResult:'); + var response_list = parseResponse(getBrowseNodesResponse['BrowseNodesResult']['BrowseNodes']); + for (var i in getBrowseNodesRequest['BrowseNodeIds']) { + if (getBrowseNodesRequest['BrowseNodeIds'].hasOwnProperty(i)) { + var browseNodeId = getBrowseNodesRequest['BrowseNodeIds'][i]; + console.log('\nPrinting information about the browse node with Id: ' + browseNodeId); + if (browseNodeId in response_list) { + var browseNode = response_list[browseNodeId]; + if (browseNode !== undefined) { + if (browseNode['Id'] !== undefined) { + console.log('BrowseNode ID: ' + browseNode['Id']); + } + if (browseNode['DisplayName'] !== undefined) { + console.log('DisplayName: ' + browseNode['DisplayName']); + } + if (browseNode['ContextFreeName'] !== undefined) { + console.log('ContextFreeName: ' + browseNode['ContextFreeName']); + } + } + } else { + console.log('BrowseNode not found, check errors'); + } + } + } + } + if (getBrowseNodesResponse['Errors'] !== undefined) { + console.log('\nErrors:'); + console.log('Complete Error Response: ' + JSON.stringify(getBrowseNodesResponse['Errors'], null, 1)); + console.log('Printing 1st Error:'); + var error_0 = getBrowseNodesResponse['Errors'][0]; + console.log('Error Code: ' + error_0['Code']); + console.log('Error Message: ' + error_0['Message']); + } +} + +function onError(error) { + console.log('Error calling PA-API 5.0!'); + console.log('Printing Full Error Object:\n' + JSON.stringify(error, null, 1)); + console.log('Status Code: ' + error['status']); + if (error['response'] !== undefined && error['response']['text'] !== undefined) { + console.log('Error Object: ' + JSON.stringify(error['response']['text'], null, 1)); + } +} + +api.getBrowseNodes(getBrowseNodesRequest).then( + function(data) { + onSuccess(data); + }, + function(error) { + onError(error); + } +); diff --git a/paapi5-nodejs-sdk-example/sampleGetItemsApi.js b/paapi5-nodejs-sdk-example/sampleGetItemsApi.js new file mode 100644 index 0000000..d45c1a9 --- /dev/null +++ b/paapi5-nodejs-sdk-example/sampleGetItemsApi.js @@ -0,0 +1,141 @@ +/** + * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +// Run `npm install` locally before executing following code with `node sampleGetItemsApi.js` + +/** + * This sample code snippet is for ProductAdvertisingAPI 5.0's GetItems API + * For more details, refer: + * https://webservices.amazon.com/paapi5/documentation/get-items.html + */ + +var ProductAdvertisingAPIv1 = require('./src/index'); + +var defaultClient = ProductAdvertisingAPIv1.ApiClient.instance; + +// Specify your credentials here. These are used to create and sign the request. +defaultClient.accessKey = ''; +defaultClient.secretKey = ''; + +/** + * PAAPI Host and Region to which you want to send request. + * For more details refer: https://webservices.amazon.com/paapi5/documentation/common-request-parameters.html#host-and-region + */ +defaultClient.host = 'webservices.amazon.com'; +defaultClient.region = 'us-east-1'; + +var api = new ProductAdvertisingAPIv1.DefaultApi(); + +// Request Initialization + +var getItemsRequest = new ProductAdvertisingAPIv1.GetItemsRequest(); + +/** Enter your partner tag (store/tracking id) and partner type */ +getItemsRequest['PartnerTag'] = ''; +getItemsRequest['PartnerType'] = 'Associates'; + +/** Enter the Item IDs for which item information is desired */ +getItemsRequest['ItemIds'] = ['059035342X', 'B00X4WHP5E', 'B00ZV9RDKK']; + +getItemsRequest['Condition'] = 'New'; + +/** + * Choose resources you want from GetItemsResource enum + * For more details, refer: https://webservices.amazon.com/paapi5/documentation/get-items.html#resources-parameter + */ +getItemsRequest['Resources'] = ['Images.Primary.Medium', 'ItemInfo.Title', 'Offers.Listings.Price']; + +/** + * Function to parse GetItemsResponse into an object with key as ASIN + */ +function parseResponse(itemsResponseList) { + var mappedResponse = {}; + for (var i in itemsResponseList) { + if (itemsResponseList.hasOwnProperty(i)) { + mappedResponse[itemsResponseList[i]['ASIN']] = itemsResponseList[i]; + } + } + return mappedResponse; +} + +function onSuccess(data) { + console.log('API called successfully.'); + var getItemsResponse = ProductAdvertisingAPIv1.GetItemsResponse.constructFromObject(data); + console.log('Complete Response: \n' + JSON.stringify(getItemsResponse, null, 1)); + if (getItemsResponse['ItemsResult'] !== undefined) { + console.log('Printing All Item Information in ItemsResult:'); + var response_list = parseResponse(getItemsResponse['ItemsResult']['Items']); + for (var i in getItemsRequest['ItemIds']) { + if (getItemsRequest['ItemIds'].hasOwnProperty(i)) { + var itemId = getItemsRequest['ItemIds'][i]; + console.log('\nPrinting information about the Item with Id: ' + itemId); + if (itemId in response_list) { + var item = response_list[itemId]; + if (item !== undefined) { + if (item['ASIN'] !== undefined) { + console.log('ASIN: ' + item['ASIN']); + } + if (item['DetailPageURL'] !== undefined) { + console.log('DetailPageURL: ' + item['DetailPageURL']); + } + if ( + item['ItemInfo'] !== undefined && + item['ItemInfo']['Title'] !== undefined && + item['ItemInfo']['Title']['DisplayValue'] !== undefined + ) { + console.log('Title: ' + item['ItemInfo']['Title']['DisplayValue']); + } + if ( + item['Offers'] !== undefined && + item['Offers']['Listings'] !== undefined && + item['Offers']['Listings'][0]['Price'] !== undefined && + item['Offers']['Listings'][0]['Price']['DisplayAmount'] !== undefined + ) { + console.log('Buying Price: ' + item['Offers']['Listings'][0]['Price']['DisplayAmount']); + } + } + } else { + console.log('Item not found, check errors'); + } + } + } + } + if (getItemsResponse['Errors'] !== undefined) { + console.log('\nErrors:'); + console.log('Complete Error Response: ' + JSON.stringify(getItemsResponse['Errors'], null, 1)); + console.log('Printing 1st Error:'); + var error_0 = getItemsResponse['Errors'][0]; + console.log('Error Code: ' + error_0['Code']); + console.log('Error Message: ' + error_0['Message']); + } +} + +function onError(error) { + console.log('Error calling PA-API 5.0!'); + console.log('Printing Full Error Object:\n' + JSON.stringify(error, null, 1)); + console.log('Status Code: ' + error['status']); + if (error['response'] !== undefined && error['response']['text'] !== undefined) { + console.log('Error Object: ' + JSON.stringify(error['response']['text'], null, 1)); + } +} + +api.getItems(getItemsRequest).then( + function(data) { + onSuccess(data); + }, + function(error) { + onError(error); + } +); diff --git a/paapi5-nodejs-sdk-example/sampleGetVariationsApi.js b/paapi5-nodejs-sdk-example/sampleGetVariationsApi.js new file mode 100644 index 0000000..729136a --- /dev/null +++ b/paapi5-nodejs-sdk-example/sampleGetVariationsApi.js @@ -0,0 +1,128 @@ +/** + * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +// Run `npm install` locally before executing following code with `node sampleGetVariationsApi.js` + +/** + * This sample code snippet is for ProductAdvertisingAPI 5.0's GetVariations API + * For more details, refer: + * https://webservices.amazon.com/paapi5/documentation/get-variations.html + */ + +var ProductAdvertisingAPIv1 = require('./src/index'); + +var defaultClient = ProductAdvertisingAPIv1.ApiClient.instance; + +// Specify your credentials here. These are used to create and sign the request. +defaultClient.accessKey = ''; +defaultClient.secretKey = ''; + +/** + * PAAPI Host and Region to which you want to send request. + * For more details refer: https://webservices.amazon.com/paapi5/documentation/common-request-parameters.html#host-and-region + */ +defaultClient.host = 'webservices.amazon.com'; +defaultClient.region = 'us-east-1'; + +var api = new ProductAdvertisingAPIv1.DefaultApi(); + +// Request Initialization + +var getVariationsRequest = new ProductAdvertisingAPIv1.GetVariationsRequest(); + +/** Enter your partner tag (store/tracking id) and partner type */ +getVariationsRequest['PartnerTag'] = ''; +getVariationsRequest['PartnerType'] = 'Associates'; + +/** Specify ASIN for which variations are desired */ +getVariationsRequest['ASIN'] = 'B07H65KP63'; + +/** + * Choose resources you want from GetVariationsResource enum + * For more details, refer: https://webservices.amazon.com/paapi5/documentation/get-variations.html#resources-parameter + */ +getVariationsRequest['Resources'] = [ + 'Images.Primary.Medium', + 'ItemInfo.Title', + 'Offers.Listings.Price', + 'VariationSummary.VariationDimension' +]; + +function onSuccess(data) { + console.log('API called successfully.'); + var getVariationsResponse = ProductAdvertisingAPIv1.GetVariationsResponse.constructFromObject(data); + console.log('Complete Response: \n' + JSON.stringify(getVariationsResponse, null, 1)); + if (getVariationsResponse['VariationsResult'] !== undefined) { + //console.log('Complete VariationsResult: \n' + JSON.stringify(getVariationsResponse['VariationsResult'], null, 1)); + console.log('Printing Variation Summary:'); + if ( + getVariationsResponse['VariationsResult']['VariationSummary'] !== undefined && + getVariationsResponse['VariationsResult']['VariationSummary']['VariationCount'] !== undefined + ) { + console.log('VariationCount: ' + getVariationsResponse['VariationsResult']['VariationSummary']['VariationCount']); + } + console.log('Printing First Item Information in VariationsResult:'); + var item_0 = getVariationsResponse['VariationsResult']['Items'][0]; + if (item_0 !== undefined) { + if (item_0['ASIN'] !== undefined) { + console.log('ASIN: ' + item_0['ASIN']); + } + if (item_0['DetailPageURL'] !== undefined) { + console.log('DetailPageURL: ' + item_0['DetailPageURL']); + } + if ( + item_0['ItemInfo'] !== undefined && + item_0['ItemInfo']['Title'] !== undefined && + item_0['ItemInfo']['Title']['DisplayValue'] !== undefined + ) { + console.log('Title: ' + item_0['ItemInfo']['Title']['DisplayValue']); + } + if ( + item_0['Offers'] !== undefined && + item_0['Offers']['Listings'] !== undefined && + item_0['Offers']['Listings'][0]['Price'] !== undefined && + item_0['Offers']['Listings'][0]['Price']['DisplayAmount'] !== undefined + ) { + console.log('Buying Price: ' + item_0['Offers']['Listings'][0]['Price']['DisplayAmount']); + } + } + } + if (getVariationsResponse['Errors'] !== undefined) { + console.log('Errors:'); + console.log('Complete Error Response: ' + JSON.stringify(getVariationsResponse['Errors'], null, 1)); + console.log('Printing 1st Error:'); + var error_0 = getVariationsResponse['Errors'][0]; + console.log('Error Code: ' + error_0['Code']); + console.log('Error Message: ' + error_0['Message']); + } +} + +function onError(error) { + console.log('Error calling PA-API 5.0!'); + console.log('Printing Full Error Object:\n' + JSON.stringify(error, null, 1)); + console.log('Status Code: ' + error['status']); + if (error['response'] !== undefined && error['response']['text'] !== undefined) { + console.log('Error Object: ' + JSON.stringify(error['response']['text'], null, 1)); + } +} + +api.getVariations(getVariationsRequest).then( + function(data) { + onSuccess(data); + }, + function(error) { + onError(error); + } +); diff --git a/paapi5-nodejs-sdk-example/sampleSearchItemsApi.js b/paapi5-nodejs-sdk-example/sampleSearchItemsApi.js new file mode 100644 index 0000000..c4d58aa --- /dev/null +++ b/paapi5-nodejs-sdk-example/sampleSearchItemsApi.js @@ -0,0 +1,124 @@ +/** + * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +// Run `npm install` locally before executing following code with `node sampleSearchItemsApi.js` + +/** + * This sample code snippet is for ProductAdvertisingAPI 5.0's SearchItems API + * For more details, refer: + * https://webservices.amazon.com/paapi5/documentation/search-items.html + */ + +var ProductAdvertisingAPIv1 = require('./src/index'); + +var defaultClient = ProductAdvertisingAPIv1.ApiClient.instance; + +// Specify your credentials here. These are used to create and sign the request. +defaultClient.accessKey = ''; +defaultClient.secretKey = ''; + +/** + * PAAPI Host and Region to which you want to send request. + * For more details refer: https://webservices.amazon.com/paapi5/documentation/common-request-parameters.html#host-and-region + */ +defaultClient.host = 'webservices.amazon.com'; +defaultClient.region = 'us-east-1'; + +var api = new ProductAdvertisingAPIv1.DefaultApi(); + +// Request Initialization + +var searchItemsRequest = new ProductAdvertisingAPIv1.SearchItemsRequest(); + +/** Enter your partner tag (store/tracking id) and partner type */ +searchItemsRequest['PartnerTag'] = ''; +searchItemsRequest['PartnerType'] = 'Associates'; + +/** Specify Keywords */ +searchItemsRequest['Keywords'] = 'Harry Potter'; + +/** + * Specify the category in which search request is to be made + * For more details, refer: https://webservices.amazon.com/paapi5/documentation/use-cases/organization-of-items-on-amazon/search-index.html + */ +searchItemsRequest['SearchIndex'] = 'Books'; + +/** Specify item count to be returned in search result */ +searchItemsRequest['ItemCount'] = 2; + +/** + * Choose resources you want from SearchItemsResource enum + * For more details, refer: https://webservices.amazon.com/paapi5/documentation/search-items.html#resources-parameter + */ +searchItemsRequest['Resources'] = ['Images.Primary.Medium', 'ItemInfo.Title', 'Offers.Listings.Price']; + +function onSuccess(data) { + console.log('API called successfully.'); + var searchItemsResponse = ProductAdvertisingAPIv1.SearchItemsResponse.constructFromObject(data); + console.log('Complete Response: \n' + JSON.stringify(searchItemsResponse, null, 1)); + if (searchItemsResponse['SearchResult'] !== undefined) { + console.log('Printing First Item Information in SearchResult:'); + var item_0 = searchItemsResponse['SearchResult']['Items'][0]; + if (item_0 !== undefined) { + if (item_0['ASIN'] !== undefined) { + console.log('ASIN: ' + item_0['ASIN']); + } + if (item_0['DetailPageURL'] !== undefined) { + console.log('DetailPageURL: ' + item_0['DetailPageURL']); + } + if ( + item_0['ItemInfo'] !== undefined && + item_0['ItemInfo']['Title'] !== undefined && + item_0['ItemInfo']['Title']['DisplayValue'] !== undefined + ) { + console.log('Title: ' + item_0['ItemInfo']['Title']['DisplayValue']); + } + if ( + item_0['Offers'] !== undefined && + item_0['Offers']['Listings'] !== undefined && + item_0['Offers']['Listings'][0]['Price'] !== undefined && + item_0['Offers']['Listings'][0]['Price']['DisplayAmount'] !== undefined + ) { + console.log('Buying Price: ' + item_0['Offers']['Listings'][0]['Price']['DisplayAmount']); + } + } + } + if (searchItemsResponse['Errors'] !== undefined) { + console.log('Errors:'); + console.log('Complete Error Response: ' + JSON.stringify(searchItemsResponse['Errors'], null, 1)); + console.log('Printing 1st Error:'); + var error_0 = searchItemsResponse['Errors'][0]; + console.log('Error Code: ' + error_0['Code']); + console.log('Error Message: ' + error_0['Message']); + } +} + +function onError(error) { + console.log('Error calling PA-API 5.0!'); + console.log('Printing Full Error Object:\n' + JSON.stringify(error, null, 1)); + console.log('Status Code: ' + error['status']); + if (error['response'] !== undefined && error['response']['text'] !== undefined) { + console.log('Error Object: ' + JSON.stringify(error['response']['text'], null, 1)); + } +} + +api.searchItems(searchItemsRequest).then( + function(data) { + onSuccess(data); + }, + function(error) { + onError(error); + } +); diff --git a/paapi5-nodejs-sdk-example/src/ApiClient.js b/paapi5-nodejs-sdk-example/src/ApiClient.js new file mode 100644 index 0000000..8a21b33 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/ApiClient.js @@ -0,0 +1,600 @@ +/** + * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +var awsv4 = require('./auth/SignHelper'); + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['superagent', 'querystring'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('superagent'), require('querystring')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ApiClient = factory(root.superagent, root.querystring); + } +}(this, function(superagent, querystring) { + 'use strict'; + + /** + * @module ApiClient + * @version 1.0.0 + */ + + /** + * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an + * application to use this class directly - the *Api and model classes provide the public API for the service. The + * contents of this file should be regarded as internal but are documented for completeness. + * @alias module:ApiClient + * @class + */ + var exports = function() { + /** + * The base URL against which to resolve every API call's (relative) path. + * @type {String} + * @default https://webservices.amazon.com + */ + this.basePath = 'https://webservices.amazon.com'.replace(/\/+$/, ''); + + /** + * The Access Key ID which uniquely identifies you. + * @type {String} + */ + this.accessKey = null; + + /** + * A key that is used in conjunction with the Access Key ID to cryptographically + * sign an API request. + * @type {String} + */ + this.secretKey = null; + + /** + * The host that receives the Amazon Product Advertising API GenNext request. + * @type {String} + * @default webservices.amazon.com + */ + this.host = 'webservices.amazon.com'; + + /** + * The service's region where the request is targeted. + * @type {String} + * @default us-east-1 + */ + this.region = 'us-east-1'; + + /** + * The authentication methods to be included for all API calls. + * @type {Array.} + */ + this.authentications = { + }; + /** + * The default HTTP headers to be included for all API calls. + * @type {Array.} + * @default {} + */ + this.defaultHeaders = {}; + + /** + * The default HTTP timeout for all API calls. + * @type {Number} + * @default 60000 + */ + this.timeout = 60000; + + /** + * If set to false an additional timestamp parameter is added to all API GET calls to + * prevent browser caching + * @type {Boolean} + * @default true + */ + this.cache = true; + + /** + * If set to true, the client will save the cookies from each server + * response, and return them in the next request. + * @default false + */ + this.enableCookies = false; + + /* + * Used to save and return cookies in a node.js (non-browser) setting, + * if this.enableCookies is set to true. + */ + if (typeof window === 'undefined') { + this.agent = new superagent.agent(); + } + + /* + * Allow user to override superagent agent + */ + this.requestAgent = { + 'User-Agent': 'paapi5-nodejs-sdk/1.0.0' + }; + }; + + /** + * Returns a string representation for an actual parameter. + * @param param The actual parameter. + * @returns {String} The string representation of param. + */ + exports.prototype.paramToString = function(param) { + if (param == undefined || param == null) { + return ''; + } + if (param instanceof Date) { + return param.toJSON(); + } + return param.toString(); + }; + + /** + * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values. + * NOTE: query parameters are not handled here. + * @param {String} path The path to append to the base URL. + * @param {Object} pathParams The parameter values to append. + * @returns {String} The encoded path with parameter values substituted. + */ + exports.prototype.buildUrl = function(path, pathParams) { + if (!path.match(/^\//)) { + path = '/' + path; + } + var url = "https://" + this.host + path; + var _this = this; + url = url.replace(/\{([\w-]+)\}/g, function(fullMatch, key) { + var value; + if (pathParams.hasOwnProperty(key)) { + value = _this.paramToString(pathParams[key]); + } else { + value = fullMatch; + } + return encodeURIComponent(value); + }); + return url; + }; + + /** + * Checks whether the given content type represents JSON.
+ * JSON content type examples:
+ *
    + *
  • application/json
  • + *
  • application/json; charset=UTF8
  • + *
  • APPLICATION/JSON
  • + *
+ * @param {String} contentType The MIME content type to check. + * @returns {Boolean} true if contentType represents JSON, otherwise false. + */ + exports.prototype.isJsonMime = function(contentType) { + return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i)); + }; + + /** + * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first. + * @param {Array.} contentTypes + * @returns {String} The chosen content type, preferring JSON. + */ + exports.prototype.jsonPreferredMime = function(contentTypes) { + for (var i = 0; i < contentTypes.length; i++) { + if (this.isJsonMime(contentTypes[i])) { + return contentTypes[i]; + } + } + return contentTypes[0]; + }; + + /** + * Checks whether the given parameter value represents file-like content. + * @param param The parameter to check. + * @returns {Boolean} true if param represents a file. + */ + exports.prototype.isFileParam = function(param) { + // fs.ReadStream in Node.js and Electron (but not in runtime like browserify) + if (typeof require === 'function') { + var fs; + try { + fs = require('fs'); + } catch (err) {} + if (fs && fs.ReadStream && param instanceof fs.ReadStream) { + return true; + } + } + // Buffer in Node.js + if (typeof Buffer === 'function' && param instanceof Buffer) { + return true; + } + // Blob in browser + if (typeof Blob === 'function' && param instanceof Blob) { + return true; + } + // File in browser (it seems File object is also instance of Blob, but keep this for safe) + if (typeof File === 'function' && param instanceof File) { + return true; + } + return false; + }; + + /** + * Normalizes parameter values: + *
    + *
  • remove nils
  • + *
  • keep files and arrays
  • + *
  • format to string with `paramToString` for other cases
  • + *
+ * @param {Object.} params The parameters as object properties. + * @returns {Object.} normalized parameters. + */ + exports.prototype.normalizeParams = function(params) { + var newParams = {}; + for (var key in params) { + if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) { + var value = params[key]; + if (this.isFileParam(value) || Array.isArray(value)) { + newParams[key] = value; + } else { + newParams[key] = this.paramToString(value); + } + } + } + return newParams; + }; + + /** + * Enumeration of collection format separator strategies. + * @enum {String} + * @readonly + */ + exports.CollectionFormatEnum = { + /** + * Comma-separated values. Value: csv + * @const + */ + CSV: ',', + /** + * Space-separated values. Value: ssv + * @const + */ + SSV: ' ', + /** + * Tab-separated values. Value: tsv + * @const + */ + TSV: '\t', + /** + * Pipe(|)-separated values. Value: pipes + * @const + */ + PIPES: '|', + /** + * Native array. Value: multi + * @const + */ + MULTI: 'multi' + }; + + /** + * Builds a string representation of an array-type actual parameter, according to the given collection format. + * @param {Array} param An array parameter. + * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. + * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns + * param as is if collectionFormat is multi. + */ + exports.prototype.buildCollectionParam = function buildCollectionParam(param, collectionFormat) { + if (param == null) { + return null; + } + switch (collectionFormat) { + case 'csv': + return param.map(this.paramToString).join(','); + case 'ssv': + return param.map(this.paramToString).join(' '); + case 'tsv': + return param.map(this.paramToString).join('\t'); + case 'pipes': + return param.map(this.paramToString).join('|'); + case 'multi': + // return the array directly as SuperAgent will handle it as expected + return param.map(this.paramToString); + default: + throw new Error('Unknown collection format: ' + collectionFormat); + } + }; + + /** + * Deserializes an HTTP response body into a value of the specified type. + * @param {Object} response A SuperAgent response object. + * @param {(String|Array.|Object.|Function)} returnType The type to return. Pass a string for simple types + * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To + * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: + * all properties on data will be converted to this type. + * @returns A value of the specified type. + */ + exports.prototype.deserialize = function deserialize(response, returnType) { + if (response == null || returnType == null || response.status == 204) { + return null; + } + // Rely on SuperAgent for parsing response body. + // See http://visionmedia.github.io/superagent/#parsing-response-bodies + var data = response.body; + if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) { + // SuperAgent does not always produce a body; use the unparsed response as a fallback + data = response.text; + } + return exports.convertToType(data, returnType); + }; + + /** + * Invokes the REST service using the supplied settings and parameters. + * @param {String} path The base URL to invoke. + * @param {String} httpMethod The HTTP method to use. + * @param {Object.} pathParams A map of path parameters and their values. + * @param {Object.} queryParams A map of query parameters and their values. + * @param {Object.} collectionQueryParams A map of collection query parameters and their values. + * @param {Object.} headerParams A map of header parameters and their values. + * @param {Object.} formParams A map of form parameters and their values. + * @param {Object} bodyParam The value to pass as the request body. + * @param {Array.} authNames An array of authentication type names. + * @param {Array.} contentTypes An array of request MIME types. + * @param {Array.} accepts An array of acceptable response MIME types. + * @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the + * constructor for a complex type. + * @returns {Promise} A {@link https://www.promisejs.org/|Promise} object. + */ + exports.prototype.callApi = function callApi(path, httpMethod, apiName, pathParams, + queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, + returnType) { + + // Throw error if credentials are not specified + if (this.accessKey === undefined || this.secretKey === undefined || this.accessKey === null || this.secretKey === null) { + throw new Error("Missing Credentials. Please specify accessKey and secretKey in client object."); + } + + var _this = this; + var url = this.buildUrl(path, pathParams); + var request = superagent(httpMethod, url); + + // apply authentications + var region = this.region + var service = 'ProductAdvertisingAPI'; + var timestamp = Date.now(); + + var requestHeaders = { + 'content-encoding': 'amz-1.0', + 'content-type': 'application/json; charset=utf-8', + 'host': this.host, + 'x-amz-target': 'com.amazon.paapi5.v1.ProductAdvertisingAPIv1.' + apiName, + 'x-amz-date': awsv4.toAmzDate(timestamp) + }; + + var authorizationHeader = awsv4.createAuthorizationHeader(this.accessKey, this.secretKey, requestHeaders, httpMethod, path, bodyParam, region, service, timestamp); + + var authHeader = { + 'Authorization': authorizationHeader + }; + request.set(authHeader); + + // set collection query parameters + for (var key in collectionQueryParams) { + if (collectionQueryParams.hasOwnProperty(key)) { + var param = collectionQueryParams[key]; + if (param.collectionFormat === 'csv') { + // SuperAgent normally percent-encodes all reserved characters in a query parameter. However, + // commas are used as delimiters for the 'csv' collectionFormat so they must not be encoded. We + // must therefore construct and encode 'csv' collection query parameters manually. + if (param.value != null) { + var value = param.value.map(this.paramToString).map(encodeURIComponent).join(','); + request.query(encodeURIComponent(key) + "=" + value); + } + } else { + // All other collection query parameters should be treated as ordinary query parameters. + queryParams[key] = this.buildCollectionParam(param.value, param.collectionFormat); + } + } + } + + // set query parameters + if (httpMethod.toUpperCase() === 'GET' && this.cache === false) { + queryParams['_'] = new Date().getTime(); + } + + // set header parameters + request.set(requestHeaders); + + + // set requestAgent if it is set by user + request.set(this.requestAgent); + + // set request timeout + request.timeout(this.timeout); + + var contentType = 'application/json; charset=utf-8'; + if (contentType) { + // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746) + if(contentType != 'multipart/form-data') { + request.type(contentType); + } + } else if (!request.header['Content-Type']) { + request.type('application/json'); + } + + if (contentType === 'application/x-www-form-urlencoded') { + request.send(querystring.stringify(this.normalizeParams(formParams))); + } else if (contentType == 'multipart/form-data') { + var _formParams = this.normalizeParams(formParams); + for (var key in _formParams) { + if (_formParams.hasOwnProperty(key)) { + if (this.isFileParam(_formParams[key])) { + // file field + request.attach(key, _formParams[key]); + } else { + request.field(key, _formParams[key]); + } + } + } + } else if (bodyParam) { + request.send(bodyParam); + } + + var accept = this.jsonPreferredMime(accepts); + if (accept) { + request.accept(accept); + } + + if (returnType === 'Blob') { + request.responseType('blob'); + } else if (returnType === 'String') { + request.responseType('string'); + } + + // Attach previously saved cookies, if enabled + if (this.enableCookies){ + if (typeof window === 'undefined') { + this.agent.attachCookies(request); + } + else { + request.withCredentials(); + } + } + + return new Promise(function(resolve, reject) { + request.end(function(error, response) { + if (error) { + reject(error); + } else { + try { + var data = _this.deserialize(response, returnType); + if (_this.enableCookies && typeof window === 'undefined'){ + _this.agent.saveCookies(response); + } + resolve({data: data, response: response}); + } catch (err) { + reject(err); + } + } + }); + }); + }; + + /** + * Parses an ISO-8601 string representation of a date value. + * @param {String} str The date value as a string. + * @returns {Date} The parsed date object. + */ + exports.parseDate = function(str) { + return new Date(str.replace(/T/i, ' ')); + }; + + /** + * Converts a value to the specified type. + * @param {(String|Object)} data The data to convert, as a string or object. + * @param {(String|Array.|Object.|Function)} type The type to return. Pass a string for simple types + * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To + * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: + * all properties on data will be converted to this type. + * @returns An instance of the specified type or null or undefined if data is null or undefined. + */ + exports.convertToType = function(data, type) { + if (data === null || data === undefined) + return data + + switch (type) { + case 'Boolean': + return Boolean(data); + case 'Integer': + return parseInt(data, 10); + case 'Number': + return parseFloat(data); + case 'String': + return String(data); + case 'Date': + return this.parseDate(String(data)); + case 'Blob': + return data; + default: + if (type === Object) { + // generic object, return directly + return data; + } else if (typeof type === 'function') { + // for model type like: User + return type.constructFromObject(data); + } else if (Array.isArray(type)) { + // for array type like: ['String'] + var itemType = type[0]; + return data.map(function(item) { + return exports.convertToType(item, itemType); + }); + } else if (typeof type === 'object') { + // for plain object type like: {'String': 'Integer'} + var keyType, valueType; + for (var k in type) { + if (type.hasOwnProperty(k)) { + keyType = k; + valueType = type[k]; + break; + } + } + var result = {}; + for (var k in data) { + if (data.hasOwnProperty(k)) { + var key = exports.convertToType(k, keyType); + var value = exports.convertToType(data[k], valueType); + result[key] = value; + } + } + return result; + } else { + // for unknown type, return the data directly + return data; + } + } + }; + + /** + * Constructs a new map or array model from REST data. + * @param data {Object|Array} The REST data. + * @param obj {Object|Array} The target object or array. + */ + exports.constructFromObject = function(data, obj, itemType) { + if (Array.isArray(data)) { + for (var i = 0; i < data.length; i++) { + if (data.hasOwnProperty(i)) + obj[i] = exports.convertToType(data[i], itemType); + } + } else { + for (var k in data) { + if (data.hasOwnProperty(k)) + obj[k] = exports.convertToType(data[k], itemType); + } + } + }; + + /** + * The default API client implementation. + * @type {module:ApiClient} + */ + exports.instance = new exports(); + + return exports; +})); diff --git a/paapi5-nodejs-sdk-example/src/api/DefaultApi.js b/paapi5-nodejs-sdk-example/src/api/DefaultApi.js new file mode 100644 index 0000000..295714a --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/api/DefaultApi.js @@ -0,0 +1,250 @@ +/** + * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/GetBrowseNodesRequest', 'model/GetBrowseNodesResponse', 'model/GetItemsRequest', 'model/GetItemsResponse', 'model/GetVariationsRequest', 'model/GetVariationsResponse', 'model/ProductAdvertisingAPIClientException', 'model/ProductAdvertisingAPIServiceException', 'model/SearchItemsRequest', 'model/SearchItemsResponse'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('../model/GetBrowseNodesRequest'), require('../model/GetBrowseNodesResponse'), require('../model/GetItemsRequest'), require('../model/GetItemsResponse'), require('../model/GetVariationsRequest'), require('../model/GetVariationsResponse'), require('../model/ProductAdvertisingAPIClientException'), require('../model/ProductAdvertisingAPIServiceException'), require('../model/SearchItemsRequest'), require('../model/SearchItemsResponse')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.DefaultApi = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.GetBrowseNodesRequest, root.ProductAdvertisingAPIv1.GetBrowseNodesResponse, root.ProductAdvertisingAPIv1.GetItemsRequest, root.ProductAdvertisingAPIv1.GetItemsResponse, root.ProductAdvertisingAPIv1.GetVariationsRequest, root.ProductAdvertisingAPIv1.GetVariationsResponse, root.ProductAdvertisingAPIv1.ProductAdvertisingAPIClientException, root.ProductAdvertisingAPIv1.ProductAdvertisingAPIServiceException, root.ProductAdvertisingAPIv1.SearchItemsRequest, root.ProductAdvertisingAPIv1.SearchItemsResponse); + } +}(this, function(ApiClient, GetBrowseNodesRequest, GetBrowseNodesResponse, GetItemsRequest, GetItemsResponse, GetVariationsRequest, GetVariationsResponse, ProductAdvertisingAPIClientException, ProductAdvertisingAPIServiceException, SearchItemsRequest, SearchItemsResponse) { + 'use strict'; + + /** + * Default service. + * @module api/DefaultApi + * @version 1.0.0 + */ + + /** + * Constructs a new DefaultApi. + * @alias module:api/DefaultApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + var exports = function(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + + + + /** + * @param {module:model/GetBrowseNodesRequest} getBrowseNodesRequest GetBrowseNodesRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetBrowseNodesResponse} and HTTP response + */ + this.getBrowseNodesWithHttpInfo = function(getBrowseNodesRequest) { + var postBody = getBrowseNodesRequest; + + // verify the required parameter 'getBrowseNodesRequest' is set + if (getBrowseNodesRequest === undefined || getBrowseNodesRequest === null) { + throw new Error("Missing the required parameter 'getBrowseNodesRequest' when calling getBrowseNodes"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = GetBrowseNodesResponse; + + return this.apiClient.callApi( + '/paapi5/getbrowsenodes', 'POST', 'GetBrowseNodes', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * @param {module:model/GetBrowseNodesRequest} getBrowseNodesRequest GetBrowseNodesRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetBrowseNodesResponse} + */ + this.getBrowseNodes = function(getBrowseNodesRequest) { + return this.getBrowseNodesWithHttpInfo(getBrowseNodesRequest) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * @param {module:model/GetItemsRequest} getItemsRequest GetItemsRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetItemsResponse} and HTTP response + */ + this.getItemsWithHttpInfo = function(getItemsRequest) { + var postBody = getItemsRequest; + + // verify the required parameter 'getItemsRequest' is set + if (getItemsRequest === undefined || getItemsRequest === null) { + throw new Error("Missing the required parameter 'getItemsRequest' when calling getItems"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = GetItemsResponse; + + return this.apiClient.callApi( + '/paapi5/getitems', 'POST', 'GetItems', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * @param {module:model/GetItemsRequest} getItemsRequest GetItemsRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetItemsResponse} + */ + this.getItems = function(getItemsRequest) { + return this.getItemsWithHttpInfo(getItemsRequest) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * @param {module:model/GetVariationsRequest} getVariationsRequest GetVariationsRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetVariationsResponse} and HTTP response + */ + this.getVariationsWithHttpInfo = function(getVariationsRequest) { + var postBody = getVariationsRequest; + + // verify the required parameter 'getVariationsRequest' is set + if (getVariationsRequest === undefined || getVariationsRequest === null) { + throw new Error("Missing the required parameter 'getVariationsRequest' when calling getVariations"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = GetVariationsResponse; + + return this.apiClient.callApi( + '/paapi5/getvariations', 'POST', 'GetVariations', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * @param {module:model/GetVariationsRequest} getVariationsRequest GetVariationsRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetVariationsResponse} + */ + this.getVariations = function(getVariationsRequest) { + return this.getVariationsWithHttpInfo(getVariationsRequest) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * @param {module:model/SearchItemsRequest} searchItemsRequest SearchItemsRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SearchItemsResponse} and HTTP response + */ + this.searchItemsWithHttpInfo = function(searchItemsRequest) { + var postBody = searchItemsRequest; + + // verify the required parameter 'searchItemsRequest' is set + if (searchItemsRequest === undefined || searchItemsRequest === null) { + throw new Error("Missing the required parameter 'searchItemsRequest' when calling searchItems"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = SearchItemsResponse; + + return this.apiClient.callApi( + '/paapi5/searchitems', 'POST', 'SearchItems', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * @param {module:model/SearchItemsRequest} searchItemsRequest SearchItemsRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SearchItemsResponse} + */ + this.searchItems = function(searchItemsRequest) { + return this.searchItemsWithHttpInfo(searchItemsRequest) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + }; + + return exports; +})); diff --git a/paapi5-nodejs-sdk-example/src/auth/SignHelper.js b/paapi5-nodejs-sdk-example/src/auth/SignHelper.js new file mode 100644 index 0000000..9a69c33 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/auth/SignHelper.js @@ -0,0 +1,165 @@ +/** + * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + * This file is for signing PAAPI request with AWS V4 Signing. For more details, see + * https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html + * + * Do not edit the class manually. + * + */ + +'use strict'; + +// sources of inspiration: +// http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html + +var crypto = require('crypto-js'); + +exports.createAuthorizationHeader = function( + accessKey, + secretKey, + requestHeaders, + httpMethod, + path, + payload, + region, + service, + timestamp +) { + /* Step 1: Create Signed Headers */ + var signedHeaders = exports.createSignedHeaders(requestHeaders); + + /* Step 2: Create Canonical Request */ + var canonicalRequest = exports.createCanonicalRequest(httpMethod, path, {}, requestHeaders, payload); + + /* Step 3: Create String To Sign */ + var stringToSign = exports.createStringToSign(timestamp, region, service, canonicalRequest); + + /* Step 4: Create Signature Headers */ + var signature = exports.createSignature(secretKey, timestamp, region, service, stringToSign); + + /* Step 5: Create Authorization Header */ + var authorizationHeader = exports.createAuthorizationHeaders( + timestamp, + accessKey, + region, + service, + signedHeaders, + signature + ); + + return authorizationHeader; +}; + +exports.createAuthorizationHeaders = function(timestamp, accessKey, region, service, signedHeaders, signature) { + return ( + 'AWS4-HMAC-SHA256' + + ' ' + + 'Credential=' + + accessKey + + '/' + + exports.createCredentialScope(timestamp, region, service) + + ', ' + + 'SignedHeaders=' + + signedHeaders + + ', ' + + 'Signature=' + + signature + ); +}; + +exports.createCanonicalRequest = function(method, pathname, query, headers, payload) { + var payloadJson = JSON.stringify(payload); + return [ + method.toUpperCase(), + pathname, + exports.createCanonicalQueryString(query), + exports.createCanonicalHeaders(headers), + exports.createSignedHeaders(headers), + hexEncodedHash(String(payloadJson)) + ].join('\n'); +}; + +exports.createCanonicalQueryString = function(params) { + return Object.keys(params) + .sort() + .map(function(key) { + return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]); + }) + .join('&'); +}; + +exports.createCanonicalHeaders = function(headers) { + return Object.keys(headers) + .sort() + .map(function(name) { + return name.toLowerCase().trim() + ':' + headers[name].toString().trim() + '\n'; + }) + .join(''); +}; + +exports.createSignedHeaders = function(headers) { + return Object.keys(headers) + .sort() + .map(function(name) { + return name.toLowerCase().trim(); + }) + .join(';'); +}; + +exports.createCredentialScope = function(time, region, service) { + return [toDate(time), region, service, 'aws4_request'].join('/'); +}; + +exports.createStringToSign = function(time, region, service, request) { + return [ + 'AWS4-HMAC-SHA256', + toTime(time), + exports.createCredentialScope(time, region, service), + hexEncodedHash(request) + ].join('\n'); +}; + +exports.createSignature = function(secret, time, region, service, stringToSign) { + var h1 = hmac('AWS4' + secret, toDate(time)); // date-key + var h2 = hmac(h1, region); // region-key + var h3 = hmac(h2, service); // service-key + var h4 = hmac(h3, 'aws4_request'); // signing-key + return hmac(h4, stringToSign).toString(crypto.enc.Hex); +}; + +exports.toAmzDate = function(time) { + return new Date(time).toISOString().replace(/[:\-]|\.\d{3}/g, ''); +}; + +function toTime(time) { + return new Date(time).toISOString().replace(/[:\-]|\.\d{3}/g, ''); +} + +function toDate(time) { + return toTime(time).substring(0, 8); +} + +function hmac(key, data) { + return crypto.HmacSHA256(data, key); +} + +function hexEncodedHash(data) { + return crypto.SHA256(data).toString(crypto.enc.Hex); +} diff --git a/paapi5-nodejs-sdk-example/src/index.js b/paapi5-nodejs-sdk-example/src/index.js new file mode 100644 index 0000000..6fc4cfb --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/index.js @@ -0,0 +1,523 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Availability', 'model/BrowseNode', 'model/BrowseNodeAncestor', 'model/BrowseNodeChild', 'model/BrowseNodeInfo', 'model/BrowseNodesResult', 'model/ByLineInfo', 'model/Classifications', 'model/Condition', 'model/ContentInfo', 'model/ContentRating', 'model/Contributor', 'model/CustomerReviews', 'model/DeliveryFlag', 'model/DimensionBasedAttribute', 'model/DurationPrice', 'model/ErrorData', 'model/ExternalIds', 'model/GetBrowseNodesRequest', 'model/GetBrowseNodesResource', 'model/GetBrowseNodesResponse', 'model/GetItemsRequest', 'model/GetItemsResource', 'model/GetItemsResponse', 'model/GetVariationsRequest', 'model/GetVariationsResource', 'model/GetVariationsResponse', 'model/ImageSize', 'model/ImageType', 'model/Images', 'model/Item', 'model/ItemIdType', 'model/ItemInfo', 'model/ItemsResult', 'model/LanguageType', 'model/Languages', 'model/ManufactureInfo', 'model/MaxPrice', 'model/Merchant', 'model/MinPrice', 'model/MinReviewsRating', 'model/MinSavingPercent', 'model/MultiValuedAttribute', 'model/OfferAvailability', 'model/OfferCondition', 'model/OfferConditionNote', 'model/OfferCount', 'model/OfferDeliveryInfo', 'model/OfferListing', 'model/OfferLoyaltyPoints', 'model/OfferMerchantInfo', 'model/OfferPrice', 'model/OfferProgramEligibility', 'model/OfferPromotion', 'model/OfferSavings', 'model/OfferShippingCharge', 'model/OfferSubCondition', 'model/OfferSummary', 'model/Offers', 'model/PartnerType', 'model/Price', 'model/PriceType', 'model/ProductAdvertisingAPIClientException', 'model/ProductAdvertisingAPIServiceException', 'model/ProductInfo', 'model/Properties', 'model/Rating', 'model/Refinement', 'model/RefinementBin', 'model/RentalOfferListing', 'model/RentalOffers', 'model/SearchItemsRequest', 'model/SearchItemsResource', 'model/SearchItemsResponse', 'model/SearchRefinements', 'model/SearchResult', 'model/SingleBooleanValuedAttribute', 'model/SingleIntegerValuedAttribute', 'model/SingleStringValuedAttribute', 'model/SortBy', 'model/TechnicalInfo', 'model/TradeInInfo', 'model/TradeInPrice', 'model/UnitBasedAttribute', 'model/VariationAttribute', 'model/VariationDimension', 'model/VariationSummary', 'model/VariationsResult', 'model/WebsiteSalesRank', 'api/DefaultApi'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('./ApiClient'), require('./model/Availability'), require('./model/BrowseNode'), require('./model/BrowseNodeAncestor'), require('./model/BrowseNodeChild'), require('./model/BrowseNodeInfo'), require('./model/BrowseNodesResult'), require('./model/ByLineInfo'), require('./model/Classifications'), require('./model/Condition'), require('./model/ContentInfo'), require('./model/ContentRating'), require('./model/Contributor'), require('./model/CustomerReviews'), require('./model/DeliveryFlag'), require('./model/DimensionBasedAttribute'), require('./model/DurationPrice'), require('./model/ErrorData'), require('./model/ExternalIds'), require('./model/GetBrowseNodesRequest'), require('./model/GetBrowseNodesResource'), require('./model/GetBrowseNodesResponse'), require('./model/GetItemsRequest'), require('./model/GetItemsResource'), require('./model/GetItemsResponse'), require('./model/GetVariationsRequest'), require('./model/GetVariationsResource'), require('./model/GetVariationsResponse'), require('./model/ImageSize'), require('./model/ImageType'), require('./model/Images'), require('./model/Item'), require('./model/ItemIdType'), require('./model/ItemInfo'), require('./model/ItemsResult'), require('./model/LanguageType'), require('./model/Languages'), require('./model/ManufactureInfo'), require('./model/MaxPrice'), require('./model/Merchant'), require('./model/MinPrice'), require('./model/MinReviewsRating'), require('./model/MinSavingPercent'), require('./model/MultiValuedAttribute'), require('./model/OfferAvailability'), require('./model/OfferCondition'), require('./model/OfferConditionNote'), require('./model/OfferCount'), require('./model/OfferDeliveryInfo'), require('./model/OfferListing'), require('./model/OfferLoyaltyPoints'), require('./model/OfferMerchantInfo'), require('./model/OfferPrice'), require('./model/OfferProgramEligibility'), require('./model/OfferPromotion'), require('./model/OfferSavings'), require('./model/OfferShippingCharge'), require('./model/OfferSubCondition'), require('./model/OfferSummary'), require('./model/Offers'), require('./model/PartnerType'), require('./model/Price'), require('./model/PriceType'), require('./model/ProductAdvertisingAPIClientException'), require('./model/ProductAdvertisingAPIServiceException'), require('./model/ProductInfo'), require('./model/Properties'), require('./model/Rating'), require('./model/Refinement'), require('./model/RefinementBin'), require('./model/RentalOfferListing'), require('./model/RentalOffers'), require('./model/SearchItemsRequest'), require('./model/SearchItemsResource'), require('./model/SearchItemsResponse'), require('./model/SearchRefinements'), require('./model/SearchResult'), require('./model/SingleBooleanValuedAttribute'), require('./model/SingleIntegerValuedAttribute'), require('./model/SingleStringValuedAttribute'), require('./model/SortBy'), require('./model/TechnicalInfo'), require('./model/TradeInInfo'), require('./model/TradeInPrice'), require('./model/UnitBasedAttribute'), require('./model/VariationAttribute'), require('./model/VariationDimension'), require('./model/VariationSummary'), require('./model/VariationsResult'), require('./model/WebsiteSalesRank'), require('./api/DefaultApi')); + } +}(function(ApiClient, Availability, BrowseNode, BrowseNodeAncestor, BrowseNodeChild, BrowseNodeInfo, BrowseNodesResult, ByLineInfo, Classifications, Condition, ContentInfo, ContentRating, Contributor, CustomerReviews, DeliveryFlag, DimensionBasedAttribute, DurationPrice, ErrorData, ExternalIds, GetBrowseNodesRequest, GetBrowseNodesResource, GetBrowseNodesResponse, GetItemsRequest, GetItemsResource, GetItemsResponse, GetVariationsRequest, GetVariationsResource, GetVariationsResponse, ImageSize, ImageType, Images, Item, ItemIdType, ItemInfo, ItemsResult, LanguageType, Languages, ManufactureInfo, MaxPrice, Merchant, MinPrice, MinReviewsRating, MinSavingPercent, MultiValuedAttribute, OfferAvailability, OfferCondition, OfferConditionNote, OfferCount, OfferDeliveryInfo, OfferListing, OfferLoyaltyPoints, OfferMerchantInfo, OfferPrice, OfferProgramEligibility, OfferPromotion, OfferSavings, OfferShippingCharge, OfferSubCondition, OfferSummary, Offers, PartnerType, Price, PriceType, ProductAdvertisingAPIClientException, ProductAdvertisingAPIServiceException, ProductInfo, Properties, Rating, Refinement, RefinementBin, RentalOfferListing, RentalOffers, SearchItemsRequest, SearchItemsResource, SearchItemsResponse, SearchRefinements, SearchResult, SingleBooleanValuedAttribute, SingleIntegerValuedAttribute, SingleStringValuedAttribute, SortBy, TechnicalInfo, TradeInInfo, TradeInPrice, UnitBasedAttribute, VariationAttribute, VariationDimension, VariationSummary, VariationsResult, WebsiteSalesRank, DefaultApi) { + 'use strict'; + + /** + * ProductAdvertisingAPI 5.0 NodeJS SDK.
+ * The index module provides access to constructors for all the classes which comprise the public API. + *

+ * An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: + *

+   * var ProductAdvertisingAPIv1 = require('index'); // See note below*.
+   * var xxxSvc = new ProductAdvertisingAPIv1.XxxApi(); // Allocate the API class we're going to use.
+   * var yyyModel = new ProductAdvertisingAPIv1.Yyy(); // Construct a model instance.
+   * yyyModel.someProperty = 'someValue';
+   * ...
+   * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
+   * ...
+   * 
+ * *NOTE: For a top-level AMD script, use require(['index'], function(){...}) + * and put the application logic within the callback function. + *

+ *

+ * A non-AMD browser application (discouraged) might do something like this: + *

+   * var xxxSvc = new ProductAdvertisingAPIv1.XxxApi(); // Allocate the API class we're going to use.
+   * var yyy = new ProductAdvertisingAPIv1.Yyy(); // Construct a model instance.
+   * yyyModel.someProperty = 'someValue';
+   * ...
+   * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
+   * ...
+   * 
+ *

+ * @module index + * @version 1.0.0 + */ + var exports = { + /** + * The ApiClient constructor. + * @property {module:ApiClient} + */ + ApiClient: ApiClient, + /** + * The Availability model constructor. + * @property {module:model/Availability} + */ + Availability: Availability, + /** + * The BrowseNode model constructor. + * @property {module:model/BrowseNode} + */ + BrowseNode: BrowseNode, + /** + * The BrowseNodeAncestor model constructor. + * @property {module:model/BrowseNodeAncestor} + */ + BrowseNodeAncestor: BrowseNodeAncestor, + /** + * The BrowseNodeChild model constructor. + * @property {module:model/BrowseNodeChild} + */ + BrowseNodeChild: BrowseNodeChild, + /** + * The BrowseNodeInfo model constructor. + * @property {module:model/BrowseNodeInfo} + */ + BrowseNodeInfo: BrowseNodeInfo, + /** + * The BrowseNodesResult model constructor. + * @property {module:model/BrowseNodesResult} + */ + BrowseNodesResult: BrowseNodesResult, + /** + * The ByLineInfo model constructor. + * @property {module:model/ByLineInfo} + */ + ByLineInfo: ByLineInfo, + /** + * The Classifications model constructor. + * @property {module:model/Classifications} + */ + Classifications: Classifications, + /** + * The Condition model constructor. + * @property {module:model/Condition} + */ + Condition: Condition, + /** + * The ContentInfo model constructor. + * @property {module:model/ContentInfo} + */ + ContentInfo: ContentInfo, + /** + * The ContentRating model constructor. + * @property {module:model/ContentRating} + */ + ContentRating: ContentRating, + /** + * The Contributor model constructor. + * @property {module:model/Contributor} + */ + Contributor: Contributor, + /** + * The CustomerReviews model constructor. + * @property {module:model/CustomerReviews} + */ + CustomerReviews: CustomerReviews, + /** + * The DeliveryFlag model constructor. + * @property {module:model/DeliveryFlag} + */ + DeliveryFlag: DeliveryFlag, + /** + * The DimensionBasedAttribute model constructor. + * @property {module:model/DimensionBasedAttribute} + */ + DimensionBasedAttribute: DimensionBasedAttribute, + /** + * The DurationPrice model constructor. + * @property {module:model/DurationPrice} + */ + DurationPrice: DurationPrice, + /** + * The ErrorData model constructor. + * @property {module:model/ErrorData} + */ + ErrorData: ErrorData, + /** + * The ExternalIds model constructor. + * @property {module:model/ExternalIds} + */ + ExternalIds: ExternalIds, + /** + * The GetBrowseNodesRequest model constructor. + * @property {module:model/GetBrowseNodesRequest} + */ + GetBrowseNodesRequest: GetBrowseNodesRequest, + /** + * The GetBrowseNodesResource model constructor. + * @property {module:model/GetBrowseNodesResource} + */ + GetBrowseNodesResource: GetBrowseNodesResource, + /** + * The GetBrowseNodesResponse model constructor. + * @property {module:model/GetBrowseNodesResponse} + */ + GetBrowseNodesResponse: GetBrowseNodesResponse, + /** + * The GetItemsRequest model constructor. + * @property {module:model/GetItemsRequest} + */ + GetItemsRequest: GetItemsRequest, + /** + * The GetItemsResource model constructor. + * @property {module:model/GetItemsResource} + */ + GetItemsResource: GetItemsResource, + /** + * The GetItemsResponse model constructor. + * @property {module:model/GetItemsResponse} + */ + GetItemsResponse: GetItemsResponse, + /** + * The GetVariationsRequest model constructor. + * @property {module:model/GetVariationsRequest} + */ + GetVariationsRequest: GetVariationsRequest, + /** + * The GetVariationsResource model constructor. + * @property {module:model/GetVariationsResource} + */ + GetVariationsResource: GetVariationsResource, + /** + * The GetVariationsResponse model constructor. + * @property {module:model/GetVariationsResponse} + */ + GetVariationsResponse: GetVariationsResponse, + /** + * The ImageSize model constructor. + * @property {module:model/ImageSize} + */ + ImageSize: ImageSize, + /** + * The ImageType model constructor. + * @property {module:model/ImageType} + */ + ImageType: ImageType, + /** + * The Images model constructor. + * @property {module:model/Images} + */ + Images: Images, + /** + * The Item model constructor. + * @property {module:model/Item} + */ + Item: Item, + /** + * The ItemIdType model constructor. + * @property {module:model/ItemIdType} + */ + ItemIdType: ItemIdType, + /** + * The ItemInfo model constructor. + * @property {module:model/ItemInfo} + */ + ItemInfo: ItemInfo, + /** + * The ItemsResult model constructor. + * @property {module:model/ItemsResult} + */ + ItemsResult: ItemsResult, + /** + * The LanguageType model constructor. + * @property {module:model/LanguageType} + */ + LanguageType: LanguageType, + /** + * The Languages model constructor. + * @property {module:model/Languages} + */ + Languages: Languages, + /** + * The ManufactureInfo model constructor. + * @property {module:model/ManufactureInfo} + */ + ManufactureInfo: ManufactureInfo, + /** + * The MaxPrice model constructor. + * @property {module:model/MaxPrice} + */ + MaxPrice: MaxPrice, + /** + * The Merchant model constructor. + * @property {module:model/Merchant} + */ + Merchant: Merchant, + /** + * The MinPrice model constructor. + * @property {module:model/MinPrice} + */ + MinPrice: MinPrice, + /** + * The MinReviewsRating model constructor. + * @property {module:model/MinReviewsRating} + */ + MinReviewsRating: MinReviewsRating, + /** + * The MinSavingPercent model constructor. + * @property {module:model/MinSavingPercent} + */ + MinSavingPercent: MinSavingPercent, + /** + * The MultiValuedAttribute model constructor. + * @property {module:model/MultiValuedAttribute} + */ + MultiValuedAttribute: MultiValuedAttribute, + /** + * The OfferAvailability model constructor. + * @property {module:model/OfferAvailability} + */ + OfferAvailability: OfferAvailability, + /** + * The OfferCondition model constructor. + * @property {module:model/OfferCondition} + */ + OfferCondition: OfferCondition, + /** + * The OfferConditionNote model constructor. + * @property {module:model/OfferConditionNote} + */ + OfferConditionNote: OfferConditionNote, + /** + * The OfferCount model constructor. + * @property {module:model/OfferCount} + */ + OfferCount: OfferCount, + /** + * The OfferDeliveryInfo model constructor. + * @property {module:model/OfferDeliveryInfo} + */ + OfferDeliveryInfo: OfferDeliveryInfo, + /** + * The OfferListing model constructor. + * @property {module:model/OfferListing} + */ + OfferListing: OfferListing, + /** + * The OfferLoyaltyPoints model constructor. + * @property {module:model/OfferLoyaltyPoints} + */ + OfferLoyaltyPoints: OfferLoyaltyPoints, + /** + * The OfferMerchantInfo model constructor. + * @property {module:model/OfferMerchantInfo} + */ + OfferMerchantInfo: OfferMerchantInfo, + /** + * The OfferPrice model constructor. + * @property {module:model/OfferPrice} + */ + OfferPrice: OfferPrice, + /** + * The OfferProgramEligibility model constructor. + * @property {module:model/OfferProgramEligibility} + */ + OfferProgramEligibility: OfferProgramEligibility, + /** + * The OfferPromotion model constructor. + * @property {module:model/OfferPromotion} + */ + OfferPromotion: OfferPromotion, + /** + * The OfferSavings model constructor. + * @property {module:model/OfferSavings} + */ + OfferSavings: OfferSavings, + /** + * The OfferShippingCharge model constructor. + * @property {module:model/OfferShippingCharge} + */ + OfferShippingCharge: OfferShippingCharge, + /** + * The OfferSubCondition model constructor. + * @property {module:model/OfferSubCondition} + */ + OfferSubCondition: OfferSubCondition, + /** + * The OfferSummary model constructor. + * @property {module:model/OfferSummary} + */ + OfferSummary: OfferSummary, + /** + * The Offers model constructor. + * @property {module:model/Offers} + */ + Offers: Offers, + /** + * The PartnerType model constructor. + * @property {module:model/PartnerType} + */ + PartnerType: PartnerType, + /** + * The Price model constructor. + * @property {module:model/Price} + */ + Price: Price, + /** + * The PriceType model constructor. + * @property {module:model/PriceType} + */ + PriceType: PriceType, + /** + * The ProductAdvertisingAPIClientException model constructor. + * @property {module:model/ProductAdvertisingAPIClientException} + */ + ProductAdvertisingAPIClientException: ProductAdvertisingAPIClientException, + /** + * The ProductAdvertisingAPIServiceException model constructor. + * @property {module:model/ProductAdvertisingAPIServiceException} + */ + ProductAdvertisingAPIServiceException: ProductAdvertisingAPIServiceException, + /** + * The ProductInfo model constructor. + * @property {module:model/ProductInfo} + */ + ProductInfo: ProductInfo, + /** + * The Properties model constructor. + * @property {module:model/Properties} + */ + Properties: Properties, + /** + * The Rating model constructor. + * @property {module:model/Rating} + */ + Rating: Rating, + /** + * The Refinement model constructor. + * @property {module:model/Refinement} + */ + Refinement: Refinement, + /** + * The RefinementBin model constructor. + * @property {module:model/RefinementBin} + */ + RefinementBin: RefinementBin, + /** + * The RentalOfferListing model constructor. + * @property {module:model/RentalOfferListing} + */ + RentalOfferListing: RentalOfferListing, + /** + * The RentalOffers model constructor. + * @property {module:model/RentalOffers} + */ + RentalOffers: RentalOffers, + /** + * The SearchItemsRequest model constructor. + * @property {module:model/SearchItemsRequest} + */ + SearchItemsRequest: SearchItemsRequest, + /** + * The SearchItemsResource model constructor. + * @property {module:model/SearchItemsResource} + */ + SearchItemsResource: SearchItemsResource, + /** + * The SearchItemsResponse model constructor. + * @property {module:model/SearchItemsResponse} + */ + SearchItemsResponse: SearchItemsResponse, + /** + * The SearchRefinements model constructor. + * @property {module:model/SearchRefinements} + */ + SearchRefinements: SearchRefinements, + /** + * The SearchResult model constructor. + * @property {module:model/SearchResult} + */ + SearchResult: SearchResult, + /** + * The SingleBooleanValuedAttribute model constructor. + * @property {module:model/SingleBooleanValuedAttribute} + */ + SingleBooleanValuedAttribute: SingleBooleanValuedAttribute, + /** + * The SingleIntegerValuedAttribute model constructor. + * @property {module:model/SingleIntegerValuedAttribute} + */ + SingleIntegerValuedAttribute: SingleIntegerValuedAttribute, + /** + * The SingleStringValuedAttribute model constructor. + * @property {module:model/SingleStringValuedAttribute} + */ + SingleStringValuedAttribute: SingleStringValuedAttribute, + /** + * The SortBy model constructor. + * @property {module:model/SortBy} + */ + SortBy: SortBy, + /** + * The TechnicalInfo model constructor. + * @property {module:model/TechnicalInfo} + */ + TechnicalInfo: TechnicalInfo, + /** + * The TradeInInfo model constructor. + * @property {module:model/TradeInInfo} + */ + TradeInInfo: TradeInInfo, + /** + * The TradeInPrice model constructor. + * @property {module:model/TradeInPrice} + */ + TradeInPrice: TradeInPrice, + /** + * The UnitBasedAttribute model constructor. + * @property {module:model/UnitBasedAttribute} + */ + UnitBasedAttribute: UnitBasedAttribute, + /** + * The VariationAttribute model constructor. + * @property {module:model/VariationAttribute} + */ + VariationAttribute: VariationAttribute, + /** + * The VariationDimension model constructor. + * @property {module:model/VariationDimension} + */ + VariationDimension: VariationDimension, + /** + * The VariationSummary model constructor. + * @property {module:model/VariationSummary} + */ + VariationSummary: VariationSummary, + /** + * The VariationsResult model constructor. + * @property {module:model/VariationsResult} + */ + VariationsResult: VariationsResult, + /** + * The WebsiteSalesRank model constructor. + * @property {module:model/WebsiteSalesRank} + */ + WebsiteSalesRank: WebsiteSalesRank, + /** + * The DefaultApi service constructor. + * @property {module:api/DefaultApi} + */ + DefaultApi: DefaultApi + }; + + return exports; +})); diff --git a/paapi5-nodejs-sdk-example/src/model/Availability.js b/paapi5-nodejs-sdk-example/src/model/Availability.js new file mode 100644 index 0000000..d6f9ec5 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/Availability.js @@ -0,0 +1,69 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.Availability = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + /** + * Enum class Availability. + * @enum {} + * @readonly + */ + var exports = { + /** + * value: "Available" + * @const + */ + "Available": "Available", + /** + * value: "IncludeOutOfStock" + * @const + */ + "IncludeOutOfStock": "IncludeOutOfStock" }; + + /** + * Returns a Availability enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/Availability} The enum Availability value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/BrowseNode.js b/paapi5-nodejs-sdk-example/src/model/BrowseNode.js new file mode 100644 index 0000000..cc6f918 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/BrowseNode.js @@ -0,0 +1,135 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/BrowseNodeAncestor', 'model/BrowseNodeChild'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./BrowseNodeAncestor'), require('./BrowseNodeChild')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.BrowseNode = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.BrowseNodeAncestor, root.ProductAdvertisingAPIv1.BrowseNodeChild); + } +}(this, function(ApiClient, BrowseNodeAncestor, BrowseNodeChild) { + 'use strict'; + + + + + /** + * The BrowseNode model module. + * @module model/BrowseNode + * @version 1.0.0 + */ + + /** + * Constructs a new BrowseNode. + * @alias module:model/BrowseNode + * @class + */ + var exports = function() { + var _this = this; + + + + + + + + + }; + + /** + * Constructs a BrowseNode from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BrowseNode} obj Optional instance to populate. + * @return {module:model/BrowseNode} The populated BrowseNode instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Ancestor')) { + obj['Ancestor'] = BrowseNodeAncestor.constructFromObject(data['Ancestor']); + } + if (data.hasOwnProperty('Children')) { + obj['Children'] = ApiClient.convertToType(data['Children'], [BrowseNodeChild]); + } + if (data.hasOwnProperty('ContextFreeName')) { + obj['ContextFreeName'] = ApiClient.convertToType(data['ContextFreeName'], 'String'); + } + if (data.hasOwnProperty('DisplayName')) { + obj['DisplayName'] = ApiClient.convertToType(data['DisplayName'], 'String'); + } + if (data.hasOwnProperty('Id')) { + obj['Id'] = ApiClient.convertToType(data['Id'], 'String'); + } + if (data.hasOwnProperty('IsRoot')) { + obj['IsRoot'] = ApiClient.convertToType(data['IsRoot'], 'Boolean'); + } + if (data.hasOwnProperty('SalesRank')) { + obj['SalesRank'] = ApiClient.convertToType(data['SalesRank'], 'Number'); + } + } + return obj; + } + + /** + * @member {module:model/BrowseNodeAncestor} Ancestor + */ + exports.prototype['Ancestor'] = undefined; + /** + * @member {Array.} Children + */ + exports.prototype['Children'] = undefined; + /** + * @member {String} ContextFreeName + */ + exports.prototype['ContextFreeName'] = undefined; + /** + * @member {String} DisplayName + */ + exports.prototype['DisplayName'] = undefined; + /** + * @member {String} Id + */ + exports.prototype['Id'] = undefined; + /** + * @member {Boolean} IsRoot + */ + exports.prototype['IsRoot'] = undefined; + /** + * @member {Number} SalesRank + */ + exports.prototype['SalesRank'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/BrowseNodeAncestor.js b/paapi5-nodejs-sdk-example/src/model/BrowseNodeAncestor.js new file mode 100644 index 0000000..e46fbaa --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/BrowseNodeAncestor.js @@ -0,0 +1,111 @@ +/** + * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.BrowseNodeAncestor = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient, BrowseNodeAncestor) { + 'use strict'; + + + + + /** + * The BrowseNodeAncestor model module. + * @module model/BrowseNodeAncestor + * @version 1.0.0 + */ + + /** + * Constructs a new BrowseNodeAncestor. + * @alias module:model/BrowseNodeAncestor + * @class + */ + var exports = function() { + var _this = this; + + + + + + }; + + /** + * Constructs a BrowseNodeAncestor from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BrowseNodeAncestor} obj Optional instance to populate. + * @return {module:model/BrowseNodeAncestor} The populated BrowseNodeAncestor instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Ancestor')) { + obj['Ancestor'] = this.constructFromObject(data['Ancestor']); + } + if (data.hasOwnProperty('ContextFreeName')) { + obj['ContextFreeName'] = ApiClient.convertToType(data['ContextFreeName'], 'String'); + } + if (data.hasOwnProperty('DisplayName')) { + obj['DisplayName'] = ApiClient.convertToType(data['DisplayName'], 'String'); + } + if (data.hasOwnProperty('Id')) { + obj['Id'] = ApiClient.convertToType(data['Id'], 'String'); + } + } + return obj; + } + + /** + * @member {module:model/BrowseNodeAncestor} Ancestor + */ + exports.prototype['Ancestor'] = undefined; + /** + * @member {String} ContextFreeName + */ + exports.prototype['ContextFreeName'] = undefined; + /** + * @member {String} DisplayName + */ + exports.prototype['DisplayName'] = undefined; + /** + * @member {String} Id + */ + exports.prototype['Id'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/BrowseNodeChild.js b/paapi5-nodejs-sdk-example/src/model/BrowseNodeChild.js new file mode 100644 index 0000000..f2e5e2e --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/BrowseNodeChild.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.BrowseNodeChild = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The BrowseNodeChild model module. + * @module model/BrowseNodeChild + * @version 1.0.0 + */ + + /** + * Constructs a new BrowseNodeChild. + * @alias module:model/BrowseNodeChild + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a BrowseNodeChild from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BrowseNodeChild} obj Optional instance to populate. + * @return {module:model/BrowseNodeChild} The populated BrowseNodeChild instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('ContextFreeName')) { + obj['ContextFreeName'] = ApiClient.convertToType(data['ContextFreeName'], 'String'); + } + if (data.hasOwnProperty('DisplayName')) { + obj['DisplayName'] = ApiClient.convertToType(data['DisplayName'], 'String'); + } + if (data.hasOwnProperty('Id')) { + obj['Id'] = ApiClient.convertToType(data['Id'], 'String'); + } + } + return obj; + } + + /** + * @member {String} ContextFreeName + */ + exports.prototype['ContextFreeName'] = undefined; + /** + * @member {String} DisplayName + */ + exports.prototype['DisplayName'] = undefined; + /** + * @member {String} Id + */ + exports.prototype['Id'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/BrowseNodeInfo.js b/paapi5-nodejs-sdk-example/src/model/BrowseNodeInfo.js new file mode 100644 index 0000000..8f4754a --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/BrowseNodeInfo.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/BrowseNode', 'model/WebsiteSalesRank'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./BrowseNode'), require('./WebsiteSalesRank')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.BrowseNodeInfo = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.BrowseNode, root.ProductAdvertisingAPIv1.WebsiteSalesRank); + } +}(this, function(ApiClient, BrowseNode, WebsiteSalesRank) { + 'use strict'; + + + + + /** + * The BrowseNodeInfo model module. + * @module model/BrowseNodeInfo + * @version 1.0.0 + */ + + /** + * Constructs a new BrowseNodeInfo. + * @alias module:model/BrowseNodeInfo + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a BrowseNodeInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BrowseNodeInfo} obj Optional instance to populate. + * @return {module:model/BrowseNodeInfo} The populated BrowseNodeInfo instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('BrowseNodes')) { + obj['BrowseNodes'] = ApiClient.convertToType(data['BrowseNodes'], [BrowseNode]); + } + if (data.hasOwnProperty('WebsiteSalesRank')) { + obj['WebsiteSalesRank'] = WebsiteSalesRank.constructFromObject(data['WebsiteSalesRank']); + } + } + return obj; + } + + /** + * @member {Array.} BrowseNodes + */ + exports.prototype['BrowseNodes'] = undefined; + /** + * @member {module:model/WebsiteSalesRank} WebsiteSalesRank + */ + exports.prototype['WebsiteSalesRank'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/BrowseNodesResult.js b/paapi5-nodejs-sdk-example/src/model/BrowseNodesResult.js new file mode 100644 index 0000000..4f9f1a0 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/BrowseNodesResult.js @@ -0,0 +1,87 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/BrowseNode'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./BrowseNode')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.BrowseNodesResult = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.BrowseNode); + } +}(this, function(ApiClient, BrowseNode) { + 'use strict'; + + + + + /** + * The BrowseNodesResult model module. + * @module model/BrowseNodesResult + * @version 1.0.0 + */ + + /** + * Constructs a new BrowseNodesResult. + * @alias module:model/BrowseNodesResult + * @class + */ + var exports = function() { + var _this = this; + + + }; + + /** + * Constructs a BrowseNodesResult from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BrowseNodesResult} obj Optional instance to populate. + * @return {module:model/BrowseNodesResult} The populated BrowseNodesResult instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('BrowseNodes')) { + obj['BrowseNodes'] = ApiClient.convertToType(data['BrowseNodes'], [BrowseNode]); + } + } + return obj; + } + + /** + * @member {Array.} BrowseNodes + */ + exports.prototype['BrowseNodes'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ByLineInfo.js b/paapi5-nodejs-sdk-example/src/model/ByLineInfo.js new file mode 100644 index 0000000..d189cee --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ByLineInfo.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Contributor', 'model/SingleStringValuedAttribute'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./Contributor'), require('./SingleStringValuedAttribute')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ByLineInfo = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.Contributor, root.ProductAdvertisingAPIv1.SingleStringValuedAttribute); + } +}(this, function(ApiClient, Contributor, SingleStringValuedAttribute) { + 'use strict'; + + + + + /** + * The ByLineInfo model module. + * @module model/ByLineInfo + * @version 1.0.0 + */ + + /** + * Constructs a new ByLineInfo. + * @alias module:model/ByLineInfo + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a ByLineInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ByLineInfo} obj Optional instance to populate. + * @return {module:model/ByLineInfo} The populated ByLineInfo instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Brand')) { + obj['Brand'] = SingleStringValuedAttribute.constructFromObject(data['Brand']); + } + if (data.hasOwnProperty('Contributors')) { + obj['Contributors'] = ApiClient.convertToType(data['Contributors'], [Contributor]); + } + if (data.hasOwnProperty('Manufacturer')) { + obj['Manufacturer'] = SingleStringValuedAttribute.constructFromObject(data['Manufacturer']); + } + } + return obj; + } + + /** + * @member {module:model/SingleStringValuedAttribute} Brand + */ + exports.prototype['Brand'] = undefined; + /** + * @member {Array.} Contributors + */ + exports.prototype['Contributors'] = undefined; + /** + * @member {module:model/SingleStringValuedAttribute} Manufacturer + */ + exports.prototype['Manufacturer'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/Classifications.js b/paapi5-nodejs-sdk-example/src/model/Classifications.js new file mode 100644 index 0000000..a3338b6 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/Classifications.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/SingleStringValuedAttribute'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./SingleStringValuedAttribute')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.Classifications = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.SingleStringValuedAttribute); + } +}(this, function(ApiClient, SingleStringValuedAttribute) { + 'use strict'; + + + + + /** + * The Classifications model module. + * @module model/Classifications + * @version 1.0.0 + */ + + /** + * Constructs a new Classifications. + * @alias module:model/Classifications + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a Classifications from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Classifications} obj Optional instance to populate. + * @return {module:model/Classifications} The populated Classifications instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Binding')) { + obj['Binding'] = SingleStringValuedAttribute.constructFromObject(data['Binding']); + } + if (data.hasOwnProperty('ProductGroup')) { + obj['ProductGroup'] = SingleStringValuedAttribute.constructFromObject(data['ProductGroup']); + } + } + return obj; + } + + /** + * @member {module:model/SingleStringValuedAttribute} Binding + */ + exports.prototype['Binding'] = undefined; + /** + * @member {module:model/SingleStringValuedAttribute} ProductGroup + */ + exports.prototype['ProductGroup'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/Condition.js b/paapi5-nodejs-sdk-example/src/model/Condition.js new file mode 100644 index 0000000..2737732 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/Condition.js @@ -0,0 +1,84 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.Condition = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + /** + * Enum class Condition. + * @enum {} + * @readonly + */ + var exports = { + /** + * value: "Any" + * @const + */ + "Any": "Any", + /** + * value: "Collectible" + * @const + */ + "Collectible": "Collectible", + /** + * value: "New" + * @const + */ + "New": "New", + /** + * value: "Refurbished" + * @const + */ + "Refurbished": "Refurbished", + /** + * value: "Used" + * @const + */ + "Used": "Used" }; + + /** + * Returns a Condition enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/Condition} The enum Condition value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ContentInfo.js b/paapi5-nodejs-sdk-example/src/model/ContentInfo.js new file mode 100644 index 0000000..89aebfd --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ContentInfo.js @@ -0,0 +1,111 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Languages', 'model/SingleIntegerValuedAttribute', 'model/SingleStringValuedAttribute'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./Languages'), require('./SingleIntegerValuedAttribute'), require('./SingleStringValuedAttribute')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ContentInfo = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.Languages, root.ProductAdvertisingAPIv1.SingleIntegerValuedAttribute, root.ProductAdvertisingAPIv1.SingleStringValuedAttribute); + } +}(this, function(ApiClient, Languages, SingleIntegerValuedAttribute, SingleStringValuedAttribute) { + 'use strict'; + + + + + /** + * The ContentInfo model module. + * @module model/ContentInfo + * @version 1.0.0 + */ + + /** + * Constructs a new ContentInfo. + * @alias module:model/ContentInfo + * @class + */ + var exports = function() { + var _this = this; + + + + + + }; + + /** + * Constructs a ContentInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ContentInfo} obj Optional instance to populate. + * @return {module:model/ContentInfo} The populated ContentInfo instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Edition')) { + obj['Edition'] = SingleStringValuedAttribute.constructFromObject(data['Edition']); + } + if (data.hasOwnProperty('Languages')) { + obj['Languages'] = Languages.constructFromObject(data['Languages']); + } + if (data.hasOwnProperty('PagesCount')) { + obj['PagesCount'] = SingleIntegerValuedAttribute.constructFromObject(data['PagesCount']); + } + if (data.hasOwnProperty('PublicationDate')) { + obj['PublicationDate'] = SingleStringValuedAttribute.constructFromObject(data['PublicationDate']); + } + } + return obj; + } + + /** + * @member {module:model/SingleStringValuedAttribute} Edition + */ + exports.prototype['Edition'] = undefined; + /** + * @member {module:model/Languages} Languages + */ + exports.prototype['Languages'] = undefined; + /** + * @member {module:model/SingleIntegerValuedAttribute} PagesCount + */ + exports.prototype['PagesCount'] = undefined; + /** + * @member {module:model/SingleStringValuedAttribute} PublicationDate + */ + exports.prototype['PublicationDate'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ContentRating.js b/paapi5-nodejs-sdk-example/src/model/ContentRating.js new file mode 100644 index 0000000..1d2f130 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ContentRating.js @@ -0,0 +1,87 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/SingleStringValuedAttribute'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./SingleStringValuedAttribute')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ContentRating = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.SingleStringValuedAttribute); + } +}(this, function(ApiClient, SingleStringValuedAttribute) { + 'use strict'; + + + + + /** + * The ContentRating model module. + * @module model/ContentRating + * @version 1.0.0 + */ + + /** + * Constructs a new ContentRating. + * @alias module:model/ContentRating + * @class + */ + var exports = function() { + var _this = this; + + + }; + + /** + * Constructs a ContentRating from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ContentRating} obj Optional instance to populate. + * @return {module:model/ContentRating} The populated ContentRating instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('AudienceRating')) { + obj['AudienceRating'] = SingleStringValuedAttribute.constructFromObject(data['AudienceRating']); + } + } + return obj; + } + + /** + * @member {module:model/SingleStringValuedAttribute} AudienceRating + */ + exports.prototype['AudienceRating'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/Contributor.js b/paapi5-nodejs-sdk-example/src/model/Contributor.js new file mode 100644 index 0000000..615e12c --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/Contributor.js @@ -0,0 +1,111 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.Contributor = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The Contributor model module. + * @module model/Contributor + * @version 1.0.0 + */ + + /** + * Constructs a new Contributor. + * @alias module:model/Contributor + * @class + */ + var exports = function() { + var _this = this; + + + + + + }; + + /** + * Constructs a Contributor from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Contributor} obj Optional instance to populate. + * @return {module:model/Contributor} The populated Contributor instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Locale')) { + obj['Locale'] = ApiClient.convertToType(data['Locale'], 'String'); + } + if (data.hasOwnProperty('Name')) { + obj['Name'] = ApiClient.convertToType(data['Name'], 'String'); + } + if (data.hasOwnProperty('Role')) { + obj['Role'] = ApiClient.convertToType(data['Role'], 'String'); + } + if (data.hasOwnProperty('RoleType')) { + obj['RoleType'] = ApiClient.convertToType(data['RoleType'], 'String'); + } + } + return obj; + } + + /** + * @member {String} Locale + */ + exports.prototype['Locale'] = undefined; + /** + * @member {String} Name + */ + exports.prototype['Name'] = undefined; + /** + * @member {String} Role + */ + exports.prototype['Role'] = undefined; + /** + * @member {String} RoleType + */ + exports.prototype['RoleType'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/CustomerReviews.js b/paapi5-nodejs-sdk-example/src/model/CustomerReviews.js new file mode 100644 index 0000000..efa6459 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/CustomerReviews.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Rating'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./Rating')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.CustomerReviews = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.Rating); + } +}(this, function(ApiClient, Rating) { + 'use strict'; + + + + + /** + * The CustomerReviews model module. + * @module model/CustomerReviews + * @version 1.0.0 + */ + + /** + * Constructs a new CustomerReviews. + * @alias module:model/CustomerReviews + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a CustomerReviews from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/CustomerReviews} obj Optional instance to populate. + * @return {module:model/CustomerReviews} The populated CustomerReviews instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Count')) { + obj['Count'] = ApiClient.convertToType(data['Count'], 'Number'); + } + if (data.hasOwnProperty('StarRating')) { + obj['StarRating'] = Rating.constructFromObject(data['StarRating']); + } + } + return obj; + } + + /** + * @member {Number} Count + */ + exports.prototype['Count'] = undefined; + /** + * @member {module:model/Rating} StarRating + */ + exports.prototype['StarRating'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/DeliveryFlag.js b/paapi5-nodejs-sdk-example/src/model/DeliveryFlag.js new file mode 100644 index 0000000..8e6d843 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/DeliveryFlag.js @@ -0,0 +1,79 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.DeliveryFlag = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + /** + * Enum class DeliveryFlag. + * @enum {} + * @readonly + */ + var exports = { + /** + * value: "AmazonGlobal" + * @const + */ + "AmazonGlobal": "AmazonGlobal", + /** + * value: "FreeShipping" + * @const + */ + "FreeShipping": "FreeShipping", + /** + * value: "FulfilledByAmazon" + * @const + */ + "FulfilledByAmazon": "FulfilledByAmazon", + /** + * value: "Prime" + * @const + */ + "Prime": "Prime" }; + + /** + * Returns a DeliveryFlag enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/DeliveryFlag} The enum DeliveryFlag value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/DimensionBasedAttribute.js b/paapi5-nodejs-sdk-example/src/model/DimensionBasedAttribute.js new file mode 100644 index 0000000..3497650 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/DimensionBasedAttribute.js @@ -0,0 +1,111 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/UnitBasedAttribute'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./UnitBasedAttribute')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.DimensionBasedAttribute = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.UnitBasedAttribute); + } +}(this, function(ApiClient, UnitBasedAttribute) { + 'use strict'; + + + + + /** + * The DimensionBasedAttribute model module. + * @module model/DimensionBasedAttribute + * @version 1.0.0 + */ + + /** + * Constructs a new DimensionBasedAttribute. + * @alias module:model/DimensionBasedAttribute + * @class + */ + var exports = function() { + var _this = this; + + + + + + }; + + /** + * Constructs a DimensionBasedAttribute from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/DimensionBasedAttribute} obj Optional instance to populate. + * @return {module:model/DimensionBasedAttribute} The populated DimensionBasedAttribute instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Height')) { + obj['Height'] = UnitBasedAttribute.constructFromObject(data['Height']); + } + if (data.hasOwnProperty('Length')) { + obj['Length'] = UnitBasedAttribute.constructFromObject(data['Length']); + } + if (data.hasOwnProperty('Weight')) { + obj['Weight'] = UnitBasedAttribute.constructFromObject(data['Weight']); + } + if (data.hasOwnProperty('Width')) { + obj['Width'] = UnitBasedAttribute.constructFromObject(data['Width']); + } + } + return obj; + } + + /** + * @member {module:model/UnitBasedAttribute} Height + */ + exports.prototype['Height'] = undefined; + /** + * @member {module:model/UnitBasedAttribute} Length + */ + exports.prototype['Length'] = undefined; + /** + * @member {module:model/UnitBasedAttribute} Weight + */ + exports.prototype['Weight'] = undefined; + /** + * @member {module:model/UnitBasedAttribute} Width + */ + exports.prototype['Width'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/DurationPrice.js b/paapi5-nodejs-sdk-example/src/model/DurationPrice.js new file mode 100644 index 0000000..120f60a --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/DurationPrice.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/OfferPrice', 'model/UnitBasedAttribute'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./OfferPrice'), require('./UnitBasedAttribute')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.DurationPrice = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.OfferPrice, root.ProductAdvertisingAPIv1.UnitBasedAttribute); + } +}(this, function(ApiClient, OfferPrice, UnitBasedAttribute) { + 'use strict'; + + + + + /** + * The DurationPrice model module. + * @module model/DurationPrice + * @version 1.0.0 + */ + + /** + * Constructs a new DurationPrice. + * @alias module:model/DurationPrice + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a DurationPrice from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/DurationPrice} obj Optional instance to populate. + * @return {module:model/DurationPrice} The populated DurationPrice instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Price')) { + obj['Price'] = OfferPrice.constructFromObject(data['Price']); + } + if (data.hasOwnProperty('Duration')) { + obj['Duration'] = UnitBasedAttribute.constructFromObject(data['Duration']); + } + } + return obj; + } + + /** + * @member {module:model/OfferPrice} Price + */ + exports.prototype['Price'] = undefined; + /** + * @member {module:model/UnitBasedAttribute} Duration + */ + exports.prototype['Duration'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ErrorData.js b/paapi5-nodejs-sdk-example/src/model/ErrorData.js new file mode 100644 index 0000000..f39015f --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ErrorData.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ErrorData = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The ErrorData model module. + * @module model/ErrorData + * @version 1.0.0 + */ + + /** + * Constructs a new ErrorData. + * @alias module:model/ErrorData + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a ErrorData from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ErrorData} obj Optional instance to populate. + * @return {module:model/ErrorData} The populated ErrorData instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Code')) { + obj['Code'] = ApiClient.convertToType(data['Code'], 'String'); + } + if (data.hasOwnProperty('Message')) { + obj['Message'] = ApiClient.convertToType(data['Message'], 'String'); + } + } + return obj; + } + + /** + * @member {String} Code + */ + exports.prototype['Code'] = undefined; + /** + * @member {String} Message + */ + exports.prototype['Message'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ExternalIds.js b/paapi5-nodejs-sdk-example/src/model/ExternalIds.js new file mode 100644 index 0000000..8dd3beb --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ExternalIds.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/MultiValuedAttribute'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./MultiValuedAttribute')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ExternalIds = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.MultiValuedAttribute); + } +}(this, function(ApiClient, MultiValuedAttribute) { + 'use strict'; + + + + + /** + * The ExternalIds model module. + * @module model/ExternalIds + * @version 1.0.0 + */ + + /** + * Constructs a new ExternalIds. + * @alias module:model/ExternalIds + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a ExternalIds from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ExternalIds} obj Optional instance to populate. + * @return {module:model/ExternalIds} The populated ExternalIds instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('EANs')) { + obj['EANs'] = MultiValuedAttribute.constructFromObject(data['EANs']); + } + if (data.hasOwnProperty('ISBNs')) { + obj['ISBNs'] = MultiValuedAttribute.constructFromObject(data['ISBNs']); + } + if (data.hasOwnProperty('UPCs')) { + obj['UPCs'] = MultiValuedAttribute.constructFromObject(data['UPCs']); + } + } + return obj; + } + + /** + * @member {module:model/MultiValuedAttribute} EANs + */ + exports.prototype['EANs'] = undefined; + /** + * @member {module:model/MultiValuedAttribute} ISBNs + */ + exports.prototype['ISBNs'] = undefined; + /** + * @member {module:model/MultiValuedAttribute} UPCs + */ + exports.prototype['UPCs'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/GetBrowseNodesRequest.js b/paapi5-nodejs-sdk-example/src/model/GetBrowseNodesRequest.js new file mode 100644 index 0000000..26897cf --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/GetBrowseNodesRequest.js @@ -0,0 +1,130 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/GetBrowseNodesResource', 'model/PartnerType'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./GetBrowseNodesResource'), require('./PartnerType')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.GetBrowseNodesRequest = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.GetBrowseNodesResource, root.ProductAdvertisingAPIv1.PartnerType); + } +}(this, function(ApiClient, GetBrowseNodesResource, PartnerType) { + 'use strict'; + + + + + /** + * The GetBrowseNodesRequest model module. + * @module model/GetBrowseNodesRequest + * @version 1.0.0 + */ + + /** + * Constructs a new GetBrowseNodesRequest. + * @alias module:model/GetBrowseNodesRequest + * @class + * @param browseNodeIds {Array.} + * @param partnerTag {String} + * @param partnerType {module:model/PartnerType} + */ + var exports = function(browseNodeIds, partnerTag, partnerType) { + var _this = this; + + _this['BrowseNodeIds'] = browseNodeIds; + + + _this['PartnerTag'] = partnerTag; + _this['PartnerType'] = partnerType; + + }; + + /** + * Constructs a GetBrowseNodesRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/GetBrowseNodesRequest} obj Optional instance to populate. + * @return {module:model/GetBrowseNodesRequest} The populated GetBrowseNodesRequest instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('BrowseNodeIds')) { + obj['BrowseNodeIds'] = ApiClient.convertToType(data['BrowseNodeIds'], ['String']); + } + if (data.hasOwnProperty('LanguagesOfPreference')) { + obj['LanguagesOfPreference'] = ApiClient.convertToType(data['LanguagesOfPreference'], ['String']); + } + if (data.hasOwnProperty('Marketplace')) { + obj['Marketplace'] = ApiClient.convertToType(data['Marketplace'], 'String'); + } + if (data.hasOwnProperty('PartnerTag')) { + obj['PartnerTag'] = ApiClient.convertToType(data['PartnerTag'], 'String'); + } + if (data.hasOwnProperty('PartnerType')) { + obj['PartnerType'] = PartnerType.constructFromObject(data['PartnerType']); + } + if (data.hasOwnProperty('Resources')) { + obj['Resources'] = ApiClient.convertToType(data['Resources'], [GetBrowseNodesResource]); + } + } + return obj; + } + + /** + * @member {Array.} BrowseNodeIds + */ + exports.prototype['BrowseNodeIds'] = undefined; + /** + * @member {Array.} LanguagesOfPreference + */ + exports.prototype['LanguagesOfPreference'] = undefined; + /** + * @member {String} Marketplace + */ + exports.prototype['Marketplace'] = undefined; + /** + * @member {String} PartnerTag + */ + exports.prototype['PartnerTag'] = undefined; + /** + * @member {module:model/PartnerType} PartnerType + */ + exports.prototype['PartnerType'] = undefined; + /** + * @member {Array.} Resources + */ + exports.prototype['Resources'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/GetBrowseNodesResource.js b/paapi5-nodejs-sdk-example/src/model/GetBrowseNodesResource.js new file mode 100644 index 0000000..4e65b10 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/GetBrowseNodesResource.js @@ -0,0 +1,69 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.GetBrowseNodesResource = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + /** + * Enum class GetBrowseNodesResource. + * @enum {} + * @readonly + */ + var exports = { + /** + * value: "BrowseNodes.Ancestor" + * @const + */ + "Ancestor": "BrowseNodes.Ancestor", + /** + * value: "BrowseNodes.Children" + * @const + */ + "Children": "BrowseNodes.Children" }; + + /** + * Returns a GetBrowseNodesResource enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/GetBrowseNodesResource} The enum GetBrowseNodesResource value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/GetBrowseNodesResponse.js b/paapi5-nodejs-sdk-example/src/model/GetBrowseNodesResponse.js new file mode 100644 index 0000000..afbd6f0 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/GetBrowseNodesResponse.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/BrowseNodesResult', 'model/ErrorData'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./BrowseNodesResult'), require('./ErrorData')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.GetBrowseNodesResponse = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.BrowseNodesResult, root.ProductAdvertisingAPIv1.ErrorData); + } +}(this, function(ApiClient, BrowseNodesResult, ErrorData) { + 'use strict'; + + + + + /** + * The GetBrowseNodesResponse model module. + * @module model/GetBrowseNodesResponse + * @version 1.0.0 + */ + + /** + * Constructs a new GetBrowseNodesResponse. + * @alias module:model/GetBrowseNodesResponse + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a GetBrowseNodesResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/GetBrowseNodesResponse} obj Optional instance to populate. + * @return {module:model/GetBrowseNodesResponse} The populated GetBrowseNodesResponse instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('BrowseNodesResult')) { + obj['BrowseNodesResult'] = BrowseNodesResult.constructFromObject(data['BrowseNodesResult']); + } + if (data.hasOwnProperty('Errors')) { + obj['Errors'] = ApiClient.convertToType(data['Errors'], [ErrorData]); + } + } + return obj; + } + + /** + * @member {module:model/BrowseNodesResult} BrowseNodesResult + */ + exports.prototype['BrowseNodesResult'] = undefined; + /** + * @member {Array.} Errors + */ + exports.prototype['Errors'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/GetItemsRequest.js b/paapi5-nodejs-sdk-example/src/model/GetItemsRequest.js new file mode 100644 index 0000000..e3c976d --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/GetItemsRequest.js @@ -0,0 +1,178 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Condition', 'model/GetItemsResource', 'model/ItemIdType', 'model/Merchant', 'model/OfferCount', 'model/PartnerType', 'model/Properties'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./Condition'), require('./GetItemsResource'), require('./ItemIdType'), require('./Merchant'), require('./OfferCount'), require('./PartnerType'), require('./Properties')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.GetItemsRequest = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.Condition, root.ProductAdvertisingAPIv1.GetItemsResource, root.ProductAdvertisingAPIv1.ItemIdType, root.ProductAdvertisingAPIv1.Merchant, root.ProductAdvertisingAPIv1.OfferCount, root.ProductAdvertisingAPIv1.PartnerType, root.ProductAdvertisingAPIv1.Properties); + } +}(this, function(ApiClient, Condition, GetItemsResource, ItemIdType, Merchant, OfferCount, PartnerType, Properties) { + 'use strict'; + + + + + /** + * The GetItemsRequest model module. + * @module model/GetItemsRequest + * @version 1.0.0 + */ + + /** + * Constructs a new GetItemsRequest. + * @alias module:model/GetItemsRequest + * @class + * @param itemIds {Array.} + * @param partnerTag {String} + * @param partnerType {module:model/PartnerType} + */ + var exports = function(itemIds, partnerTag, partnerType) { + var _this = this; + + + + _this['ItemIds'] = itemIds; + + + + + + _this['PartnerTag'] = partnerTag; + _this['PartnerType'] = partnerType; + + + }; + + /** + * Constructs a GetItemsRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/GetItemsRequest} obj Optional instance to populate. + * @return {module:model/GetItemsRequest} The populated GetItemsRequest instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Condition')) { + obj['Condition'] = Condition.constructFromObject(data['Condition']); + } + if (data.hasOwnProperty('CurrencyOfPreference')) { + obj['CurrencyOfPreference'] = ApiClient.convertToType(data['CurrencyOfPreference'], 'String'); + } + if (data.hasOwnProperty('ItemIds')) { + obj['ItemIds'] = ApiClient.convertToType(data['ItemIds'], ['String']); + } + if (data.hasOwnProperty('ItemIdType')) { + obj['ItemIdType'] = ItemIdType.constructFromObject(data['ItemIdType']); + } + if (data.hasOwnProperty('LanguagesOfPreference')) { + obj['LanguagesOfPreference'] = ApiClient.convertToType(data['LanguagesOfPreference'], ['String']); + } + if (data.hasOwnProperty('Marketplace')) { + obj['Marketplace'] = ApiClient.convertToType(data['Marketplace'], 'String'); + } + if (data.hasOwnProperty('Merchant')) { + obj['Merchant'] = Merchant.constructFromObject(data['Merchant']); + } + if (data.hasOwnProperty('OfferCount')) { + obj['OfferCount'] = OfferCount.constructFromObject(data['OfferCount']); + } + if (data.hasOwnProperty('PartnerTag')) { + obj['PartnerTag'] = ApiClient.convertToType(data['PartnerTag'], 'String'); + } + if (data.hasOwnProperty('PartnerType')) { + obj['PartnerType'] = PartnerType.constructFromObject(data['PartnerType']); + } + if (data.hasOwnProperty('Properties')) { + obj['Properties'] = Properties.constructFromObject(data['Properties']); + } + if (data.hasOwnProperty('Resources')) { + obj['Resources'] = ApiClient.convertToType(data['Resources'], [GetItemsResource]); + } + } + return obj; + } + + /** + * @member {module:model/Condition} Condition + */ + exports.prototype['Condition'] = undefined; + /** + * @member {String} CurrencyOfPreference + */ + exports.prototype['CurrencyOfPreference'] = undefined; + /** + * @member {Array.} ItemIds + */ + exports.prototype['ItemIds'] = undefined; + /** + * @member {module:model/ItemIdType} ItemIdType + */ + exports.prototype['ItemIdType'] = undefined; + /** + * @member {Array.} LanguagesOfPreference + */ + exports.prototype['LanguagesOfPreference'] = undefined; + /** + * @member {String} Marketplace + */ + exports.prototype['Marketplace'] = undefined; + /** + * @member {module:model/Merchant} Merchant + */ + exports.prototype['Merchant'] = undefined; + /** + * @member {module:model/OfferCount} OfferCount + */ + exports.prototype['OfferCount'] = undefined; + /** + * @member {String} PartnerTag + */ + exports.prototype['PartnerTag'] = undefined; + /** + * @member {module:model/PartnerType} PartnerType + */ + exports.prototype['PartnerType'] = undefined; + /** + * @member {module:model/Properties} Properties + */ + exports.prototype['Properties'] = undefined; + /** + * @member {Array.} Resources + */ + exports.prototype['Resources'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/GetItemsResource.js b/paapi5-nodejs-sdk-example/src/model/GetItemsResource.js new file mode 100644 index 0000000..ac8c4af --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/GetItemsResource.js @@ -0,0 +1,354 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.GetItemsResource = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + /** + * Enum class GetItemsResource. + * @enum {} + * @readonly + */ + var exports = { + /** + * value: "BrowseNodeInfo.BrowseNodes" + * @const + */ + "BrowseNodeInfo.BrowseNodes": "BrowseNodeInfo.BrowseNodes", + /** + * value: "BrowseNodeInfo.BrowseNodes.Ancestor" + * @const + */ + "BrowseNodeInfo.BrowseNodes.Ancestor": "BrowseNodeInfo.BrowseNodes.Ancestor", + /** + * value: "BrowseNodeInfo.BrowseNodes.SalesRank" + * @const + */ + "BrowseNodeInfo.BrowseNodes.SalesRank": "BrowseNodeInfo.BrowseNodes.SalesRank", + /** + * value: "BrowseNodeInfo.WebsiteSalesRank" + * @const + */ + "BrowseNodeInfo.WebsiteSalesRank": "BrowseNodeInfo.WebsiteSalesRank", + /** + * value: "CustomerReviews.Count" + * @const + */ + "CustomerReviews.Count": "CustomerReviews.Count", + /** + * value: "CustomerReviews.StarRating" + * @const + */ + "CustomerReviews.StarRating": "CustomerReviews.StarRating", + /** + * value: "Images.Primary.Small" + * @const + */ + "Images.Primary.Small": "Images.Primary.Small", + /** + * value: "Images.Primary.Medium" + * @const + */ + "Images.Primary.Medium": "Images.Primary.Medium", + /** + * value: "Images.Primary.Large" + * @const + */ + "Images.Primary.Large": "Images.Primary.Large", + /** + * value: "Images.Variants.Small" + * @const + */ + "Images.Variants.Small": "Images.Variants.Small", + /** + * value: "Images.Variants.Medium" + * @const + */ + "Images.Variants.Medium": "Images.Variants.Medium", + /** + * value: "Images.Variants.Large" + * @const + */ + "Images.Variants.Large": "Images.Variants.Large", + /** + * value: "ItemInfo.ByLineInfo" + * @const + */ + "ItemInfo.ByLineInfo": "ItemInfo.ByLineInfo", + /** + * value: "ItemInfo.ContentInfo" + * @const + */ + "ItemInfo.ContentInfo": "ItemInfo.ContentInfo", + /** + * value: "ItemInfo.ContentRating" + * @const + */ + "ItemInfo.ContentRating": "ItemInfo.ContentRating", + /** + * value: "ItemInfo.Classifications" + * @const + */ + "ItemInfo.Classifications": "ItemInfo.Classifications", + /** + * value: "ItemInfo.ExternalIds" + * @const + */ + "ItemInfo.ExternalIds": "ItemInfo.ExternalIds", + /** + * value: "ItemInfo.Features" + * @const + */ + "ItemInfo.Features": "ItemInfo.Features", + /** + * value: "ItemInfo.ManufactureInfo" + * @const + */ + "ItemInfo.ManufactureInfo": "ItemInfo.ManufactureInfo", + /** + * value: "ItemInfo.ProductInfo" + * @const + */ + "ItemInfo.ProductInfo": "ItemInfo.ProductInfo", + /** + * value: "ItemInfo.TechnicalInfo" + * @const + */ + "ItemInfo.TechnicalInfo": "ItemInfo.TechnicalInfo", + /** + * value: "ItemInfo.Title" + * @const + */ + "ItemInfo.Title": "ItemInfo.Title", + /** + * value: "ItemInfo.TradeInInfo" + * @const + */ + "ItemInfo.TradeInInfo": "ItemInfo.TradeInInfo", + /** + * value: "Offers.Listings.Availability.MaxOrderQuantity" + * @const + */ + "Offers.Listings.Availability.MaxOrderQuantity": "Offers.Listings.Availability.MaxOrderQuantity", + /** + * value: "Offers.Listings.Availability.Message" + * @const + */ + "Offers.Listings.Availability.Message": "Offers.Listings.Availability.Message", + /** + * value: "Offers.Listings.Availability.MinOrderQuantity" + * @const + */ + "Offers.Listings.Availability.MinOrderQuantity": "Offers.Listings.Availability.MinOrderQuantity", + /** + * value: "Offers.Listings.Availability.Type" + * @const + */ + "Offers.Listings.Availability.Type": "Offers.Listings.Availability.Type", + /** + * value: "Offers.Listings.Condition" + * @const + */ + "Offers.Listings.Condition": "Offers.Listings.Condition", + /** + * value: "Offers.Listings.Condition.ConditionNote" + * @const + */ + "Offers.Listings.Condition.ConditionNote": "Offers.Listings.Condition.ConditionNote", + /** + * value: "Offers.Listings.Condition.SubCondition" + * @const + */ + "Offers.Listings.Condition.SubCondition": "Offers.Listings.Condition.SubCondition", + /** + * value: "Offers.Listings.DeliveryInfo.IsAmazonFulfilled" + * @const + */ + "Offers.Listings.DeliveryInfo.IsAmazonFulfilled": "Offers.Listings.DeliveryInfo.IsAmazonFulfilled", + /** + * value: "Offers.Listings.DeliveryInfo.IsFreeShippingEligible" + * @const + */ + "Offers.Listings.DeliveryInfo.IsFreeShippingEligible": "Offers.Listings.DeliveryInfo.IsFreeShippingEligible", + /** + * value: "Offers.Listings.DeliveryInfo.IsPrimeEligible" + * @const + */ + "Offers.Listings.DeliveryInfo.IsPrimeEligible": "Offers.Listings.DeliveryInfo.IsPrimeEligible", + /** + * value: "Offers.Listings.DeliveryInfo.ShippingCharges" + * @const + */ + "Offers.Listings.DeliveryInfo.ShippingCharges": "Offers.Listings.DeliveryInfo.ShippingCharges", + /** + * value: "Offers.Listings.IsBuyBoxWinner" + * @const + */ + "Offers.Listings.IsBuyBoxWinner": "Offers.Listings.IsBuyBoxWinner", + /** + * value: "Offers.Listings.LoyaltyPoints.Points" + * @const + */ + "Offers.Listings.LoyaltyPoints.Points": "Offers.Listings.LoyaltyPoints.Points", + /** + * value: "Offers.Listings.MerchantInfo" + * @const + */ + "Offers.Listings.MerchantInfo": "Offers.Listings.MerchantInfo", + /** + * value: "Offers.Listings.Price" + * @const + */ + "Offers.Listings.Price": "Offers.Listings.Price", + /** + * value: "Offers.Listings.ProgramEligibility.IsPrimeExclusive" + * @const + */ + "Offers.Listings.ProgramEligibility.IsPrimeExclusive": "Offers.Listings.ProgramEligibility.IsPrimeExclusive", + /** + * value: "Offers.Listings.ProgramEligibility.IsPrimePantry" + * @const + */ + "Offers.Listings.ProgramEligibility.IsPrimePantry": "Offers.Listings.ProgramEligibility.IsPrimePantry", + /** + * value: "Offers.Listings.Promotions" + * @const + */ + "Offers.Listings.Promotions": "Offers.Listings.Promotions", + /** + * value: "Offers.Listings.SavingBasis" + * @const + */ + "Offers.Listings.SavingBasis": "Offers.Listings.SavingBasis", + /** + * value: "Offers.Summaries.HighestPrice" + * @const + */ + "Offers.Summaries.HighestPrice": "Offers.Summaries.HighestPrice", + /** + * value: "Offers.Summaries.LowestPrice" + * @const + */ + "Offers.Summaries.LowestPrice": "Offers.Summaries.LowestPrice", + /** + * value: "Offers.Summaries.OfferCount" + * @const + */ + "Offers.Summaries.OfferCount": "Offers.Summaries.OfferCount", + /** + * value: "ParentASIN" + * @const + */ + "ParentASIN": "ParentASIN", + /** + * value: "RentalOffers.Listings.Availability.MaxOrderQuantity" + * @const + */ + "RentalOffers.Listings.Availability.MaxOrderQuantity": "RentalOffers.Listings.Availability.MaxOrderQuantity", + /** + * value: "RentalOffers.Listings.Availability.Message" + * @const + */ + "RentalOffers.Listings.Availability.Message": "RentalOffers.Listings.Availability.Message", + /** + * value: "RentalOffers.Listings.Availability.MinOrderQuantity" + * @const + */ + "RentalOffers.Listings.Availability.MinOrderQuantity": "RentalOffers.Listings.Availability.MinOrderQuantity", + /** + * value: "RentalOffers.Listings.Availability.Type" + * @const + */ + "RentalOffers.Listings.Availability.Type": "RentalOffers.Listings.Availability.Type", + /** + * value: "RentalOffers.Listings.BasePrice" + * @const + */ + "RentalOffers.Listings.BasePrice": "RentalOffers.Listings.BasePrice", + /** + * value: "RentalOffers.Listings.Condition" + * @const + */ + "RentalOffers.Listings.Condition": "RentalOffers.Listings.Condition", + /** + * value: "RentalOffers.Listings.Condition.ConditionNote" + * @const + */ + "RentalOffers.Listings.Condition.ConditionNote": "RentalOffers.Listings.Condition.ConditionNote", + /** + * value: "RentalOffers.Listings.Condition.SubCondition" + * @const + */ + "RentalOffers.Listings.Condition.SubCondition": "RentalOffers.Listings.Condition.SubCondition", + /** + * value: "RentalOffers.Listings.DeliveryInfo.IsAmazonFulfilled" + * @const + */ + "RentalOffers.Listings.DeliveryInfo.IsAmazonFulfilled": "RentalOffers.Listings.DeliveryInfo.IsAmazonFulfilled", + /** + * value: "RentalOffers.Listings.DeliveryInfo.IsFreeShippingEligible" + * @const + */ + "RentalOffers.Listings.DeliveryInfo.IsFreeShippingEligible": "RentalOffers.Listings.DeliveryInfo.IsFreeShippingEligible", + /** + * value: "RentalOffers.Listings.DeliveryInfo.IsPrimeEligible" + * @const + */ + "RentalOffers.Listings.DeliveryInfo.IsPrimeEligible": "RentalOffers.Listings.DeliveryInfo.IsPrimeEligible", + /** + * value: "RentalOffers.Listings.DeliveryInfo.ShippingCharges" + * @const + */ + "RentalOffers.Listings.DeliveryInfo.ShippingCharges": "RentalOffers.Listings.DeliveryInfo.ShippingCharges", + /** + * value: "RentalOffers.Listings.MerchantInfo" + * @const + */ + "RentalOffers.Listings.MerchantInfo": "RentalOffers.Listings.MerchantInfo" }; + + /** + * Returns a GetItemsResource enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/GetItemsResource} The enum GetItemsResource value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/GetItemsResponse.js b/paapi5-nodejs-sdk-example/src/model/GetItemsResponse.js new file mode 100644 index 0000000..50eae7c --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/GetItemsResponse.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/ErrorData', 'model/ItemsResult'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./ErrorData'), require('./ItemsResult')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.GetItemsResponse = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.ErrorData, root.ProductAdvertisingAPIv1.ItemsResult); + } +}(this, function(ApiClient, ErrorData, ItemsResult) { + 'use strict'; + + + + + /** + * The GetItemsResponse model module. + * @module model/GetItemsResponse + * @version 1.0.0 + */ + + /** + * Constructs a new GetItemsResponse. + * @alias module:model/GetItemsResponse + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a GetItemsResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/GetItemsResponse} obj Optional instance to populate. + * @return {module:model/GetItemsResponse} The populated GetItemsResponse instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Errors')) { + obj['Errors'] = ApiClient.convertToType(data['Errors'], [ErrorData]); + } + if (data.hasOwnProperty('ItemsResult')) { + obj['ItemsResult'] = ItemsResult.constructFromObject(data['ItemsResult']); + } + } + return obj; + } + + /** + * @member {Array.} Errors + */ + exports.prototype['Errors'] = undefined; + /** + * @member {module:model/ItemsResult} ItemsResult + */ + exports.prototype['ItemsResult'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/GetVariationsRequest.js b/paapi5-nodejs-sdk-example/src/model/GetVariationsRequest.js new file mode 100644 index 0000000..bd2ca34 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/GetVariationsRequest.js @@ -0,0 +1,186 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Condition', 'model/GetVariationsResource', 'model/Merchant', 'model/OfferCount', 'model/PartnerType', 'model/Properties'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./Condition'), require('./GetVariationsResource'), require('./Merchant'), require('./OfferCount'), require('./PartnerType'), require('./Properties')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.GetVariationsRequest = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.Condition, root.ProductAdvertisingAPIv1.GetVariationsResource, root.ProductAdvertisingAPIv1.Merchant, root.ProductAdvertisingAPIv1.OfferCount, root.ProductAdvertisingAPIv1.PartnerType, root.ProductAdvertisingAPIv1.Properties); + } +}(this, function(ApiClient, Condition, GetVariationsResource, Merchant, OfferCount, PartnerType, Properties) { + 'use strict'; + + + + + /** + * The GetVariationsRequest model module. + * @module model/GetVariationsRequest + * @version 1.0.0 + */ + + /** + * Constructs a new GetVariationsRequest. + * @alias module:model/GetVariationsRequest + * @class + * @param ASIN {String} + * @param partnerTag {String} + * @param partnerType {module:model/PartnerType} + */ + var exports = function(ASIN, partnerTag, partnerType) { + var _this = this; + + _this['ASIN'] = ASIN; + + + + + + + _this['PartnerTag'] = partnerTag; + _this['PartnerType'] = partnerType; + + + + + }; + + /** + * Constructs a GetVariationsRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/GetVariationsRequest} obj Optional instance to populate. + * @return {module:model/GetVariationsRequest} The populated GetVariationsRequest instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('ASIN')) { + obj['ASIN'] = ApiClient.convertToType(data['ASIN'], 'String'); + } + if (data.hasOwnProperty('Condition')) { + obj['Condition'] = Condition.constructFromObject(data['Condition']); + } + if (data.hasOwnProperty('CurrencyOfPreference')) { + obj['CurrencyOfPreference'] = ApiClient.convertToType(data['CurrencyOfPreference'], 'String'); + } + if (data.hasOwnProperty('LanguagesOfPreference')) { + obj['LanguagesOfPreference'] = ApiClient.convertToType(data['LanguagesOfPreference'], ['String']); + } + if (data.hasOwnProperty('Marketplace')) { + obj['Marketplace'] = ApiClient.convertToType(data['Marketplace'], 'String'); + } + if (data.hasOwnProperty('Merchant')) { + obj['Merchant'] = Merchant.constructFromObject(data['Merchant']); + } + if (data.hasOwnProperty('OfferCount')) { + obj['OfferCount'] = OfferCount.constructFromObject(data['OfferCount']); + } + if (data.hasOwnProperty('PartnerTag')) { + obj['PartnerTag'] = ApiClient.convertToType(data['PartnerTag'], 'String'); + } + if (data.hasOwnProperty('PartnerType')) { + obj['PartnerType'] = PartnerType.constructFromObject(data['PartnerType']); + } + if (data.hasOwnProperty('Properties')) { + obj['Properties'] = Properties.constructFromObject(data['Properties']); + } + if (data.hasOwnProperty('Resources')) { + obj['Resources'] = ApiClient.convertToType(data['Resources'], [GetVariationsResource]); + } + if (data.hasOwnProperty('VariationCount')) { + obj['VariationCount'] = ApiClient.convertToType(data['VariationCount'], 'Number'); + } + if (data.hasOwnProperty('VariationPage')) { + obj['VariationPage'] = ApiClient.convertToType(data['VariationPage'], 'Number'); + } + } + return obj; + } + + /** + * @member {String} ASIN + */ + exports.prototype['ASIN'] = undefined; + /** + * @member {module:model/Condition} Condition + */ + exports.prototype['Condition'] = undefined; + /** + * @member {String} CurrencyOfPreference + */ + exports.prototype['CurrencyOfPreference'] = undefined; + /** + * @member {Array.} LanguagesOfPreference + */ + exports.prototype['LanguagesOfPreference'] = undefined; + /** + * @member {String} Marketplace + */ + exports.prototype['Marketplace'] = undefined; + /** + * @member {module:model/Merchant} Merchant + */ + exports.prototype['Merchant'] = undefined; + /** + * @member {module:model/OfferCount} OfferCount + */ + exports.prototype['OfferCount'] = undefined; + /** + * @member {String} PartnerTag + */ + exports.prototype['PartnerTag'] = undefined; + /** + * @member {module:model/PartnerType} PartnerType + */ + exports.prototype['PartnerType'] = undefined; + /** + * @member {module:model/Properties} Properties + */ + exports.prototype['Properties'] = undefined; + /** + * @member {Array.} Resources + */ + exports.prototype['Resources'] = undefined; + /** + * @member {Number} VariationCount + */ + exports.prototype['VariationCount'] = undefined; + /** + * @member {Number} VariationPage + */ + exports.prototype['VariationPage'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/GetVariationsResource.js b/paapi5-nodejs-sdk-example/src/model/GetVariationsResource.js new file mode 100644 index 0000000..311d91a --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/GetVariationsResource.js @@ -0,0 +1,369 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.GetVariationsResource = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + /** + * Enum class GetVariationsResource. + * @enum {} + * @readonly + */ + var exports = { + /** + * value: "BrowseNodeInfo.BrowseNodes" + * @const + */ + "BrowseNodeInfo.BrowseNodes": "BrowseNodeInfo.BrowseNodes", + /** + * value: "BrowseNodeInfo.BrowseNodes.Ancestor" + * @const + */ + "BrowseNodeInfo.BrowseNodes.Ancestor": "BrowseNodeInfo.BrowseNodes.Ancestor", + /** + * value: "BrowseNodeInfo.BrowseNodes.SalesRank" + * @const + */ + "BrowseNodeInfo.BrowseNodes.SalesRank": "BrowseNodeInfo.BrowseNodes.SalesRank", + /** + * value: "BrowseNodeInfo.WebsiteSalesRank" + * @const + */ + "BrowseNodeInfo.WebsiteSalesRank": "BrowseNodeInfo.WebsiteSalesRank", + /** + * value: "CustomerReviews.Count" + * @const + */ + "CustomerReviews.Count": "CustomerReviews.Count", + /** + * value: "CustomerReviews.StarRating" + * @const + */ + "CustomerReviews.StarRating": "CustomerReviews.StarRating", + /** + * value: "Images.Primary.Small" + * @const + */ + "Images.Primary.Small": "Images.Primary.Small", + /** + * value: "Images.Primary.Medium" + * @const + */ + "Images.Primary.Medium": "Images.Primary.Medium", + /** + * value: "Images.Primary.Large" + * @const + */ + "Images.Primary.Large": "Images.Primary.Large", + /** + * value: "Images.Variants.Small" + * @const + */ + "Images.Variants.Small": "Images.Variants.Small", + /** + * value: "Images.Variants.Medium" + * @const + */ + "Images.Variants.Medium": "Images.Variants.Medium", + /** + * value: "Images.Variants.Large" + * @const + */ + "Images.Variants.Large": "Images.Variants.Large", + /** + * value: "ItemInfo.ByLineInfo" + * @const + */ + "ItemInfo.ByLineInfo": "ItemInfo.ByLineInfo", + /** + * value: "ItemInfo.ContentInfo" + * @const + */ + "ItemInfo.ContentInfo": "ItemInfo.ContentInfo", + /** + * value: "ItemInfo.ContentRating" + * @const + */ + "ItemInfo.ContentRating": "ItemInfo.ContentRating", + /** + * value: "ItemInfo.Classifications" + * @const + */ + "ItemInfo.Classifications": "ItemInfo.Classifications", + /** + * value: "ItemInfo.ExternalIds" + * @const + */ + "ItemInfo.ExternalIds": "ItemInfo.ExternalIds", + /** + * value: "ItemInfo.Features" + * @const + */ + "ItemInfo.Features": "ItemInfo.Features", + /** + * value: "ItemInfo.ManufactureInfo" + * @const + */ + "ItemInfo.ManufactureInfo": "ItemInfo.ManufactureInfo", + /** + * value: "ItemInfo.ProductInfo" + * @const + */ + "ItemInfo.ProductInfo": "ItemInfo.ProductInfo", + /** + * value: "ItemInfo.TechnicalInfo" + * @const + */ + "ItemInfo.TechnicalInfo": "ItemInfo.TechnicalInfo", + /** + * value: "ItemInfo.Title" + * @const + */ + "ItemInfo.Title": "ItemInfo.Title", + /** + * value: "ItemInfo.TradeInInfo" + * @const + */ + "ItemInfo.TradeInInfo": "ItemInfo.TradeInInfo", + /** + * value: "Offers.Listings.Availability.MaxOrderQuantity" + * @const + */ + "Offers.Listings.Availability.MaxOrderQuantity": "Offers.Listings.Availability.MaxOrderQuantity", + /** + * value: "Offers.Listings.Availability.Message" + * @const + */ + "Offers.Listings.Availability.Message": "Offers.Listings.Availability.Message", + /** + * value: "Offers.Listings.Availability.MinOrderQuantity" + * @const + */ + "Offers.Listings.Availability.MinOrderQuantity": "Offers.Listings.Availability.MinOrderQuantity", + /** + * value: "Offers.Listings.Availability.Type" + * @const + */ + "Offers.Listings.Availability.Type": "Offers.Listings.Availability.Type", + /** + * value: "Offers.Listings.Condition" + * @const + */ + "Offers.Listings.Condition": "Offers.Listings.Condition", + /** + * value: "Offers.Listings.Condition.ConditionNote" + * @const + */ + "Offers.Listings.Condition.ConditionNote": "Offers.Listings.Condition.ConditionNote", + /** + * value: "Offers.Listings.Condition.SubCondition" + * @const + */ + "Offers.Listings.Condition.SubCondition": "Offers.Listings.Condition.SubCondition", + /** + * value: "Offers.Listings.DeliveryInfo.IsAmazonFulfilled" + * @const + */ + "Offers.Listings.DeliveryInfo.IsAmazonFulfilled": "Offers.Listings.DeliveryInfo.IsAmazonFulfilled", + /** + * value: "Offers.Listings.DeliveryInfo.IsFreeShippingEligible" + * @const + */ + "Offers.Listings.DeliveryInfo.IsFreeShippingEligible": "Offers.Listings.DeliveryInfo.IsFreeShippingEligible", + /** + * value: "Offers.Listings.DeliveryInfo.IsPrimeEligible" + * @const + */ + "Offers.Listings.DeliveryInfo.IsPrimeEligible": "Offers.Listings.DeliveryInfo.IsPrimeEligible", + /** + * value: "Offers.Listings.DeliveryInfo.ShippingCharges" + * @const + */ + "Offers.Listings.DeliveryInfo.ShippingCharges": "Offers.Listings.DeliveryInfo.ShippingCharges", + /** + * value: "Offers.Listings.IsBuyBoxWinner" + * @const + */ + "Offers.Listings.IsBuyBoxWinner": "Offers.Listings.IsBuyBoxWinner", + /** + * value: "Offers.Listings.LoyaltyPoints.Points" + * @const + */ + "Offers.Listings.LoyaltyPoints.Points": "Offers.Listings.LoyaltyPoints.Points", + /** + * value: "Offers.Listings.MerchantInfo" + * @const + */ + "Offers.Listings.MerchantInfo": "Offers.Listings.MerchantInfo", + /** + * value: "Offers.Listings.Price" + * @const + */ + "Offers.Listings.Price": "Offers.Listings.Price", + /** + * value: "Offers.Listings.ProgramEligibility.IsPrimeExclusive" + * @const + */ + "Offers.Listings.ProgramEligibility.IsPrimeExclusive": "Offers.Listings.ProgramEligibility.IsPrimeExclusive", + /** + * value: "Offers.Listings.ProgramEligibility.IsPrimePantry" + * @const + */ + "Offers.Listings.ProgramEligibility.IsPrimePantry": "Offers.Listings.ProgramEligibility.IsPrimePantry", + /** + * value: "Offers.Listings.Promotions" + * @const + */ + "Offers.Listings.Promotions": "Offers.Listings.Promotions", + /** + * value: "Offers.Listings.SavingBasis" + * @const + */ + "Offers.Listings.SavingBasis": "Offers.Listings.SavingBasis", + /** + * value: "Offers.Summaries.HighestPrice" + * @const + */ + "Offers.Summaries.HighestPrice": "Offers.Summaries.HighestPrice", + /** + * value: "Offers.Summaries.LowestPrice" + * @const + */ + "Offers.Summaries.LowestPrice": "Offers.Summaries.LowestPrice", + /** + * value: "Offers.Summaries.OfferCount" + * @const + */ + "Offers.Summaries.OfferCount": "Offers.Summaries.OfferCount", + /** + * value: "ParentASIN" + * @const + */ + "ParentASIN": "ParentASIN", + /** + * value: "RentalOffers.Listings.Availability.MaxOrderQuantity" + * @const + */ + "RentalOffers.Listings.Availability.MaxOrderQuantity": "RentalOffers.Listings.Availability.MaxOrderQuantity", + /** + * value: "RentalOffers.Listings.Availability.Message" + * @const + */ + "RentalOffers.Listings.Availability.Message": "RentalOffers.Listings.Availability.Message", + /** + * value: "RentalOffers.Listings.Availability.MinOrderQuantity" + * @const + */ + "RentalOffers.Listings.Availability.MinOrderQuantity": "RentalOffers.Listings.Availability.MinOrderQuantity", + /** + * value: "RentalOffers.Listings.Availability.Type" + * @const + */ + "RentalOffers.Listings.Availability.Type": "RentalOffers.Listings.Availability.Type", + /** + * value: "RentalOffers.Listings.BasePrice" + * @const + */ + "RentalOffers.Listings.BasePrice": "RentalOffers.Listings.BasePrice", + /** + * value: "RentalOffers.Listings.Condition" + * @const + */ + "RentalOffers.Listings.Condition": "RentalOffers.Listings.Condition", + /** + * value: "RentalOffers.Listings.Condition.ConditionNote" + * @const + */ + "RentalOffers.Listings.Condition.ConditionNote": "RentalOffers.Listings.Condition.ConditionNote", + /** + * value: "RentalOffers.Listings.Condition.SubCondition" + * @const + */ + "RentalOffers.Listings.Condition.SubCondition": "RentalOffers.Listings.Condition.SubCondition", + /** + * value: "RentalOffers.Listings.DeliveryInfo.IsAmazonFulfilled" + * @const + */ + "RentalOffers.Listings.DeliveryInfo.IsAmazonFulfilled": "RentalOffers.Listings.DeliveryInfo.IsAmazonFulfilled", + /** + * value: "RentalOffers.Listings.DeliveryInfo.IsFreeShippingEligible" + * @const + */ + "RentalOffers.Listings.DeliveryInfo.IsFreeShippingEligible": "RentalOffers.Listings.DeliveryInfo.IsFreeShippingEligible", + /** + * value: "RentalOffers.Listings.DeliveryInfo.IsPrimeEligible" + * @const + */ + "RentalOffers.Listings.DeliveryInfo.IsPrimeEligible": "RentalOffers.Listings.DeliveryInfo.IsPrimeEligible", + /** + * value: "RentalOffers.Listings.DeliveryInfo.ShippingCharges" + * @const + */ + "RentalOffers.Listings.DeliveryInfo.ShippingCharges": "RentalOffers.Listings.DeliveryInfo.ShippingCharges", + /** + * value: "RentalOffers.Listings.MerchantInfo" + * @const + */ + "RentalOffers.Listings.MerchantInfo": "RentalOffers.Listings.MerchantInfo", + /** + * value: "VariationSummary.Price.HighestPrice" + * @const + */ + "VariationSummary.Price.HighestPrice": "VariationSummary.Price.HighestPrice", + /** + * value: "VariationSummary.Price.LowestPrice" + * @const + */ + "VariationSummary.Price.LowestPrice": "VariationSummary.Price.LowestPrice", + /** + * value: "VariationSummary.VariationDimension" + * @const + */ + "VariationSummary.VariationDimension": "VariationSummary.VariationDimension" }; + + /** + * Returns a GetVariationsResource enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/GetVariationsResource} The enum GetVariationsResource value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/GetVariationsResponse.js b/paapi5-nodejs-sdk-example/src/model/GetVariationsResponse.js new file mode 100644 index 0000000..2b638e9 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/GetVariationsResponse.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/ErrorData', 'model/VariationsResult'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./ErrorData'), require('./VariationsResult')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.GetVariationsResponse = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.ErrorData, root.ProductAdvertisingAPIv1.VariationsResult); + } +}(this, function(ApiClient, ErrorData, VariationsResult) { + 'use strict'; + + + + + /** + * The GetVariationsResponse model module. + * @module model/GetVariationsResponse + * @version 1.0.0 + */ + + /** + * Constructs a new GetVariationsResponse. + * @alias module:model/GetVariationsResponse + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a GetVariationsResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/GetVariationsResponse} obj Optional instance to populate. + * @return {module:model/GetVariationsResponse} The populated GetVariationsResponse instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Errors')) { + obj['Errors'] = ApiClient.convertToType(data['Errors'], [ErrorData]); + } + if (data.hasOwnProperty('VariationsResult')) { + obj['VariationsResult'] = VariationsResult.constructFromObject(data['VariationsResult']); + } + } + return obj; + } + + /** + * @member {Array.} Errors + */ + exports.prototype['Errors'] = undefined; + /** + * @member {module:model/VariationsResult} VariationsResult + */ + exports.prototype['VariationsResult'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ImageSize.js b/paapi5-nodejs-sdk-example/src/model/ImageSize.js new file mode 100644 index 0000000..f9ec6c6 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ImageSize.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ImageSize = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The ImageSize model module. + * @module model/ImageSize + * @version 1.0.0 + */ + + /** + * Constructs a new ImageSize. + * @alias module:model/ImageSize + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a ImageSize from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ImageSize} obj Optional instance to populate. + * @return {module:model/ImageSize} The populated ImageSize instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('URL')) { + obj['URL'] = ApiClient.convertToType(data['URL'], 'String'); + } + if (data.hasOwnProperty('Height')) { + obj['Height'] = ApiClient.convertToType(data['Height'], 'Number'); + } + if (data.hasOwnProperty('Width')) { + obj['Width'] = ApiClient.convertToType(data['Width'], 'Number'); + } + } + return obj; + } + + /** + * @member {String} URL + */ + exports.prototype['URL'] = undefined; + /** + * @member {Number} Height + */ + exports.prototype['Height'] = undefined; + /** + * @member {Number} Width + */ + exports.prototype['Width'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ImageType.js b/paapi5-nodejs-sdk-example/src/model/ImageType.js new file mode 100644 index 0000000..b8da3dd --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ImageType.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/ImageSize'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./ImageSize')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ImageType = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.ImageSize); + } +}(this, function(ApiClient, ImageSize) { + 'use strict'; + + + + + /** + * The ImageType model module. + * @module model/ImageType + * @version 1.0.0 + */ + + /** + * Constructs a new ImageType. + * @alias module:model/ImageType + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a ImageType from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ImageType} obj Optional instance to populate. + * @return {module:model/ImageType} The populated ImageType instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Small')) { + obj['Small'] = ImageSize.constructFromObject(data['Small']); + } + if (data.hasOwnProperty('Medium')) { + obj['Medium'] = ImageSize.constructFromObject(data['Medium']); + } + if (data.hasOwnProperty('Large')) { + obj['Large'] = ImageSize.constructFromObject(data['Large']); + } + } + return obj; + } + + /** + * @member {module:model/ImageSize} Small + */ + exports.prototype['Small'] = undefined; + /** + * @member {module:model/ImageSize} Medium + */ + exports.prototype['Medium'] = undefined; + /** + * @member {module:model/ImageSize} Large + */ + exports.prototype['Large'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/Images.js b/paapi5-nodejs-sdk-example/src/model/Images.js new file mode 100644 index 0000000..6e545c9 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/Images.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/ImageType'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./ImageType')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.Images = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.ImageType); + } +}(this, function(ApiClient, ImageType) { + 'use strict'; + + + + + /** + * The Images model module. + * @module model/Images + * @version 1.0.0 + */ + + /** + * Constructs a new Images. + * @alias module:model/Images + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a Images from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Images} obj Optional instance to populate. + * @return {module:model/Images} The populated Images instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Primary')) { + obj['Primary'] = ImageType.constructFromObject(data['Primary']); + } + if (data.hasOwnProperty('Variants')) { + obj['Variants'] = ApiClient.convertToType(data['Variants'], [ImageType]); + } + } + return obj; + } + + /** + * @member {module:model/ImageType} Primary + */ + exports.prototype['Primary'] = undefined; + /** + * @member {Array.} Variants + */ + exports.prototype['Variants'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/Item.js b/paapi5-nodejs-sdk-example/src/model/Item.js new file mode 100644 index 0000000..6a7de7e --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/Item.js @@ -0,0 +1,167 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/BrowseNodeInfo', 'model/CustomerReviews', 'model/Images', 'model/ItemInfo', 'model/Offers', 'model/RentalOffers', 'model/VariationAttribute'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./BrowseNodeInfo'), require('./CustomerReviews'), require('./Images'), require('./ItemInfo'), require('./Offers'), require('./RentalOffers'), require('./VariationAttribute')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.Item = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.BrowseNodeInfo, root.ProductAdvertisingAPIv1.CustomerReviews, root.ProductAdvertisingAPIv1.Images, root.ProductAdvertisingAPIv1.ItemInfo, root.ProductAdvertisingAPIv1.Offers, root.ProductAdvertisingAPIv1.RentalOffers, root.ProductAdvertisingAPIv1.VariationAttribute); + } +}(this, function(ApiClient, BrowseNodeInfo, CustomerReviews, Images, ItemInfo, Offers, RentalOffers, VariationAttribute) { + 'use strict'; + + + + + /** + * The Item model module. + * @module model/Item + * @version 1.0.0 + */ + + /** + * Constructs a new Item. + * @alias module:model/Item + * @class + */ + var exports = function() { + var _this = this; + + + + + + + + + + + + + }; + + /** + * Constructs a Item from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Item} obj Optional instance to populate. + * @return {module:model/Item} The populated Item instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('ASIN')) { + obj['ASIN'] = ApiClient.convertToType(data['ASIN'], 'String'); + } + if (data.hasOwnProperty('BrowseNodeInfo')) { + obj['BrowseNodeInfo'] = BrowseNodeInfo.constructFromObject(data['BrowseNodeInfo']); + } + if (data.hasOwnProperty('CustomerReviews')) { + obj['CustomerReviews'] = CustomerReviews.constructFromObject(data['CustomerReviews']); + } + if (data.hasOwnProperty('DetailPageURL')) { + obj['DetailPageURL'] = ApiClient.convertToType(data['DetailPageURL'], 'String'); + } + if (data.hasOwnProperty('Images')) { + obj['Images'] = Images.constructFromObject(data['Images']); + } + if (data.hasOwnProperty('ItemInfo')) { + obj['ItemInfo'] = ItemInfo.constructFromObject(data['ItemInfo']); + } + if (data.hasOwnProperty('Offers')) { + obj['Offers'] = Offers.constructFromObject(data['Offers']); + } + if (data.hasOwnProperty('ParentASIN')) { + obj['ParentASIN'] = ApiClient.convertToType(data['ParentASIN'], 'String'); + } + if (data.hasOwnProperty('RentalOffers')) { + obj['RentalOffers'] = RentalOffers.constructFromObject(data['RentalOffers']); + } + if (data.hasOwnProperty('Score')) { + obj['Score'] = ApiClient.convertToType(data['Score'], 'Number'); + } + if (data.hasOwnProperty('VariationAttributes')) { + obj['VariationAttributes'] = ApiClient.convertToType(data['VariationAttributes'], [VariationAttribute]); + } + } + return obj; + } + + /** + * @member {String} ASIN + */ + exports.prototype['ASIN'] = undefined; + /** + * @member {module:model/BrowseNodeInfo} BrowseNodeInfo + */ + exports.prototype['BrowseNodeInfo'] = undefined; + /** + * @member {module:model/CustomerReviews} CustomerReviews + */ + exports.prototype['CustomerReviews'] = undefined; + /** + * @member {String} DetailPageURL + */ + exports.prototype['DetailPageURL'] = undefined; + /** + * @member {module:model/Images} Images + */ + exports.prototype['Images'] = undefined; + /** + * @member {module:model/ItemInfo} ItemInfo + */ + exports.prototype['ItemInfo'] = undefined; + /** + * @member {module:model/Offers} Offers + */ + exports.prototype['Offers'] = undefined; + /** + * @member {String} ParentASIN + */ + exports.prototype['ParentASIN'] = undefined; + /** + * @member {module:model/RentalOffers} RentalOffers + */ + exports.prototype['RentalOffers'] = undefined; + /** + * @member {Number} Score + */ + exports.prototype['Score'] = undefined; + /** + * @member {Array.} VariationAttributes + */ + exports.prototype['VariationAttributes'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ItemIdType.js b/paapi5-nodejs-sdk-example/src/model/ItemIdType.js new file mode 100644 index 0000000..91442eb --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ItemIdType.js @@ -0,0 +1,64 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ItemIdType = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + /** + * Enum class ItemIdType. + * @enum {} + * @readonly + */ + var exports = { + /** + * value: "ASIN" + * @const + */ + "ASIN": "ASIN" }; + + /** + * Returns a ItemIdType enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/ItemIdType} The enum ItemIdType value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ItemInfo.js b/paapi5-nodejs-sdk-example/src/model/ItemInfo.js new file mode 100644 index 0000000..9444e13 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ItemInfo.js @@ -0,0 +1,167 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/ByLineInfo', 'model/Classifications', 'model/ContentInfo', 'model/ContentRating', 'model/ExternalIds', 'model/ManufactureInfo', 'model/MultiValuedAttribute', 'model/ProductInfo', 'model/SingleStringValuedAttribute', 'model/TechnicalInfo', 'model/TradeInInfo'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./ByLineInfo'), require('./Classifications'), require('./ContentInfo'), require('./ContentRating'), require('./ExternalIds'), require('./ManufactureInfo'), require('./MultiValuedAttribute'), require('./ProductInfo'), require('./SingleStringValuedAttribute'), require('./TechnicalInfo'), require('./TradeInInfo')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ItemInfo = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.ByLineInfo, root.ProductAdvertisingAPIv1.Classifications, root.ProductAdvertisingAPIv1.ContentInfo, root.ProductAdvertisingAPIv1.ContentRating, root.ProductAdvertisingAPIv1.ExternalIds, root.ProductAdvertisingAPIv1.ManufactureInfo, root.ProductAdvertisingAPIv1.MultiValuedAttribute, root.ProductAdvertisingAPIv1.ProductInfo, root.ProductAdvertisingAPIv1.SingleStringValuedAttribute, root.ProductAdvertisingAPIv1.TechnicalInfo, root.ProductAdvertisingAPIv1.TradeInInfo); + } +}(this, function(ApiClient, ByLineInfo, Classifications, ContentInfo, ContentRating, ExternalIds, ManufactureInfo, MultiValuedAttribute, ProductInfo, SingleStringValuedAttribute, TechnicalInfo, TradeInInfo) { + 'use strict'; + + + + + /** + * The ItemInfo model module. + * @module model/ItemInfo + * @version 1.0.0 + */ + + /** + * Constructs a new ItemInfo. + * @alias module:model/ItemInfo + * @class + */ + var exports = function() { + var _this = this; + + + + + + + + + + + + + }; + + /** + * Constructs a ItemInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ItemInfo} obj Optional instance to populate. + * @return {module:model/ItemInfo} The populated ItemInfo instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('ByLineInfo')) { + obj['ByLineInfo'] = ByLineInfo.constructFromObject(data['ByLineInfo']); + } + if (data.hasOwnProperty('Classifications')) { + obj['Classifications'] = Classifications.constructFromObject(data['Classifications']); + } + if (data.hasOwnProperty('ContentInfo')) { + obj['ContentInfo'] = ContentInfo.constructFromObject(data['ContentInfo']); + } + if (data.hasOwnProperty('ContentRating')) { + obj['ContentRating'] = ContentRating.constructFromObject(data['ContentRating']); + } + if (data.hasOwnProperty('ExternalIds')) { + obj['ExternalIds'] = ExternalIds.constructFromObject(data['ExternalIds']); + } + if (data.hasOwnProperty('Features')) { + obj['Features'] = MultiValuedAttribute.constructFromObject(data['Features']); + } + if (data.hasOwnProperty('ManufactureInfo')) { + obj['ManufactureInfo'] = ManufactureInfo.constructFromObject(data['ManufactureInfo']); + } + if (data.hasOwnProperty('ProductInfo')) { + obj['ProductInfo'] = ProductInfo.constructFromObject(data['ProductInfo']); + } + if (data.hasOwnProperty('TechnicalInfo')) { + obj['TechnicalInfo'] = TechnicalInfo.constructFromObject(data['TechnicalInfo']); + } + if (data.hasOwnProperty('Title')) { + obj['Title'] = SingleStringValuedAttribute.constructFromObject(data['Title']); + } + if (data.hasOwnProperty('TradeInInfo')) { + obj['TradeInInfo'] = TradeInInfo.constructFromObject(data['TradeInInfo']); + } + } + return obj; + } + + /** + * @member {module:model/ByLineInfo} ByLineInfo + */ + exports.prototype['ByLineInfo'] = undefined; + /** + * @member {module:model/Classifications} Classifications + */ + exports.prototype['Classifications'] = undefined; + /** + * @member {module:model/ContentInfo} ContentInfo + */ + exports.prototype['ContentInfo'] = undefined; + /** + * @member {module:model/ContentRating} ContentRating + */ + exports.prototype['ContentRating'] = undefined; + /** + * @member {module:model/ExternalIds} ExternalIds + */ + exports.prototype['ExternalIds'] = undefined; + /** + * @member {module:model/MultiValuedAttribute} Features + */ + exports.prototype['Features'] = undefined; + /** + * @member {module:model/ManufactureInfo} ManufactureInfo + */ + exports.prototype['ManufactureInfo'] = undefined; + /** + * @member {module:model/ProductInfo} ProductInfo + */ + exports.prototype['ProductInfo'] = undefined; + /** + * @member {module:model/TechnicalInfo} TechnicalInfo + */ + exports.prototype['TechnicalInfo'] = undefined; + /** + * @member {module:model/SingleStringValuedAttribute} Title + */ + exports.prototype['Title'] = undefined; + /** + * @member {module:model/TradeInInfo} TradeInInfo + */ + exports.prototype['TradeInInfo'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ItemsResult.js b/paapi5-nodejs-sdk-example/src/model/ItemsResult.js new file mode 100644 index 0000000..64f0bee --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ItemsResult.js @@ -0,0 +1,87 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Item'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./Item')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ItemsResult = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.Item); + } +}(this, function(ApiClient, Item) { + 'use strict'; + + + + + /** + * The ItemsResult model module. + * @module model/ItemsResult + * @version 1.0.0 + */ + + /** + * Constructs a new ItemsResult. + * @alias module:model/ItemsResult + * @class + */ + var exports = function() { + var _this = this; + + + }; + + /** + * Constructs a ItemsResult from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ItemsResult} obj Optional instance to populate. + * @return {module:model/ItemsResult} The populated ItemsResult instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Items')) { + obj['Items'] = ApiClient.convertToType(data['Items'], [Item]); + } + } + return obj; + } + + /** + * @member {Array.} Items + */ + exports.prototype['Items'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/LanguageType.js b/paapi5-nodejs-sdk-example/src/model/LanguageType.js new file mode 100644 index 0000000..90e1a33 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/LanguageType.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.LanguageType = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The LanguageType model module. + * @module model/LanguageType + * @version 1.0.0 + */ + + /** + * Constructs a new LanguageType. + * @alias module:model/LanguageType + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a LanguageType from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/LanguageType} obj Optional instance to populate. + * @return {module:model/LanguageType} The populated LanguageType instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('DisplayValue')) { + obj['DisplayValue'] = ApiClient.convertToType(data['DisplayValue'], 'String'); + } + if (data.hasOwnProperty('Type')) { + obj['Type'] = ApiClient.convertToType(data['Type'], 'String'); + } + } + return obj; + } + + /** + * @member {String} DisplayValue + */ + exports.prototype['DisplayValue'] = undefined; + /** + * @member {String} Type + */ + exports.prototype['Type'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/Languages.js b/paapi5-nodejs-sdk-example/src/model/Languages.js new file mode 100644 index 0000000..b4b6f77 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/Languages.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/LanguageType'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./LanguageType')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.Languages = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.LanguageType); + } +}(this, function(ApiClient, LanguageType) { + 'use strict'; + + + + + /** + * The Languages model module. + * @module model/Languages + * @version 1.0.0 + */ + + /** + * Constructs a new Languages. + * @alias module:model/Languages + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a Languages from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Languages} obj Optional instance to populate. + * @return {module:model/Languages} The populated Languages instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('DisplayValues')) { + obj['DisplayValues'] = ApiClient.convertToType(data['DisplayValues'], [LanguageType]); + } + if (data.hasOwnProperty('Label')) { + obj['Label'] = ApiClient.convertToType(data['Label'], 'String'); + } + if (data.hasOwnProperty('Locale')) { + obj['Locale'] = ApiClient.convertToType(data['Locale'], 'String'); + } + } + return obj; + } + + /** + * @member {Array.} DisplayValues + */ + exports.prototype['DisplayValues'] = undefined; + /** + * @member {String} Label + */ + exports.prototype['Label'] = undefined; + /** + * @member {String} Locale + */ + exports.prototype['Locale'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ManufactureInfo.js b/paapi5-nodejs-sdk-example/src/model/ManufactureInfo.js new file mode 100644 index 0000000..460b39b --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ManufactureInfo.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/SingleStringValuedAttribute'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./SingleStringValuedAttribute')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ManufactureInfo = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.SingleStringValuedAttribute); + } +}(this, function(ApiClient, SingleStringValuedAttribute) { + 'use strict'; + + + + + /** + * The ManufactureInfo model module. + * @module model/ManufactureInfo + * @version 1.0.0 + */ + + /** + * Constructs a new ManufactureInfo. + * @alias module:model/ManufactureInfo + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a ManufactureInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ManufactureInfo} obj Optional instance to populate. + * @return {module:model/ManufactureInfo} The populated ManufactureInfo instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('ItemPartNumber')) { + obj['ItemPartNumber'] = SingleStringValuedAttribute.constructFromObject(data['ItemPartNumber']); + } + if (data.hasOwnProperty('Model')) { + obj['Model'] = SingleStringValuedAttribute.constructFromObject(data['Model']); + } + if (data.hasOwnProperty('Warranty')) { + obj['Warranty'] = SingleStringValuedAttribute.constructFromObject(data['Warranty']); + } + } + return obj; + } + + /** + * @member {module:model/SingleStringValuedAttribute} ItemPartNumber + */ + exports.prototype['ItemPartNumber'] = undefined; + /** + * @member {module:model/SingleStringValuedAttribute} Model + */ + exports.prototype['Model'] = undefined; + /** + * @member {module:model/SingleStringValuedAttribute} Warranty + */ + exports.prototype['Warranty'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/MaxPrice.js b/paapi5-nodejs-sdk-example/src/model/MaxPrice.js new file mode 100644 index 0000000..dfeb99a --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/MaxPrice.js @@ -0,0 +1,75 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.MaxPrice = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The MaxPrice model module. + * @module model/MaxPrice + * @version 1.0.0 + */ + + /** + * Constructs a new MaxPrice. + * @alias module:model/MaxPrice + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * Constructs a MaxPrice from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MaxPrice} obj Optional instance to populate. + * @return {module:model/MaxPrice} The populated MaxPrice instance. + */ + exports.constructFromObject = function(data, obj) { + return data; + } + + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/Merchant.js b/paapi5-nodejs-sdk-example/src/model/Merchant.js new file mode 100644 index 0000000..0795b3e --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/Merchant.js @@ -0,0 +1,69 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.Merchant = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + /** + * Enum class Merchant. + * @enum {} + * @readonly + */ + var exports = { + /** + * value: "All" + * @const + */ + "All": "All", + /** + * value: "Amazon" + * @const + */ + "Amazon": "Amazon" }; + + /** + * Returns a Merchant enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/Merchant} The enum Merchant value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/MinPrice.js b/paapi5-nodejs-sdk-example/src/model/MinPrice.js new file mode 100644 index 0000000..e5b8b24 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/MinPrice.js @@ -0,0 +1,75 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.MinPrice = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The MinPrice model module. + * @module model/MinPrice + * @version 1.0.0 + */ + + /** + * Constructs a new MinPrice. + * @alias module:model/MinPrice + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * Constructs a MinPrice from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MinPrice} obj Optional instance to populate. + * @return {module:model/MinPrice} The populated MinPrice instance. + */ + exports.constructFromObject = function(data, obj) { + return data; + } + + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/MinReviewsRating.js b/paapi5-nodejs-sdk-example/src/model/MinReviewsRating.js new file mode 100644 index 0000000..10e09c8 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/MinReviewsRating.js @@ -0,0 +1,75 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.MinReviewsRating = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The MinReviewsRating model module. + * @module model/MinReviewsRating + * @version 1.0.0 + */ + + /** + * Constructs a new MinReviewsRating. + * @alias module:model/MinReviewsRating + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * Constructs a MinReviewsRating from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MinReviewsRating} obj Optional instance to populate. + * @return {module:model/MinReviewsRating} The populated MinReviewsRating instance. + */ + exports.constructFromObject = function(data, obj) { + return data; + } + + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/MinSavingPercent.js b/paapi5-nodejs-sdk-example/src/model/MinSavingPercent.js new file mode 100644 index 0000000..b53a04e --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/MinSavingPercent.js @@ -0,0 +1,75 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.MinSavingPercent = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The MinSavingPercent model module. + * @module model/MinSavingPercent + * @version 1.0.0 + */ + + /** + * Constructs a new MinSavingPercent. + * @alias module:model/MinSavingPercent + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * Constructs a MinSavingPercent from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MinSavingPercent} obj Optional instance to populate. + * @return {module:model/MinSavingPercent} The populated MinSavingPercent instance. + */ + exports.constructFromObject = function(data, obj) { + return data; + } + + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/MultiValuedAttribute.js b/paapi5-nodejs-sdk-example/src/model/MultiValuedAttribute.js new file mode 100644 index 0000000..3457fe0 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/MultiValuedAttribute.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.MultiValuedAttribute = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The MultiValuedAttribute model module. + * @module model/MultiValuedAttribute + * @version 1.0.0 + */ + + /** + * Constructs a new MultiValuedAttribute. + * @alias module:model/MultiValuedAttribute + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a MultiValuedAttribute from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MultiValuedAttribute} obj Optional instance to populate. + * @return {module:model/MultiValuedAttribute} The populated MultiValuedAttribute instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('DisplayValues')) { + obj['DisplayValues'] = ApiClient.convertToType(data['DisplayValues'], ['String']); + } + if (data.hasOwnProperty('Label')) { + obj['Label'] = ApiClient.convertToType(data['Label'], 'String'); + } + if (data.hasOwnProperty('Locale')) { + obj['Locale'] = ApiClient.convertToType(data['Locale'], 'String'); + } + } + return obj; + } + + /** + * @member {Array.} DisplayValues + */ + exports.prototype['DisplayValues'] = undefined; + /** + * @member {String} Label + */ + exports.prototype['Label'] = undefined; + /** + * @member {String} Locale + */ + exports.prototype['Locale'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferAvailability.js b/paapi5-nodejs-sdk-example/src/model/OfferAvailability.js new file mode 100644 index 0000000..191beb6 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferAvailability.js @@ -0,0 +1,111 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferAvailability = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OfferAvailability model module. + * @module model/OfferAvailability + * @version 1.0.0 + */ + + /** + * Constructs a new OfferAvailability. + * @alias module:model/OfferAvailability + * @class + */ + var exports = function() { + var _this = this; + + + + + + }; + + /** + * Constructs a OfferAvailability from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferAvailability} obj Optional instance to populate. + * @return {module:model/OfferAvailability} The populated OfferAvailability instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('MaxOrderQuantity')) { + obj['MaxOrderQuantity'] = ApiClient.convertToType(data['MaxOrderQuantity'], 'Number'); + } + if (data.hasOwnProperty('Message')) { + obj['Message'] = ApiClient.convertToType(data['Message'], 'String'); + } + if (data.hasOwnProperty('MinOrderQuantity')) { + obj['MinOrderQuantity'] = ApiClient.convertToType(data['MinOrderQuantity'], 'Number'); + } + if (data.hasOwnProperty('Type')) { + obj['Type'] = ApiClient.convertToType(data['Type'], 'String'); + } + } + return obj; + } + + /** + * @member {Number} MaxOrderQuantity + */ + exports.prototype['MaxOrderQuantity'] = undefined; + /** + * @member {String} Message + */ + exports.prototype['Message'] = undefined; + /** + * @member {Number} MinOrderQuantity + */ + exports.prototype['MinOrderQuantity'] = undefined; + /** + * @member {String} Type + */ + exports.prototype['Type'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferCondition.js b/paapi5-nodejs-sdk-example/src/model/OfferCondition.js new file mode 100644 index 0000000..f30709e --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferCondition.js @@ -0,0 +1,127 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/OfferConditionNote', 'model/OfferSubCondition'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./OfferConditionNote'), require('./OfferSubCondition')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferCondition = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.OfferConditionNote, root.ProductAdvertisingAPIv1.OfferSubCondition); + } +}(this, function(ApiClient, OfferConditionNote, OfferSubCondition) { + 'use strict'; + + + + + /** + * The OfferCondition model module. + * @module model/OfferCondition + * @version 1.0.0 + */ + + /** + * Constructs a new OfferCondition. + * @alias module:model/OfferCondition + * @class + */ + var exports = function() { + var _this = this; + + + + + + + + }; + + /** + * Constructs a OfferCondition from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferCondition} obj Optional instance to populate. + * @return {module:model/OfferCondition} The populated OfferCondition instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('DisplayValue')) { + obj['DisplayValue'] = ApiClient.convertToType(data['DisplayValue'], 'String'); + } + if (data.hasOwnProperty('Label')) { + obj['Label'] = ApiClient.convertToType(data['Label'], 'String'); + } + if (data.hasOwnProperty('Locale')) { + obj['Locale'] = ApiClient.convertToType(data['Locale'], 'String'); + } + if (data.hasOwnProperty('Value')) { + obj['Value'] = ApiClient.convertToType(data['Value'], 'String'); + } + if (data.hasOwnProperty('SubCondition')) { + obj['SubCondition'] = OfferSubCondition.constructFromObject(data['SubCondition']); + } + if (data.hasOwnProperty('ConditionNote')) { + obj['ConditionNote'] = OfferConditionNote.constructFromObject(data['ConditionNote']); + } + } + return obj; + } + + /** + * @member {String} DisplayValue + */ + exports.prototype['DisplayValue'] = undefined; + /** + * @member {String} Label + */ + exports.prototype['Label'] = undefined; + /** + * @member {String} Locale + */ + exports.prototype['Locale'] = undefined; + /** + * @member {String} Value + */ + exports.prototype['Value'] = undefined; + /** + * @member {module:model/OfferSubCondition} SubCondition + */ + exports.prototype['SubCondition'] = undefined; + /** + * @member {module:model/OfferConditionNote} ConditionNote + */ + exports.prototype['ConditionNote'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferConditionNote.js b/paapi5-nodejs-sdk-example/src/model/OfferConditionNote.js new file mode 100644 index 0000000..109c33d --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferConditionNote.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferConditionNote = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OfferConditionNote model module. + * @module model/OfferConditionNote + * @version 1.0.0 + */ + + /** + * Constructs a new OfferConditionNote. + * @alias module:model/OfferConditionNote + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a OfferConditionNote from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferConditionNote} obj Optional instance to populate. + * @return {module:model/OfferConditionNote} The populated OfferConditionNote instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Locale')) { + obj['Locale'] = ApiClient.convertToType(data['Locale'], 'String'); + } + if (data.hasOwnProperty('Value')) { + obj['Value'] = ApiClient.convertToType(data['Value'], 'String'); + } + } + return obj; + } + + /** + * @member {String} Locale + */ + exports.prototype['Locale'] = undefined; + /** + * @member {String} Value + */ + exports.prototype['Value'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferCount.js b/paapi5-nodejs-sdk-example/src/model/OfferCount.js new file mode 100644 index 0000000..f90d34f --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferCount.js @@ -0,0 +1,75 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferCount = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OfferCount model module. + * @module model/OfferCount + * @version 1.0.0 + */ + + /** + * Constructs a new OfferCount. + * @alias module:model/OfferCount + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * Constructs a OfferCount from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferCount} obj Optional instance to populate. + * @return {module:model/OfferCount} The populated OfferCount instance. + */ + exports.constructFromObject = function(data, obj) { + return data; + } + + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferDeliveryInfo.js b/paapi5-nodejs-sdk-example/src/model/OfferDeliveryInfo.js new file mode 100644 index 0000000..cce4a60 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferDeliveryInfo.js @@ -0,0 +1,111 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/OfferShippingCharge'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./OfferShippingCharge')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferDeliveryInfo = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.OfferShippingCharge); + } +}(this, function(ApiClient, OfferShippingCharge) { + 'use strict'; + + + + + /** + * The OfferDeliveryInfo model module. + * @module model/OfferDeliveryInfo + * @version 1.0.0 + */ + + /** + * Constructs a new OfferDeliveryInfo. + * @alias module:model/OfferDeliveryInfo + * @class + */ + var exports = function() { + var _this = this; + + + + + + }; + + /** + * Constructs a OfferDeliveryInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferDeliveryInfo} obj Optional instance to populate. + * @return {module:model/OfferDeliveryInfo} The populated OfferDeliveryInfo instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('IsAmazonFulfilled')) { + obj['IsAmazonFulfilled'] = ApiClient.convertToType(data['IsAmazonFulfilled'], 'Boolean'); + } + if (data.hasOwnProperty('IsFreeShippingEligible')) { + obj['IsFreeShippingEligible'] = ApiClient.convertToType(data['IsFreeShippingEligible'], 'Boolean'); + } + if (data.hasOwnProperty('IsPrimeEligible')) { + obj['IsPrimeEligible'] = ApiClient.convertToType(data['IsPrimeEligible'], 'Boolean'); + } + if (data.hasOwnProperty('ShippingCharges')) { + obj['ShippingCharges'] = ApiClient.convertToType(data['ShippingCharges'], [OfferShippingCharge]); + } + } + return obj; + } + + /** + * @member {Boolean} IsAmazonFulfilled + */ + exports.prototype['IsAmazonFulfilled'] = undefined; + /** + * @member {Boolean} IsFreeShippingEligible + */ + exports.prototype['IsFreeShippingEligible'] = undefined; + /** + * @member {Boolean} IsPrimeEligible + */ + exports.prototype['IsPrimeEligible'] = undefined; + /** + * @member {Array.} ShippingCharges + */ + exports.prototype['ShippingCharges'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferListing.js b/paapi5-nodejs-sdk-example/src/model/OfferListing.js new file mode 100644 index 0000000..50bf770 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferListing.js @@ -0,0 +1,175 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/OfferAvailability', 'model/OfferCondition', 'model/OfferDeliveryInfo', 'model/OfferLoyaltyPoints', 'model/OfferMerchantInfo', 'model/OfferPrice', 'model/OfferProgramEligibility', 'model/OfferPromotion'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./OfferAvailability'), require('./OfferCondition'), require('./OfferDeliveryInfo'), require('./OfferLoyaltyPoints'), require('./OfferMerchantInfo'), require('./OfferPrice'), require('./OfferProgramEligibility'), require('./OfferPromotion')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferListing = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.OfferAvailability, root.ProductAdvertisingAPIv1.OfferCondition, root.ProductAdvertisingAPIv1.OfferDeliveryInfo, root.ProductAdvertisingAPIv1.OfferLoyaltyPoints, root.ProductAdvertisingAPIv1.OfferMerchantInfo, root.ProductAdvertisingAPIv1.OfferPrice, root.ProductAdvertisingAPIv1.OfferProgramEligibility, root.ProductAdvertisingAPIv1.OfferPromotion); + } +}(this, function(ApiClient, OfferAvailability, OfferCondition, OfferDeliveryInfo, OfferLoyaltyPoints, OfferMerchantInfo, OfferPrice, OfferProgramEligibility, OfferPromotion) { + 'use strict'; + + + + + /** + * The OfferListing model module. + * @module model/OfferListing + * @version 1.0.0 + */ + + /** + * Constructs a new OfferListing. + * @alias module:model/OfferListing + * @class + */ + var exports = function() { + var _this = this; + + + + + + + + + + + + + + }; + + /** + * Constructs a OfferListing from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferListing} obj Optional instance to populate. + * @return {module:model/OfferListing} The populated OfferListing instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Availability')) { + obj['Availability'] = OfferAvailability.constructFromObject(data['Availability']); + } + if (data.hasOwnProperty('Condition')) { + obj['Condition'] = OfferCondition.constructFromObject(data['Condition']); + } + if (data.hasOwnProperty('DeliveryInfo')) { + obj['DeliveryInfo'] = OfferDeliveryInfo.constructFromObject(data['DeliveryInfo']); + } + if (data.hasOwnProperty('Id')) { + obj['Id'] = ApiClient.convertToType(data['Id'], 'String'); + } + if (data.hasOwnProperty('IsBuyBoxWinner')) { + obj['IsBuyBoxWinner'] = ApiClient.convertToType(data['IsBuyBoxWinner'], 'Boolean'); + } + if (data.hasOwnProperty('LoyaltyPoints')) { + obj['LoyaltyPoints'] = OfferLoyaltyPoints.constructFromObject(data['LoyaltyPoints']); + } + if (data.hasOwnProperty('MerchantInfo')) { + obj['MerchantInfo'] = OfferMerchantInfo.constructFromObject(data['MerchantInfo']); + } + if (data.hasOwnProperty('Price')) { + obj['Price'] = OfferPrice.constructFromObject(data['Price']); + } + if (data.hasOwnProperty('ProgramEligibility')) { + obj['ProgramEligibility'] = OfferProgramEligibility.constructFromObject(data['ProgramEligibility']); + } + if (data.hasOwnProperty('Promotions')) { + obj['Promotions'] = ApiClient.convertToType(data['Promotions'], [OfferPromotion]); + } + if (data.hasOwnProperty('SavingBasis')) { + obj['SavingBasis'] = OfferPrice.constructFromObject(data['SavingBasis']); + } + if (data.hasOwnProperty('ViolatesMAP')) { + obj['ViolatesMAP'] = ApiClient.convertToType(data['ViolatesMAP'], 'Boolean'); + } + } + return obj; + } + + /** + * @member {module:model/OfferAvailability} Availability + */ + exports.prototype['Availability'] = undefined; + /** + * @member {module:model/OfferCondition} Condition + */ + exports.prototype['Condition'] = undefined; + /** + * @member {module:model/OfferDeliveryInfo} DeliveryInfo + */ + exports.prototype['DeliveryInfo'] = undefined; + /** + * @member {String} Id + */ + exports.prototype['Id'] = undefined; + /** + * @member {Boolean} IsBuyBoxWinner + */ + exports.prototype['IsBuyBoxWinner'] = undefined; + /** + * @member {module:model/OfferLoyaltyPoints} LoyaltyPoints + */ + exports.prototype['LoyaltyPoints'] = undefined; + /** + * @member {module:model/OfferMerchantInfo} MerchantInfo + */ + exports.prototype['MerchantInfo'] = undefined; + /** + * @member {module:model/OfferPrice} Price + */ + exports.prototype['Price'] = undefined; + /** + * @member {module:model/OfferProgramEligibility} ProgramEligibility + */ + exports.prototype['ProgramEligibility'] = undefined; + /** + * @member {Array.} Promotions + */ + exports.prototype['Promotions'] = undefined; + /** + * @member {module:model/OfferPrice} SavingBasis + */ + exports.prototype['SavingBasis'] = undefined; + /** + * @member {Boolean} ViolatesMAP + */ + exports.prototype['ViolatesMAP'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferLoyaltyPoints.js b/paapi5-nodejs-sdk-example/src/model/OfferLoyaltyPoints.js new file mode 100644 index 0000000..795300a --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferLoyaltyPoints.js @@ -0,0 +1,87 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferLoyaltyPoints = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OfferLoyaltyPoints model module. + * @module model/OfferLoyaltyPoints + * @version 1.0.0 + */ + + /** + * Constructs a new OfferLoyaltyPoints. + * @alias module:model/OfferLoyaltyPoints + * @class + */ + var exports = function() { + var _this = this; + + + }; + + /** + * Constructs a OfferLoyaltyPoints from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferLoyaltyPoints} obj Optional instance to populate. + * @return {module:model/OfferLoyaltyPoints} The populated OfferLoyaltyPoints instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Points')) { + obj['Points'] = ApiClient.convertToType(data['Points'], 'Number'); + } + } + return obj; + } + + /** + * @member {Number} Points + */ + exports.prototype['Points'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferMerchantInfo.js b/paapi5-nodejs-sdk-example/src/model/OfferMerchantInfo.js new file mode 100644 index 0000000..fee3aa8 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferMerchantInfo.js @@ -0,0 +1,119 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferMerchantInfo = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OfferMerchantInfo model module. + * @module model/OfferMerchantInfo + * @version 1.0.0 + */ + + /** + * Constructs a new OfferMerchantInfo. + * @alias module:model/OfferMerchantInfo + * @class + */ + var exports = function() { + var _this = this; + + + + + + + }; + + /** + * Constructs a OfferMerchantInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferMerchantInfo} obj Optional instance to populate. + * @return {module:model/OfferMerchantInfo} The populated OfferMerchantInfo instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('DefaultShippingCountry')) { + obj['DefaultShippingCountry'] = ApiClient.convertToType(data['DefaultShippingCountry'], 'String'); + } + if (data.hasOwnProperty('FeedbackCount')) { + obj['FeedbackCount'] = ApiClient.convertToType(data['FeedbackCount'], 'Number'); + } + if (data.hasOwnProperty('FeedbackRating')) { + obj['FeedbackRating'] = ApiClient.convertToType(data['FeedbackRating'], 'Number'); + } + if (data.hasOwnProperty('Id')) { + obj['Id'] = ApiClient.convertToType(data['Id'], 'String'); + } + if (data.hasOwnProperty('Name')) { + obj['Name'] = ApiClient.convertToType(data['Name'], 'String'); + } + } + return obj; + } + + /** + * @member {String} DefaultShippingCountry + */ + exports.prototype['DefaultShippingCountry'] = undefined; + /** + * @member {Number} FeedbackCount + */ + exports.prototype['FeedbackCount'] = undefined; + /** + * @member {Number} FeedbackRating + */ + exports.prototype['FeedbackRating'] = undefined; + /** + * @member {String} Id + */ + exports.prototype['Id'] = undefined; + /** + * @member {String} Name + */ + exports.prototype['Name'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferPrice.js b/paapi5-nodejs-sdk-example/src/model/OfferPrice.js new file mode 100644 index 0000000..14d1cd6 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferPrice.js @@ -0,0 +1,135 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/OfferSavings', 'model/PriceType'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./OfferSavings'), require('./PriceType')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferPrice = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.OfferSavings, root.ProductAdvertisingAPIv1.PriceType); + } +}(this, function(ApiClient, OfferSavings, PriceType) { + 'use strict'; + + + + + /** + * The OfferPrice model module. + * @module model/OfferPrice + * @version 1.0.0 + */ + + /** + * Constructs a new OfferPrice. + * @alias module:model/OfferPrice + * @class + */ + var exports = function() { + var _this = this; + + + + + + + + + }; + + /** + * Constructs a OfferPrice from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferPrice} obj Optional instance to populate. + * @return {module:model/OfferPrice} The populated OfferPrice instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Amount')) { + obj['Amount'] = ApiClient.convertToType(data['Amount'], 'Number'); + } + if (data.hasOwnProperty('Currency')) { + obj['Currency'] = ApiClient.convertToType(data['Currency'], 'String'); + } + if (data.hasOwnProperty('DisplayAmount')) { + obj['DisplayAmount'] = ApiClient.convertToType(data['DisplayAmount'], 'String'); + } + if (data.hasOwnProperty('PricePerUnit')) { + obj['PricePerUnit'] = ApiClient.convertToType(data['PricePerUnit'], 'Number'); + } + if (data.hasOwnProperty('PriceType')) { + obj['PriceType'] = PriceType.constructFromObject(data['PriceType']); + } + if (data.hasOwnProperty('PriceTypeLabel')) { + obj['PriceTypeLabel'] = ApiClient.convertToType(data['PriceTypeLabel'], 'String'); + } + if (data.hasOwnProperty('Savings')) { + obj['Savings'] = OfferSavings.constructFromObject(data['Savings']); + } + } + return obj; + } + + /** + * @member {Number} Amount + */ + exports.prototype['Amount'] = undefined; + /** + * @member {String} Currency + */ + exports.prototype['Currency'] = undefined; + /** + * @member {String} DisplayAmount + */ + exports.prototype['DisplayAmount'] = undefined; + /** + * @member {Number} PricePerUnit + */ + exports.prototype['PricePerUnit'] = undefined; + /** + * @member {module:model/PriceType} PriceType + */ + exports.prototype['PriceType'] = undefined; + /** + * @member {String} PriceTypeLabel + */ + exports.prototype['PriceTypeLabel'] = undefined; + /** + * @member {module:model/OfferSavings} Savings + */ + exports.prototype['Savings'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferProgramEligibility.js b/paapi5-nodejs-sdk-example/src/model/OfferProgramEligibility.js new file mode 100644 index 0000000..aee2ee2 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferProgramEligibility.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferProgramEligibility = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OfferProgramEligibility model module. + * @module model/OfferProgramEligibility + * @version 1.0.0 + */ + + /** + * Constructs a new OfferProgramEligibility. + * @alias module:model/OfferProgramEligibility + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a OfferProgramEligibility from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferProgramEligibility} obj Optional instance to populate. + * @return {module:model/OfferProgramEligibility} The populated OfferProgramEligibility instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('IsPrimeExclusive')) { + obj['IsPrimeExclusive'] = ApiClient.convertToType(data['IsPrimeExclusive'], 'Boolean'); + } + if (data.hasOwnProperty('IsPrimePantry')) { + obj['IsPrimePantry'] = ApiClient.convertToType(data['IsPrimePantry'], 'Boolean'); + } + } + return obj; + } + + /** + * @member {Boolean} IsPrimeExclusive + */ + exports.prototype['IsPrimeExclusive'] = undefined; + /** + * @member {Boolean} IsPrimePantry + */ + exports.prototype['IsPrimePantry'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferPromotion.js b/paapi5-nodejs-sdk-example/src/model/OfferPromotion.js new file mode 100644 index 0000000..70e7572 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferPromotion.js @@ -0,0 +1,127 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferPromotion = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OfferPromotion model module. + * @module model/OfferPromotion + * @version 1.0.0 + */ + + /** + * Constructs a new OfferPromotion. + * @alias module:model/OfferPromotion + * @class + */ + var exports = function() { + var _this = this; + + + + + + + + }; + + /** + * Constructs a OfferPromotion from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferPromotion} obj Optional instance to populate. + * @return {module:model/OfferPromotion} The populated OfferPromotion instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Amount')) { + obj['Amount'] = ApiClient.convertToType(data['Amount'], 'Number'); + } + if (data.hasOwnProperty('Currency')) { + obj['Currency'] = ApiClient.convertToType(data['Currency'], 'String'); + } + if (data.hasOwnProperty('DiscountPercent')) { + obj['DiscountPercent'] = ApiClient.convertToType(data['DiscountPercent'], 'Number'); + } + if (data.hasOwnProperty('DisplayAmount')) { + obj['DisplayAmount'] = ApiClient.convertToType(data['DisplayAmount'], 'String'); + } + if (data.hasOwnProperty('PricePerUnit')) { + obj['PricePerUnit'] = ApiClient.convertToType(data['PricePerUnit'], 'Number'); + } + if (data.hasOwnProperty('Type')) { + obj['Type'] = ApiClient.convertToType(data['Type'], 'String'); + } + } + return obj; + } + + /** + * @member {Number} Amount + */ + exports.prototype['Amount'] = undefined; + /** + * @member {String} Currency + */ + exports.prototype['Currency'] = undefined; + /** + * @member {Number} DiscountPercent + */ + exports.prototype['DiscountPercent'] = undefined; + /** + * @member {String} DisplayAmount + */ + exports.prototype['DisplayAmount'] = undefined; + /** + * @member {Number} PricePerUnit + */ + exports.prototype['PricePerUnit'] = undefined; + /** + * @member {String} Type + */ + exports.prototype['Type'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferSavings.js b/paapi5-nodejs-sdk-example/src/model/OfferSavings.js new file mode 100644 index 0000000..5880396 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferSavings.js @@ -0,0 +1,119 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferSavings = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OfferSavings model module. + * @module model/OfferSavings + * @version 1.0.0 + */ + + /** + * Constructs a new OfferSavings. + * @alias module:model/OfferSavings + * @class + */ + var exports = function() { + var _this = this; + + + + + + + }; + + /** + * Constructs a OfferSavings from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferSavings} obj Optional instance to populate. + * @return {module:model/OfferSavings} The populated OfferSavings instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Amount')) { + obj['Amount'] = ApiClient.convertToType(data['Amount'], 'Number'); + } + if (data.hasOwnProperty('Currency')) { + obj['Currency'] = ApiClient.convertToType(data['Currency'], 'String'); + } + if (data.hasOwnProperty('DisplayAmount')) { + obj['DisplayAmount'] = ApiClient.convertToType(data['DisplayAmount'], 'String'); + } + if (data.hasOwnProperty('Percentage')) { + obj['Percentage'] = ApiClient.convertToType(data['Percentage'], 'Number'); + } + if (data.hasOwnProperty('PricePerUnit')) { + obj['PricePerUnit'] = ApiClient.convertToType(data['PricePerUnit'], 'Number'); + } + } + return obj; + } + + /** + * @member {Number} Amount + */ + exports.prototype['Amount'] = undefined; + /** + * @member {String} Currency + */ + exports.prototype['Currency'] = undefined; + /** + * @member {String} DisplayAmount + */ + exports.prototype['DisplayAmount'] = undefined; + /** + * @member {Number} Percentage + */ + exports.prototype['Percentage'] = undefined; + /** + * @member {Number} PricePerUnit + */ + exports.prototype['PricePerUnit'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferShippingCharge.js b/paapi5-nodejs-sdk-example/src/model/OfferShippingCharge.js new file mode 100644 index 0000000..f68f008 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferShippingCharge.js @@ -0,0 +1,119 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferShippingCharge = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OfferShippingCharge model module. + * @module model/OfferShippingCharge + * @version 1.0.0 + */ + + /** + * Constructs a new OfferShippingCharge. + * @alias module:model/OfferShippingCharge + * @class + */ + var exports = function() { + var _this = this; + + + + + + + }; + + /** + * Constructs a OfferShippingCharge from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferShippingCharge} obj Optional instance to populate. + * @return {module:model/OfferShippingCharge} The populated OfferShippingCharge instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Amount')) { + obj['Amount'] = ApiClient.convertToType(data['Amount'], 'Number'); + } + if (data.hasOwnProperty('Currency')) { + obj['Currency'] = ApiClient.convertToType(data['Currency'], 'String'); + } + if (data.hasOwnProperty('DisplayAmount')) { + obj['DisplayAmount'] = ApiClient.convertToType(data['DisplayAmount'], 'String'); + } + if (data.hasOwnProperty('IsRateTaxInclusive')) { + obj['IsRateTaxInclusive'] = ApiClient.convertToType(data['IsRateTaxInclusive'], 'Boolean'); + } + if (data.hasOwnProperty('Type')) { + obj['Type'] = ApiClient.convertToType(data['Type'], 'String'); + } + } + return obj; + } + + /** + * @member {Number} Amount + */ + exports.prototype['Amount'] = undefined; + /** + * @member {String} Currency + */ + exports.prototype['Currency'] = undefined; + /** + * @member {String} DisplayAmount + */ + exports.prototype['DisplayAmount'] = undefined; + /** + * @member {Boolean} IsRateTaxInclusive + */ + exports.prototype['IsRateTaxInclusive'] = undefined; + /** + * @member {String} Type + */ + exports.prototype['Type'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferSubCondition.js b/paapi5-nodejs-sdk-example/src/model/OfferSubCondition.js new file mode 100644 index 0000000..5583c2a --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferSubCondition.js @@ -0,0 +1,111 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferSubCondition = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OfferSubCondition model module. + * @module model/OfferSubCondition + * @version 1.0.0 + */ + + /** + * Constructs a new OfferSubCondition. + * @alias module:model/OfferSubCondition + * @class + */ + var exports = function() { + var _this = this; + + + + + + }; + + /** + * Constructs a OfferSubCondition from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferSubCondition} obj Optional instance to populate. + * @return {module:model/OfferSubCondition} The populated OfferSubCondition instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('DisplayValue')) { + obj['DisplayValue'] = ApiClient.convertToType(data['DisplayValue'], 'String'); + } + if (data.hasOwnProperty('Label')) { + obj['Label'] = ApiClient.convertToType(data['Label'], 'String'); + } + if (data.hasOwnProperty('Locale')) { + obj['Locale'] = ApiClient.convertToType(data['Locale'], 'String'); + } + if (data.hasOwnProperty('Value')) { + obj['Value'] = ApiClient.convertToType(data['Value'], 'String'); + } + } + return obj; + } + + /** + * @member {String} DisplayValue + */ + exports.prototype['DisplayValue'] = undefined; + /** + * @member {String} Label + */ + exports.prototype['Label'] = undefined; + /** + * @member {String} Locale + */ + exports.prototype['Locale'] = undefined; + /** + * @member {String} Value + */ + exports.prototype['Value'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/OfferSummary.js b/paapi5-nodejs-sdk-example/src/model/OfferSummary.js new file mode 100644 index 0000000..c99284c --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/OfferSummary.js @@ -0,0 +1,111 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/OfferCondition', 'model/OfferPrice'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./OfferCondition'), require('./OfferPrice')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.OfferSummary = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.OfferCondition, root.ProductAdvertisingAPIv1.OfferPrice); + } +}(this, function(ApiClient, OfferCondition, OfferPrice) { + 'use strict'; + + + + + /** + * The OfferSummary model module. + * @module model/OfferSummary + * @version 1.0.0 + */ + + /** + * Constructs a new OfferSummary. + * @alias module:model/OfferSummary + * @class + */ + var exports = function() { + var _this = this; + + + + + + }; + + /** + * Constructs a OfferSummary from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OfferSummary} obj Optional instance to populate. + * @return {module:model/OfferSummary} The populated OfferSummary instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Condition')) { + obj['Condition'] = OfferCondition.constructFromObject(data['Condition']); + } + if (data.hasOwnProperty('HighestPrice')) { + obj['HighestPrice'] = OfferPrice.constructFromObject(data['HighestPrice']); + } + if (data.hasOwnProperty('LowestPrice')) { + obj['LowestPrice'] = OfferPrice.constructFromObject(data['LowestPrice']); + } + if (data.hasOwnProperty('OfferCount')) { + obj['OfferCount'] = ApiClient.convertToType(data['OfferCount'], 'Number'); + } + } + return obj; + } + + /** + * @member {module:model/OfferCondition} Condition + */ + exports.prototype['Condition'] = undefined; + /** + * @member {module:model/OfferPrice} HighestPrice + */ + exports.prototype['HighestPrice'] = undefined; + /** + * @member {module:model/OfferPrice} LowestPrice + */ + exports.prototype['LowestPrice'] = undefined; + /** + * @member {Number} OfferCount + */ + exports.prototype['OfferCount'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/Offers.js b/paapi5-nodejs-sdk-example/src/model/Offers.js new file mode 100644 index 0000000..a24f9f2 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/Offers.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/OfferListing', 'model/OfferSummary'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./OfferListing'), require('./OfferSummary')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.Offers = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.OfferListing, root.ProductAdvertisingAPIv1.OfferSummary); + } +}(this, function(ApiClient, OfferListing, OfferSummary) { + 'use strict'; + + + + + /** + * The Offers model module. + * @module model/Offers + * @version 1.0.0 + */ + + /** + * Constructs a new Offers. + * @alias module:model/Offers + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a Offers from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Offers} obj Optional instance to populate. + * @return {module:model/Offers} The populated Offers instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Listings')) { + obj['Listings'] = ApiClient.convertToType(data['Listings'], [OfferListing]); + } + if (data.hasOwnProperty('Summaries')) { + obj['Summaries'] = ApiClient.convertToType(data['Summaries'], [OfferSummary]); + } + } + return obj; + } + + /** + * @member {Array.} Listings + */ + exports.prototype['Listings'] = undefined; + /** + * @member {Array.} Summaries + */ + exports.prototype['Summaries'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/PartnerType.js b/paapi5-nodejs-sdk-example/src/model/PartnerType.js new file mode 100644 index 0000000..0077984 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/PartnerType.js @@ -0,0 +1,64 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.PartnerType = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + /** + * Enum class PartnerType. + * @enum {} + * @readonly + */ + var exports = { + /** + * value: "Associates" + * @const + */ + "Associates": "Associates" }; + + /** + * Returns a PartnerType enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/PartnerType} The enum PartnerType value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/Price.js b/paapi5-nodejs-sdk-example/src/model/Price.js new file mode 100644 index 0000000..46ecd0f --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/Price.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/OfferPrice'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./OfferPrice')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.Price = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.OfferPrice); + } +}(this, function(ApiClient, OfferPrice) { + 'use strict'; + + + + + /** + * The Price model module. + * @module model/Price + * @version 1.0.0 + */ + + /** + * Constructs a new Price. + * @alias module:model/Price + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a Price from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Price} obj Optional instance to populate. + * @return {module:model/Price} The populated Price instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('HighestPrice')) { + obj['HighestPrice'] = OfferPrice.constructFromObject(data['HighestPrice']); + } + if (data.hasOwnProperty('LowestPrice')) { + obj['LowestPrice'] = OfferPrice.constructFromObject(data['LowestPrice']); + } + } + return obj; + } + + /** + * @member {module:model/OfferPrice} HighestPrice + */ + exports.prototype['HighestPrice'] = undefined; + /** + * @member {module:model/OfferPrice} LowestPrice + */ + exports.prototype['LowestPrice'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/PriceType.js b/paapi5-nodejs-sdk-example/src/model/PriceType.js new file mode 100644 index 0000000..fbcac64 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/PriceType.js @@ -0,0 +1,79 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.PriceType = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + /** + * Enum class PriceType. + * @enum {} + * @readonly + */ + var exports = { + /** + * value: "LIST_PRICE" + * @const + */ + "LIST_PRICE": "LIST_PRICE", + /** + * value: "LOWEST_PRICE" + * @const + */ + "LOWEST_PRICE": "LOWEST_PRICE", + /** + * value: "LOWEST_PRICE_STRIKETHROUGH" + * @const + */ + "LOWEST_PRICE_STRIKETHROUGH": "LOWEST_PRICE_STRIKETHROUGH", + /** + * value: "WAS_PRICE" + * @const + */ + "WAS_PRICE": "WAS_PRICE" }; + + /** + * Returns a PriceType enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/PriceType} The enum PriceType value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ProductAdvertisingAPIClientException.js b/paapi5-nodejs-sdk-example/src/model/ProductAdvertisingAPIClientException.js new file mode 100644 index 0000000..4ea4027 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ProductAdvertisingAPIClientException.js @@ -0,0 +1,87 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/ErrorData'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./ErrorData')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ProductAdvertisingAPIClientException = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.ErrorData); + } +}(this, function(ApiClient, ErrorData) { + 'use strict'; + + + + + /** + * The ProductAdvertisingAPIClientException model module. + * @module model/ProductAdvertisingAPIClientException + * @version 1.0.0 + */ + + /** + * Constructs a new ProductAdvertisingAPIClientException. + * @alias module:model/ProductAdvertisingAPIClientException + * @class + */ + var exports = function() { + var _this = this; + + + }; + + /** + * Constructs a ProductAdvertisingAPIClientException from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ProductAdvertisingAPIClientException} obj Optional instance to populate. + * @return {module:model/ProductAdvertisingAPIClientException} The populated ProductAdvertisingAPIClientException instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Errors')) { + obj['Errors'] = ApiClient.convertToType(data['Errors'], [ErrorData]); + } + } + return obj; + } + + /** + * @member {Array.} Errors + */ + exports.prototype['Errors'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ProductAdvertisingAPIServiceException.js b/paapi5-nodejs-sdk-example/src/model/ProductAdvertisingAPIServiceException.js new file mode 100644 index 0000000..3b1abbd --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ProductAdvertisingAPIServiceException.js @@ -0,0 +1,87 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ProductAdvertisingAPIServiceException = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The ProductAdvertisingAPIServiceException model module. + * @module model/ProductAdvertisingAPIServiceException + * @version 1.0.0 + */ + + /** + * Constructs a new ProductAdvertisingAPIServiceException. + * @alias module:model/ProductAdvertisingAPIServiceException + * @class + */ + var exports = function() { + var _this = this; + + + }; + + /** + * Constructs a ProductAdvertisingAPIServiceException from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ProductAdvertisingAPIServiceException} obj Optional instance to populate. + * @return {module:model/ProductAdvertisingAPIServiceException} The populated ProductAdvertisingAPIServiceException instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('message')) { + obj['message'] = ApiClient.convertToType(data['message'], 'String'); + } + } + return obj; + } + + /** + * @member {String} message + */ + exports.prototype['message'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/ProductInfo.js b/paapi5-nodejs-sdk-example/src/model/ProductInfo.js new file mode 100644 index 0000000..719aa0d --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/ProductInfo.js @@ -0,0 +1,127 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/DimensionBasedAttribute', 'model/SingleBooleanValuedAttribute', 'model/SingleIntegerValuedAttribute', 'model/SingleStringValuedAttribute'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./DimensionBasedAttribute'), require('./SingleBooleanValuedAttribute'), require('./SingleIntegerValuedAttribute'), require('./SingleStringValuedAttribute')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.ProductInfo = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.DimensionBasedAttribute, root.ProductAdvertisingAPIv1.SingleBooleanValuedAttribute, root.ProductAdvertisingAPIv1.SingleIntegerValuedAttribute, root.ProductAdvertisingAPIv1.SingleStringValuedAttribute); + } +}(this, function(ApiClient, DimensionBasedAttribute, SingleBooleanValuedAttribute, SingleIntegerValuedAttribute, SingleStringValuedAttribute) { + 'use strict'; + + + + + /** + * The ProductInfo model module. + * @module model/ProductInfo + * @version 1.0.0 + */ + + /** + * Constructs a new ProductInfo. + * @alias module:model/ProductInfo + * @class + */ + var exports = function() { + var _this = this; + + + + + + + + }; + + /** + * Constructs a ProductInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ProductInfo} obj Optional instance to populate. + * @return {module:model/ProductInfo} The populated ProductInfo instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Color')) { + obj['Color'] = SingleStringValuedAttribute.constructFromObject(data['Color']); + } + if (data.hasOwnProperty('IsAdultProduct')) { + obj['IsAdultProduct'] = SingleBooleanValuedAttribute.constructFromObject(data['IsAdultProduct']); + } + if (data.hasOwnProperty('ItemDimensions')) { + obj['ItemDimensions'] = DimensionBasedAttribute.constructFromObject(data['ItemDimensions']); + } + if (data.hasOwnProperty('ReleaseDate')) { + obj['ReleaseDate'] = SingleStringValuedAttribute.constructFromObject(data['ReleaseDate']); + } + if (data.hasOwnProperty('Size')) { + obj['Size'] = SingleStringValuedAttribute.constructFromObject(data['Size']); + } + if (data.hasOwnProperty('UnitCount')) { + obj['UnitCount'] = SingleIntegerValuedAttribute.constructFromObject(data['UnitCount']); + } + } + return obj; + } + + /** + * @member {module:model/SingleStringValuedAttribute} Color + */ + exports.prototype['Color'] = undefined; + /** + * @member {module:model/SingleBooleanValuedAttribute} IsAdultProduct + */ + exports.prototype['IsAdultProduct'] = undefined; + /** + * @member {module:model/DimensionBasedAttribute} ItemDimensions + */ + exports.prototype['ItemDimensions'] = undefined; + /** + * @member {module:model/SingleStringValuedAttribute} ReleaseDate + */ + exports.prototype['ReleaseDate'] = undefined; + /** + * @member {module:model/SingleStringValuedAttribute} Size + */ + exports.prototype['Size'] = undefined; + /** + * @member {module:model/SingleIntegerValuedAttribute} UnitCount + */ + exports.prototype['UnitCount'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/Properties.js b/paapi5-nodejs-sdk-example/src/model/Properties.js new file mode 100644 index 0000000..c0d844c --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/Properties.js @@ -0,0 +1,82 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.Properties = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The Properties model module. + * @module model/Properties + * @version 1.0.0 + */ + + /** + * Constructs a new Properties. + * @alias module:model/Properties + * @class + * @extends Object + */ + var exports = function() { + var _this = this; + + return _this; + }; + + /** + * Constructs a Properties from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Properties} obj Optional instance to populate. + * @return {module:model/Properties} The populated Properties instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + ApiClient.constructFromObject(data, obj, 'String'); + + } + return obj; + } + + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/Rating.js b/paapi5-nodejs-sdk-example/src/model/Rating.js new file mode 100644 index 0000000..82faf6e --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/Rating.js @@ -0,0 +1,87 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.Rating = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The Rating model module. + * @module model/Rating + * @version 1.0.0 + */ + + /** + * Constructs a new Rating. + * @alias module:model/Rating + * @class + */ + var exports = function() { + var _this = this; + + + }; + + /** + * Constructs a Rating from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Rating} obj Optional instance to populate. + * @return {module:model/Rating} The populated Rating instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Value')) { + obj['Value'] = ApiClient.convertToType(data['Value'], 'Number'); + } + } + return obj; + } + + /** + * @member {Number} Value + */ + exports.prototype['Value'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/Refinement.js b/paapi5-nodejs-sdk-example/src/model/Refinement.js new file mode 100644 index 0000000..44febc6 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/Refinement.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/RefinementBin'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./RefinementBin')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.Refinement = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.RefinementBin); + } +}(this, function(ApiClient, RefinementBin) { + 'use strict'; + + + + + /** + * The Refinement model module. + * @module model/Refinement + * @version 1.0.0 + */ + + /** + * Constructs a new Refinement. + * @alias module:model/Refinement + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a Refinement from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Refinement} obj Optional instance to populate. + * @return {module:model/Refinement} The populated Refinement instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Bins')) { + obj['Bins'] = ApiClient.convertToType(data['Bins'], [RefinementBin]); + } + if (data.hasOwnProperty('DisplayName')) { + obj['DisplayName'] = ApiClient.convertToType(data['DisplayName'], 'String'); + } + if (data.hasOwnProperty('Id')) { + obj['Id'] = ApiClient.convertToType(data['Id'], 'String'); + } + } + return obj; + } + + /** + * @member {Array.} Bins + */ + exports.prototype['Bins'] = undefined; + /** + * @member {String} DisplayName + */ + exports.prototype['DisplayName'] = undefined; + /** + * @member {String} Id + */ + exports.prototype['Id'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/RefinementBin.js b/paapi5-nodejs-sdk-example/src/model/RefinementBin.js new file mode 100644 index 0000000..ebb0573 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/RefinementBin.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.RefinementBin = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The RefinementBin model module. + * @module model/RefinementBin + * @version 1.0.0 + */ + + /** + * Constructs a new RefinementBin. + * @alias module:model/RefinementBin + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a RefinementBin from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/RefinementBin} obj Optional instance to populate. + * @return {module:model/RefinementBin} The populated RefinementBin instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('DisplayName')) { + obj['DisplayName'] = ApiClient.convertToType(data['DisplayName'], 'String'); + } + if (data.hasOwnProperty('Id')) { + obj['Id'] = ApiClient.convertToType(data['Id'], 'String'); + } + } + return obj; + } + + /** + * @member {String} DisplayName + */ + exports.prototype['DisplayName'] = undefined; + /** + * @member {String} Id + */ + exports.prototype['Id'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/RentalOfferListing.js b/paapi5-nodejs-sdk-example/src/model/RentalOfferListing.js new file mode 100644 index 0000000..71e948e --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/RentalOfferListing.js @@ -0,0 +1,127 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/DurationPrice', 'model/OfferAvailability', 'model/OfferCondition', 'model/OfferDeliveryInfo', 'model/OfferMerchantInfo'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./DurationPrice'), require('./OfferAvailability'), require('./OfferCondition'), require('./OfferDeliveryInfo'), require('./OfferMerchantInfo')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.RentalOfferListing = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.DurationPrice, root.ProductAdvertisingAPIv1.OfferAvailability, root.ProductAdvertisingAPIv1.OfferCondition, root.ProductAdvertisingAPIv1.OfferDeliveryInfo, root.ProductAdvertisingAPIv1.OfferMerchantInfo); + } +}(this, function(ApiClient, DurationPrice, OfferAvailability, OfferCondition, OfferDeliveryInfo, OfferMerchantInfo) { + 'use strict'; + + + + + /** + * The RentalOfferListing model module. + * @module model/RentalOfferListing + * @version 1.0.0 + */ + + /** + * Constructs a new RentalOfferListing. + * @alias module:model/RentalOfferListing + * @class + */ + var exports = function() { + var _this = this; + + + + + + + + }; + + /** + * Constructs a RentalOfferListing from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/RentalOfferListing} obj Optional instance to populate. + * @return {module:model/RentalOfferListing} The populated RentalOfferListing instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Availability')) { + obj['Availability'] = OfferAvailability.constructFromObject(data['Availability']); + } + if (data.hasOwnProperty('BasePrice')) { + obj['BasePrice'] = DurationPrice.constructFromObject(data['BasePrice']); + } + if (data.hasOwnProperty('Condition')) { + obj['Condition'] = OfferCondition.constructFromObject(data['Condition']); + } + if (data.hasOwnProperty('DeliveryInfo')) { + obj['DeliveryInfo'] = OfferDeliveryInfo.constructFromObject(data['DeliveryInfo']); + } + if (data.hasOwnProperty('Id')) { + obj['Id'] = ApiClient.convertToType(data['Id'], 'String'); + } + if (data.hasOwnProperty('MerchantInfo')) { + obj['MerchantInfo'] = OfferMerchantInfo.constructFromObject(data['MerchantInfo']); + } + } + return obj; + } + + /** + * @member {module:model/OfferAvailability} Availability + */ + exports.prototype['Availability'] = undefined; + /** + * @member {module:model/DurationPrice} BasePrice + */ + exports.prototype['BasePrice'] = undefined; + /** + * @member {module:model/OfferCondition} Condition + */ + exports.prototype['Condition'] = undefined; + /** + * @member {module:model/OfferDeliveryInfo} DeliveryInfo + */ + exports.prototype['DeliveryInfo'] = undefined; + /** + * @member {String} Id + */ + exports.prototype['Id'] = undefined; + /** + * @member {module:model/OfferMerchantInfo} MerchantInfo + */ + exports.prototype['MerchantInfo'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/RentalOffers.js b/paapi5-nodejs-sdk-example/src/model/RentalOffers.js new file mode 100644 index 0000000..2856276 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/RentalOffers.js @@ -0,0 +1,87 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/RentalOfferListing'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./RentalOfferListing')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.RentalOffers = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.RentalOfferListing); + } +}(this, function(ApiClient, RentalOfferListing) { + 'use strict'; + + + + + /** + * The RentalOffers model module. + * @module model/RentalOffers + * @version 1.0.0 + */ + + /** + * Constructs a new RentalOffers. + * @alias module:model/RentalOffers + * @class + */ + var exports = function() { + var _this = this; + + + }; + + /** + * Constructs a RentalOffers from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/RentalOffers} obj Optional instance to populate. + * @return {module:model/RentalOffers} The populated RentalOffers instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Listings')) { + obj['Listings'] = ApiClient.convertToType(data['Listings'], [RentalOfferListing]); + } + } + return obj; + } + + /** + * @member {Array.} Listings + */ + exports.prototype['Listings'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/SearchItemsRequest.js b/paapi5-nodejs-sdk-example/src/model/SearchItemsRequest.js new file mode 100644 index 0000000..1e2a410 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/SearchItemsRequest.js @@ -0,0 +1,297 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Availability', 'model/Condition', 'model/DeliveryFlag', 'model/MaxPrice', 'model/Merchant', 'model/MinPrice', 'model/MinReviewsRating', 'model/MinSavingPercent', 'model/OfferCount', 'model/PartnerType', 'model/Properties', 'model/SearchItemsResource', 'model/SortBy'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./Availability'), require('./Condition'), require('./DeliveryFlag'), require('./MaxPrice'), require('./Merchant'), require('./MinPrice'), require('./MinReviewsRating'), require('./MinSavingPercent'), require('./OfferCount'), require('./PartnerType'), require('./Properties'), require('./SearchItemsResource'), require('./SortBy')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.SearchItemsRequest = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.Availability, root.ProductAdvertisingAPIv1.Condition, root.ProductAdvertisingAPIv1.DeliveryFlag, root.ProductAdvertisingAPIv1.MaxPrice, root.ProductAdvertisingAPIv1.Merchant, root.ProductAdvertisingAPIv1.MinPrice, root.ProductAdvertisingAPIv1.MinReviewsRating, root.ProductAdvertisingAPIv1.MinSavingPercent, root.ProductAdvertisingAPIv1.OfferCount, root.ProductAdvertisingAPIv1.PartnerType, root.ProductAdvertisingAPIv1.Properties, root.ProductAdvertisingAPIv1.SearchItemsResource, root.ProductAdvertisingAPIv1.SortBy); + } +}(this, function(ApiClient, Availability, Condition, DeliveryFlag, MaxPrice, Merchant, MinPrice, MinReviewsRating, MinSavingPercent, OfferCount, PartnerType, Properties, SearchItemsResource, SortBy) { + 'use strict'; + + + + + /** + * The SearchItemsRequest model module. + * @module model/SearchItemsRequest + * @version 1.0.0 + */ + + /** + * Constructs a new SearchItemsRequest. + * @alias module:model/SearchItemsRequest + * @class + * @param partnerTag {String} + * @param partnerType {module:model/PartnerType} + */ + var exports = function(partnerTag, partnerType) { + var _this = this; + + + + + + + + + + + + + + + + + + + + + + _this['PartnerTag'] = partnerTag; + _this['PartnerType'] = partnerType; + + + + + + }; + + /** + * Constructs a SearchItemsRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/SearchItemsRequest} obj Optional instance to populate. + * @return {module:model/SearchItemsRequest} The populated SearchItemsRequest instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Actor')) { + obj['Actor'] = ApiClient.convertToType(data['Actor'], 'String'); + } + if (data.hasOwnProperty('Artist')) { + obj['Artist'] = ApiClient.convertToType(data['Artist'], 'String'); + } + if (data.hasOwnProperty('Author')) { + obj['Author'] = ApiClient.convertToType(data['Author'], 'String'); + } + if (data.hasOwnProperty('Availability')) { + obj['Availability'] = Availability.constructFromObject(data['Availability']); + } + if (data.hasOwnProperty('Brand')) { + obj['Brand'] = ApiClient.convertToType(data['Brand'], 'String'); + } + if (data.hasOwnProperty('BrowseNodeId')) { + obj['BrowseNodeId'] = ApiClient.convertToType(data['BrowseNodeId'], 'String'); + } + if (data.hasOwnProperty('Condition')) { + obj['Condition'] = Condition.constructFromObject(data['Condition']); + } + if (data.hasOwnProperty('CurrencyOfPreference')) { + obj['CurrencyOfPreference'] = ApiClient.convertToType(data['CurrencyOfPreference'], 'String'); + } + if (data.hasOwnProperty('DeliveryFlags')) { + obj['DeliveryFlags'] = ApiClient.convertToType(data['DeliveryFlags'], [DeliveryFlag]); + } + if (data.hasOwnProperty('ItemCount')) { + obj['ItemCount'] = ApiClient.convertToType(data['ItemCount'], 'Number'); + } + if (data.hasOwnProperty('ItemPage')) { + obj['ItemPage'] = ApiClient.convertToType(data['ItemPage'], 'Number'); + } + if (data.hasOwnProperty('Keywords')) { + obj['Keywords'] = ApiClient.convertToType(data['Keywords'], 'String'); + } + if (data.hasOwnProperty('LanguagesOfPreference')) { + obj['LanguagesOfPreference'] = ApiClient.convertToType(data['LanguagesOfPreference'], ['String']); + } + if (data.hasOwnProperty('Marketplace')) { + obj['Marketplace'] = ApiClient.convertToType(data['Marketplace'], 'String'); + } + if (data.hasOwnProperty('MaxPrice')) { + obj['MaxPrice'] = MaxPrice.constructFromObject(data['MaxPrice']); + } + if (data.hasOwnProperty('Merchant')) { + obj['Merchant'] = Merchant.constructFromObject(data['Merchant']); + } + if (data.hasOwnProperty('MinPrice')) { + obj['MinPrice'] = MinPrice.constructFromObject(data['MinPrice']); + } + if (data.hasOwnProperty('MinReviewsRating')) { + obj['MinReviewsRating'] = MinReviewsRating.constructFromObject(data['MinReviewsRating']); + } + if (data.hasOwnProperty('MinSavingPercent')) { + obj['MinSavingPercent'] = MinSavingPercent.constructFromObject(data['MinSavingPercent']); + } + if (data.hasOwnProperty('OfferCount')) { + obj['OfferCount'] = OfferCount.constructFromObject(data['OfferCount']); + } + if (data.hasOwnProperty('PartnerTag')) { + obj['PartnerTag'] = ApiClient.convertToType(data['PartnerTag'], 'String'); + } + if (data.hasOwnProperty('PartnerType')) { + obj['PartnerType'] = PartnerType.constructFromObject(data['PartnerType']); + } + if (data.hasOwnProperty('Properties')) { + obj['Properties'] = Properties.constructFromObject(data['Properties']); + } + if (data.hasOwnProperty('Resources')) { + obj['Resources'] = ApiClient.convertToType(data['Resources'], [SearchItemsResource]); + } + if (data.hasOwnProperty('SearchIndex')) { + obj['SearchIndex'] = ApiClient.convertToType(data['SearchIndex'], 'String'); + } + if (data.hasOwnProperty('SortBy')) { + obj['SortBy'] = SortBy.constructFromObject(data['SortBy']); + } + if (data.hasOwnProperty('Title')) { + obj['Title'] = ApiClient.convertToType(data['Title'], 'String'); + } + } + return obj; + } + + /** + * @member {String} Actor + */ + exports.prototype['Actor'] = undefined; + /** + * @member {String} Artist + */ + exports.prototype['Artist'] = undefined; + /** + * @member {String} Author + */ + exports.prototype['Author'] = undefined; + /** + * @member {module:model/Availability} Availability + */ + exports.prototype['Availability'] = undefined; + /** + * @member {String} Brand + */ + exports.prototype['Brand'] = undefined; + /** + * @member {String} BrowseNodeId + */ + exports.prototype['BrowseNodeId'] = undefined; + /** + * @member {module:model/Condition} Condition + */ + exports.prototype['Condition'] = undefined; + /** + * @member {String} CurrencyOfPreference + */ + exports.prototype['CurrencyOfPreference'] = undefined; + /** + * @member {Array.} DeliveryFlags + */ + exports.prototype['DeliveryFlags'] = undefined; + /** + * @member {Number} ItemCount + */ + exports.prototype['ItemCount'] = undefined; + /** + * @member {Number} ItemPage + */ + exports.prototype['ItemPage'] = undefined; + /** + * @member {String} Keywords + */ + exports.prototype['Keywords'] = undefined; + /** + * @member {Array.} LanguagesOfPreference + */ + exports.prototype['LanguagesOfPreference'] = undefined; + /** + * @member {String} Marketplace + */ + exports.prototype['Marketplace'] = undefined; + /** + * @member {module:model/MaxPrice} MaxPrice + */ + exports.prototype['MaxPrice'] = undefined; + /** + * @member {module:model/Merchant} Merchant + */ + exports.prototype['Merchant'] = undefined; + /** + * @member {module:model/MinPrice} MinPrice + */ + exports.prototype['MinPrice'] = undefined; + /** + * @member {module:model/MinReviewsRating} MinReviewsRating + */ + exports.prototype['MinReviewsRating'] = undefined; + /** + * @member {module:model/MinSavingPercent} MinSavingPercent + */ + exports.prototype['MinSavingPercent'] = undefined; + /** + * @member {module:model/OfferCount} OfferCount + */ + exports.prototype['OfferCount'] = undefined; + /** + * @member {String} PartnerTag + */ + exports.prototype['PartnerTag'] = undefined; + /** + * @member {module:model/PartnerType} PartnerType + */ + exports.prototype['PartnerType'] = undefined; + /** + * @member {module:model/Properties} Properties + */ + exports.prototype['Properties'] = undefined; + /** + * @member {Array.} Resources + */ + exports.prototype['Resources'] = undefined; + /** + * @member {String} SearchIndex + */ + exports.prototype['SearchIndex'] = undefined; + /** + * @member {module:model/SortBy} SortBy + */ + exports.prototype['SortBy'] = undefined; + /** + * @member {String} Title + */ + exports.prototype['Title'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/SearchItemsResource.js b/paapi5-nodejs-sdk-example/src/model/SearchItemsResource.js new file mode 100644 index 0000000..685328f --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/SearchItemsResource.js @@ -0,0 +1,359 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.SearchItemsResource = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + /** + * Enum class SearchItemsResource. + * @enum {} + * @readonly + */ + var exports = { + /** + * value: "BrowseNodeInfo.BrowseNodes" + * @const + */ + "BrowseNodeInfo.BrowseNodes": "BrowseNodeInfo.BrowseNodes", + /** + * value: "BrowseNodeInfo.BrowseNodes.Ancestor" + * @const + */ + "BrowseNodeInfo.BrowseNodes.Ancestor": "BrowseNodeInfo.BrowseNodes.Ancestor", + /** + * value: "BrowseNodeInfo.BrowseNodes.SalesRank" + * @const + */ + "BrowseNodeInfo.BrowseNodes.SalesRank": "BrowseNodeInfo.BrowseNodes.SalesRank", + /** + * value: "BrowseNodeInfo.WebsiteSalesRank" + * @const + */ + "BrowseNodeInfo.WebsiteSalesRank": "BrowseNodeInfo.WebsiteSalesRank", + /** + * value: "CustomerReviews.Count" + * @const + */ + "CustomerReviews.Count": "CustomerReviews.Count", + /** + * value: "CustomerReviews.StarRating" + * @const + */ + "CustomerReviews.StarRating": "CustomerReviews.StarRating", + /** + * value: "Images.Primary.Small" + * @const + */ + "Images.Primary.Small": "Images.Primary.Small", + /** + * value: "Images.Primary.Medium" + * @const + */ + "Images.Primary.Medium": "Images.Primary.Medium", + /** + * value: "Images.Primary.Large" + * @const + */ + "Images.Primary.Large": "Images.Primary.Large", + /** + * value: "Images.Variants.Small" + * @const + */ + "Images.Variants.Small": "Images.Variants.Small", + /** + * value: "Images.Variants.Medium" + * @const + */ + "Images.Variants.Medium": "Images.Variants.Medium", + /** + * value: "Images.Variants.Large" + * @const + */ + "Images.Variants.Large": "Images.Variants.Large", + /** + * value: "ItemInfo.ByLineInfo" + * @const + */ + "ItemInfo.ByLineInfo": "ItemInfo.ByLineInfo", + /** + * value: "ItemInfo.ContentInfo" + * @const + */ + "ItemInfo.ContentInfo": "ItemInfo.ContentInfo", + /** + * value: "ItemInfo.ContentRating" + * @const + */ + "ItemInfo.ContentRating": "ItemInfo.ContentRating", + /** + * value: "ItemInfo.Classifications" + * @const + */ + "ItemInfo.Classifications": "ItemInfo.Classifications", + /** + * value: "ItemInfo.ExternalIds" + * @const + */ + "ItemInfo.ExternalIds": "ItemInfo.ExternalIds", + /** + * value: "ItemInfo.Features" + * @const + */ + "ItemInfo.Features": "ItemInfo.Features", + /** + * value: "ItemInfo.ManufactureInfo" + * @const + */ + "ItemInfo.ManufactureInfo": "ItemInfo.ManufactureInfo", + /** + * value: "ItemInfo.ProductInfo" + * @const + */ + "ItemInfo.ProductInfo": "ItemInfo.ProductInfo", + /** + * value: "ItemInfo.TechnicalInfo" + * @const + */ + "ItemInfo.TechnicalInfo": "ItemInfo.TechnicalInfo", + /** + * value: "ItemInfo.Title" + * @const + */ + "ItemInfo.Title": "ItemInfo.Title", + /** + * value: "ItemInfo.TradeInInfo" + * @const + */ + "ItemInfo.TradeInInfo": "ItemInfo.TradeInInfo", + /** + * value: "Offers.Listings.Availability.MaxOrderQuantity" + * @const + */ + "Offers.Listings.Availability.MaxOrderQuantity": "Offers.Listings.Availability.MaxOrderQuantity", + /** + * value: "Offers.Listings.Availability.Message" + * @const + */ + "Offers.Listings.Availability.Message": "Offers.Listings.Availability.Message", + /** + * value: "Offers.Listings.Availability.MinOrderQuantity" + * @const + */ + "Offers.Listings.Availability.MinOrderQuantity": "Offers.Listings.Availability.MinOrderQuantity", + /** + * value: "Offers.Listings.Availability.Type" + * @const + */ + "Offers.Listings.Availability.Type": "Offers.Listings.Availability.Type", + /** + * value: "Offers.Listings.Condition" + * @const + */ + "Offers.Listings.Condition": "Offers.Listings.Condition", + /** + * value: "Offers.Listings.Condition.ConditionNote" + * @const + */ + "Offers.Listings.Condition.ConditionNote": "Offers.Listings.Condition.ConditionNote", + /** + * value: "Offers.Listings.Condition.SubCondition" + * @const + */ + "Offers.Listings.Condition.SubCondition": "Offers.Listings.Condition.SubCondition", + /** + * value: "Offers.Listings.DeliveryInfo.IsAmazonFulfilled" + * @const + */ + "Offers.Listings.DeliveryInfo.IsAmazonFulfilled": "Offers.Listings.DeliveryInfo.IsAmazonFulfilled", + /** + * value: "Offers.Listings.DeliveryInfo.IsFreeShippingEligible" + * @const + */ + "Offers.Listings.DeliveryInfo.IsFreeShippingEligible": "Offers.Listings.DeliveryInfo.IsFreeShippingEligible", + /** + * value: "Offers.Listings.DeliveryInfo.IsPrimeEligible" + * @const + */ + "Offers.Listings.DeliveryInfo.IsPrimeEligible": "Offers.Listings.DeliveryInfo.IsPrimeEligible", + /** + * value: "Offers.Listings.DeliveryInfo.ShippingCharges" + * @const + */ + "Offers.Listings.DeliveryInfo.ShippingCharges": "Offers.Listings.DeliveryInfo.ShippingCharges", + /** + * value: "Offers.Listings.IsBuyBoxWinner" + * @const + */ + "Offers.Listings.IsBuyBoxWinner": "Offers.Listings.IsBuyBoxWinner", + /** + * value: "Offers.Listings.LoyaltyPoints.Points" + * @const + */ + "Offers.Listings.LoyaltyPoints.Points": "Offers.Listings.LoyaltyPoints.Points", + /** + * value: "Offers.Listings.MerchantInfo" + * @const + */ + "Offers.Listings.MerchantInfo": "Offers.Listings.MerchantInfo", + /** + * value: "Offers.Listings.Price" + * @const + */ + "Offers.Listings.Price": "Offers.Listings.Price", + /** + * value: "Offers.Listings.ProgramEligibility.IsPrimeExclusive" + * @const + */ + "Offers.Listings.ProgramEligibility.IsPrimeExclusive": "Offers.Listings.ProgramEligibility.IsPrimeExclusive", + /** + * value: "Offers.Listings.ProgramEligibility.IsPrimePantry" + * @const + */ + "Offers.Listings.ProgramEligibility.IsPrimePantry": "Offers.Listings.ProgramEligibility.IsPrimePantry", + /** + * value: "Offers.Listings.Promotions" + * @const + */ + "Offers.Listings.Promotions": "Offers.Listings.Promotions", + /** + * value: "Offers.Listings.SavingBasis" + * @const + */ + "Offers.Listings.SavingBasis": "Offers.Listings.SavingBasis", + /** + * value: "Offers.Summaries.HighestPrice" + * @const + */ + "Offers.Summaries.HighestPrice": "Offers.Summaries.HighestPrice", + /** + * value: "Offers.Summaries.LowestPrice" + * @const + */ + "Offers.Summaries.LowestPrice": "Offers.Summaries.LowestPrice", + /** + * value: "Offers.Summaries.OfferCount" + * @const + */ + "Offers.Summaries.OfferCount": "Offers.Summaries.OfferCount", + /** + * value: "ParentASIN" + * @const + */ + "ParentASIN": "ParentASIN", + /** + * value: "RentalOffers.Listings.Availability.MaxOrderQuantity" + * @const + */ + "RentalOffers.Listings.Availability.MaxOrderQuantity": "RentalOffers.Listings.Availability.MaxOrderQuantity", + /** + * value: "RentalOffers.Listings.Availability.Message" + * @const + */ + "RentalOffers.Listings.Availability.Message": "RentalOffers.Listings.Availability.Message", + /** + * value: "RentalOffers.Listings.Availability.MinOrderQuantity" + * @const + */ + "RentalOffers.Listings.Availability.MinOrderQuantity": "RentalOffers.Listings.Availability.MinOrderQuantity", + /** + * value: "RentalOffers.Listings.Availability.Type" + * @const + */ + "RentalOffers.Listings.Availability.Type": "RentalOffers.Listings.Availability.Type", + /** + * value: "RentalOffers.Listings.BasePrice" + * @const + */ + "RentalOffers.Listings.BasePrice": "RentalOffers.Listings.BasePrice", + /** + * value: "RentalOffers.Listings.Condition" + * @const + */ + "RentalOffers.Listings.Condition": "RentalOffers.Listings.Condition", + /** + * value: "RentalOffers.Listings.Condition.ConditionNote" + * @const + */ + "RentalOffers.Listings.Condition.ConditionNote": "RentalOffers.Listings.Condition.ConditionNote", + /** + * value: "RentalOffers.Listings.Condition.SubCondition" + * @const + */ + "RentalOffers.Listings.Condition.SubCondition": "RentalOffers.Listings.Condition.SubCondition", + /** + * value: "RentalOffers.Listings.DeliveryInfo.IsAmazonFulfilled" + * @const + */ + "RentalOffers.Listings.DeliveryInfo.IsAmazonFulfilled": "RentalOffers.Listings.DeliveryInfo.IsAmazonFulfilled", + /** + * value: "RentalOffers.Listings.DeliveryInfo.IsFreeShippingEligible" + * @const + */ + "RentalOffers.Listings.DeliveryInfo.IsFreeShippingEligible": "RentalOffers.Listings.DeliveryInfo.IsFreeShippingEligible", + /** + * value: "RentalOffers.Listings.DeliveryInfo.IsPrimeEligible" + * @const + */ + "RentalOffers.Listings.DeliveryInfo.IsPrimeEligible": "RentalOffers.Listings.DeliveryInfo.IsPrimeEligible", + /** + * value: "RentalOffers.Listings.DeliveryInfo.ShippingCharges" + * @const + */ + "RentalOffers.Listings.DeliveryInfo.ShippingCharges": "RentalOffers.Listings.DeliveryInfo.ShippingCharges", + /** + * value: "RentalOffers.Listings.MerchantInfo" + * @const + */ + "RentalOffers.Listings.MerchantInfo": "RentalOffers.Listings.MerchantInfo", + /** + * value: "SearchRefinements" + * @const + */ + "SearchRefinements": "SearchRefinements" }; + + /** + * Returns a SearchItemsResource enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/SearchItemsResource} The enum SearchItemsResource value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/SearchItemsResponse.js b/paapi5-nodejs-sdk-example/src/model/SearchItemsResponse.js new file mode 100644 index 0000000..0f0c1a3 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/SearchItemsResponse.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/ErrorData', 'model/SearchResult'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./ErrorData'), require('./SearchResult')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.SearchItemsResponse = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.ErrorData, root.ProductAdvertisingAPIv1.SearchResult); + } +}(this, function(ApiClient, ErrorData, SearchResult) { + 'use strict'; + + + + + /** + * The SearchItemsResponse model module. + * @module model/SearchItemsResponse + * @version 1.0.0 + */ + + /** + * Constructs a new SearchItemsResponse. + * @alias module:model/SearchItemsResponse + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a SearchItemsResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/SearchItemsResponse} obj Optional instance to populate. + * @return {module:model/SearchItemsResponse} The populated SearchItemsResponse instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('SearchResult')) { + obj['SearchResult'] = SearchResult.constructFromObject(data['SearchResult']); + } + if (data.hasOwnProperty('Errors')) { + obj['Errors'] = ApiClient.convertToType(data['Errors'], [ErrorData]); + } + } + return obj; + } + + /** + * @member {module:model/SearchResult} SearchResult + */ + exports.prototype['SearchResult'] = undefined; + /** + * @member {Array.} Errors + */ + exports.prototype['Errors'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/SearchRefinements.js b/paapi5-nodejs-sdk-example/src/model/SearchRefinements.js new file mode 100644 index 0000000..5428032 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/SearchRefinements.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Refinement'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./Refinement')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.SearchRefinements = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.Refinement); + } +}(this, function(ApiClient, Refinement) { + 'use strict'; + + + + + /** + * The SearchRefinements model module. + * @module model/SearchRefinements + * @version 1.0.0 + */ + + /** + * Constructs a new SearchRefinements. + * @alias module:model/SearchRefinements + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a SearchRefinements from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/SearchRefinements} obj Optional instance to populate. + * @return {module:model/SearchRefinements} The populated SearchRefinements instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('BrowseNode')) { + obj['BrowseNode'] = Refinement.constructFromObject(data['BrowseNode']); + } + if (data.hasOwnProperty('OtherRefinements')) { + obj['OtherRefinements'] = ApiClient.convertToType(data['OtherRefinements'], [Refinement]); + } + if (data.hasOwnProperty('SearchIndex')) { + obj['SearchIndex'] = Refinement.constructFromObject(data['SearchIndex']); + } + } + return obj; + } + + /** + * @member {module:model/Refinement} BrowseNode + */ + exports.prototype['BrowseNode'] = undefined; + /** + * @member {Array.} OtherRefinements + */ + exports.prototype['OtherRefinements'] = undefined; + /** + * @member {module:model/Refinement} SearchIndex + */ + exports.prototype['SearchIndex'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/SearchResult.js b/paapi5-nodejs-sdk-example/src/model/SearchResult.js new file mode 100644 index 0000000..5baf6c2 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/SearchResult.js @@ -0,0 +1,111 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Item', 'model/SearchRefinements'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./Item'), require('./SearchRefinements')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.SearchResult = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.Item, root.ProductAdvertisingAPIv1.SearchRefinements); + } +}(this, function(ApiClient, Item, SearchRefinements) { + 'use strict'; + + + + + /** + * The SearchResult model module. + * @module model/SearchResult + * @version 1.0.0 + */ + + /** + * Constructs a new SearchResult. + * @alias module:model/SearchResult + * @class + */ + var exports = function() { + var _this = this; + + + + + + }; + + /** + * Constructs a SearchResult from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/SearchResult} obj Optional instance to populate. + * @return {module:model/SearchResult} The populated SearchResult instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('TotalResultCount')) { + obj['TotalResultCount'] = ApiClient.convertToType(data['TotalResultCount'], 'Number'); + } + if (data.hasOwnProperty('SearchURL')) { + obj['SearchURL'] = ApiClient.convertToType(data['SearchURL'], 'String'); + } + if (data.hasOwnProperty('Items')) { + obj['Items'] = ApiClient.convertToType(data['Items'], [Item]); + } + if (data.hasOwnProperty('SearchRefinements')) { + obj['SearchRefinements'] = SearchRefinements.constructFromObject(data['SearchRefinements']); + } + } + return obj; + } + + /** + * @member {Number} TotalResultCount + */ + exports.prototype['TotalResultCount'] = undefined; + /** + * @member {String} SearchURL + */ + exports.prototype['SearchURL'] = undefined; + /** + * @member {Array.} Items + */ + exports.prototype['Items'] = undefined; + /** + * @member {module:model/SearchRefinements} SearchRefinements + */ + exports.prototype['SearchRefinements'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/SingleBooleanValuedAttribute.js b/paapi5-nodejs-sdk-example/src/model/SingleBooleanValuedAttribute.js new file mode 100644 index 0000000..4136fb3 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/SingleBooleanValuedAttribute.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.SingleBooleanValuedAttribute = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The SingleBooleanValuedAttribute model module. + * @module model/SingleBooleanValuedAttribute + * @version 1.0.0 + */ + + /** + * Constructs a new SingleBooleanValuedAttribute. + * @alias module:model/SingleBooleanValuedAttribute + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a SingleBooleanValuedAttribute from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/SingleBooleanValuedAttribute} obj Optional instance to populate. + * @return {module:model/SingleBooleanValuedAttribute} The populated SingleBooleanValuedAttribute instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('DisplayValue')) { + obj['DisplayValue'] = ApiClient.convertToType(data['DisplayValue'], 'Boolean'); + } + if (data.hasOwnProperty('Label')) { + obj['Label'] = ApiClient.convertToType(data['Label'], 'String'); + } + if (data.hasOwnProperty('Locale')) { + obj['Locale'] = ApiClient.convertToType(data['Locale'], 'String'); + } + } + return obj; + } + + /** + * @member {Boolean} DisplayValue + */ + exports.prototype['DisplayValue'] = undefined; + /** + * @member {String} Label + */ + exports.prototype['Label'] = undefined; + /** + * @member {String} Locale + */ + exports.prototype['Locale'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/SingleIntegerValuedAttribute.js b/paapi5-nodejs-sdk-example/src/model/SingleIntegerValuedAttribute.js new file mode 100644 index 0000000..67e2880 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/SingleIntegerValuedAttribute.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.SingleIntegerValuedAttribute = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The SingleIntegerValuedAttribute model module. + * @module model/SingleIntegerValuedAttribute + * @version 1.0.0 + */ + + /** + * Constructs a new SingleIntegerValuedAttribute. + * @alias module:model/SingleIntegerValuedAttribute + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a SingleIntegerValuedAttribute from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/SingleIntegerValuedAttribute} obj Optional instance to populate. + * @return {module:model/SingleIntegerValuedAttribute} The populated SingleIntegerValuedAttribute instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('DisplayValue')) { + obj['DisplayValue'] = ApiClient.convertToType(data['DisplayValue'], 'Number'); + } + if (data.hasOwnProperty('Label')) { + obj['Label'] = ApiClient.convertToType(data['Label'], 'String'); + } + if (data.hasOwnProperty('Locale')) { + obj['Locale'] = ApiClient.convertToType(data['Locale'], 'String'); + } + } + return obj; + } + + /** + * @member {Number} DisplayValue + */ + exports.prototype['DisplayValue'] = undefined; + /** + * @member {String} Label + */ + exports.prototype['Label'] = undefined; + /** + * @member {String} Locale + */ + exports.prototype['Locale'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/SingleStringValuedAttribute.js b/paapi5-nodejs-sdk-example/src/model/SingleStringValuedAttribute.js new file mode 100644 index 0000000..1a6c83c --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/SingleStringValuedAttribute.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.SingleStringValuedAttribute = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The SingleStringValuedAttribute model module. + * @module model/SingleStringValuedAttribute + * @version 1.0.0 + */ + + /** + * Constructs a new SingleStringValuedAttribute. + * @alias module:model/SingleStringValuedAttribute + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a SingleStringValuedAttribute from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/SingleStringValuedAttribute} obj Optional instance to populate. + * @return {module:model/SingleStringValuedAttribute} The populated SingleStringValuedAttribute instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('DisplayValue')) { + obj['DisplayValue'] = ApiClient.convertToType(data['DisplayValue'], 'String'); + } + if (data.hasOwnProperty('Label')) { + obj['Label'] = ApiClient.convertToType(data['Label'], 'String'); + } + if (data.hasOwnProperty('Locale')) { + obj['Locale'] = ApiClient.convertToType(data['Locale'], 'String'); + } + } + return obj; + } + + /** + * @member {String} DisplayValue + */ + exports.prototype['DisplayValue'] = undefined; + /** + * @member {String} Label + */ + exports.prototype['Label'] = undefined; + /** + * @member {String} Locale + */ + exports.prototype['Locale'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/SortBy.js b/paapi5-nodejs-sdk-example/src/model/SortBy.js new file mode 100644 index 0000000..d8839ce --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/SortBy.js @@ -0,0 +1,89 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.SortBy = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + /** + * Enum class SortBy. + * @enum {} + * @readonly + */ + var exports = { + /** + * value: "AvgCustomerReviews" + * @const + */ + "AvgCustomerReviews": "AvgCustomerReviews", + /** + * value: "Featured" + * @const + */ + "Featured": "Featured", + /** + * value: "NewestArrivals" + * @const + */ + "NewestArrivals": "NewestArrivals", + /** + * value: "Price:HighToLow" + * @const + */ + "Price:HighToLow": "Price:HighToLow", + /** + * value: "Price:LowToHigh" + * @const + */ + "Price:LowToHigh": "Price:LowToHigh", + /** + * value: "Relevance" + * @const + */ + "Relevance": "Relevance" }; + + /** + * Returns a SortBy enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/SortBy} The enum SortBy value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/TechnicalInfo.js b/paapi5-nodejs-sdk-example/src/model/TechnicalInfo.js new file mode 100644 index 0000000..4b0386b --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/TechnicalInfo.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/MultiValuedAttribute', 'model/SingleStringValuedAttribute'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./MultiValuedAttribute'), require('./SingleStringValuedAttribute')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.TechnicalInfo = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.MultiValuedAttribute, root.ProductAdvertisingAPIv1.SingleStringValuedAttribute); + } +}(this, function(ApiClient, MultiValuedAttribute, SingleStringValuedAttribute) { + 'use strict'; + + + + + /** + * The TechnicalInfo model module. + * @module model/TechnicalInfo + * @version 1.0.0 + */ + + /** + * Constructs a new TechnicalInfo. + * @alias module:model/TechnicalInfo + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a TechnicalInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/TechnicalInfo} obj Optional instance to populate. + * @return {module:model/TechnicalInfo} The populated TechnicalInfo instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('EnergyEfficiencyClass')) { + obj['EnergyEfficiencyClass'] = SingleStringValuedAttribute.constructFromObject(data['EnergyEfficiencyClass']); + } + if (data.hasOwnProperty('Formats')) { + obj['Formats'] = MultiValuedAttribute.constructFromObject(data['Formats']); + } + } + return obj; + } + + /** + * @member {module:model/SingleStringValuedAttribute} EnergyEfficiencyClass + */ + exports.prototype['EnergyEfficiencyClass'] = undefined; + /** + * @member {module:model/MultiValuedAttribute} Formats + */ + exports.prototype['Formats'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/TradeInInfo.js b/paapi5-nodejs-sdk-example/src/model/TradeInInfo.js new file mode 100644 index 0000000..2f00c08 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/TradeInInfo.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/TradeInPrice'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./TradeInPrice')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.TradeInInfo = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.TradeInPrice); + } +}(this, function(ApiClient, TradeInPrice) { + 'use strict'; + + + + + /** + * The TradeInInfo model module. + * @module model/TradeInInfo + * @version 1.0.0 + */ + + /** + * Constructs a new TradeInInfo. + * @alias module:model/TradeInInfo + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a TradeInInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/TradeInInfo} obj Optional instance to populate. + * @return {module:model/TradeInInfo} The populated TradeInInfo instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('IsEligibleForTradeIn')) { + obj['IsEligibleForTradeIn'] = ApiClient.convertToType(data['IsEligibleForTradeIn'], 'Boolean'); + } + if (data.hasOwnProperty('Price')) { + obj['Price'] = TradeInPrice.constructFromObject(data['Price']); + } + } + return obj; + } + + /** + * @member {Boolean} IsEligibleForTradeIn + */ + exports.prototype['IsEligibleForTradeIn'] = undefined; + /** + * @member {module:model/TradeInPrice} Price + */ + exports.prototype['Price'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/TradeInPrice.js b/paapi5-nodejs-sdk-example/src/model/TradeInPrice.js new file mode 100644 index 0000000..54f3ba7 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/TradeInPrice.js @@ -0,0 +1,103 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.TradeInPrice = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The TradeInPrice model module. + * @module model/TradeInPrice + * @version 1.0.0 + */ + + /** + * Constructs a new TradeInPrice. + * @alias module:model/TradeInPrice + * @class + */ + var exports = function() { + var _this = this; + + + + + }; + + /** + * Constructs a TradeInPrice from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/TradeInPrice} obj Optional instance to populate. + * @return {module:model/TradeInPrice} The populated TradeInPrice instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Amount')) { + obj['Amount'] = ApiClient.convertToType(data['Amount'], 'Number'); + } + if (data.hasOwnProperty('Currency')) { + obj['Currency'] = ApiClient.convertToType(data['Currency'], 'String'); + } + if (data.hasOwnProperty('DisplayAmount')) { + obj['DisplayAmount'] = ApiClient.convertToType(data['DisplayAmount'], 'String'); + } + } + return obj; + } + + /** + * @member {Number} Amount + */ + exports.prototype['Amount'] = undefined; + /** + * @member {String} Currency + */ + exports.prototype['Currency'] = undefined; + /** + * @member {String} DisplayAmount + */ + exports.prototype['DisplayAmount'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/UnitBasedAttribute.js b/paapi5-nodejs-sdk-example/src/model/UnitBasedAttribute.js new file mode 100644 index 0000000..9ee24a1 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/UnitBasedAttribute.js @@ -0,0 +1,111 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.UnitBasedAttribute = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The UnitBasedAttribute model module. + * @module model/UnitBasedAttribute + * @version 1.0.0 + */ + + /** + * Constructs a new UnitBasedAttribute. + * @alias module:model/UnitBasedAttribute + * @class + */ + var exports = function() { + var _this = this; + + + + + + }; + + /** + * Constructs a UnitBasedAttribute from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/UnitBasedAttribute} obj Optional instance to populate. + * @return {module:model/UnitBasedAttribute} The populated UnitBasedAttribute instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('DisplayValue')) { + obj['DisplayValue'] = ApiClient.convertToType(data['DisplayValue'], 'Number'); + } + if (data.hasOwnProperty('Label')) { + obj['Label'] = ApiClient.convertToType(data['Label'], 'String'); + } + if (data.hasOwnProperty('Locale')) { + obj['Locale'] = ApiClient.convertToType(data['Locale'], 'String'); + } + if (data.hasOwnProperty('Unit')) { + obj['Unit'] = ApiClient.convertToType(data['Unit'], 'String'); + } + } + return obj; + } + + /** + * @member {Number} DisplayValue + */ + exports.prototype['DisplayValue'] = undefined; + /** + * @member {String} Label + */ + exports.prototype['Label'] = undefined; + /** + * @member {String} Locale + */ + exports.prototype['Locale'] = undefined; + /** + * @member {String} Unit + */ + exports.prototype['Unit'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/VariationAttribute.js b/paapi5-nodejs-sdk-example/src/model/VariationAttribute.js new file mode 100644 index 0000000..ad9658a --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/VariationAttribute.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.VariationAttribute = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The VariationAttribute model module. + * @module model/VariationAttribute + * @version 1.0.0 + */ + + /** + * Constructs a new VariationAttribute. + * @alias module:model/VariationAttribute + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a VariationAttribute from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/VariationAttribute} obj Optional instance to populate. + * @return {module:model/VariationAttribute} The populated VariationAttribute instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Name')) { + obj['Name'] = ApiClient.convertToType(data['Name'], 'String'); + } + if (data.hasOwnProperty('Value')) { + obj['Value'] = ApiClient.convertToType(data['Value'], 'String'); + } + } + return obj; + } + + /** + * @member {String} Name + */ + exports.prototype['Name'] = undefined; + /** + * @member {String} Value + */ + exports.prototype['Value'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/VariationDimension.js b/paapi5-nodejs-sdk-example/src/model/VariationDimension.js new file mode 100644 index 0000000..dd04468 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/VariationDimension.js @@ -0,0 +1,111 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.VariationDimension = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The VariationDimension model module. + * @module model/VariationDimension + * @version 1.0.0 + */ + + /** + * Constructs a new VariationDimension. + * @alias module:model/VariationDimension + * @class + */ + var exports = function() { + var _this = this; + + + + + + }; + + /** + * Constructs a VariationDimension from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/VariationDimension} obj Optional instance to populate. + * @return {module:model/VariationDimension} The populated VariationDimension instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('DisplayName')) { + obj['DisplayName'] = ApiClient.convertToType(data['DisplayName'], 'String'); + } + if (data.hasOwnProperty('Locale')) { + obj['Locale'] = ApiClient.convertToType(data['Locale'], 'String'); + } + if (data.hasOwnProperty('Name')) { + obj['Name'] = ApiClient.convertToType(data['Name'], 'String'); + } + if (data.hasOwnProperty('Values')) { + obj['Values'] = ApiClient.convertToType(data['Values'], ['String']); + } + } + return obj; + } + + /** + * @member {String} DisplayName + */ + exports.prototype['DisplayName'] = undefined; + /** + * @member {String} Locale + */ + exports.prototype['Locale'] = undefined; + /** + * @member {String} Name + */ + exports.prototype['Name'] = undefined; + /** + * @member {Array.} Values + */ + exports.prototype['Values'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/VariationSummary.js b/paapi5-nodejs-sdk-example/src/model/VariationSummary.js new file mode 100644 index 0000000..3b30b28 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/VariationSummary.js @@ -0,0 +1,111 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Price', 'model/VariationDimension'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./Price'), require('./VariationDimension')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.VariationSummary = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.Price, root.ProductAdvertisingAPIv1.VariationDimension); + } +}(this, function(ApiClient, Price, VariationDimension) { + 'use strict'; + + + + + /** + * The VariationSummary model module. + * @module model/VariationSummary + * @version 1.0.0 + */ + + /** + * Constructs a new VariationSummary. + * @alias module:model/VariationSummary + * @class + */ + var exports = function() { + var _this = this; + + + + + + }; + + /** + * Constructs a VariationSummary from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/VariationSummary} obj Optional instance to populate. + * @return {module:model/VariationSummary} The populated VariationSummary instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('PageCount')) { + obj['PageCount'] = ApiClient.convertToType(data['PageCount'], 'Number'); + } + if (data.hasOwnProperty('Price')) { + obj['Price'] = Price.constructFromObject(data['Price']); + } + if (data.hasOwnProperty('VariationCount')) { + obj['VariationCount'] = ApiClient.convertToType(data['VariationCount'], 'Number'); + } + if (data.hasOwnProperty('VariationDimensions')) { + obj['VariationDimensions'] = ApiClient.convertToType(data['VariationDimensions'], [VariationDimension]); + } + } + return obj; + } + + /** + * @member {Number} PageCount + */ + exports.prototype['PageCount'] = undefined; + /** + * @member {module:model/Price} Price + */ + exports.prototype['Price'] = undefined; + /** + * @member {Number} VariationCount + */ + exports.prototype['VariationCount'] = undefined; + /** + * @member {Array.} VariationDimensions + */ + exports.prototype['VariationDimensions'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/VariationsResult.js b/paapi5-nodejs-sdk-example/src/model/VariationsResult.js new file mode 100644 index 0000000..4f0f158 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/VariationsResult.js @@ -0,0 +1,95 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Item', 'model/VariationSummary'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./Item'), require('./VariationSummary')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.VariationsResult = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.Item, root.ProductAdvertisingAPIv1.VariationSummary); + } +}(this, function(ApiClient, Item, VariationSummary) { + 'use strict'; + + + + + /** + * The VariationsResult model module. + * @module model/VariationsResult + * @version 1.0.0 + */ + + /** + * Constructs a new VariationsResult. + * @alias module:model/VariationsResult + * @class + */ + var exports = function() { + var _this = this; + + + + }; + + /** + * Constructs a VariationsResult from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/VariationsResult} obj Optional instance to populate. + * @return {module:model/VariationsResult} The populated VariationsResult instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('Items')) { + obj['Items'] = ApiClient.convertToType(data['Items'], [Item]); + } + if (data.hasOwnProperty('VariationSummary')) { + obj['VariationSummary'] = VariationSummary.constructFromObject(data['VariationSummary']); + } + } + return obj; + } + + /** + * @member {Array.} Items + */ + exports.prototype['Items'] = undefined; + /** + * @member {module:model/VariationSummary} VariationSummary + */ + exports.prototype['VariationSummary'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/src/model/WebsiteSalesRank.js b/paapi5-nodejs-sdk-example/src/model/WebsiteSalesRank.js new file mode 100644 index 0000000..f486f41 --- /dev/null +++ b/paapi5-nodejs-sdk-example/src/model/WebsiteSalesRank.js @@ -0,0 +1,111 @@ +/** + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.ProductAdvertisingAPIv1) { + root.ProductAdvertisingAPIv1 = {}; + } + root.ProductAdvertisingAPIv1.WebsiteSalesRank = factory(root.ProductAdvertisingAPIv1.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The WebsiteSalesRank model module. + * @module model/WebsiteSalesRank + * @version 1.0.0 + */ + + /** + * Constructs a new WebsiteSalesRank. + * @alias module:model/WebsiteSalesRank + * @class + */ + var exports = function() { + var _this = this; + + + + + + }; + + /** + * Constructs a WebsiteSalesRank from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/WebsiteSalesRank} obj Optional instance to populate. + * @return {module:model/WebsiteSalesRank} The populated WebsiteSalesRank instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('ContextFreeName')) { + obj['ContextFreeName'] = ApiClient.convertToType(data['ContextFreeName'], 'String'); + } + if (data.hasOwnProperty('DisplayName')) { + obj['DisplayName'] = ApiClient.convertToType(data['DisplayName'], 'String'); + } + if (data.hasOwnProperty('Id')) { + obj['Id'] = ApiClient.convertToType(data['Id'], 'String'); + } + if (data.hasOwnProperty('SalesRank')) { + obj['SalesRank'] = ApiClient.convertToType(data['SalesRank'], 'Number'); + } + } + return obj; + } + + /** + * @member {String} ContextFreeName + */ + exports.prototype['ContextFreeName'] = undefined; + /** + * @member {String} DisplayName + */ + exports.prototype['DisplayName'] = undefined; + /** + * @member {String} Id + */ + exports.prototype['Id'] = undefined; + /** + * @member {Number} SalesRank + */ + exports.prototype['SalesRank'] = undefined; + + + + return exports; +})); + + diff --git a/paapi5-nodejs-sdk-example/test/api/DefaultApi.spec.js b/paapi5-nodejs-sdk-example/test/api/DefaultApi.spec.js new file mode 100644 index 0000000..58c3d33 --- /dev/null +++ b/paapi5-nodejs-sdk-example/test/api/DefaultApi.spec.js @@ -0,0 +1,260 @@ +/** + * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + + /** + * ProductAdvertisingAPI + * https://webservices.amazon.com/paapi5/documentation/index.html + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.ProductAdvertisingAPIv1); + } +}(this, function(expect, ProductAdvertisingAPIv1) { + 'use strict'; + + var instance; + var DUMMY_ACCESS_KEY = 'DUMMY_ACCESS_KEY'; + var DUMMY_SECRET_KEY = 'DUMMY_SECRET_KEY'; + var DUMMY_REGION = 'DUMMY_REGION'; + var INVALID_SIGNATURE = 'InvalidSignature'; + var UNRECOGNIZED_CLIENT = 'UnrecognizedClient'; + var HOST = 'webservices.amazon.com'; + var REGION = 'us-east-1'; + + beforeEach(function() { + instance = new ProductAdvertisingAPIv1.DefaultApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('DefaultApi', function() { + describe('getBrowseNodes', function() { + it('should throw error if GetBrowseNodesRequest is not provided', function(done) { + //var getBrowseNodesRequest = new ProductAdvertisingAPIv1.GetBrowseNodesRequest(); + try { + instance.getBrowseNodes(); + } catch (e) { + expect(e).to.be.a(Error); + expect(e.message).to.be('Missing the required parameter \'getBrowseNodesRequest\' when calling getBrowseNodes'); + done(); + } + }); + + it('PA-API 5.0 call should fail with InvalidSignature error when GetBrowseNodes request has invalid region', function(done) { + var getBrowseNodesRequest = new ProductAdvertisingAPIv1.GetBrowseNodesRequest(); + var defaultClient = ProductAdvertisingAPIv1.ApiClient.instance; + defaultClient.accessKey = DUMMY_ACCESS_KEY; + defaultClient.secretKey = DUMMY_SECRET_KEY; + defaultClient.host = HOST; + defaultClient.region = DUMMY_REGION; + + instance.getBrowseNodes(getBrowseNodesRequest).then( + {}, + function(error) { + expect(error['status']).to.be(401); + expect(JSON.parse(error['response']['text'])['Errors'][0]['Code']).to.be(INVALID_SIGNATURE); + done(); + } + ); + }); + + it('PA-API 5.0 call should fail with UnrecognizedClient error when GetBrowseNodes request has dummy credentials', function(done) { + var getBrowseNodesRequest = new ProductAdvertisingAPIv1.GetBrowseNodesRequest(); + var defaultClient = ProductAdvertisingAPIv1.ApiClient.instance; + defaultClient.accessKey = DUMMY_ACCESS_KEY; + defaultClient.secretKey = DUMMY_SECRET_KEY; + defaultClient.host = HOST; + defaultClient.region = REGION; + + instance.getBrowseNodes(getBrowseNodesRequest).then( + {}, + function(error) { + expect(error['status']).to.be(401); + expect(JSON.parse(error['response']['text'])['Errors'][0]['Code']).to.be(UNRECOGNIZED_CLIENT); + done(); + } + ); + }); + }); + + describe('getItems', function() { + it('should throw error if GetItemsRequest is not provided', function(done) { + try { + instance.getItems(); + } catch (e) { + expect(e).to.be.a(Error); + expect(e.message).to.be('Missing the required parameter \'getItemsRequest\' when calling getItems'); + done(); + } + }); + + it('PA-API 5.0 call should fail with InvalidSignature error when GetItems request has invalid region', function(done) { + var getItemsRequest = new ProductAdvertisingAPIv1.GetItemsRequest(); + var defaultClient = ProductAdvertisingAPIv1.ApiClient.instance; + defaultClient.accessKey = DUMMY_ACCESS_KEY; + defaultClient.secretKey = DUMMY_SECRET_KEY; + defaultClient.host = HOST; + defaultClient.region = DUMMY_REGION; + + instance.getItems(getItemsRequest).then( + {}, + function(error) { + expect(error['status']).to.be(401); + expect(JSON.parse(error['response']['text'])['Errors'][0]['Code']).to.be(INVALID_SIGNATURE); + done(); + } + ); + }); + + it('PA-API 5.0 call should fail with UnrecognizedClient error when GetItems request has dummy credentials', function(done) { + var getItemsRequest = new ProductAdvertisingAPIv1.GetItemsRequest(); + var defaultClient = ProductAdvertisingAPIv1.ApiClient.instance; + defaultClient.accessKey = DUMMY_ACCESS_KEY; + defaultClient.secretKey = DUMMY_SECRET_KEY; + defaultClient.host = HOST; + defaultClient.region = REGION; + + instance.getItems(getItemsRequest).then( + {}, + function(error) { + expect(error['status']).to.be(401); + expect(JSON.parse(error['response']['text'])['Errors'][0]['Code']).to.be(UNRECOGNIZED_CLIENT); + done(); + } + ); + }); + }); + + describe('getVariations', function() { + it('should throw error if GetVariationsRequest is not provided', function(done) { + try { + instance.getVariations(); + } catch (e) { + expect(e).to.be.a(Error); + expect(e.message).to.be('Missing the required parameter \'getVariationsRequest\' when calling getVariations'); + done(); + } + }); + + it('PA-API 5.0 call should fail with InvalidSignature error when GetVariations request has invalid region', function(done) { + var getVariationsRequest = new ProductAdvertisingAPIv1.GetVariationsRequest(); + var defaultClient = ProductAdvertisingAPIv1.ApiClient.instance; + defaultClient.accessKey = DUMMY_ACCESS_KEY; + defaultClient.secretKey = DUMMY_SECRET_KEY; + defaultClient.host = HOST; + defaultClient.region = DUMMY_REGION; + + instance.getVariations(getVariationsRequest).then( + {}, + function(error) { + expect(error['status']).to.be(401); + expect(JSON.parse(error['response']['text'])['Errors'][0]['Code']).to.be(INVALID_SIGNATURE); + done(); + } + ); + }); + + it('PA-API 5.0 call should fail with UnrecognizedClient error when GetVariations request has dummy credentials', function(done) { + var getVariationsRequest = new ProductAdvertisingAPIv1.GetVariationsRequest(); + var defaultClient = ProductAdvertisingAPIv1.ApiClient.instance; + defaultClient.accessKey = DUMMY_ACCESS_KEY; + defaultClient.secretKey = DUMMY_SECRET_KEY; + defaultClient.host = HOST; + defaultClient.region = REGION; + + instance.getVariations(getVariationsRequest).then( + {}, + function(error) { + expect(error['status']).to.be(401); + expect(JSON.parse(error['response']['text'])['Errors'][0]['Code']).to.be(UNRECOGNIZED_CLIENT); + done(); + } + ); + }); + }); + + describe('searchItems', function() { + it('should throw error if SearchItemsRequest is not provided', function(done) { + try { + instance.searchItems(); + } catch (e) { + expect(e).to.be.a(Error); + expect(e.message).to.be('Missing the required parameter \'searchItemsRequest\' when calling searchItems'); + done(); + } + }); + + it('PA-API 5.0 call should fail with InvalidSignature error when SearchItems request has invalid region', function(done) { + var searchItemsRequest = new ProductAdvertisingAPIv1.SearchItemsRequest(); + var defaultClient = ProductAdvertisingAPIv1.ApiClient.instance; + defaultClient.accessKey = DUMMY_ACCESS_KEY; + defaultClient.secretKey = DUMMY_SECRET_KEY; + defaultClient.host = HOST; + defaultClient.region = DUMMY_REGION; + + instance.searchItems(searchItemsRequest).then( + {}, + function(error) { + expect(error['status']).to.be(401); + expect(JSON.parse(error['response']['text'])['Errors'][0]['Code']).to.be(INVALID_SIGNATURE); + done(); + } + ); + }); + + it('PA-API 5.0 call should fail with UnrecognizedClient error when SearchItems request has dummy credentials', function(done) { + var searchItemsRequest = new ProductAdvertisingAPIv1.SearchItemsRequest(); + var defaultClient = ProductAdvertisingAPIv1.ApiClient.instance; + defaultClient.accessKey = DUMMY_ACCESS_KEY; + defaultClient.secretKey = DUMMY_SECRET_KEY; + defaultClient.host = HOST; + defaultClient.region = REGION; + + instance.searchItems(searchItemsRequest).then( + {}, + function(error) { + expect(error['status']).to.be(401); + expect(JSON.parse(error['response']['text'])['Errors'][0]['Code']).to.be(UNRECOGNIZED_CLIENT); + done(); + } + ); + }); + }); + }); + +}));