o
    ȷeQ                     @   sh   d dl Z d dlmZmZ d dlmZ d dlZd dlZd dlZ	d dl
mZ d dl mZ G dd deZdS )    N)AWSQueryConnectionAWSAuthConnection)BotoServerError)ItemSet)handlerc                       sR   e Zd ZdZdZ					d fdd		Zd
d ZdddZdd Zdd Z	  Z
S )ECSConnectionz
    ECommerce Connection

    For more information on how to use this module see:

    http://blog.coredumped.org/2010/09/search-for-books-on-amazon-using-boto.html
    z
2010-11-01NTecs.amazonaws.comr   /c                    s0   t t| j|||||||||	|
||||d d S )N)security_tokenprofile_name)superr   __init__)selfaws_access_key_idaws_secret_access_key	is_secureportproxy
proxy_port
proxy_user
proxy_passhostdebughttps_connection_factorypathr
   r   	__class__ H/var/www/ideatree/venv/lib/python3.10/site-packages/boto/ecs/__init__.pyr   *   s   
zECSConnection.__init__c                 C   s   dgS )Necsr   )r   r   r   r   _required_auth_capability5   s   z'ECSConnection._required_auth_capabilityc           	      C   s   d|d< ||d< |r||d< |  d|d}| d}tj| |jdkrCtjd	|j|jf  tjd
|  t	|j|j||du rOt
| |||}n|}t|| }tj|d| |jsst	|jdjdi |jd |S )zQ
        Utility method to handle calls to ECS and parsing of responses.
        AWSECommerceServiceService	OperationItemPageNz	/onca/xmlzutf-8   z%s %sz%sz{Code}: {Message}r   r   )make_requestreaddecodebotologr   statuserrorreasonr   r   r   
XmlHandlerxmlsaxparseStringencodeis_validformaterrors)	r   actionparamspageitemSetresponsebodyrshr   r   r   get_response8   s&   
zECSConnection.get_responsec                 K   s   ||d< |  d|S )a  
        Returns items that satisfy the search criteria, including one or more search
        indices.

        For a full list of search terms,
        :see: http://docs.amazonwebservices.com/AWSECommerceService/2010-09-01/DG/index.html?ItemSearch.html
        SearchIndex
ItemSearchr>   )r   search_indexr7   r   r   r   item_searchW   s   zECSConnection.item_searchc                 K   s   |  d|S )z
        Returns items that satisfy the lookup query.

        For a full list of parameters, see:
        http://s3.amazonaws.com/awsdocs/Associates/2011-08-01/prod-adv-api-dg-2011-08-01.pdf
        
ItemLookuprA   )r   r7   r   r   r   item_lookupb   s   zECSConnection.item_lookup)NNTNNNNNr   r   Nr	   NN)r   N)__name__
__module____qualname____doc__
APIVersionr   r    r>   rC   rE   __classcell__r   r   r   r   r      s    
r   )r)   boto.connectionr   r   boto.exceptionr   timeurllibxml.saxr/   boto.ecs.itemr   r   r   r   r   r   r   <module>   s   