Deprecation warnings for using old arguments in request methods. by GriceTurrble · Pull Request #222 · python-amazon-mws/python-amazon-mws · GitHub
Skip to content
This repository was archived by the owner on Jan 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions mws/apis/feeds.py
2 changes: 2 additions & 0 deletions mws/apis/inbound_shipments.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Amazon MWS FulfillmentInboundShipment API."""

from mws.utils.deprecation import kwargs_renamed_for_v11
from mws import MWS, MWSError, utils
from mws.utils.params import enumerate_param
from mws.utils.params import enumerate_keyed_param
Expand Down Expand Up @@ -473,6 +474,7 @@ def void_transport_request(self, shipment_id):
"VoidTransportRequest", {"ShipmentId": shipment_id}, method="POST"
)

@kwargs_renamed_for_v11([("num_packages", "num_labels")])
def get_package_labels(self, shipment_id, num_labels, page_type=None):
"""Returns PDF document data for printing package labels for an inbound shipment.

Expand Down
2 changes: 1 addition & 1 deletion mws/apis/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def list_inventory_supply(
skus=(),
datetime_=None,
response_group="Basic",
next_token=None,
marketplace_id=None,
next_token=None,
Comment on lines 27 to +29

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a reordering change here, should be no impact.

):
"""Returns information on available inventory

Expand Down
12 changes: 12 additions & 0 deletions mws/apis/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
from mws.utils.params import enumerate_params
from mws.decorators import next_token_action

# DEPRECATIONS
from mws.utils.deprecation import kwargs_renamed_for_v11


class Orders(MWS):
"""Amazon Orders API
Expand All @@ -21,6 +24,15 @@ class Orders(MWS):
"ListOrderItems",
]

@kwargs_renamed_for_v11(
[
("marketplaceids", "marketplace_ids"),
("lastupdatedafter", "last_updated_after"),
("lastupdatedbefore", "last_updated_before"),
("orderstatus", "order_statuses"),
("seller_orderid", "seller_order_id"),
]
)
@next_token_action("ListOrders")
def list_orders(
self,
Expand Down
26 changes: 26 additions & 0 deletions mws/apis/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
from mws.utils.params import coerce_to_bool
from mws.utils.params import enumerate_param

# DEPRECATION
from mws.utils.deprecation import kwargs_renamed_for_v11


class Products(MWS):
"""Amazon MWS Products API
Expand All @@ -20,6 +23,9 @@ class Products(MWS):
NAMESPACE = "{http://mws.amazonservices.com/schema/Products/2011-10-01}"
# NEXT_TOKEN_OPERATIONS = []

@kwargs_renamed_for_v11(
[("marketplaceid", "marketplace_id"), ("contextid", "context_id")]
)
def list_matching_products(self, marketplace_id, query, context_id=None):
"""Returns a list of products and their attributes, based on a search query.

Expand All @@ -35,6 +41,7 @@ def list_matching_products(self, marketplace_id, query, context_id=None):
},
)

@kwargs_renamed_for_v11([("marketplaceid", "marketplace_id")])
def get_matching_product(self, marketplace_id, asins):
"""Returns a list of products and their attributes, based on a list of ASIN values.

Expand All @@ -45,6 +52,7 @@ def get_matching_product(self, marketplace_id, asins):
data.update(enumerate_param("ASINList.ASIN.", asins))
return self.make_request("GetMatchingProduct", data)

@kwargs_renamed_for_v11([("marketplaceid", "marketplace_id")])
def get_matching_product_for_id(self, marketplace_id, type_, ids):
"""Returns a list of products and their attributes, based on a list of
ASIN, GCID, SellerSKU, UPC, EAN, ISBN, and JAN values.
Expand All @@ -59,6 +67,7 @@ def get_matching_product_for_id(self, marketplace_id, type_, ids):
data.update(enumerate_param("IdList.Id.", ids))
return self.make_request("GetMatchingProductForId", data)

@kwargs_renamed_for_v11([("marketplaceid", "marketplace_id")])
def get_competitive_pricing_for_sku(self, marketplace_id, skus):
"""Returns the current competitive price of a product, based on SellerSKU.

Expand All @@ -69,6 +78,7 @@ def get_competitive_pricing_for_sku(self, marketplace_id, skus):
data.update(enumerate_param("SellerSKUList.SellerSKU.", skus))
return self.make_request("GetCompetitivePricingForSKU", data)

@kwargs_renamed_for_v11([("marketplaceid", "marketplace_id")])
def get_competitive_pricing_for_asin(self, marketplace_id, asins):
"""Returns the current competitive price of a product, based on ASIN.

