From a30e2d9f11fcef9e8d8862a5356bbde9ffb6dad1 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 9 Feb 2021 00:02:59 +0100 Subject: [PATCH] added report types enum --- setup.py | 2 +- sp_api/base/reportTypes.py | 68 +++++++++++++++++++++++-------- tests/api/reports/test_reports.py | 2 +- 3 files changed, 53 insertions(+), 19 deletions(-) diff --git a/setup.py b/setup.py index 32310ec03..1cc4cbb23 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='python-amazon-sp-api', - version='0.2.1', + version='0.2.2', install_requires=[ "requests", "six~=1.15.0", diff --git a/sp_api/base/reportTypes.py b/sp_api/base/reportTypes.py index ba515245d..33c720fec 100644 --- a/sp_api/base/reportTypes.py +++ b/sp_api/base/reportTypes.py @@ -3,38 +3,55 @@ class ReportType(str, Enum): GET_FLAT_FILE_OPEN_LISTINGS_DATA = 'GET_FLAT_FILE_OPEN_LISTINGS_DATA' + GET_MERCHANT_LISTINGS_ALL_DATA = 'GET_MERCHANT_LISTINGS_ALL_DATA' GET_MERCHANT_LISTINGS_DATA = 'GET_MERCHANT_LISTINGS_DATA' + GET_MERCHANT_LISTINGS_INACTIVE_DATA = 'GET_MERCHANT_LISTINGS_INACTIVE_DATA' GET_MERCHANT_LISTINGS_DATA_BACK_COMPAT = 'GET_MERCHANT_LISTINGS_DATA_BACK_COMPAT' GET_MERCHANT_LISTINGS_DATA_LITE = 'GET_MERCHANT_LISTINGS_DATA_LITE' GET_MERCHANT_LISTINGS_DATA_LITER = 'GET_MERCHANT_LISTINGS_DATA_LITER' GET_MERCHANT_CANCELLED_LISTINGS_DATA = 'GET_MERCHANT_CANCELLED_LISTINGS_DATA' - GET_CONVERGED_FLAT_FILE_SOLD_LISTINGS_DATA = 'GET_CONVERGED_FLAT_FILE_SOLD_LISTINGS_DATA' GET_MERCHANT_LISTINGS_DEFECT_DATA = 'GET_MERCHANT_LISTINGS_DEFECT_DATA' - GET_FLAT_FILE_ACTIONABLE_ORDER_DATA = 'GET_FLAT_FILE_ACTIONABLE_ORDER_DATA' - GET_ORDERS_DATA = 'GET_ORDERS_DATA' - GET_FLAT_FILE_ORDERS_DATA = 'GET_FLAT_FILE_ORDERS_DATA' - GET_CONVERGED_FLAT_FILE_ORDER_REPORT_DATA = 'GET_CONVERGED_FLAT_FILE_ORDER_REPORT_DATA' + GET_PAN_EU_OFFER_STATUS = 'GET_PAN_EU_OFFER_STATUS' + GET_MFN_PAN_EU_OFFER_STATUS = 'GET_MFN_PAN_EU_OFFER_STATUS' + GET_FLAT_FILE_GEO_OPPORTUNITIES = 'GET_FLAT_FILE_GEO_OPPORTUNITIES' + GET_REFERRAL_FEE_PREVIEW_REPORT = 'GET_REFERRAL_FEE_PREVIEW_REPORT' + GET_FLAT_FILE_ACTIONABLE_ORDER_DATA_SHIPPING = 'GET_FLAT_FILE_ACTIONABLE_ORDER_DATA_SHIPPING' + GET_ORDER_REPORT_DATA_INVOICING = 'GET_ORDER_REPORT_DATA_INVOICING' + GET_FLAT_FILE_ORDER_REPORT_DATA_INVOICING = 'GET_FLAT_FILE_ORDER_REPORT_DATA_INVOICING' + GET_ORDER_REPORT_DATA_TAX = 'GET_ORDER_REPORT_DATA_TAX' + GET_FLAT_FILE_ORDER_REPORT_DATA_TAX = 'GET_FLAT_FILE_ORDER_REPORT_DATA_TAX' + GET_ORDER_REPORT_DATA_SHIPPING = 'GET_ORDER_REPORT_DATA_SHIPPING' + GET_FLAT_FILE_ORDER_REPORT_DATA_SHIPPING = 'GET_FLAT_FILE_ORDER_REPORT_DATA_SHIPPING' + GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL = 'GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL' + GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL = 'GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL' + GET_FLAT_FILE_ARCHIVED_ORDERS_DATA_BY_ORDER_DATE = 'GET_FLAT_FILE_ARCHIVED_ORDERS_DATA_BY_ORDER_DATE' + GET_XML_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL = 'GET_XML_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL' + GET_XML_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL = 'GET_XML_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL' GET_FLAT_FILE_PENDING_ORDERS_DATA = 'GET_FLAT_FILE_PENDING_ORDERS_DATA' GET_PENDING_ORDERS_DATA = 'GET_PENDING_ORDERS_DATA' GET_CONVERGED_FLAT_FILE_PENDING_ORDERS_DATA = 'GET_CONVERGED_FLAT_FILE_PENDING_ORDERS_DATA' + GET_XML_RETURNS_DATA_BY_RETURN_DATE = 'GET_XML_RETURNS_DATA_BY_RETURN_DATE' + GET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATE = 'GET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATE' + GET_XML_MFN_PRIME_RETURNS_REPORT = 'GET_XML_MFN_PRIME_RETURNS_REPORT' + GET_CSV_MFN_PRIME_RETURNS_REPORT = 'GET_CSV_MFN_PRIME_RETURNS_REPORT' + GET_XML_MFN_SKU_RETURN_ATTRIBUTES_REPORT = 'GET_XML_MFN_SKU_RETURN_ATTRIBUTES_REPORT' + GET_FLAT_FILE_MFN_SKU_RETURN_ATTRIBUTES_REPORT = 'GET_FLAT_FILE_MFN_SKU_RETURN_ATTRIBUTES_REPORT' GET_SELLER_FEEDBACK_DATA = 'GET_SELLER_FEEDBACK_DATA' GET_V1_SELLER_PERFORMANCE_REPORT = 'GET_V1_SELLER_PERFORMANCE_REPORT' GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE = 'GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE' + GET_V2_SETTLEMENT_REPORT_DATA_XML = 'GET_V2_SETTLEMENT_REPORT_DATA_XML' GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_V2 = 'GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_V2' - GET_FLAT_FILE_SALES_TAX_DATA = 'GET_FLAT_FILE_SALES_TAX_DATA' - SC_VAT_TAX_REPORT = 'SC_VAT_TAX_REPORT' - GET_VAT_TRANSACTION_DATA = 'GET_VAT_TRANSACTION_DATA' - GET_XML_BROWSE_TREE_DATA = 'GET_XML_BROWSE_TREE_DATA' - GET_AMAZON_FULFILLED_SHIPMENTS_DATA = 'GET_AMAZON_FULFILLED_SHIPMENTS_DATA' - FEE_DISCOUNTS_REPORT = 'FEE_DISCOUNTS_REPORT' - GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE = 'GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE' - GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE = 'GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE' - GET_XML_ALL_ORDERS_DATA_BY_LAST_UPDATE = 'GET_XML_ALL_ORDERS_DATA_BY_LAST_UPDATE' - GET_XML_ALL_ORDERS_DATA_BY_ORDER_DATE = 'GET_XML_ALL_ORDERS_DATA_BY_ORDER_DATE' + GET_AMAZON_FULFILLED_SHIPMENTS_DATA_GENERAL = 'GET_AMAZON_FULFILLED_SHIPMENTS_DATA_GENERAL' + GET_AMAZON_FULFILLED_SHIPMENTS_DATA_INVOICING = 'GET_AMAZON_FULFILLED_SHIPMENTS_DATA_INVOICING' + GET_AMAZON_FULFILLED_SHIPMENTS_DATA_TAX = 'GET_AMAZON_FULFILLED_SHIPMENTS_DATA_TAX' GET_FBA_FULFILLMENT_CUSTOMER_SHIPMENT_SALES_DATA = 'GET_FBA_FULFILLMENT_CUSTOMER_SHIPMENT_SALES_DATA' GET_FBA_FULFILLMENT_CUSTOMER_SHIPMENT_PROMOTION_DATA = 'GET_FBA_FULFILLMENT_CUSTOMER_SHIPMENT_PROMOTION_DATA' GET_FBA_FULFILLMENT_CUSTOMER_TAXES_DATA = 'GET_FBA_FULFILLMENT_CUSTOMER_TAXES_DATA' + GET_REMOTE_FULFILLMENT_ELIGIBILITY = 'GET_REMOTE_FULFILLMENT_ELIGIBILITY' GET_AFN_INVENTORY_DATA = 'GET_AFN_INVENTORY_DATA' + GET_AFN_INVENTORY_DATA_BY_COUNTRY = 'GET_AFN_INVENTORY_DATA_BY_COUNTRY' + GET_LEDGER_SUMMARY_VIEW_DATA = 'GET_LEDGER_SUMMARY_VIEW_DATA' + GET_LEDGER_DETAIL_VIEW_DATA = 'GET_LEDGER_DETAIL_VIEW_DATA' GET_FBA_FULFILLMENT_CURRENT_INVENTORY_DATA = 'GET_FBA_FULFILLMENT_CURRENT_INVENTORY_DATA' GET_FBA_FULFILLMENT_MONTHLY_INVENTORY_DATA = 'GET_FBA_FULFILLMENT_MONTHLY_INVENTORY_DATA' GET_FBA_FULFILLMENT_INVENTORY_RECEIPTS_DATA = 'GET_FBA_FULFILLMENT_INVENTORY_RECEIPTS_DATA' @@ -44,16 +61,33 @@ class ReportType(str, Enum): GET_FBA_FULFILLMENT_INVENTORY_HEALTH_DATA = 'GET_FBA_FULFILLMENT_INVENTORY_HEALTH_DATA' GET_FBA_MYI_UNSUPPRESSED_INVENTORY_DATA = 'GET_FBA_MYI_UNSUPPRESSED_INVENTORY_DATA' GET_FBA_MYI_ALL_INVENTORY_DATA = 'GET_FBA_MYI_ALL_INVENTORY_DATA' - GET_FBA_FULFILLMENT_CROSS_BORDER_INVENTORY_MOVEMENT_DATA = 'GET_FBA_FULFILLMENT_CROSS_BORDER_INVENTORY_MOVEMENT_DATA' + GET_RESTOCK_INVENTORY_RECOMMENDATIONS_REPORT = 'GET_RESTOCK_INVENTORY_RECOMMENDATIONS_REPORT' GET_FBA_FULFILLMENT_INBOUND_NONCOMPLIANCE_DATA = 'GET_FBA_FULFILLMENT_INBOUND_NONCOMPLIANCE_DATA' GET_STRANDED_INVENTORY_UI_DATA = 'GET_STRANDED_INVENTORY_UI_DATA' GET_STRANDED_INVENTORY_LOADER_DATA = 'GET_STRANDED_INVENTORY_LOADER_DATA' + POST_FLAT_FILE_INVLOADER_DATA = 'POST_FLAT_FILE_INVLOADER_DATA' GET_FBA_INVENTORY_AGED_DATA = 'GET_FBA_INVENTORY_AGED_DATA' GET_EXCESS_INVENTORY_DATA = 'GET_EXCESS_INVENTORY_DATA' + GET_FBA_STORAGE_FEE_CHARGES_DATA = 'GET_FBA_STORAGE_FEE_CHARGES_DATA' + GET_PRODUCT_EXCHANGE_DATA = 'GET_PRODUCT_EXCHANGE_DATA' GET_FBA_ESTIMATED_FBA_FEES_TXT_DATA = 'GET_FBA_ESTIMATED_FBA_FEES_TXT_DATA' GET_FBA_REIMBURSEMENTS_DATA = 'GET_FBA_REIMBURSEMENTS_DATA' + GET_FBA_FULFILLMENT_LONGTERM_STORAGE_FEE_CHARGES_DATA = 'GET_FBA_FULFILLMENT_LONGTERM_STORAGE_FEE_CHARGES_DATA' GET_FBA_FULFILLMENT_CUSTOMER_RETURNS_DATA = 'GET_FBA_FULFILLMENT_CUSTOMER_RETURNS_DATA' + GET_FBA_FULFILLMENT_CUSTOMER_SHIPMENT_REPLACEMENT_DATA = 'GET_FBA_FULFILLMENT_CUSTOMER_SHIPMENT_REPLACEMENT_DATA' GET_FBA_RECOMMENDED_REMOVAL_DATA = 'GET_FBA_RECOMMENDED_REMOVAL_DATA' GET_FBA_FULFILLMENT_REMOVAL_ORDER_DETAIL_DATA = 'GET_FBA_FULFILLMENT_REMOVAL_ORDER_DETAIL_DATA' GET_FBA_FULFILLMENT_REMOVAL_SHIPMENT_DETAIL_DATA = 'GET_FBA_FULFILLMENT_REMOVAL_SHIPMENT_DETAIL_DATA' - + GET_FBA_UNO_INVENTORY_DATA = 'GET_FBA_UNO_INVENTORY_DATA' + GET_FLAT_FILE_SALES_TAX_DATA = 'GET_FLAT_FILE_SALES_TAX_DATA' + SC_VAT_TAX_REPORT = 'SC_VAT_TAX_REPORT' + GET_VAT_TRANSACTION_DATA = 'GET_VAT_TRANSACTION_DATA' + GET_GST_MTR_B2B_CUSTOM = 'GET_GST_MTR_B2B_CUSTOM' + GET_GST_MTR_B2C_CUSTOM = 'GET_GST_MTR_B2C_CUSTOM' + GET_XML_BROWSE_TREE_DATA = 'GET_XML_BROWSE_TREE_DATA' + GET_EASYSHIP_DOCUMENTS = 'GET_EASYSHIP_DOCUMENTS' + GET_EASYSHIP_PICKEDUP = 'GET_EASYSHIP_PICKEDUP' + GET_EASYSHIP_WAITING_FOR_PICKUP = 'GET_EASYSHIP_WAITING_FOR_PICKUP' + RFQD_BULK_DOWNLOAD = 'RFQD_BULK_DOWNLOAD' + FEE_DISCOUNTS_REPORT = 'FEE_DISCOUNTS_REPORT' + GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA = 'GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA' diff --git a/tests/api/reports/test_reports.py b/tests/api/reports/test_reports.py index 80f696400..ac328540c 100644 --- a/tests/api/reports/test_reports.py +++ b/tests/api/reports/test_reports.py @@ -6,7 +6,7 @@ def test_create_report(): res = Reports().create_report( - reportType='GET_MERCHANT_LISTINGS_ALL_DATA', + reportType=ReportType.GET_MERCHANT_LISTINGS_ALL_DATA, dataStartTime='2019-12-10T20:11:24.000Z', marketplaceIds=[ "A1PA6795UKMFR9",