o
    ȷe                     @   s  d dl Zd dlZd dlZd dlZd dlmZ d dlmZ d dl	Z
d dlZ
d dlmZ d dlmZmZmZmZ dgZdddd	d
dddddddddZdd ZdZi Zdd Zdd Zdd Zd/ddZd d! Zd"d# Zd$d% Zd&d' Zd(d) Z d*d+ Z!d,d- Z"G d.d deZ#dS )0    N)AWSQueryConnection)BotoServerError)
XmlHandler)filtermapsixencodebytesMWSConnection)z
2009-01-01Merchant/)z
2013-09-01SellerIdz/Orders/2013-09-01)z
2011-10-01r   z/Products/2011-10-01)z
2011-07-01r   z/Sellers/2011-07-01)
2010-10-01r   z&/FulfillmentInboundShipment/2010-10-01)r   r   z'/FulfillmentOutboundShipment/2010-10-01)r   r   z /FulfillmentInventory/2010-10-01)z
2013-04-01r   z/Recommendations/2013-04-01)
2014-03-01r   z/CustomerInformation/2014-03-01)r   r   z/CartInformation/2014-03-01)z
2013-07-01r   z/Subscriptions/2013-07-01)z
2013-01-01r   z/OffAmazonPayments/2013-01-01)FeedsReportsOrdersProductsSellersInboundOutbound	InventoryRecommendationsCustomerInfoCartInfoSubscriptionsOffAmazonPaymentsc                 C   s   t t|   S N)r   hashlibmd5digeststrip)c r"   J/var/www/ideatree/venv/lib/python3.10/site-packages/boto/mws/connection.py<lambda>9       r$   )actionresponsesectionquotarestoreversionc                 C   s(   t D ]}t||t| |d  q| |_|S r   )decorated_attrssetattrgetattr__wrapped__)functoattrr"   r"   r#   add_attrs_from?   s   r3   c                         fdd}|S )Nc                    0    fdd}d  jd|_t |dS )Nc                    s   dd  D D ]2\}}||v r9|d | |rdpd }t t|| D ]}|| | ||t|d  < q#|| q| g|R i |S )Nc                 S   s   g | ]}| d qS ).)split.0fr"   r"   r#   
<listcomp>K   r%   zHstructured_lists.<locals>.decorator.<locals>.wrapper.<locals>.<listcomp>r6       )rangelenstrpop)selfargskwkeyaccnewkeyifieldsr0   r"   r#   wrapperJ   s   
z4structured_lists.<locals>.decorator.<locals>.wrapperz{0}
Lists: {1}, r1   format__doc__joinr3   r0   rK   rJ   r0   r#   	decoratorH   s
   z#structured_lists.<locals>.decoratorr"   rJ   rU   r"   rS   r#   structured_listsF   s   rW   c                    r4   )Nc                    s*    fdd}d  j|_t |dS )Nc                     sh   t  fdddfD rdj}t|  d<  dt d d d< | i  S )Nc                    s   g | ]}| vqS r"   r"   r8   rD   r"   r#   r;   ]   s    zAhttp_body.<locals>.decorator.<locals>.wrapper.<locals>.<listcomp>content_typezB{0} requires {1} and content_type arguments for building HTTP bodybody)Content-TypeContent-MD5headers)anyrO   r&   KeyErrorrA   content_md5rC   rD   message)fieldr0   rX   r#   rK   \   s   


z-http_body.<locals>.decorator.<locals>.wrapperz{0}
Required HTTP Body: {1}rM   )rO   rP   r3   rR   rc   rT   r#   rU   Z   s
   
zhttp_body.<locals>.decoratorr"   )rc   rU   r"   rd   r#   	http_bodyX   s   re   Fc                 C   s   t | tjjjrt| j|||d d S t | tjr4| D ]}|	dr#qt| | ||d | |d qd S t | t
jr@| ||< d S t | tjrgt| D ]\}}|rRdpSdt|d  }t|||| |d qJd S t | trvt|  ||< d S | ||< d S )Nmembers_r6   z.member.r=   )
isinstancebotomwsr'   ResponseElementdestructure_object__dict__collectionsMapping
startswithr   string_typesIterable	enumerater@   boollower)valueintoprefixrg   nameindexelementsuffixr"   r"   r#   rm   m   s,   

rm   c                         fdd}|S )Nc                    s2    fdd}d  jd|_t |dS )Nc                     sH    dd}t fddD ]}t | ||d q| i  S )Nrg   Fc                    s   |  v S r   r"   )rH   rX   r"   r#   r$      s    zHstructured_objects.<locals>.decorator.<locals>.wrapper.<locals>.<lambda>rf   )getr   rm   rA   )rC   rD   rg   rc   )rJ   r0   kwargsrX   r#   rK      s   z6structured_objects.<locals>.decorator.<locals>.wrapperzJ{0}
Element|Iter|Map: {1}
(ResponseElement or anything iterable/dict-like)rL   rM   rN   rR   rJ   r   rT   r#   rU      s
   z%structured_objects.<locals>.decoratorr"   )rJ   r   rU   r"   r   r#   structured_objects   s   r   c                     r4   )Nc                    >    fdd}d dd D }d j||_t |dS )Nc                     sZ    fdd}dt tt|kr&ddd D }dj|}t|| i  S )Nc                       t  fdd| D S )Nc                 3       | ]}| v V  qd S r   r"   r9   rE   rX   r"   r#   	<genexpr>       zRrequires.<locals>.decorator.<locals>.requires.<locals>.<lambda>.<locals>.<genexpr>allgrouprX   r"   r#   r$      r%   z?requires.<locals>.decorator.<locals>.requires.<locals>.<lambda>r=    OR c                 S      g | ]}d  |qS +rQ   r9   gr"   r"   r#   r;      r%   zArequires.<locals>.decorator.<locals>.requires.<locals>.<listcomp>z{0} requires {1} argument(s)r?   listr   rQ   rO   r&   r_   rC   rD   hasgrouprb   r0   groupsrX   r#   requires      
