o
    i-                     @   s   d dl Zd dlZddlmZmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZmZ dd	lmZ dd
lmZ ddlmZ ddlmZ G dd dZG dd dZdS )    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)GetProjectRequestV1Response)ListProjectRequestsV1Response   )AsyncRawRequestsClientRawRequestsClient)RequestsListRequestDeployment)RequestsListRequestEndpoint)RequestsListRequestMethod)RequestsListRequestStatusc                   @      e Zd ZdefddZedefddZddddddddddddd	ed
e	j
ej de	j
ej de	j
e de	j
e de	j
e de	j
e de	j
e de	j
e de	j
e de	j
e de	j
e defddZddd	edede	j
e defddZdS )RequestsClientclient_wrapperc                C      t |d| _d S N)r   )r
   _raw_clientselfr    r   _/home/ubuntu/.local/lib/python3.10/site-packages/deepgram/manage/v1/projects/requests/client.py__init__      zRequestsClient.__init__returnc                 C      | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawRequestsClient
        r   r   r   r   r   with_raw_response      	z RequestsClient.with_raw_responseNstartendlimitpageaccessor
request_id
deploymentendpointmethodstatusrequest_options
project_idr"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   c                C   s*   | j j|||||||||	|
||d}|jS )a
  
        Generates a list of requests for a specific project

        Parameters
        ----------
        project_id : str
            The unique identifier of the project

        start : typing.Optional[dt.datetime]
            Start date of the requested date range. Formats accepted are YYYY-MM-DD, YYYY-MM-DDTHH:MM:SS, or YYYY-MM-DDTHH:MM:SS+HH:MM

        end : typing.Optional[dt.datetime]
            End date of the requested date range. Formats accepted are YYYY-MM-DD, YYYY-MM-DDTHH:MM:SS, or YYYY-MM-DDTHH:MM:SS+HH:MM

        limit : typing.Optional[float]
            Number of results to return per page. Default 10. Range [1,1000]

        page : typing.Optional[float]
            Navigate and return the results to retrieve specific portions of information of the response

        accessor : typing.Optional[str]
            Filter for requests where a specific accessor was used

        request_id : typing.Optional[str]
            Filter for a specific request id

        deployment : typing.Optional[RequestsListRequestDeployment]
            Filter for requests where a specific deployment was used

        endpoint : typing.Optional[RequestsListRequestEndpoint]
            Filter for requests where a specific endpoint was used

        method : typing.Optional[RequestsListRequestMethod]
            Filter for requests where a specific method was used

        status : typing.Optional[RequestsListRequestStatus]
            Filter for requests that succeeded (status code < 300) or failed (status code >=400)

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ListProjectRequestsV1Response
            A list of requests for a specific project

        Examples
        --------
        import datetime

        from deepgram import DeepgramClient

        client = DeepgramClient(
            api_key="YOUR_API_KEY",
        )
        client.manage.v1.projects.requests.list(
            project_id="123456-7890-1234-5678-901234",
            start=datetime.datetime.fromisoformat(
                "2024-01-15 09:30:00+00:00",
            ),
            end=datetime.datetime.fromisoformat(
                "2024-01-15 09:30:00+00:00",
            ),
            limit=1.1,
            page=1.1,
            accessor="12345678-1234-1234-1234-123456789012",
            request_id="12345678-1234-1234-1234-123456789012",
            deployment="hosted",
            endpoint="listen",
            method="sync",
            status="succeeded",
        )
        r!   r   listdatar   r-   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   	_responser   r   r   r/       s   YzRequestsClient.listr,   c                C   s   | j j|||d}|jS )a*  
        Retrieves a specific request for a specific project

        Parameters
        ----------
        project_id : str
            The unique identifier of the project

        request_id : str
            The unique identifier of the request

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GetProjectRequestV1Response
            A specific request for a specific project

        Examples
        --------
        from deepgram import DeepgramClient

        client = DeepgramClient(
            api_key="YOUR_API_KEY",
        )
        client.manage.v1.projects.requests.get(
            project_id="123456-7890-1234-5678-901234",
            request_id="123456-7890-1234-5678-901234",
        )
        r3   r   getr0   r   r-   r'   r,   r2   r   r   r   r5      s   "zRequestsClient.get)__name__
