Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
saleweaver committed Dec 14, 2024
1 parent da79171 commit 2fa058f
Show file tree
Hide file tree
Showing 70 changed files with 3,040 additions and 2,353 deletions.
2 changes: 1 addition & 1 deletion sp_api/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.8.19'
__version__ = "1.8.19"
65 changes: 26 additions & 39 deletions sp_api/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
from .feeds.feeds import Feeds as FeedsV2

from .inventories.inventories import Inventories
from .fulfillment_inbound.fulfillment_inbound import FulfillmentInbound, FulfillmentInboundVersion
from .fulfillment_inbound.fulfillment_inbound import (
FulfillmentInbound,
FulfillmentInboundVersion,
)
from .upload.upload import Upload
from .messaging.messaging import Messaging
from .merchant_fulfillment.merchant_fulfillment import MerchantFulfillment

##### DO NOT DELETE ########## INSERT IMPORT HERE #######

from .listings_restrictions.listings_restrictions import ListingsRestrictions

from .messaging.messaging import Messaging
Expand All @@ -37,16 +41,25 @@

from .vendor_invoices.vendor_invoices import VendorInvoices

from .vendor_direct_fulfillment_transactions.vendor_direct_fulfillment_transactions import \
VendorDirectFulfillmentTransactions
from .vendor_direct_fulfillment_transactions.vendor_direct_fulfillment_transactions import (
VendorDirectFulfillmentTransactions,
)

from .vendor_direct_fulfillment_shipping.vendor_direct_fulfillment_shipping import VendorDirectFulfillmentShipping
from .vendor_direct_fulfillment_shipping.vendor_direct_fulfillment_shipping import (
VendorDirectFulfillmentShipping,
)

from .vendor_direct_fulfillment_payments.vendor_direct_fulfillment_payments import VendorDirectFulfillmentPayments
from .vendor_direct_fulfillment_payments.vendor_direct_fulfillment_payments import (
VendorDirectFulfillmentPayments,
)

from .vendor_direct_fulfillment_orders.vendor_direct_fulfillment_orders import VendorDirectFulfillmentOrders
from .vendor_direct_fulfillment_orders.vendor_direct_fulfillment_orders import (
VendorDirectFulfillmentOrders,
)

from .vendor_direct_fulfillment_inventory.vendor_direct_fulfillment_inventory import VendorDirectFulfillmentInventory
from .vendor_direct_fulfillment_inventory.vendor_direct_fulfillment_inventory import (
VendorDirectFulfillmentInventory,
)

from .tokens.tokens import Tokens

Expand Down Expand Up @@ -74,8 +87,10 @@

from .application_management.application_management import ApplicationManagement

from .amazon_warehousing_and_distribu.amazon_warehousing_and_distribu import AmazonWarehousingAndDistribution, \
AmazonWarehousingAndDistributionVersion
from .amazon_warehousing_and_distribu.amazon_warehousing_and_distribu import (
AmazonWarehousingAndDistribution,
AmazonWarehousingAndDistributionVersion,
)