z-requires.<locals>.decorator.<locals>.requiresr   c                 S   r   r   r   r   r"   r"   r#   r;      r%   z/requires.<locals>.decorator.<locals>.<listcomp>z{0}
Required: {1}rM   rQ   rO   rP   r3   )r0   r   rb   r   rT   r#   rU         zrequires.<locals>.decoratorr"   r   rU   r"   r   r#   r         r   c                     r4   )Nc                    r   )Nc                     sZ    fdd}t tt|dvr&ddd D }dj|}t|| i  S )Nc                    r   )Nc                 3   r   r   r"   r   rX   r"   r#   r      r   zRexclusive.<locals>.decorator.<locals>.wrapper.<locals>.<lambda>.<locals>.<genexpr>r   r   rX   r"   r#   r$      r%   z?exclusive.<locals>.decorator.<locals>.wrapper.<locals>.<lambda>)r   r=   r   c                 S   r   r   r   r   r"   r"   r#   r;      r%   zAexclusive.<locals>.decorator.<locals>.wrapper.<locals>.<listcomp>z{0} requires either {1}r   r   r   rX   r#   rK      r   z-exclusive.<locals>.decorator.<locals>.wrapperr   c                 S   r   r   r   r   r"   r"   r#   r;      r%   z0exclusive.<locals>.decorator.<locals>.<listcomp>z{0}
Either: {1}rM   r   r0   rK   rb   r   rT   r#   rU      r   zexclusive.<locals>.decoratorr"   r   r"   r   r#   	exclusive   r   r   c                    r~   )Nc                    sB    fdd}d dd D }d j||_t |dS )Nc                     sd   fdd v r+t  fddD s+ddd D }dj|}t|| i S )	Nc                    r   )Nc                 3   r   r   r"   r   rX   r"   r#   r      r   zRdependent.<locals>.decorator.<locals>.wrapper.<locals>.<lambda>.<locals>.<genexpr>r   r   rX   r"   r#   r$      r%   z?dependent.<locals>.decorator.<locals>.wrapper.<locals>.<lambda>c                 3   s    | ]} |V  qd S r   r"   r   )r   r"   r#   r      r   z@dependent.<locals>.decorator.<locals>.wrapper.<locals>.<genexpr>r   c                 S   r   r   r   r   r"   r"   r#   r;      r%   zAdependent.<locals>.decorator.<locals>.wrapper.<locals>.<listcomp>z{0} argument {1} requires {2})r^   rQ   rO   r&   r_   ra   )rc   r0   r   )r   rD   r#   rK      s   z-dependent.<locals>.decorator.<locals>.wrapperr   c                 S   r   r   r   r   r"   r"   r#   r;      r%   z0dependent.<locals>.decorator.<locals>.<listcomp>z{0}
{1} requires: {2}rM   r   r   rc   r   rT   r#   rU      s   zdependent.<locals>.decoratorr"   )rc   r   rU   r"   r   r#   	dependent   s   r   c                     r4   )Nc                    r5   )Nc                     s@   t  fddD sdjd}t|| i  S )Nc                 3   r   r   r"   r9   rH   rX   r"   r#   r      r   zHrequires_some_of.<locals>.decorator.<locals>.requires.<locals>.<genexpr>z,{0} requires at least one of {1} argument(s)rL   )r^   rO   r&   rQ   r_   ra   rI   rX   r#   r      s   z5requires_some_of.<locals>.decorator.<locals>.requiresz{0}
Some Required: {1}rL   rM   rN   )r0   r   rS   rT   r#   rU      s
   z#requires_some_of.<locals>.decoratorr"   rV   r"   rS   r#   requires_some_of   s   r   c                     r4   )Nc                    r5   )Nc                     s:    fddD D ]}t  |   |< q	| i  S )Nc                    s    g | ]}t  |tr|qS r"   )ri   r   ru   r8   rX   r"   r#   r;      s     zIboolean_arguments.<locals>.decorator.<locals>.wrapper.<locals>.<listcomp>)r@   rv   )rC   rD   rc   rI   rX   r#   rK      s   z5boolean_arguments.<locals>.decorator.<locals>.wrapperz{0}
Booleans: {1}rL   rM   rN   rR   rS   rT   r#   rU      s
   z$boolean_arguments.<locals>.decoratorr"   rV   r"   rS   r#   boolean_arguments   s   	r   c                    s    t |t|f fdd	}|S )Nc                    s   t  \ dpttjjd fdd}tD ]}t||t	 
