
    Yj`                    d   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mZmZ ddlmZ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mZ ddlmZm Z  ddl!m"Z"m#Z#m$Z$ ddl%m&Z& ddl'm(Z( ddgZ) G d de      Z* G d de      Z+ G d d      Z, G d d      Z- G d d      Z. G d d      Z/y)    )annotations)LiteralN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)path_templatemaybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncConversationCursorPageAsyncConversationCursorPage)AsyncPaginatormake_request_options)spend_alert_list_paramsspend_alert_create_paramsspend_alert_update_params)OrganizationSpendAlert)OrganizationSpendAlertDeletedSpendAlertsAsyncSpendAlertsc            	      2   e Zd Zedd       Zedd       Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	e
e
e
e
ddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Zddded	 	 	 	 	 	 	 	 	 	 	 dd
Zy)r   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
        )SpendAlertsWithRawResponseselfs    o/var/www/html/vmm-quimica/venv/lib/python3.12/site-packages/openai/resources/admin/organization/spend_alerts.pywith_raw_responsezSpendAlerts.with_raw_response   s     *$//    c                    t        |       S 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
        ) SpendAlertsWithStreamingResponser%   s    r'   with_streaming_responsez#SpendAlerts.with_streaming_response#   s     055r)   Nextra_headersextra_query
extra_bodytimeoutc                   | j                  dt        ||||dt        j                        t	        ||||ddi      t
              S )z  
        Creates an organization spend alert.

        Args:
          currency: The currency for the threshold amount.

          interval: The time interval for evaluating spend against the threshold.

          notification_channel: Email notification settings for a spend alert.

          threshold_amount: The alert threshold 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
        /organization/spend_alertscurrencyintervalnotification_channelthreshold_amountadmin_api_key_authTr/   r0   r1   r2   securitybodyoptionscast_to)_postr   r   SpendAlertCreateParamsr   r   	r&   r7   r8   r9   r:   r/   r0   r1   r2   s	            r'   createzSpendAlerts.create,   se    D zz(  ( (,@(8	 *@@ )+'%.5 +%  
 	
r)   c                   |st        d|      | j                  t        d|      t        ||||ddi      t              S )Z  
        Retrieves an organization spend alert.

        Args:
          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
        7Expected a non-empty value for `alert_id` but received %/organization/spend_alerts/{alert_id}alert_idr;   Tr<   r@   rA   
ValueError_getr   r   r   r&   rK   r/   r0   r1   r2   s         r'   retrievezSpendAlerts.retrievec   s^    . VW_VbcddyyAHU(+'%.5 +  

 
	
r)   c                   |st        d|      | j                  t        d|      t        ||||dt        j
                        t        ||||	ddi      t              S )	z  
        Updates an organization spend alert.

        Args:
          currency: The currency for the threshold amount.

          interval: The time interval for evaluating spend against the threshold.

          notification_channel: Email notification settings for a spend alert.

          threshold_amount: The alert threshold 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
        rH   rI   rJ   r6   r;   Tr<   r>   )rN   rB   r   r   r   SpendAlertUpdateParamsr   r   
r&   rK   r7   r8   r9   r:   r/   r0   r1   r2   s
             r'   updatezSpendAlerts.update   s    F VW_VbcddzzAHU  ( (,@(8	 *@@ )+'%.5 +%  
 	
r)   afterbeforelimitorderr/   r0   r1   r2   c                   | j                  dt        t           t        ||||t	        ||||dt
        j                        ddi      t              S a  Lists organization spend alerts.

        Args:
          after: Cursor for pagination.

        Provide the ID of the last spend alert from the previous
              response to fetch the next page.

          before: Cursor for pagination. Provide the ID of the first spend alert from the previous
              response to fetch the previous page.

          limit: A limit on the number of spend alerts to return. Defaults to 20.

          order: Sort order for the returned spend alerts.

          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
        r5   )rX   rY   rZ   r[   r;   T)r/   r0   r1   r2   queryr=   )pager@   model)_get_api_listr   r   r   r   r   SpendAlertListParams	r&   rX   rY   rZ   r[   r/   r0   r1   r2   s	            r'   listzSpendAlerts.list   sp    J !!(+,BC(+'%%!&"(!&!&	 ,@@ /5  )' " 
 	
r)   c                   |st        d|      | j                  t        d|      t        ||||ddi      t              S )X  
        Deletes an organization spend alert.

        Args:
          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
        rH   rI   rJ   r;   Tr<   rL   rN   _deleter   r   r   rP   s         r'   deletezSpendAlerts.delete   s^    . VW_Vbcdd||AHU(+'%.5 2  

 
	
r)   )returnr$   )rj   r,   r7   Literal['USD']r8   Literal['month']r9   z-spend_alert_create_params.NotificationChannelr:   intr/   Headers | Noner0   Query | Noner1   Body | Noner2   (float | httpx2.Timeout | None | NotGivenrj   r   rK   strr/   ro   r0   rp   r1   rq   r2   rr   rj   r   rK   rt   r7   rl   r8   rm   r9   z-spend_alert_update_params.NotificationChannelr:   rn   r/   ro   r0   rp   r1   rq   r2   rr   rj   r   )rX   
str | OmitrY   rv   rZ   
int | Omitr[   Literal['asc', 'desc'] | Omitr/   ro   r0   rp   r1   rq   r2   rr   rj   z2SyncConversationCursorPage[OrganizationSpendAlert]rK   rt   r/   ro   r0   rp   r1   rq   r2   rr   rj   r   __name__
__module____qualname__r   r(   r-   r   rE   rQ   rV   r   rd   ri    r)   r'   r   r      s%   0 0 6 6" )-$("&<E5
 !5
 #	5

 L5
 5
 &5
 "5
  5
 :5
 
 5
z )-$("&<E#
#
 &#
 "#
  #
 :#
 
 #
^ )-$("&<E8
8
 !	8

 #8
 L8
 8
 &8
 "8
  8
 :8
 
 8
z !! /3 )-$("&<E9
 9
 	9

 9
 -9
 &9
 "9
  9
 :9
 
<9
B )-$("&<E#
#
 &#
 "#
  #
 :#
 
'#
r)   c            	      2   e Zd Zedd       Zedd       Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	e
e
e
e
ddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Zddded	 	 	 	 	 	 	 	 	 	 	 dd
Zy)r    c                    t        |       S r#   )AsyncSpendAlertsWithRawResponser%   s    r'   r(   z"AsyncSpendAlerts.with_raw_response$  s     /t44r)   c                    t        |       S r+   )%AsyncSpendAlertsWithStreamingResponser%   s    r'   r-   z(AsyncSpendAlerts.with_streaming_response.  s     5T::r)   Nr.   c                  K   | j                  dt        ||||dt        j                         d{   t	        ||||ddi      t
               d{   S 7 '7 w)r4   r5   r6   Nr;   Tr<   r>   )rB   r   r   rC   r   r   rD   s	            r'   rE   zAsyncSpendAlerts.create7  s~     D ZZ(, ( (,@(8	 *@@  )+'%.5 +%   
 
 	

s!   /AA
"AAAAc                  K   |st        d|      | j                  t        d|      t        ||||ddi      t               d{   S 7 w)	rG   rH   rI   rJ   r;   Tr<   rL   NrM   rP   s         r'   rQ   zAsyncSpendAlerts.retrieven  sl     . VW_VbcddYYAHU(+'%.5 +  

 

 
	
 

   AA	A
Ac                  K   |st        d|      | j                  t        d|      t        ||||dt        j
                         d{   t        ||||	ddi      t        	       d{   S 7 '7 w)
rS   rH   rI   rJ   r6   Nr;   Tr<   r>   )rN   rB   r   r   r   rT   r   r   rU   s
             r'   rV   zAsyncSpendAlerts.update  s     F VW_VbcddZZAHU, ( (,@(8	 *@@  )+'%.5 +%   
 
 	

s$   A
A8A4
"A8/A60A86A8rW   c                   | j                  dt        t           t        ||||t	        ||||dt
        j                        ddi      t              S r]   )ra   r   r   r   r   r   rb   rc   s	            r'   rd   zAsyncSpendAlerts.list  sp    J !!(,-CD(+'%%!&"(!&!&	 ,@@ /5  )' " 
 	
r)   c                  K   |st        d|      | j                  t        d|      t        ||||ddi      t               d{   S 7 w)	rf   rH   rI   rJ   r;   Tr<   rL   Nrg   rP   s         r'   ri   zAsyncSpendAlerts.delete  sl     . VW_Vbcdd\\AHU(+'%.5 2 " 

 

 
	
 

r   )rj   r   )rj   r   rk   rs   ru   )rX   rv   rY   rv   rZ   rw   r[   rx   r/   ro   r0   rp   r1   rq   r2   rr   rj   z[AsyncPaginator[OrganizationSpendAlert, AsyncConversationCursorPage[OrganizationSpendAlert]]ry   rz   r~   r)   r'   r    r    #  s&   5 5 ; ;" )-$("&<E5
 !5
 #	5

 L5
 5
 &5
 "5
  5
 :5
 
 5
z )-$("&<E#
#
 &#
 "#
  #
 :#
 
 #
^ )-$("&<E8
8
 !	8

 #8
 L8
 8
 &8
 "8
  8
 :8
 
 8
z !! /3 )-$("&<E9
 9
 	9

 9
 -9
 &9
 "9
  9
 :9
 
e9
B )-$("&<E#
#
 &#
 "#
  #
 :#
 
'#
r)   c                      e Zd ZddZy)r$   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y N)_spend_alertsr   to_raw_response_wrapperrE   rQ   rV   rd   ri   r&   spend_alertss     r'   __init__z#SpendAlertsWithRawResponse.__init__/  s    )&>>
 )@@!!
 '>>
 %<<
	 '>>
r)   Nr   r   rj   Noner{   r|   r}   r   r~   r)   r'   r$   r$   .      
r)   r$   c                      e Zd ZddZy)r   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y r   )r   r   async_to_raw_response_wrapperrE   rQ   rV   rd   ri   r   s     r'   r   z(AsyncSpendAlertsWithRawResponse.__init__D  s    )&DD
 )FF!!
 'DD
 %BB
	 'DD
r)   Nr   r    rj   r   r   r~   r)   r'   r   r   C  r   r)   r   c                      e Zd ZddZy)r,   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y r   )r   r   rE   rQ   rV   rd   ri   r   s     r'   r   z)SpendAlertsWithStreamingResponse.__init__Y  s{    )2
 5!!
 3
 1
	 3
r)   Nr   r   r~   r)   r'   r,   r,   X  r   r)   r,   c                      e Zd ZddZy)r   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y r   )r   r   rE   rQ   rV   rd   ri   r   s     r'   r   z.AsyncSpendAlertsWithStreamingResponse.__init__n  s{    )8
 ;!!
 9
 7
	 9
r)   Nr   r   r~   r)   r'   r   r   m  r   r)   r   )0
__future__r   typing_extensionsr   httpx2 r   _typesr   r   r	   r
   r   r   r   _utilsr   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.admin.organizationr   r   r   1types.admin.organization.organization_spend_alertr   9types.admin.organization.organization_spend_alert_deletedr   __all__r   r    r$   r   r,   r   r~   r)   r'   <module>r      s    # %  ! L L L L L ' ; Z R A v v X g,
-H
/ H
VH
' H
V
 
*
 
*
 
*
 
r)   