
    bf                     J    d dl mZmZ d dlmZ d dlmZ  G d de          ZdS )   )_DICT_VERSION_LIST_DICT_VERSION_ACCOUNT)api_version)Mastodonc                   p   e Zd Z edde          d             Z edde          d             Z edde          dd            Z edde          d             Z	 edde          d             Z
 eddd          d	             Z eddd          d
             Z eddd          d             ZdS )r   z2.1.0c                 .    |                      dd          S )z
        Fetch a list of all the Lists by the logged-in user.

        Returns a list of :ref:`list dicts <list dicts>`.
        GET/api/v1/lists)_Mastodon__api_request)selfs    \/home/feoh/.local/pipx/venvs/mastodon-archive/lib/python3.11/site-packages/mastodon/lists.pylistszMastodon.lists   s     !!%999    c                 ^    |                      |          }|                     dd|           S )zd
        Fetch info about a specific list.

        Returns a :ref:`list dict <list dict>`.
        r	   /api/v1/lists/_Mastodon__unpack_idr   r   ids     r   listzMastodon.list   s6     b!!!!%)>")>)>???r   z2.6.0Nc                 >   |                      |          }||                      |d          }||                      |d          }||                      |d          }|                     t                      dg          }|                     dd| d|          S )z
        Get the accounts that are on the given list.

        Returns a list of :ref:`account dicts <account dicts>`.
        NT)dateconvr   r	   r   	/accountsr   _Mastodon__generate_paramslocalsr   )r   r   max_idmin_idsince_idlimitparamss          r   list_accountszMastodon.list_accounts    s     b!!%%ft%<<F%%ft%<<F''4'@@H''4&99!!%)G")G)G)GPPPr   c                 r    |                      t                                }|                     dd|          S )z
        Create a new list with the given `title`.

        Returns the :ref:`list dict <list dict>` of the created list.
        POSTr
   )r   r   r   )r   titler!   s      r   list_createzMastodon.list_create8   s3     ''11!!&/6BBBr   c                     |                      |          }|                     t                      dg          }|                     dd| |          S )z
        Update info about a list, where "info" is really the lists `title`.

        Returns the :ref:`list dict <list dict>` of the modified list.
        r   PUTr   r   )r   r   r%   r!   s       r   list_updatezMastodon.list_updateB   sS     b!!''4&99!!%)>")>)>GGGr   c                 b    |                      |          }|                     dd|            dS )z 
        Delete a list.
        DELETEr   Nr   r   s     r   list_deletezMastodon.list_deleteM   s<    
 b!!8%:b%:%:;;;;;r   c                                            |          }t          |t                    s|g} fd|D             }                     t	                      dg          }                     dd| d|           dS )zH
        Add the account(s) given in `account_ids` to the list.
        c                 :    g | ]}                     |          S  r   .0xr   s     r   
<listcomp>z.Mastodon.list_accounts_add.<locals>.<listcomp>^   '    @@@qt''**@@@r   r   r$   r   r   Nr   
isinstancer   r   r   r   r   r   account_idsr!   s   `   r   list_accounts_addzMastodon.list_accounts_addU   s    
 b!!+t,, 	(&-K@@@@K@@@''4&996#AB#A#A#A6JJJJJr   c                                            |          }t          |t                    s|g} fd|D             }                     t	                      dg          }                     dd| d|           dS )zM
        Remove the account(s) given in `account_ids` from the list.
        c                 :    g | ]}                     |          S r/   r0   r1   s     r   r4   z1Mastodon.list_accounts_delete.<locals>.<listcomp>l   r5   r   r   r+   r   r   Nr6   r8   s   `   r   list_accounts_deletezMastodon.list_accounts_deletec   s    
 b!!+t,, 	(&-K@@@@K@@@''4&998%Cb%C%C%CVLLLLLr   )NNNN)__name__
__module____qualname__r   r   r   r   r   r"   r&   r)   r,   r:   r=   r/   r   r   r   r   	   s        ['#566: : 76: ['#566@ @ 76@ ['#899Q Q Q :9Q. ['#566C C 76C ['#566H H 76H ['7++< < ,+< ['7++K K ,+K ['7++M M ,+M M Mr   r   N)versionsr   r   utilityr   	internalsr   	Internalsr/   r   r   <module>rE      s    @ ? ? ? ? ? ? ?             , , , , , ,fM fM fM fM fMy fM fM fM fM fMr   