| q$dj|_jt< |S )Nr<   rh   c                    s|   |  t|  d  |  d u rd  }t||d< |d< | j| d}td}| ||g|R i |S )Nz?{0} requires {1} argument. Set the MWSConnection.{2} attribute?ActionVersion)
connection)pathr)   r*   )
setdefaultr.   rO   r_   _response_factorydict)rB   rC   rD   rb   r'   request	accesskeyr&   r0   r   r)   r*   r+   r"   r#   rK      s   
z.api_action.<locals>.decorator.<locals>.wrapperz3MWS {0}/{1} API call; quota={2} restore={3:.2f}
{4})api_version_pathrQ   r   r@   
capitalize__name__r7   r,   r-   localsr   rO   rP   api_call_map)r0   r)   r*   rK   r2   apir(   r   r#   rU      s   

zapi_action.<locals>.decorator)intfloat)r(   r)   r*   r   rU   r"   r   r#   
api_action   s   r   c                       sP  e Zd ZejjjZejjjZ fddZ	dd Z
dd Zdd ZdPddZdd Zdd Zdd Zdd ZedgededededdddQddZeddd edd!d"d#d$ Zed%gedd&d&d'd( Zedd edd!d"d)d* Zeddedd!d"d+d, Zed-geddd.d/d0 Zd1d2 Zed3geded4ed5dd.d6d7 Zed8d9d:ed5d!d"d;d< Zed%ged5d&d&d=d> Z ed9d:ed5d!d"d?d@ Z!ed5d!d"dAdB Z"edCed8d9ed5d!d.dDdE Z#ed%ged5d&d&dFdG Z$edCed9ed5d!d"dHdI Z%edJged5dd.dKdL Z&ed3dMged5d!d"dNdO Z'ed9ed5d!d"dPdQ Z(ed%ged5d&d&dRdS Z)ed9ed5d!d"dTdU Z*edVgedCedWed5d!d"dXdY Z+edZd[ge,dZd[ed\d]d^d_d` Z-eg dae,dbdced\d]d^ddde Z.edfge,dbdced\d]d^dgdh Z/e0didjedkdled\d]d^dmdn Z1ed%ged\d]d^dodp Z2edfgdqdrged\d]d^dsdt Z3ed%ged\d]d^dudv Z4ed\dwdxdydzd{ Z5ed|gd}ged~edd]d^dd Z6ed%gedd]d^dd Z7eddwdxdydd Z8edgedd]d^dd Z9eddge,ddedd]d^dd Z:eg de,ddedd]d^dd Z;edgedd]d^dd Z<edd]d^dd Z=ed%gedd]d^dd Z>edgedd]d^dd Z?eddwdxdydd Z@edgdqgedgeAdgdqgeBddgeAdqgdgdgeBdrdqgeAdgdrge,dddeddddeddd.dd ZCed%geddd.dd ZDedgededdd.dd ZEedgedd]dwdd ZFed%gedd]dwdd ZGeddwdxdydd ZHeddgeddddd ZIeddgededdddd ZJeg d¢edÃedddddń ZKeddgedǃeddd!dȃddʄ ZLeddgededdd!d˃dd̈́ ZMeddgedǃeddddσddф ZNeddgededddd҃ddԄ ZOeddgeddddփdd؄ ZPeddgeddddڃdd܄ ZQeddwdxdyddބ ZReddgedǃeddd!d߃dd ZSeddgededdd!ddd ZTeddd.dd ZUed%geddd.dd ZVedgedddwdd ZWedgededddwdd ZXed%gedddwdd ZYeddwdxdydd ZZeddddd Z[ed%geddddd Z\edgededdddd Z]eddwdxdyd d Z^edgeddddd Z_ed%geddddd Z`edged	edddd
d Zaeddwdxdydd Zbeddge,dddeddd^dd Zceddge,dddeddd^dd Zdedgeddd^dd Zeeddge,dddeddd^dd Zfeddge,dddeddd^dd Zgeg de,dddeddd^dd  Zheg de,dddeddd^d!d" Ziedgeddd^d#d$ Zjeddge,dddeddd^d%d& Zkeddwdxdyd'd( Zled)d*ge,d*ed+d!d,d-d. Zmed)ged+ddwd/d0 Zned)ged+d!d,d1d2 Zoed)ged+d!d,d3d4 Zped)ged+d!d,d5d6 Zqeg d7e,d8ed+d!d,d9d: Zred;ged+ddwd<d= Zseg d>e,d?ed+d!d,d@dA ZtedBged+ddwdCdD Zued;ged+d!d,dEdF Zveg dGe,dHed+d!d,dIdJ ZwedKged+ddwdLdM Zxed+dwdxdydNdO Zy  ZzS (R  r	   c                    sz   | dd |dd| _|dd p|d| _|dd p!| j| _| j|dg fi |}tt| j	|i | d S )Nhostzmws.amazonservices.comsandboxFr
   r   factory_scopes)
r   rA   
_sandboxedr   r
   r   _setup_factoriessuperr	   __init__)rB   rC   rD   	__class__r"   r#   r     s   zMWSConnection.__init__c                 K   st   t jj| jft jj| jfd D ]&\}\}}||v r't| d| || q||g }t| d| ||d q|S )N)response_factoryresponse_error_factoryrh   )scopes)	rj   rk   r'   ResponseFactory	exceptionResponseErrorFactoryitemsr-   rA   )rB   extrascopesrD   factoryscopeDefaultr   r"   r"   r#   r     s   