Expand All @@ -79,6 +89,9 @@ def get_competitive_pricing_for_asin(self, marketplace_id, asins):
data.update(enumerate_param("ASINList.ASIN.", asins))
return self.make_request("GetCompetitivePricingForASIN", data)

@kwargs_renamed_for_v11(
[("marketplaceid", "marketplace_id"), ("excludeme", "exclude_me")]
)
def get_lowest_offer_listings_for_sku(
self, marketplace_id, skus, condition="Any", exclude_me=False
):
Expand All @@ -98,6 +111,9 @@ def get_lowest_offer_listings_for_sku(
data.update(enumerate_param("SellerSKUList.SellerSKU.", skus))
return self.make_request("GetLowestOfferListingsForSKU", data)

@kwargs_renamed_for_v11(
[("marketplaceid", "marketplace_id"), ("excludeme", "exclude_me")]
)
def get_lowest_offer_listings_for_asin(
self, marketplace_id, asins, condition="Any", exclude_me=False
):
Expand All @@ -116,6 +132,9 @@ def get_lowest_offer_listings_for_asin(
data.update(enumerate_param("ASINList.ASIN.", asins))
return self.make_request("GetLowestOfferListingsForASIN", data)

@kwargs_renamed_for_v11(
[("marketplaceid", "marketplace_id"), ("excludeme", "exclude_me")]
)
def get_lowest_priced_offers_for_sku(
self, marketplace_id, sku, condition="New", exclude_me=False
):
Expand All @@ -136,6 +155,9 @@ def get_lowest_priced_offers_for_sku(
},
)

@kwargs_renamed_for_v11(
[("marketplaceid", "marketplace_id"), ("excludeme", "exclude_me")]
)
def get_lowest_priced_offers_for_asin(
self, marketplace_id, asin, condition="New", exclude_me=False
):
Expand Down Expand Up @@ -170,6 +192,7 @@ def get_my_fees_estimate(
)
return self.make_request("GetMyFeesEstimate", data, method="POST")

@kwargs_renamed_for_v11([("marketplaceid", "marketplace_id")])
def get_my_price_for_sku(self, marketplace_id, skus, condition=None):
"""Returns pricing information for your own offer listings, based on SellerSKU.

Expand All @@ -183,6 +206,7 @@ def get_my_price_for_sku(self, marketplace_id, skus, condition=None):
data.update(enumerate_param("SellerSKUList.SellerSKU.", skus))
return self.make_request("GetMyPriceForSKU", data)

@kwargs_renamed_for_v11([("marketplaceid", "marketplace_id")])
def get_my_price_for_asin(self, marketplace_id, asins, condition=None):
"""Returns pricing information for your own offer listings, based on ASIN.

Expand All @@ -196,6 +220,7 @@ def get_my_price_for_asin(self, marketplace_id, asins, condition=None):
data.update(enumerate_param("ASINList.ASIN.", asins))
return self.make_request("GetMyPriceForASIN", data)

@kwargs_renamed_for_v11([("marketplaceid", "marketplace_id")])
def get_product_categories_for_sku(self, marketplace_id, sku):
"""Returns the parent product categories that a product belongs to, based on SellerSKU.

Expand All @@ -207,6 +232,7 @@ def get_product_categories_for_sku(self, marketplace_id, sku):
{"MarketplaceId": marketplace_id, "SellerSKU": sku},
)

@kwargs_renamed_for_v11([("marketplaceid", "marketplace_id")])
def get_product_categories_for_asin(self, marketplace_id, asin):
"""Returns the parent product categories that a product belongs to, based on ASIN.

Expand Down
10 changes: 10 additions & 0 deletions mws/apis/recommendations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from mws import MWS
from mws.decorators import next_token_action

# DEPRECATIONS
from mws.utils.deprecation import kwargs_renamed_for_v11


class Recommendations(MWS):
"""Amazon MWS Recommendations API
Expand All @@ -18,6 +21,7 @@ class Recommendations(MWS):
"ListRecommendations",
]

@kwargs_renamed_for_v11([("marketplaceid", "marketplace_id")])
def get_last_updated_time_for_recommendations(self, marketplace_id):
"""Checks whether there are active recommendations for each category for
the given marketplace, and if there are, returns the time when recommendations
Expand All @@ -32,6 +36,12 @@ def get_last_updated_time_for_recommendations(self, marketplace_id):
method="POST",
)

@kwargs_renamed_for_v11(
[
("marketplaceid", "marketplace_id"),
("recommendationcategory", "recommendation_category"),
]
)
@next_token_action("ListRecommendations")
def list_recommendations(
self, marketplace_id=None, recommendation_category=None, next_token=None
Expand Down
31 changes: 31 additions & 0 deletions mws/apis/reports.py
Loading