Exemplo n.º 1
0
    def get_report_list(self, params):
        http_method = 'POST'
        action = 'GetReportList'

        max_count = params.get('MaxCount')
        report_types = params.get('ReportTypeList')
        al = params.get('Acknowledged')
        report_request_ids = params.get('ReportRequestIdList')
        available_from_date = params.get('AvailableFromDate')
        available_to_date = params.get('AvailableToDate')
        parameters = ''
        if max_count:
            parameters += '&MaxCount=' + max_count
        if report_types:
            if report_types.find(',') == -1:
                parameters += '&ReportTypeList.Type.1=' + report_types
            else:
                parameters += common.set_param_list(report_types, 'ReportTypeList.Type')
        if al:
            parameters += '&Acknowledged=' + al
        if report_request_ids:
            if report_request_ids.find(',') == -1:
                parameters += '&ReportRequestIdList.Id.1=' + report_request_ids
            else:
                parameters += common.set_param_list(report_request_ids, 'ReportRequestIdList.Id')
        if available_from_date:
            iso_time = common.amz_iso_time(available_from_date)
            time_encode = self.params_encode(iso_time)
            parameters += '&AvailableFromDate=' + time_encode
        if available_to_date:
            iso_time = common.amz_iso_time(available_to_date)
            time_encode = self.params_encode(iso_time)
            parameters += '&AvailableToDate=' + time_encode
        return self.req_handler(http_method, action, parameters)
Exemplo n.º 2
0
    def get_report_request_count(self, params):
        http_method = 'POST'
        action = 'GetReportRequestCount'

        report_types = params.get('ReportTypeList')
        report_status = params.get('ReportProcessingStatusList')
        request_from_date = params.get('RequestedFromDate')
        request_to_date = params.get('RequestedToDate')
        parameters = ''
        if report_types:
            if report_types.find(',') == -1:
                parameters += '&ReportTypeList.Type.1=' + report_types
            else:
                parameters += common.set_param_list(report_types, 'ReportTypeList.Type')
        if report_status:
            if report_status.find(',') == -1:
                parameters += '&ReportProcessingStatusList.Status.1=' + report_status
            else:
                parameters += common.set_param_list(report_status, 'ReportProcessingStatusList.Status')
        if request_from_date:
            iso_time = common.amz_iso_time(request_from_date)
            time_encode = self.params_encode(iso_time)
            parameters += '&RequestedFromDate=' + time_encode
        if request_to_date:
            iso_time = common.amz_iso_time(request_to_date)
            time_encode = self.params_encode(iso_time)
            parameters += '&RequestedToDate=' + time_encode
        return self.req_handler(http_method, action, parameters)
Exemplo n.º 3
0
    def get_competitive_pricing_for_asin(self, params):
        http_method = 'POST'
        action = 'GetCompetitivePricingForASIN'

        asins = params.get('ASINList')
        if asins.find(',') == -1:
            parameters = '&ASINList.ASIN.1=' + asins
        else:
            parameters = common.set_param_list(asins, 'ASINList.ASIN')
        return self.req_handler(http_method, action, parameters)
Exemplo n.º 4
0
    def get_matching_product(self, params):
        http_method = 'POST'
        action = 'GetMatchingProduct'

        asins = params.get('ASINList')
        if asins.find(',') == -1:
            parameters = '&ASINList.ASIN.1=' + asins
        else:
            parameters = common.set_param_list(asins, 'ASINList.ASIN')
        return self.req_handler(http_method, action, parameters)
Exemplo n.º 5
0
    def get_report_schedule_count(self, params):
        http_method = 'POST'
        action = 'GetReportScheduleCount'

        report_types = params.get('ReportTypeList')
        if report_types.find(',') == -1:
            parameters = '&ReportTypeList.Type.1=' + report_types
        else:
            parameters = common.set_param_list(report_types, 'ReportTypeList.Type')
        return self.req_handler(http_method, action, parameters)
Exemplo n.º 6
0
    def get_order(self, params):
        http_method = 'GET'
        action = 'GetOrder'

        order_id = params.get('AmazonOrderId')
        if order_id.find(',') == -1:
            parameters = '&AmazonOrderId.Id.1=' + self.params_encode(order_id)
        else:
            parameters = common.set_param_list(order_id, 'AmazonOrderId.Id')
        return self.req_handler(http_method, action, parameters)
Exemplo n.º 7
0
    def get_competitive_pricing_for_sku(self, params):
        http_method = 'POST'
        action = 'GetCompetitivePricingForSKU'

        seller_skus = params.get('SellerSKUList')
        if seller_skus.find(',') == -1:
            parameters = '&SellerSKUList.SellerSKU.1=' + seller_skus
        else:
            parameters = common.set_param_list(seller_skus,
                                               'SellerSKUList.SellerSKU')
        return self.req_handler(http_method, action, parameters)
Exemplo n.º 8
0
    def get_matching_product_for_id(self, params):
        http_method = 'POST'
        action = 'GetMatchingProductForId'

        id_type = params.get('IdType')
        id_list = params.get('IDLIST')
        parameters = '&IdType=' + id_type
        if id_list.find(',') == -1:
            parameters += '&IdList.Id.1=' + id_list
        else:
            parameters += common.set_param_list(id_list, 'IdList.Id')
        return self.req_handler(http_method, action, parameters)