zMWSConnection._setup_factoriesc                 C   s.   | j s|S |d}|d  d7  < d|S )Nr   _Sandbox)r   r7   rQ   )rB   r   splatr"   r"   r#   _sandboxify"  s
   

zMWSConnection._sandboxifyc                 C   s   dgS )Nrk   r"   )rB   r"   r"   r#   _required_auth_capability)  s   z'MWSConnection._required_auth_capabilityr<   Nc              
   C   s(  |pi }|  |d }| jd|d|||| jd}z	| j|dd}W n ty7 } z
| |j|j|jd}~ww |	 }t
j| |sUt
jd|  | |j|j||jdkrwt
jd|j|jf  t
jd	|  | |j|j||d
}	|	durt||	ksJ |d}
| ||
|S )zyMake a POST request, optionally with a content body,
           and return the response, optionally as raw text.
        r   POSTN)dataparamsr]   r   )override_num_retrieszNull body %s   z%s %sz%sr\   r[   )r   build_base_http_requestr   _mexer   _response_error_factorystatusreasonrZ   readrj   logdebugerror	getheaderr`   _parse_response)rB   r   r   parserrZ   r]   r   r'   bsr   contenttyper"   r"   r#   _post_request,  s<   


zMWSConnection._post_requestc                 C   s*   | ds|S t|| }tj|| |S )Nztext/xml)rq   r   xmlsaxparseString)rB   r   r   rZ   handlerr"   r"   r#   r   J  s
   

zMWSConnection._parse_responsec                 C   s2   d|v r
t |dp|}|tv rt| t| S dS )zReturn the MWS API method referred to in the argument.
           The named method can be in CamelCase or underlined_lower_case.
           This is the complement to MWSConnection.any_call.action
        rh   N)stringcapwordsr   r.   )rB   rz   r&   r"   r"   r#   
method_forQ  s   zMWSConnection.method_forc                 O   s0   |  |}|sJ d|| ||i |S )zPass a call name as the first argument and a generator
           is returned for the initial response and any continuation
           call responses made using the NextToken.
        zNo call named "{0}")r   rO   iter_response)rB   callrC   rD   methodr"   r"   r#   	iter_call[  s   
zMWSConnection.iter_callc                 c   s\    |V  |  |jd }|r(|jjdkr,||jjd}|V  |r*|jjdksdS dS dS dS )zPass a call's response as the initial argument and a
           generator is returned for the initial response and any
           continuation call responses made using the NextToken.
        ByNextTokentrue)	NextTokenN)r   _action_resultHasNextr   )rB   r'   morer"   r"   r#   r   d  s    zMWSConnection.iter_responseFeedTypePurgeAndReplaceFeedContentzMarketplaceIdList.Idr      x   c                 K   s   |pi }| j |||||dS )z5Uploads a feed for processing by Amazon MWS.
        )rZ   r]   r   )rB   r   r'   r]   rZ   rD   r"   r"   r#   submit_feedo  s   zMWSConnection.submit_feedzFeedSubmissionIdList.IdzFeedTypeList.TypezFeedProcessingStatusList.Status
   -   c                 K      |  |||S )z]Returns a list of all feed submissions submitted in the
           previous 90 days.
        r   rB   r   r'   rD   r"   r"   r#   get_feed_submission_list{     z&MWSConnection.get_feed_submission_listr   r   c                 K   r  )zJReturns a list of feed submissions using the NextToken parameter.
        r   r  r"   r"   r#   &get_feed_submission_list_by_next_token     z4MWSConnection.get_feed_submission_list_by_next_tokenc                 K   r  )zHReturns a count of the feeds submitted in the previous 90 days.
        r   r  r"   r"   r#   get_feed_submission_count  r	  z'MWSConnection.get_feed_submission_countc                 K   r  )zxCancels one or more feed submissions and returns a
           count of the feed submissions that were canceled.
        r   r  r"   r"   r#   cancel_feed_submissions     z%MWSConnection.cancel_feed_submissionsFeedSubmissionId<   c                 K   r  )z,Returns the feed processing report.
        r   r  r"   r"   r#   get_feed_submission_result  r	  z(MWSConnection.get_feed_submission_resultc                 K   s.   d ttjt }d| jj|}t	|)z8Instruct the user on how to get service status.
        rL   zTUse {0}.get_(section)_service_status(), where (section) is one of the following: {1})
rQ   r   r@   rv   r   keysrO   r   r   AttributeError)rB   rD   sectionsrb   r"   r"   r#   get_service_status  s
   z MWSConnection.get_service_status
ReportTypezReportOptions=ShowSalesChannelr   c                 K   r  )zHCreates a report request and submits the request to Amazon MWS.
        r   r  r"   r"   r#   request_report  r  zMWSConnection.request_reportzReportRequestIdList.IdzReportTypeList.Typez!ReportProcessingStatusList.Statusc                 K   r  )zoReturns a list of report requests that you can use to get the
           ReportRequestId for a report.
        r   r  r"   r"   r#   get_report_request_list  r  z%MWSConnection.get_report_request_listc                 K   r  )a
  Returns a list of report requests using the NextToken,
           which was supplied by a previous request to either
           GetReportRequestListByNextToken or GetReportRequestList, where
           the value of HasNext was true in that previous request.
        r   r  r"   r"   r#   %get_report_request_list_by_next_token     z3MWSConnection.get_report_request_list_by_next_tokenc                 K   r  )zmReturns a count of report requests that have been submitted
           to Amazon MWS for processing.
        r   r  r"   r"   r#   get_report_request_count  r  z&MWSConnection.get_report_request_countc                 K   r  )zCancel one or more report requests, returning the count of the
           canceled report requests and the report request information.
        r   r  r"   r"   r#   cancel_report_requests  r	  z$MWSConnection.cancel_report_requestsAcknowledgedc                 K   r  )zxReturns a list of reports that were created in the previous
           90 days that match the query parameters.
        r   r  r"   r"   r#   get_report_list  r  zMWSConnection.get_report_listc                 K   r  )zReturns a list of reports using the NextToken, which
           was supplied by a previous request to either
           GetReportListByNextToken or GetReportList, where the
           value of HasNext was true in the previous call.
        r   r  r"   r"   r#   get_report_list_by_next_token  r  z+MWSConnection.get_report_list_by_next_tokenc                 K   r  )zReturns a count of the reports, created in the previous 90 days,
           with a status of _DONE_ and that are available for download.
        r   r  r"   r"   r#   get_report_count  r  zMWSConnection.get_report_countReportIdc                 K   r  )z*Returns the contents of a report.
        r   r  r"   r"   r#   
get_report  r	  zMWSConnection.get_reportSchedulec                 K   r  )zgCreates, updates, or deletes a report request schedule for
           a specified report type.
        r   r  r"   r"   r#   manage_report_schedule  r  z$MWSConnection.manage_report_schedulec                 K   r  )z|Returns a list of order report requests that are scheduled
           to be submitted to Amazon MWS for processing.
        r   r  r"   r"   r#   get_report_schedule_list  r  z&MWSConnection.get_report_schedule_listc                 K   r  )a  Returns a list of report requests using the NextToken,
           which was supplied by a previous request to either
           GetReportScheduleListByNextToken or GetReportScheduleList,
           where the value of HasNext was true in that previous request.
        r   r  r"   r"   r#   &get_report_schedule_list_by_next_token	  r  z4MWSConnection.get_report_schedule_list_by_next_tokenc                 K   r  )znReturns a count of order report requests that are scheduled
           to be submitted to Amazon MWS.
        r   r  r"   r"   r#   get_report_schedule_count  r  z'MWSConnection.get_report_schedule_countReportIdListzReportIdList.Idc                 K   r  )z@Updates the acknowledged status of one or more reports.
        r   r  r"   r"   r#   update_report_acknowledgements  r  z,MWSConnection.update_report_acknowledgementsShipFromAddressInboundShipmentPlanRequestItemsr      g      ?c                 K   r  )zHReturns the information required to create an inbound shipment.
        r   r  r"   r"   r#   create_inbound_shipment_plan$  r  z*MWSConnection.create_inbound_shipment_plan)
ShipmentIdInboundShipmentHeaderInboundShipmentItemsr-  r.  c                 K   r  )z%Creates an inbound shipment.
        r   r  r"   r"   r#   create_inbound_shipment,  r  z%MWSConnection.create_inbound_shipmentr,  c                 K   r  )zUpdates an existing inbound shipment.  Amazon documentation
           is ambiguous as to whether the InboundShipmentHeader and
           InboundShipmentItems arguments are required.
        r   r  r"   r"   r#   update_inbound_shipment4  r  z%MWSConnection.update_inbound_shipmentShipmentIdListShipmentStatusListzShipmentIdList.IdzShipmentStatusList.Statusc                 K   r  )z[Returns a list of inbound shipments based on criteria that
           you specify.
        r   r  r"   r"   r#   list_inbound_shipments>  r  z$MWSConnection.list_inbound_shipmentsc                 K   r  )z]Returns the next page of inbound shipments using the NextToken
           parameter.
        r   r  r"   r"   r#   $list_inbound_shipments_by_next_tokenG  r  z2MWSConnection.list_inbound_shipments_by_next_tokenLastUpdatedAfterLastUpdatedBeforec                 K   r  )zReturns a list of items in a specified inbound shipment, or a
           list of items that were updated within a specified time frame.
        r   r  r"   r"   r#   list_inbound_shipment_itemsO  r  z)MWSConnection.list_inbound_shipment_itemsc                 K   r  zbReturns the next page of inbound shipment items using the
           NextToken parameter.
        r   r  r"   r"   r#   )list_inbound_shipment_items_by_next_tokenW  r  z7MWSConnection.list_inbound_shipment_items_by_next_token   i,  GetServiceStatusc                 K   r  )zcReturns the operational status of the Fulfillment Inbound
           Shipment API section.
        r   r  r"   r"   r#   get_inbound_service_status_  r	  z(MWSConnection.get_inbound_service_status
SellerSkusQueryStartDateTimezSellerSkus.memberr   c                 K   r  )zWReturns information about the availability of a seller's
           inventory.
        r   r  r"   r"   r#   list_inventory_supplyf  r  z#MWSConnection.list_inventory_supplyc                 K   r  )zReturns the next page of information about the availability
           of a seller's inventory using the NextToken parameter.
        r   r  r"   r"   r#   #list_inventory_supply_by_next_tokeno  r  z1MWSConnection.list_inventory_supply_by_next_tokenc                 K   r  )z\Returns the operational status of the Fulfillment Inventory
           API section.
        r   r  r"   r"   r#   get_inventory_service_statusw  r	  z*MWSConnection.get_inventory_service_statusPackageNumberr   c                 K   r  )zReturns delivery tracking information for a package in
           an outbound shipment for a Multi-Channel Fulfillment order.
        r   r  r"   r"   r#   get_package_tracking_details~  r  z*MWSConnection.get_package_tracking_detailsAddressItemsc                 K   r  )zReturns a list of fulfillment order previews based on items
           and shipping speed categories that you specify.
        r   r  r"   r"   r#   get_fulfillment_preview  r  z%MWSConnection.get_fulfillment_preview)SellerFulfillmentOrderIdDisplayableOrderIdShippingSpeedCategoryDisplayableOrderDateTimeDestinationAddressDisplayableOrderCommentrE  rK  c                 K   r  )ziRequests that Amazon ship items from the seller's inventory
           to a destination address.
        r   r  r"   r"   r#   create_fulfillment_order  s   
z&MWSConnection.create_fulfillment_orderrG  c                 K   r  )z^Returns a fulfillment order based on a specified
           SellerFulfillmentOrderId.
        r   r  r"   r"   r#   get_fulfillment_order  r  z#MWSConnection.get_fulfillment_orderc                 K   r  )z{Returns a list of fulfillment orders fulfilled after (or
           at) a specified date or by fulfillment method.
        r   r  r"   r"   r#   list_all_fulfillment_orders  r	  z)MWSConnection.list_all_fulfillment_ordersc                 K   r  r8  r   r  r"   r"   r#   )list_all_fulfillment_orders_by_next_token  r  z7MWSConnection.list_all_fulfillment_orders_by_next_tokenc                 K   r  )zbRequests that Amazon stop attempting to fulfill an existing
           fulfillment order.
        r   r  r"   r"   r#   cancel_fulfillment_order  r  z&MWSConnection.cancel_fulfillment_orderc                 K   r  )z[Returns the operational status of the Fulfillment Outbound
           API section.
        r   r  r"   r"   r#   get_outbound_service_status  r	  z)MWSConnection.get_outbound_service_statusCreatedAfterMarketplaceIdCreatedBefore
BuyerEmailSellerOrderId
OrderTotalShippingAddressPaymentExecutionDetailzMarketplaceId.IdzOrderStatus.StatuszFulfillmentChannel.ChannelzPaymentMethod.r      c                    sv   t d}|dg|dgd D ] \} ||v r3t fdd|D r3dd |}t|q| |||S )	zeReturns a list of orders created or updated during a time
           frame that you specify.
        )zFulfillmentChannel.Channel.1zOrderStatus.Status.1zPaymentMethod.1r5  r6  rW  rV  )rV  rW  c                 3   r   r   r"   r   dontr"   r#   r     r   z,MWSConnection.list_orders.<locals>.<genexpr>z%Don't include {0} when specifying {1}z or )setunionr   r^   rO   rQ   AssertionErrorr   )rB   r   r'   rD   toggledorb   r"   r\  r#   list_orders  s   


zMWSConnection.list_ordersc                 K   r  )zReturns the next page of orders using the NextToken value
           that was returned by your previous request to either
           ListOrders or ListOrdersByNextToken.
        r   r  r"   r"   r#   list_orders_by_next_token  r  z'MWSConnection.list_orders_by_next_tokenAmazonOrderIdzAmazonOrderId.Idc                 K   r  )zBReturns an order for each AmazonOrderId that you specify.
        r   r  r"   r"   r#   	get_order  r  zMWSConnection.get_orderc                 K   r  )zYReturns order item information for an AmazonOrderId that
           you specify.
        r   r  r"   r"   r#   list_order_items  r  zMWSConnection.list_order_itemsc                 K   r  )zReturns the next page of order items using the NextToken
           value that was returned by your previous request to either
           ListOrderItems or ListOrderItemsByNextToken.
        r   r  r"   r"   r#   list_order_items_by_next_token  r  z,MWSConnection.list_order_items_by_next_tokenc                 K   r  )zBReturns the operational status of the Orders API section.
        r   r  r"   r"   r#   get_orders_service_status      z'MWSConnection.get_orders_service_statusQueryr      c                 K   r  )zReturns a list of products and their attributes, ordered
           by relevancy, based on a search query that you specify.
        r   r  r"   r"   r#   list_matching_products  r  z$MWSConnection.list_matching_productsASINListzASINList.ASINc                 K   r  )zuReturns a list of products and their attributes, based on
           a list of ASIN values that you specify.
        r   r  r"   r"   r#   get_matching_product  r  z"MWSConnection.get_matching_product)rT  IdTypeIdListz	IdList.Idc                 K   r  )zuReturns a list of products and their attributes, based on
           a list of Product IDs that you specify.
        r   r  r"   r"   r#   get_matching_product_for_id  r  z)MWSConnection.get_matching_product_for_idSellerSKUListzSellerSKUList.SellerSKUGetCompetitivePricingForSKUc                 K   r  )zReturns the current competitive pricing of a product,
           based on the SellerSKUs and MarketplaceId that you specify.
        r   r  r"   r"   r#   get_competitive_pricing_for_sku   r  z-MWSConnection.get_competitive_pricing_for_skuGetCompetitivePricingForASINc                 K   r  )zReturns the current competitive pricing of a product,
           based on the ASINs and MarketplaceId that you specify.
        r   r  r"   r"   r#    get_competitive_pricing_for_asin)  r  z.MWSConnection.get_competitive_pricing_for_asin   GetLowestOfferListingsForSKUc                 K   r  )ztReturns the lowest price offer listings for a specific
           product by item condition and SellerSKUs.
        r   r  r"   r"   r#   !get_lowest_offer_listings_for_sku2  r  z/MWSConnection.get_lowest_offer_listings_for_skuGetLowestOfferListingsForASINc                 K   r  )zoReturns the lowest price offer listings for a specific
           product by item condition and ASINs.
        r   r  r"   r"   r#   "get_lowest_offer_listings_for_asin;  r  z0MWSConnection.get_lowest_offer_listings_for_asin	SellerSKUGetProductCategoriesForSKUc                 K   r  )zDReturns the product categories that a SellerSKU belongs to.
        r   r  r"   r"   r#   get_product_categories_for_skuD  r	  z,MWSConnection.get_product_categories_for_skuASINGetProductCategoriesForASINc                 K   r  )z@Returns the product categories that an ASIN belongs to.
        r   r  r"   r"   r#   get_product_categories_for_asinK  r	  z-MWSConnection.get_product_categories_for_asinc                 K   r  )zDReturns the operational status of the Products API section.
        r   r  r"   r"   r#   get_products_service_statusR  rj  z)MWSConnection.get_products_service_statusGetMyPriceForSKUc                 K   r  )zUReturns pricing information for your own offer listings, based on SellerSKU.
        r   r  r"   r"   r#   get_my_price_for_skuX  r  z"MWSConnection.get_my_price_for_skuGetMyPriceForASINc                 K   r  )zPReturns pricing information for your own offer listings, based on ASIN.
        r   r  r"   r"   r#   get_my_price_for_asin`  r  z#MWSConnection.get_my_price_for_asinr   c                 K   r  )zReturns a list of marketplaces that the seller submitting
           the request can sell in, and a list of participations that
           include seller-specific information in that marketplace.
        r   r  r"   r"   r#   list_marketplace_participationsh  r  z-MWSConnection.list_marketplace_participationsc                 K   r  )zReturns the next page of marketplaces and participations
           using the NextToken value that was returned by your
           previous request to either ListMarketplaceParticipations
           or ListMarketplaceParticipationsByNextToken.
        r   r  r"   r"   r#   -list_marketplace_participations_by_next_tokenp  s   	z;MWSConnection.list_marketplace_participations_by_next_tokenr   c                 K   r  )zChecks whether there are active recommendations for each category
           for the given marketplace, and if there are, returns the time when
           recommendations were last updated for each category.
        r   r  r"   r"   r#   )get_last_updated_time_for_recommendations{  r  z7MWSConnection.get_last_updated_time_for_recommendationszCategoryQueryList.CategoryQueryc                 K   r  )zReturns your active recommendations for a specific category or for
           all categories for a specific marketplace.
        r   r  r"   r"   r#   list_recommendations  r  z"MWSConnection.list_recommendationsc                 K   r  )z[Returns the next page of recommendations using the NextToken
           parameter.
        r   r  r"   r"   r#   "list_recommendations_by_next_token  r  z0MWSConnection.list_recommendations_by_next_tokenc                 K   r  )zKReturns the operational status of the Recommendations API section.
        r   r  r"   r"   r#   "get_recommendations_service_status  rj  z0MWSConnection.get_recommendations_service_statusr      c                 K   r  zbReturns a list of customer accounts based on search criteria that
           you specify.
        r   r  r"   r"   r#   list_customers  r	  zMWSConnection.list_customers2      c                 K   r  )zJReturns the next page of customers using the NextToken parameter.
        r   r  r"   r"   r#   list_customers_by_next_token  r	  z*MWSConnection.list_customers_by_next_tokenCustomerIdListzCustomerIdList.CustomerIdc                 K   r  r  r   r  r"   r"   r#   get_customers_for_customer_id  r  z+MWSConnection.get_customers_for_customer_idc                 K   r  )z[Returns the operational status of the Customer Information API
           section.
        r   r  r"   r"   r#   get_customerinfo_service_status  r	  z-MWSConnection.get_customerinfo_service_statusDateRangeStartr   c                 K   r  )zReturns a list of shopping carts in your Webstore that were last
           updated during the time range that you specify.
        r   r  r"   r"   r#   