__module____qualname__r   r   propertyr
   r   strtypingOptionaldtdatetimefloatr   r   r   r   r   r   r/   r   r5   r   r   r   r   r      sh    

	

jr   c                   @   r   )AsyncRequestsClientr   c                C   r   r   )r	   r   r   r   r   r   r      r   zAsyncRequestsClient.__init__r   c                 C   r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawRequestsClient
        r   r   r   r   r   r      r    z%AsyncRequestsClient.with_raw_responseNr!   r-   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   c                   s2   | j j|||||||||	|
||dI dH }|jS )a
  
        Generates a list of requests for a specific project

        Parameters
        ----------
        project_id : str
            The unique identifier of the project

        start : typing.Optional[dt.datetime]
            Start date of the requested date range. Formats accepted are YYYY-MM-DD, YYYY-MM-DDTHH:MM:SS, or YYYY-MM-DDTHH:MM:SS+HH:MM

        end : typing.Optional[dt.datetime]
            End date of the requested date range. Formats accepted are YYYY-MM-DD, YYYY-MM-DDTHH:MM:SS, or YYYY-MM-DDTHH:MM:SS+HH:MM

        limit : typing.Optional[float]
            Number of results to return per page. Default 10. Range [1,1000]

        page : typing.Optional[float]
            Navigate and return the results to retrieve specific portions of information of the response

        accessor : typing.Optional[str]
            Filter for requests where a specific accessor was used

        request_id : typing.Optional[str]
            Filter for a specific request id

        deployment : typing.Optional[RequestsListRequestDeployment]
            Filter for requests where a specific deployment was used

        endpoint : typing.Optional[RequestsListRequestEndpoint]
            Filter for requests where a specific endpoint was used

        method : typing.Optional[RequestsListRequestMethod]
            Filter for requests where a specific method was used

        status : typing.Optional[RequestsListRequestStatus]
            Filter for requests that succeeded (status code < 300) or failed (status code >=400)

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ListProjectRequestsV1Response
            A list of requests for a specific project

        Examples
        --------
        import asyncio
        import datetime

        from deepgram import AsyncDeepgramClient

        client = AsyncDeepgramClient(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.manage.v1.projects.requests.list(
                project_id="123456-7890-1234-5678-901234",
                start=datetime.datetime.fromisoformat(
                    "2024-01-15 09:30:00+00:00",
                ),
                end=datetime.datetime.fromisoformat(
                    "2024-01-15 09:30:00+00:00",
                ),
                limit=1.1,
                page=1.1,
                accessor="12345678-1234-1234-1234-123456789012",
                request_id="12345678-1234-1234-1234-123456789012",
                deployment="hosted",
                endpoint="listen",
                method="sync",
                status="succeeded",
            )


        asyncio.run(main())
        r!   Nr.   r1   r   r   r   r/      s    `zAsyncRequestsClient.listr3   c                   s    | j j|||dI dH }|jS )a  
        Retrieves a specific request for a specific project

        Parameters
        ----------
        project_id : str
            The unique identifier of the project

        request_id : str
            The unique identifier of the request

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GetProjectRequestV1Response
            A specific request for a specific project

        Examples
        --------
        import asyncio

        from deepgram import AsyncDeepgramClient

        client = AsyncDeepgramClient(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.manage.v1.projects.requests.get(
                project_id="123456-7890-1234-5678-901234",
                request_id="123456-7890-1234-5678-901234",
            )


        asyncio.run(main())
        r3   Nr4   r6   r   r   r   r5   .  s   *zAsyncRequestsClient.get)r7   r8   r9   r   r   r:   r	   r   r;   r<   r=   r>   r?   r@   r   r   r   r   r   r   r/   r   r5   r   r   r   r   rA      sh    

	

qrA   )r?   r>   r<   core.client_wrapperr   r   core.request_optionsr   $types.get_project_request_v1responser   &types.list_project_requests_v1responser   
raw_clientr	   r
   &types.requests_list_request_deploymentr   $types.requests_list_request_endpointr   "types.requests_list_request_methodr   "types.requests_list_request_statusr   r   rA   r   r   r   r   <module>   s    