Exemplo n.º 9
0
    def get_lowest_offer_listings_for_asin(self, params):
        http_method = 'POST'
        action = 'GetLowestOfferListingsForASIN'

        asins = params.get('ASINList')
        item_condition = params.get('ItemCondition')
        if asins.find(',') == -1:
            parameters = '&ASINList.ASIN.1=' + asins
        else:
            parameters = common.set_param_list(asins, 'ASINList.ASIN')
        if item_condition:
            parameters += '&ItemCondition=' + item_condition
        return self.req_handler(http_method, action, parameters)
Exemplo n.º 10
0
    def update_report_acknowledgements(self, params):
        http_method = 'POST'
        action = 'UpdateReportAcknowledgements'

        report_ids = params.get('ReportIdList')
        al = params.get('Acknowledged')
        if report_ids.find(',') == -1:
            parameters = '&ReportIdList.Id.1=' + report_ids
        else:
            parameters = common.set_param_list(report_ids, 'ReportIdList.Id')
        if al:
            parameters += '&Acknowledged=' + al
        return self.req_handler(http_method, action, parameters)
Exemplo n.º 11
0
    def get_lowest_offer_listings_for_sku(self, params):
        http_method = 'POST'
        action = 'GetLowestOfferListingsForSKU'

        seller_skus = params.get('SellerSKUList')
        item_condition = params.get('ItemCondition')
        if seller_skus.find(',') == -1:
            parameters = '&SellerSKUList.SellerSKU.1=' + seller_skus
        else:
            parameters = common.set_param_list(seller_skus,
                                               'SellerSKUList.SellerSKU')
        if item_condition:
            parameters += '&ItemCondition=' + item_condition
        return self.req_handler(http_method, action, parameters)
Exemplo n.º 12
0
    def list_invertory_supply(self, params):
        http_method = 'GET'
        action = 'ListInventorySupply'

        seller_skus = params.get('SellerSkus')
        start_time = params.get('QueryStartDateTime')
        response_group = params.get('ResponseGroup')
        parameters = ''
        if seller_skus:
            if seller_skus.find(',') == -1:
                parameters = '&SellerSkus.member.1=' + seller_skus
            else:
                parameters = common.set_param_list(seller_skus, 'SellerSkus.member')
        if start_time:
            start_time_iso = datetime.datetime.strftime(start_time, '%Y-%m-%dT%H:%M:%SZ')
            parameters = '&QueryStartDateTime=' + self.params_encode(start_time_iso)
        if response_group:
            parameters += '&ResponseGroup=' + response_group
        return self.req_handler(http_method, action, parameters)
Exemplo n.º 13
0
    def list_orders(self, params):
        http_method = 'GET'
        action = 'ListOrders'

        created_after = params.get('CreatedAfter')
        created_before = params.get('CreatedBefore')
        last_updated_after = params.get('LastUpdatedAfter')
        last_updated_before = params.get('LastUpdatedBefore')
        order_status = params.get('OrderStatus')
        channel = params.get('FulfillmentChannel')
        pay_method = params.get('PaymentMethod')
        buyer_email = params.get('BuyerEmail')
        seller_order_id = params.get('SellerOrderId')
        max_page = params.get('MaxResultsPerPage')
        tfm_ship_status = params.get('TFMShipmentStatus')
        easy_ship_status = params.get('EasyShipShipmentStatus')

        parameters = ''
        if created_after:
            parameters = '&CreatedAfter=' + self.params_encode(
                common.amz_iso_time(created_after))
        if last_updated_after:
            parameters = '&LastUpdatedAfter=' + self.params_encode(
                common.amz_iso_time(last_updated_after))
        if created_before:
            parameters += '&CreatedBefore=' + self.params_encode(
                common.amz_iso_time(created_before))
        if last_updated_before:
            parameters += '&LastUpdatedBefore=' + self.params_encode(
                common.amz_iso_time(last_updated_before))
        if order_status:
            if order_status.find(',') == -1:
                parameters += '&OrderStatus.Status.1=' + self.params_encode(
                    order_status)
            else:
                parameters += common.set_param_list(order_status,
                                                    'OrderStatus.Status')
        if channel:
            if channel.find(',') == -1:
                parameters += '&FulfillmentChannel.Channel.1=' + self.params_encode(
                    channel)
            else:
                parameters += common.set_param_list(
                    channel, 'FulfillmentChannel.Channel')
        if pay_method:
            if pay_method.find(',') == -1:
                parameters += '&PaymentMethod.Method.1=' + self.params_encode(
                    pay_method)
            else:
                parameters += common.set_param_list(pay_method,
                                                    'PaymentMethod.Method')
        if buyer_email:
            parameters += '&BuyerEmail=' + self.params_encode(buyer_email)
        if seller_order_id:
            parameters += '&SellerOrderId=' + self.params_encode(
                seller_order_id)
        if max_page:
            parameters += '&MaxResultsPerPage=' + self.params_encode(max_page)
        if tfm_ship_status:
            parameters += '&TFMShipmentStatus=' + self.params_encode(
                tfm_ship_status)
        if easy_ship_status:
            parameters += '&EasyShipShipmentStatus=' + self.params_encode(
                easy_ship_status)

        return self.req_handler(http_method, action, parameters)