o
    ùT·j×/  ã                   @  s  d dl mZ d dlmZ d dlZddlmZ ddlmZm	Z	m
Z
mZmZ ddlmZmZ ddlmZ dd	lmZ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 ddgZ G dd„ deƒZ!G dd„ deƒZ"G dd„ dƒZ#G dd„ dƒZ$G dd„ dƒZ%G dd„ dƒZ&dS )é    )Úannotations)ÚLiteralNé   )Ú_legacy_response)ÚBodyÚQueryÚHeadersÚNotGivenÚ	not_given)Úmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)Úmake_request_options)Úspend_limit_update_params)ÚOrganizationSpendLimit)ÚOrganizationSpendLimitDeletedÚ
SpendLimitÚAsyncSpendLimitc                   @  ój   e Zd Zed dd„ƒZed!dd„ƒZddded	œd"dd„Zddded	œd#dd„Zddded	œd$dd„Z	dS )%r   ÚreturnÚSpendLimitWithRawResponsec                 C  ó   t | ƒS ©a  
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
        )r   ©Úself© r   úr/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/admin/organization/spend_limit.pyÚwith_raw_response   ó   zSpendLimit.with_raw_responseÚSpendLimitWithStreamingResponsec                 C  r   ©zÌ
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
        )r#   r   r   r   r    Úwith_streaming_response"   ó   z"SpendLimit.with_streaming_responseN©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutr(   úHeaders | Noner)   úQuery | Noner*   úBody | Noner+   ú(float | httpx2.Timeout | None | NotGivenr   c             	   C  ó"   | j dt||||ddid�td�S )ú(Get the organization's hard spend limit.ú/organization/spend_limitÚadmin_api_key_authT©r(   r)   r*   r+   Úsecurity©ÚoptionsÚcast_to©Ú_getr   r   ©r   r(   r)   r*   r+   r   r   r    Úretrieve+   ó   û÷zSpendLimit.retrieveÚcurrencyúLiteral['USD']ÚintervalúLiteral['month']Úthreshold_amountÚintc             
   C  s4   | j dt|||dœtjƒt||||ddid�td�S )á•  
        Create or replace the organization's hard spend limit.

        Args:
          currency: The currency for the threshold amount. Currently, only `USD` is supported.

          interval: The time interval for evaluating spend against the threshold. Currently, only
              `month` is supported.

          threshold_amount: The hard spend limit amount, in cents.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        r2   ©r>   r@   rB   r3   Tr4   ©Úbodyr7   r8   )Ú_postr   r   ÚSpendLimitUpdateParamsr   r   ©r   r>   r@   rB   r(   r)   r*   r+   r   r   r    ÚupdateB   s$    ýúûïzSpendLimit.updater   c             	   C  r0   )ú+Delete the organization's hard spend limit.r2   r3   Tr4   r6   ©Ú_deleter   r   r;   r   r   r    Údeletev   r=   zSpendLimit.delete)r   r   )r   r#   ©
r(   r,   r)   r-   r*   r.   r+   r/   r   r   ©r>   r?   r@   rA   rB   rC   r(   r,   r)   r-   r*   r.   r+   r/   r   r   ©
r(   r,   r)   r-   r*   r.   r+   r/   r   r   ©
Ú__name__Ú
__module__Ú__qualname__r   r!   r%   r
   r<   rK   rO   r   r   r   r    r      ó(    	øõ9øc                   @  r   )%r   r   ÚAsyncSpendLimitWithRawResponsec                 C  r   r   )rX   r   r   r   r    r!   �   r"   z!AsyncSpendLimit.with_raw_responseÚ$AsyncSpendLimitWithStreamingResponsec                 C  r   r$   )rY   r   r   r   r    r%   ™   r&   z'AsyncSpendLimit.with_streaming_responseNr'   r(   r,   r)   r-   r*   r.   r+   r/   r   c             	   Ã  ó*   �| j dt||||ddid�td�I dH S )r1   r2   r3   Tr4   r6   Nr9   r;   r   r   r    r<   ¢   ó   €û÷zAsyncSpendLimit.retriever>   r?   r@   rA   rB   rC   c             
   Ã  sB   �| j dt|||dœtjƒI dH t||||ddid�td�I dH S )rD   r2   rE   Nr3   Tr4   rF   )rH   r   r   rI   r   r   rJ   r   r   r    rK   ¹   s&   € ýúûïzAsyncSpendLimit.updater   c             	   Ã  rZ   )rL   r2   r3   Tr4   r6   NrM   r;   r   r   r    rO   í   r[   zAsyncSpendLimit.delete)r   rX   )r   rY   rP   rQ   rR   rS   r   r   r   r    r   Ž   rW   c                   @  ó   e Zd Zddd„ZdS )	r   Úspend_limitr   r   ÚNonec                 C  ó4   || _ t |j¡| _t |j¡| _t |j¡| _d S ©N)Ú_spend_limitr   Úto_raw_response_wrapperr<   rK   rO   ©r   r]   r   r   r    Ú__init__  ó   ÿÿ
ÿz"SpendLimitWithRawResponse.__init__N©r]   r   r   r^   ©rT   rU   rV   rd   r   r   r   r    r     ó    r   c                   @  r\   )	rX   r]   r   r   r^   c                 C  r_   r`   )ra   r   Úasync_to_raw_response_wrapperr<   rK   rO   rc   r   r   r    rd     re   z'AsyncSpendLimitWithRawResponse.__init__N©r]   r   r   r^   rg   r   r   r   r    rX     rh   rX   c                   @  r\   )	r#   r]   r   r   r^   c                 C  ó.   || _ t|jƒ| _t|jƒ| _t|jƒ| _d S r`   )ra   r   r<   rK   rO   rc   r   r   r    rd   $  ó   ÿÿ
ÿz(SpendLimitWithStreamingResponse.__init__Nrf   rg   r   r   r   r    r#   #  rh   r#   c                   @  r\   )	rY   r]   r   r   r^   c                 C  rk   r`   )ra   r   r<   rK   rO   rc   r   r   r    rd   3  rl   z-AsyncSpendLimitWithStreamingResponse.__init__Nrj   rg   r   r   r   r    rY   2  rh   rY   )'Ú
__future__r   Útyping_extensionsr   Úhttpx2Ú r   Ú_typesr   r   r   r	   r
   Ú_utilsr   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú_base_clientr   Útypes.admin.organizationr   Ú1types.admin.organization.organization_spend_limitr   Ú9types.admin.organization.organization_spend_limit_deletedr   Ú__all__r   r   r   rX   r#   rY   r   r   r   r    Ú<module>   s(   ww