o
    ˷e                     @   s0   d Z ddlmZ ddlmZ G dd deZdS )z
The Campaign Folders API endpoints

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/campaign-folders/
Schema: https://api.mailchimp.com/schema/3.0/CampaignFolders/Instance.json
    )unicode_literals)BaseApic                       sJ   e Zd ZdZ fddZdd ZdddZd	d
 Zdd Zdd Z	  Z
S )CampaignFoldersz0
    Organize your campaigns using folders.
    c                    s&   t t| j|i | d| _d| _dS )z)
        Initialize the endpoint
        zcampaign-foldersN)superr   __init__endpoint	folder_id)selfargskwargs	__class__ Z/var/www/ideatree/venv/lib/python3.10/site-packages/mailchimp3/entities/campaignfolders.pyr      s   
zCampaignFolders.__init__c                 C   sD   d|vrt d| jj|  |d}|dur|d | _|S d| _|S )z
        Create a new campaign folder.

        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*
        }
        name$The campaign folder must have a nameurldataNid)KeyError
_mc_client_post_build_pathr   )r	   r   responser   r   r   create   s   

zCampaignFolders.createFc                 K   s<   d| _ |r| jdd|  i|S | jjdd|  i|S )at  
        Get all folders used to organize campaigns.

        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        Nr   r   )r   _iterater   r   _get)r	   get_allqueryparamsr   r   r   all.   s   zCampaignFolders.allc                 K   s"   || _ | jjdd| |i|S )aF  
        Get information about a specific folder used to organize campaigns.

        :param folder_id: The unique id for the campaign folder.
        :type folder_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        r   Nr   )r   r   r   r   )r	   r   r   r   r   r   getA   s   
zCampaignFolders.getc                 C   s,   || _ d|vrtd| jj| ||dS )a>  
        Update a specific folder used to organize campaigns.

        :param folder_id: The unique id for the campaign folder.
        :type folder_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*
        }
        r   r   r   )r   r   r   _patchr   )r	   r   r   r   r   r   updateO   s   zCampaignFolders.updatec                 C   s   || _ | jj| |dS )u   
        Delete a specific campaign folder, and mark all the campaigns in the
        folder as ‘unfiled’.

        :param folder_id: The unique id for the campaign folder.
        :type folder_id: :py:class:`str`
        )r   )r   r   _deleter   )r	   r   r   r   r   deletea   s   zCampaignFolders.delete)F)__name__
__module____qualname____doc__r   r   r    r!   r#   r%   __classcell__r   r   r   r   r      s    	
r   N)r)   
__future__r   mailchimp3.baseapir   r   r   r   r   r   <module>   s   