o
    gZh                     @   sH   d dl Zd dlmZ ddlmZ ddlmZmZm	Z	 G dd deZ
dS )    N)ObjectApiResponse   )NamespacedClient)SKIP_IN_PATH_quote_rewrite_parametersc                   @   s  e Zd Ze ddddddddededeje dejejeej	e f  deje dejejd	d
ef  deje dejejd	d
ef  de
ej fddZe ddddddddededeje dejejeej	e f  deje dejejd	d
ef  deje dejejd	d
ef  de
ej fddZe ddddddeje dejejeej	e f  deje deje de
ej f
ddZdS )DanglingIndicesClientN)error_tracefilter_pathhumanmaster_timeoutprettytimeout
index_uuidaccept_data_lossr	   r
   r   r   zt.Literal[-1]zt.Literal[0]r   r   returnc                C      |t v rtd|du rtddt| }	i }
|dur!||
d< |dur)||
d< |dur1||
d< |dur9||
d< |durA||
d	< |durI||
d
< |durQ||
d< ddi}| jd|	|
|dS )a  
        Deletes the specified dangling index

        `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-gateway-dangling-indices.html>`_

        :param index_uuid: The UUID of the dangling index
        :param accept_data_loss: Must be set to true in order to delete the dangling
            index
        :param master_timeout: Specify timeout for connection to master
        :param timeout: Explicit operation timeout
        -Empty value passed for parameter 'index_uuid'N3Empty value passed for parameter 'accept_data_loss'/_dangling/r   r	   r
   r   r   r   r   acceptapplication/jsonDELETEparamsheadersr   
ValueErrorr   perform_requestselfr   r   r	   r
   r   r   r   r   _DanglingIndicesClient__path_DanglingIndicesClient__query_DanglingIndicesClient__headers r$   b/var/www/html/lang_env/lib/python3.10/site-packages/elasticsearch/_sync/client/dangling_indices.pydelete_dangling_index   0   z+DanglingIndicesClient.delete_dangling_indexc                C   r   )a  
        Imports the specified dangling index

        `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-gateway-dangling-indices.html>`_

        :param index_uuid: The UUID of the dangling index
        :param accept_data_loss: Must be set to true in order to import the dangling
            index
        :param master_timeout: Specify timeout for connection to master
        :param timeout: Explicit operation timeout
        r   Nr   r   r   r	   r
   r   r   r   r   r   r   POSTr   r   r   r$   r$   r%   import_dangling_indexN   r'   z+DanglingIndicesClient.import_dangling_index)r	   r
   r   r   c                C   sb   d}i }|dur||d< |dur||d< |dur||d< |dur$||d< ddi}| j d	|||d
S )z
        Returns all dangling indices.

        `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-gateway-dangling-indices.html>`_
        z
/_danglingNr	   r
   r   r   r   r   GETr   )r   )r    r	   r
   r   r   r!   r"   r#   r$   r$   r%   list_dangling_indices   s   z+DanglingIndicesClient.list_dangling_indices)__name__
__module____qualname__r   strbooltOptionalUnionSequencer   Anyr&   r)   r+   r$   r$   r$   r%   r      s    22r   )typingr1   Zelastic_transportr   _baser   utilsr   r   r   r   r$   r$   r$   r%   <module>   s
   