__all__ = [
"Sales",
Expand All @@ -90,7 +105,7 @@
"Feeds",
"Inventories",
"FulfillmentInbound",
'Upload',
"Upload",
"Messaging",
"FulfillmentInbound",
"MerchantFulfillment",
Expand All @@ -102,59 +117,31 @@
"Feeds",
"FeedsV2",
"ReportsV2",

"Messaging",

"CatalogItems",

"ProductTypeDefinitions",

"ListingsItems",

"VendorTransactionStatus",

"VendorShipments",

"VendorOrders",

"VendorInvoices",

"VendorDirectFulfillmentTransactions",

"VendorDirectFulfillmentShipping",

"VendorDirectFulfillmentPayments",

"VendorDirectFulfillmentOrders",

"VendorDirectFulfillmentInventory",

"Tokens",

"Solicitations",

"Shipping",

"Services",

"FbaSmallAndLight",

"FbaInboundEligibility",

"Authorization",

"AplusContent",

"FulfillmentOutbound",

"Replenishment",

"SupplySources",

"DataKiosk",

"ApplicationManagement",

"AmazonWarehousingAndDistribution"

"AmazonWarehousingAndDistribution",
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,112 +12,118 @@ class AmazonWarehousingAndDistributionVersion(str, enum.Enum):
class AmazonWarehousingAndDistribution(Client):
"""
AmazonWarehousingAndDistribu SP-API Client
:link:
:link:
The Selling Partner API for Amazon Warehousing and Distribution (AWD).
"""

version: AmazonWarehousingAndDistributionVersion = AmazonWarehousingAndDistributionVersion.V_2024_05_09
version: AmazonWarehousingAndDistributionVersion = (
AmazonWarehousingAndDistributionVersion.V_2024_05_09
)

def __init__(self, *args, **kwargs):
if 'version' in kwargs:
self.version = kwargs.get('version', AmazonWarehousingAndDistributionVersion.V_2024_05_09)
super().__init__(*args, **{**kwargs, 'version': self.version})
if "version" in kwargs:
self.version = kwargs.get(
"version", AmazonWarehousingAndDistributionVersion.V_2024_05_09
)
super().__init__(*args, **{**kwargs, "version": self.version})

@sp_endpoint('/awd/<version>/inboundShipments/{}', method='GET')
@sp_endpoint("/awd/<version>/inboundShipments/{}", method="GET")
def get_inbound_shipment(self, shipmentId, **kwargs) -> ApiResponse:
"""
get_inbound_shipment(self, shipmentId, **kwargs) -> ApiResponse
get_inbound_shipment(self, shipmentId, **kwargs) -> ApiResponse
Retrieves an AWD inbound shipment.
Retrieves an AWD inbound shipment.
**Usage Plan:**
**Usage Plan:**
| Rate (requests per second) | Burst |
| ---- | ---- |
| 2 | 2 |
| Rate (requests per second) | Burst |
| ---- | ---- |
| 2 | 2 |
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api)
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api)
Args:
shipmentId:string | * REQUIRED ID for the shipment. A shipment contains the cases being inbounded.
Args:
Returns:
ApiResponse:
shipmentId:string | * REQUIRED ID for the shipment. A shipment contains the cases being inbounded.
Returns:
ApiResponse:
"""

return self._request(fill_query_params(kwargs.pop('path'), shipmentId), params=kwargs)
return self._request(
fill_query_params(kwargs.pop("path"), shipmentId), params=kwargs
)

@sp_endpoint('/awd/<version>/inboundShipments', method='GET')
@sp_endpoint("/awd/<version>/inboundShipments", method="GET")
def list_inbound_shipments(self, **kwargs) -> ApiResponse:
"""
list_inbound_shipments(self, **kwargs) -> ApiResponse
Retrieves a summary for all the inbound AWD shipments associated with a merchant, with the ability to apply optional filters.
**Usage Plan:**
| Rate (requests per second) | Burst |
| ---- | ---- |
| 1 | 1 |
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
Args:
key sortBy:string | Field to sort results by. Required if `sortOrder` is provided.
key sortOrder:string | Sort the response in `ASCENDING` or `DESCENDING` order.
key shipmentStatus:string | Filter by inbound shipment status.
key updatedAfter:string | List the inbound shipments that were updated after a certain time (inclusive). The date must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format.
key updatedBefore:string | List the inbound shipments that were updated before a certain time (inclusive). The date must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format.
key maxResults:integer | Maximum number of results to return.
key nextToken:string | Token to retrieve the next set of paginated results.
Returns:
ApiResponse:
list_inbound_shipments(self, **kwargs) -> ApiResponse
Retrieves a summary for all the inbound AWD shipments associated with a merchant, with the ability to apply optional filters.
**Usage Plan:**
| Rate (requests per second) | Burst |
| ---- | ---- |
| 1 | 1 |
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
Args:
key sortBy:string | Field to sort results by. Required if `sortOrder` is provided.
key sortOrder:string | Sort the response in `ASCENDING` or `DESCENDING` order.
key shipmentStatus:string | Filter by inbound shipment status.
key updatedAfter:string | List the inbound shipments that were updated after a certain time (inclusive). The date must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format.
key updatedBefore:string | List the inbound shipments that were updated before a certain time (inclusive). The date must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format.
key maxResults:integer | Maximum number of results to return.
key nextToken:string | Token to retrieve the next set of paginated results.
Returns:
ApiResponse:
"""

return self._request(kwargs.pop('path'), params=kwargs)
return self._request(kwargs.pop("path"), params=kwargs)

@sp_endpoint('/awd/<version>/inventory', method='GET')
@sp_endpoint("/awd/<version>/inventory", method="GET")
def list_inventory(self, **kwargs) -> ApiResponse:
"""
list_inventory(self, **kwargs) -> ApiResponse
list_inventory(self, **kwargs) -> ApiResponse
Lists AWD inventory associated with a merchant with the ability to apply optional filters.
**Usage Plan:**
| Rate (requests per second) | Burst |
| ---- | ---- |
| 2 | 2 |
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
Args:
key sku:string | Filter by seller or merchant SKU for the item.
Lists AWD inventory associated with a merchant with the ability to apply optional filters.
key sortOrder:string | Sort the response in `ASCENDING` or `DESCENDING` order.
**Usage Plan:**
key details:string | Set to `SHOW` to return summaries with additional inventory details. Defaults to `HIDE,` which returns only inventory summary totals.
| Rate (requests per second) | Burst |
| ---- | ---- |
| 2 | 2 |
key nextToken:string | Token to retrieve the next set of paginated results.
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
key maxResults:integer | Maximum number of results to return.
Args:
key sku:string | Filter by seller or merchant SKU for the item.
key sortOrder:string | Sort the response in `ASCENDING` or `DESCENDING` order.
key details:string | Set to `SHOW` to return summaries with additional inventory details. Defaults to `HIDE,` which returns only inventory summary totals.
key nextToken:string | Token to retrieve the next set of paginated results.
key maxResults:integer | Maximum number of results to return.
Returns:
ApiResponse:
Returns:
ApiResponse:
"""

return self._request(kwargs.pop('path'), params=kwargs)
return self._request(kwargs.pop("path"), params=kwargs)
Loading

0 comments on commit 2fa058f

Please sign in to comment.