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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„ 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Ú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                	   @  óž   e Zd Zed2dd„ƒZed3dd„ƒZddded	œd4dd„Zddded	œd5dd „Zddded	œd6d"d#„Z	e
e
e
e
ddded$œd7d-d.„Zddded	œd8d0d1„ZdS )9r   ÚreturnÚSpendAlertsWithRawResponsec                 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'   ús/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/admin/organization/spend_alerts.pyÚwith_raw_response   ó   zSpendAlerts.with_raw_responseÚ SpendAlertsWithStreamingResponsec                 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#SpendAlerts.with_streaming_responseN©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚcurrencyúLiteral['USD']ÚintervalúLiteral['month']Únotification_channelú-spend_alert_create_params.NotificationChannelÚthreshold_amountÚintr0   úHeaders | Noner1   úQuery | Noner2   úBody | Noner3   ú(float | httpx2.Timeout | None | NotGivenr   c          	   
   C  s6   | j dt||||dœtjƒt||||ddid�td�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©r4   r6   r8   r:   Úadmin_api_key_authT©r0   r1   r2   r3   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚSpendAlertCreateParamsr   r   ©	r&   r4   r6   r8   r:   r0   r1   r2   r3   r'   r'   r(   Úcreate,   s&   "üù	ûîzSpendAlerts.createÚalert_idÚstrc             	   C  ó<   |s	t d|›�ƒ‚| jtd|d�t||||ddid�td�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}©rN   rC   TrD   ©rH   rI   ©Ú
ValueErrorÚ_getr   r   r   ©r&   rN   r0   r1   r2   r3   r'   r'   r(   Úretrievec   ó   
û÷zSpendAlerts.retrieveú-spend_alert_update_params.NotificationChannelc          
   
   C  sP   |s	t d|›�ƒ‚| jtd|d�t||||dœtjƒt||||	ddid�td�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
        rR   rS   rT   rB   rC   TrD   rF   )rW   rJ   r   r   r   ÚSpendAlertUpdateParamsr   r   ©
r&   rN   r4   r6   r8   r:   r0   r1   r2   r3   r'   r'   r(   Úupdateˆ   s*   #
üù	ûîzSpendAlerts.update©ÚafterÚbeforeÚlimitÚorderr0   r1   r2   r3   rb   ú
str | Omitrc   rd   ú
int | Omitre   úLiteral['asc', 'desc'] | Omitú2SyncConversationCursorPage[OrganizationSpendAlert]c          	      C  ó<   | j dtt t||||t||||dœtjƒddid�td�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
        rA   )rb   rc   rd   re   rC   T)r0   r1   r2   r3   ÚqueryrE   )ÚpagerH   Úmodel)Ú_get_api_listr   r   r   r   r   ÚSpendAlertListParams©	r&   rb   rc   rd   re   r0   r1   r2   r3   r'   r'   r(   ÚlistÂ   ó(   %üù	òízSpendAlerts.listr   c             	   C  rP   )á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
        rR   rS   rT   rC   TrD   rU   ©rW   Ú_deleter   r   r   rY   r'   r'   r(   Údeleteý   r[   zSpendAlerts.delete)r!   r"   )r!   r+   ©r4   r5   r6   r7   r8   r9   r:   r;   r0   r<   r1   r=   r2   r>   r3   r?   r!   r   ©rN   rO   r0   r<   r1   r=   r2   r>   r3   r?   r!   r   ©rN   rO   r4   r5   r6   r7   r8   r\   r:   r;   r0   r<   r1   r=   r2   r>   r3   r?   r!   r   )rb   rf   rc   rf   rd   rg   re   rh   r0   r<   r1   r=   r2   r>   r3   r?   r!   ri   ©rN   rO   r0   r<   r1   r=   r2   r>   r3   r?   r!   r   ©Ú__name__Ú
__module__Ú__qualname__r   r)   r-   r   rM   rZ   r`   r   rr   rw   r'   r'   r'   r(   r      óD    	ô=÷/ó=ôA÷c                	   @  r    )9r   r!   ÚAsyncSpendAlertsWithRawResponsec                 C  r#   r$   )r�   r%   r'   r'   r(   r)   $  r*   z"AsyncSpendAlerts.with_raw_responseÚ%AsyncSpendAlertsWithStreamingResponsec                 C  r#   r,   )r‚   r%   r'   r'   r(   r-   .  r.   z(AsyncSpendAlerts.with_streaming_responseNr/   r4   r5   r6   r7   r8   r9   r:   r;   r0   r<   r1   r=   r2   r>   r3   r?   r   c          	   
   Ã  sD   �| j dt||||dœtjƒI dH t||||ddid�td�I dH S )r@   rA   rB   NrC   TrD   rF   )rJ   r   r   rK   r   r   rL   r'   r'   r(   rM   7  s(   €"üù	ûîzAsyncSpendAlerts.createrN   rO   c             	   Ã  óD   �|s
t d|›�ƒ‚| jtd|d�t||||ddid�td�I dH S )	rQ   rR   rS   rT   rC   TrD   rU   NrV   rY   r'   r'   r(   rZ   n  ó   €
û÷zAsyncSpendAlerts.retriever\   c          
   
   Ã  s^   �|s
t d|›�ƒ‚| jtd|d�t||||dœtjƒI dH t||||	ddid�td	�I dH S )
r]   rR   rS   rT   rB   NrC   TrD   rF   )rW   rJ   r   r   r   r^   r   r   r_   r'   r'   r(   r`   “  s,   €#
üù	ûîzAsyncSpendAlerts.updatera   rb   rf   rc   rd   rg   re   rh   ú[AsyncPaginator[OrganizationSpendAlert, AsyncConversationCursorPage[OrganizationSpendAlert]]c          	      C  rj   rk   )ro   r   r   r   r   r   rp   rq   r'   r'   r(   rr   Í  rs   zAsyncSpendAlerts.listr   c             	   Ã  rƒ   )	rt   rR   rS   rT   rC   TrD   rU   Nru   rY   r'   r'   r(   rw     r„   zAsyncSpendAlerts.delete)r!   r�   )r!   r‚   rx   ry   rz   )rb   rf   rc   rf   rd   rg   re   rh   r0   r<   r1   r=   r2   r>   r3   r?   r!   r…   r{   r|   r'   r'   r'   r(   r   #  r€   c                   @  ó   e Zd Zddd„ZdS )	r"   Úspend_alertsr   r!   ÚNonec                 C  óP   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S ©N)Ú_spend_alertsr   Úto_raw_response_wrapperrM   rZ   r`   rr   rw   ©r&   r‡   r'   r'   r(   Ú__init__/  ó    ÿÿÿÿ
ÿz#SpendAlertsWithRawResponse.__init__N©r‡   r   r!   rˆ   ©r}   r~   r   rŽ   r'   r'   r'   r(   r"   .  ó    r"   c                   @  r†   )	r�   r‡   r   r!   rˆ   c                 C  r‰   rŠ   )r‹   r   Úasync_to_raw_response_wrapperrM   rZ   r`   rr   rw   r�   r'   r'   r(   rŽ   D  r�   z(AsyncSpendAlertsWithRawResponse.__init__N©r‡   r   r!   rˆ   r‘   r'   r'   r'   r(   r�   C  r’   r�   c                   @  r†   )	r+   r‡   r   r!   rˆ   c                 C  óF   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S rŠ   )r‹   r   rM   rZ   r`   rr   rw   r�   r'   r'   r(   rŽ   Y  ó    ÿÿÿÿ
ÿz)SpendAlertsWithStreamingResponse.__init__Nr�   r‘   r'   r'   r'   r(   r+   X  r’   r+   c                   @  r†   )	r‚   r‡   r   r!   rˆ   c                 C  r•   rŠ   )r‹   r   rM   rZ   r`   rr   rw   r�   r'   r'   r(   rŽ   n  r–   z.AsyncSpendAlertsWithStreamingResponse.__init__Nr”   r‘   r'   r'   r'   r(   r‚   m  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'   r(   Ú<module>   s2   $    