list_carts  r  zMWSConnection.list_cartsc                 K   r  )zZReturns the next page of shopping carts using the NextToken
           parameter.
        r   r  r"   r"   r#   list_carts_by_next_token  r  z&MWSConnection.list_carts_by_next_token
CartIdListzCartIdList.CartIdc                 K   r  )zLReturns shopping carts based on the CartId values that you specify.
        r   r  r"   r"   r#   	get_carts  r  zMWSConnection.get_cartsc                 K   r  )zLReturns the operational status of the Cart Information API section.
        r   r  r"   r"   r#   get_cartinfo_service_status  rj  z)MWSConnection.get_cartinfo_service_statusDestinationTrf   r      c                 K   r  )zMSpecifies a new destination where you want to receive notifications.
        r   r  r"   r"   r#   register_destination  r  z"MWSConnection.register_destinationc                 K   r  )z]Removes an existing destination from the list of registered
           destinations.
        r   r  r"   r"   r#   deregister_destination  r  z$MWSConnection.deregister_destinationc                 K   r  )zALists all current destinations that you have registered.
        r   r  r"   r"   r#   list_registered_destinations  r	  z*MWSConnection.list_registered_destinationsc                 K   r  )z>Sends a test notification to an existing destination.
        r   r  r"   r"   r#   %send_test_notification_to_destination  r  z3MWSConnection.send_test_notification_to_destinationSubscriptionc                 K   r  )zcCreates a new subscription for the specified notification type
           and destination.
        r   r  r"   r"   r#   create_subscription  r  z!MWSConnection.create_subscription)rT  NotificationTyper  c                 K   r  )z^Gets the subscription for the specified notification type and
           destination.
        r   r  r"   r"   r#   get_subscription  r  zMWSConnection.get_subscriptionc                 K   r  )zaDeletes the subscription for the specified notification type and
           destination.
        r   r  r"   r"   r#   delete_subscription
  r  z!MWSConnection.delete_subscriptionc                 K   r  )z:Returns a list of all your current subscriptions.
        r   r  r"   r"   r#   list_subscriptions  r	  z MWSConnection.list_subscriptionsc                 K   r  )zaUpdates the subscription for the specified notification type and
           destination.
        r   r  r"   r"   r#   update_subscription  r  z!MWSConnection.update_subscriptionc                 K   r  )zIReturns the operational status of the Subscriptions API section.
        r   r  r"   r"   r#    get_subscriptions_service_status#  rj  z.MWSConnection.get_subscriptions_service_statusAmazonOrderReferenceIdOrderReferenceAttributesr   r=   c                 K   r  )ziSets order reference details such as the order total and a
           description for the order.
        r   r  r"   r"   r#   set_order_reference_details)  r  z)MWSConnection.set_order_reference_detailsc                 K   r  )z[Returns details about the Order Reference object and its current
           state.
        r   r  r"   r"   r#   get_order_reference_details2  r  z)MWSConnection.get_order_reference_detailsc                 K   r  )zConfirms that the order reference is free of constraints and all
           required information has been set on the order reference.
        r   r  r"   r"   r#   confirm_order_reference:  r  z%MWSConnection.confirm_order_referencec                 K   r  )zwCancel an order reference; all authorizations associated with
           this order reference are also closed.
        r   r  r"   r"   r#   cancel_order_referenceB  r  z$MWSConnection.cancel_order_referencec                 K   r  )zConfirms that an order reference has been fulfilled (fully
           or partially) and that you do not expect to create any new
           authorizations on this order reference.
        r   r  r"   r"   r#   close_order_referenceJ  r  z#MWSConnection.close_order_reference)r  AuthorizationReferenceIdAuthorizationAmountr  c                 K   r  )zlReserves a specified amount against the payment method(s) stored in
           the order reference.
        r   r  r"   r"   r#   	authorizeS  r  zMWSConnection.authorizeAmazonAuthorizationIdc                 K   r  )zxReturns the status of a particular authorization and the total
           amount captured on the authorization.
        r   r  r"   r"   r#   get_authorization_details]  r  z'MWSConnection.get_authorization_details)r  CaptureReferenceIdCaptureAmountr  c                 K   r  )z>Captures funds from an authorized payment instrument.
        r   r  r"   r"   r#   capturee  r  zMWSConnection.captureAmazonCaptureIdc                 K   r  )zlReturns the status of a particular capture and the total amount
           refunded on the capture.
        r   r  r"   r"   r#   get_capture_detailsm  r  z!MWSConnection.get_capture_detailsc                 K   r  )z!Closes an authorization.
        r   r  r"   r"   r#   close_authorizationu  r	  z!MWSConnection.close_authorization)r  RefundReferenceIdRefundAmountr  c                 K   r  )z.Refunds a previously captured amount.
        r   r  r"   r"   r#   refund|  r  zMWSConnection.refundAmazonRefundIdc                 K   r  )z3Returns the status of a particular refund.
        r   r  r"   r"   r#   get_refund_details  r	  z MWSConnection.get_refund_detailsc                 K   r  )zZReturns the operational status of the Off-Amazon Payments API
           section.
        r   r  r"   r"   r#   $get_offamazonpayments_service_status  r	  z2MWSConnection.get_offamazonpayments_service_status)r<   N)Nr<   ){r   
__module____qualname__rj   rk   r'   r   r   r   r   r   r   r   r   r   r   r   r   r   r   re   rW   r   r  r  r  r
  r  r  r  r  r  r  r  r  r  r  r  r   r"  r#  r$  r%  r'  r   r+  r/  r0  r   r3  r4  r7  r9  r<  r?  r@  rA  rC  rF  rM  rN  rO  rP  rQ  rR  r   r   rc  rd  rf  rg  rh  ri  rm  ro  rr  ru  rw  rz  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  __classcell__r"   r"   r   r#   r	     s   


	





	

































































	

















)F)$xml.saxr   r   r   ro   boto.connectionr   boto.exceptionr   boto.mws.exceptionrj   boto.mws.responseboto.handlerr   boto.compatr   r   r   r   __all__r   r`   r,   r   r3   rW   re   rm   r   r   r   r   r   r   r   r	   r"   r"   r"   r#   <module>   sP   
