
    2Rjk                       d dl mZ 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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 m!Z!m"Z" ddl#m$Z$m%Z% ddl&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6 ddgZ7 G d de      Z8 G d de      Z9 G d d      Z: G d d      Z; G d d      Z< G d d      Z=y)     )annotations)List)LiteralN   )_legacy_response)BodyOmitQueryHeadersNotGivenSequenceNotStromit	not_given)path_templatemaybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncPage	AsyncPageSyncConversationCursorPageAsyncConversationCursorPage)AsyncPaginatormake_request_options)certificate_list_paramscertificate_create_paramscertificate_update_paramscertificate_activate_paramscertificate_retrieve_paramscertificate_deactivate_params)Certificate)CertificateListResponse)CertificateDeleteResponse)CertificateActivateResponse)CertificateDeactivateResponseCertificatesAsyncCertificatesc                  v   e Zd Zedd       Zedd       Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
eeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 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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
        )CertificatesWithRawResponseselfs    x/var/www/html/meridian/meridian-ai/venv/lib/python3.12/site-packages/openai/resources/admin/organization/certificates.pywith_raw_responsezCertificates.with_raw_response$   s     +400    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
        )!CertificatesWithStreamingResponser/   s    r1   with_streaming_responsez$Certificates.with_streaming_response.   s     166r3   Nnameextra_headersextra_query
extra_bodytimeoutc                   | j                  dt        ||dt        j                        t	        ||||ddi      t
              S )L  Upload a certificate to the organization.

        This does **not** automatically
        activate the certificate.

        Organizations can upload up to 50 certificates.

        Args:
          certificate: The certificate content in PEM format

          name: An optional name for the certificate

          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/certificatescertificater9   admin_api_key_authTr:   r;   r<   r=   securitybodyoptionscast_to)_postr   r   CertificateCreateParamsr   r$   r0   rB   r9   r:   r;   r<   r=   s          r1   createzCertificates.create7   s_    @ zz( #.  *AA )+'%.5  !  
 	
r3   includer:   r;   r<   r=   c                   |st        d|      | j                  t        d|      t        ||||t	        d|it
        j                        ddi      t              S )	v  
        Get a certificate that has been uploaded to the organization.

        You can get a certificate regardless of whether it is active or not.

        Args:
          include: A list of additional fields to include in the response. Currently the only
              supported value is `content` to fetch the PEM content of the certificate.

          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
        =Expected a non-empty value for `certificate_id` but received +/organization/certificates/{certificate_id}certificate_idrO   rC   Tr:   r;   r<   r=   queryrE   rH   rI   )
ValueError_getr   r   r   r"   CertificateRetrieveParamsr$   r0   rU   rO   r:   r;   r<   r=   s          r1   retrievezCertificates.retrievej   su    : \]k\noppyyGXfg(+'%%y'&:<W<q<qr.5    
 	
r3   c                   |st        d|      | j                  t        d|      t        d|it        j
                        t        ||||ddi      t              S )	  Modify a certificate.

        Note that only the name can be modified.

        Args:
          name: The updated name for the certificate

          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   r9   rC   TrD   rF   )rY   rJ   r   r   r    CertificateUpdateParamsr   r$   r0   rU   r9   r:   r;   r<   r=   s          r1   updatezCertificates.update   st    6 \]k\noppzzGXfg &$1J1b1bc(+'%.5    
 	
r3   afterlimitorderr:   r;   r<   r=   c                   | j                  dt        t           t        ||||t	        |||dt
        j                        ddi      t              S a  
        List uploaded certificates for this organization.

        Args:
          after: A cursor for use in pagination. `after` is an object ID that defines your place
              in the list. For instance, if you make a list request and receive 100 objects,
              ending with obj_foo, your subsequent call can include after=obj_foo in order to
              fetch the next page of the list.

          limit: A limit on the number of objects to be returned. Limit can range between 1 and
              100, and the default is 20.

          order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending
              order and `desc` for descending order.

          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
        r@   )rd   re   rf   rC   TrV   )pagerH   model)_get_api_listr   r%   r   r   r   CertificateListParamsr0   rd   re   rf   r:   r;   r<   r=   s           r1   listzCertificates.list   sm    H !!(+,CD(+'%%!&!&!&
 ,AA /5 *% " 
 	
r3   r:   r;   r<   r=   c                   |st        d|      | j                  t        d|      t        ||||ddi      t              S )  
        Delete a certificate from the organization.

        The certificate must be inactive for the organization and all projects.

        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   rX   rY   _deleter   r   r&   r0   rU   r:   r;   r<   r=   s         r1   deletezCertificates.delete   s_    2 \]k\nopp||GXfg(+'%.5 .  

 
	
r3   c                   | j                  dt        t           t        d|it        j
                        t        ||||ddi      t        d      S a  
        Activate certificates at the organization level.

        You can atomically and idempotently activate up to 10 certificates at a time.

        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
        z#/organization/certificates/activatecertificate_idsrC   TrD   postri   rG   rH   rj   method)rk   r   r'   r   r!   CertificateActivateParamsr   r0   rx   r:   r;   r<   r=   s         r1   activatezCertificates.activate   sg    2 !!156 "O46Q6k6k )+'%.5 . " 
 	
r3   c                   | j                  dt        t           t        d|it        j
                        t        ||||ddi      t        d      S a  
        Deactivate certificates at the organization level.

        You can atomically and idempotently deactivate up to 10 certificates at a time.

        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
        z%/organization/certificates/deactivaterx   rC   TrD   ry   rz   )rk   r   r(   r   r#   CertificateDeactivateParamsr   r}   s         r1   
deactivatezCertificates.deactivateJ  sg    2 !!378 "O46S6o6o )+'%.5 0 " 
 	
r3   )returnr.   )r   r6   rB   strr9   
str | Omitr:   Headers | Noner;   Query | Noner<   Body | Noner=   'float | httpx.Timeout | None | NotGivenr   r$   rU   r   rO   zList[Literal['content']] | Omitr:   r   r;   r   r<   r   r=   r   r   r$   rU   r   r9   r   r:   r   r;   r   r<   r   r=   r   r   r$   )rd   r   re   
int | Omitrf   Literal['asc', 'desc'] | Omitr:   r   r;   r   r<   r   r=   r   r   z3SyncConversationCursorPage[CertificateListResponse]rU   r   r:   r   r;   r   r<   r   r=   r   r   r&   )rx   SequenceNotStr[str]r:   r   r;   r   r<   r   r=   r   r   z%SyncPage[CertificateActivateResponse])rx   r   r:   r   r;   r   r<   r   r=   r   r   z'SyncPage[CertificateDeactivateResponse]__name__
__module____qualname__r   r2   r7   r   r   rM   r]   rb   rn   ru   r~   r    r3   r1   r)   r)   #   s   1 1 7 7   )-$("&;D1
 1
 	1
 &1
 "1
  1
 91
 
1
n 48 )-$("&;D*
*
 1	*
 &*
 "*
  *
 9*
 
*
`   )-$("&;D(
(
 	(
 &(
 "(
  (
 9(
 
(
Z ! /3 )-$("&;D7
 7
 	7

 -7
 &7
 "7
  7
 97
 
=7
~ )-$("&;D%
%
 &%
 "%
  %
 9%
 
#%
Z )-$("&;D(
 -(
 &(
 "(
  (
 9(
 
/(
` )-$("&;D(
 -(
 &(
 "(
  (
 9(
 
1(
r3   c                  v   e Zd Zedd       Zedd       Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
eeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 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y)r*   c                    t        |       S r-   ) AsyncCertificatesWithRawResponser/   s    r1   r2   z#AsyncCertificates.with_raw_responsev  s     055r3   c                    t        |       S r5   )&AsyncCertificatesWithStreamingResponser/   s    r1   r7   z)AsyncCertificates.with_streaming_response  s     6d;;r3   Nr8   c                  K   | j                  dt        ||dt        j                         d{   t	        ||||ddi      t
               d{   S 7 '7 w)r?   r@   rA   NrC   TrD   rF   )rJ   r   r   rK   r   r$   rL   s          r1   rM   zAsyncCertificates.create  sx     @ ZZ(,#.  *AA  )+'%.5  !   
 
 	

s!   -AA
"AAAArN   c                  K   |st        d|      | j                  t        d|      t        ||||t	        d|it
        j                         d{   ddi      t        	       d{   S 7 7 w)
rQ   rR   rS   rT   rO   NrC   TrV   rX   )rY   rZ   r   r   r   r"   r[   r$   r\   s          r1   r]   zAsyncCertificates.retrieve  s     : \]k\noppYYGXfg(+'%1(*E*_*_  /5	    
 
 	

s$   AA5A1A5,A3-A53A5c                  K   |st        d|      | j                  t        d|      t        d|it        j
                         d{   t        ||||ddi      t        	       d{   S 7 '7 w)
r_   rR   rS   rT   r9   NrC   TrD   rF   )rY   rJ   r   r   r    r`   r   r$   ra   s          r1   rb   zAsyncCertificates.update  s     6 \]k\noppZZGXfg,fd^=V=n=noo(+'%.5     
 
 	
o
s$   AA5	A1

"A5,A3-A53A5rc   c                   | j                  dt        t           t        ||||t	        |||dt
        j                        ddi      t              S rh   )rk   r   r%   r   r   r   rl   rm   s           r1   rn   zAsyncCertificates.list  sm    H !!(,-DE(+'%%!&!&!&
 ,AA /5 *% " 
 	
r3   ro   c                  K   |st        d|      | j                  t        d|      t        ||||ddi      t               d{   S 7 w)	rq   rR   rS   rT   rC   TrD   rX   Nrr   rt   s         r1   ru   zAsyncCertificates.deleteM  sm     2 \]k\nopp\\GXfg(+'%.5 . " 

 

 
	
 

s   AA	A
Ac                   | j                  dt        t           t        d|it        j
                        t        ||||ddi      t        d      S rw   )rk   r   r'   r   r!   r|   r   r}   s         r1   r~   zAsyncCertificates.activatet  sg    2 !!167 "O46Q6k6k )+'%.5 . " 
 	
r3   c                   | j                  dt        t           t        d|it        j
                        t        ||||ddi      t        d      S r   )rk   r   r(   r   r#   r   r   r}   s         r1   r   zAsyncCertificates.deactivate  sg    2 !!389 "O46S6o6o )+'%.5 0 " 
 	
r3   )r   r   )r   r   r   r   r   )rd   r   re   r   rf   r   r:   r   r;   r   r<   r   r=   r   r   z]AsyncPaginator[CertificateListResponse, AsyncConversationCursorPage[CertificateListResponse]]r   )rx   r   r:   r   r;   r   r<   r   r=   r   r   zSAsyncPaginator[CertificateActivateResponse, AsyncPage[CertificateActivateResponse]])rx   r   r:   r   r;   r   r<   r   r=   r   r   zWAsyncPaginator[CertificateDeactivateResponse, AsyncPage[CertificateDeactivateResponse]]r   r   r3   r1   r*   r*   u  s   6 6 < <   )-$("&;D1
 1
 	1
 &1
 "1
  1
 91
 
1
n 48 )-$("&;D,
,
 1	,
 &,
 ",
  ,
 9,
 
,
d   )-$("&;D(
(
 	(
 &(
 "(
  (
 9(
 
(
Z ! /3 )-$("&;D7
 7
 	7

 -7
 &7
 "7
  7
 97
 
g7
~ )-$("&;D%
%
 &%
 "%
  %
 9%
 
#%
Z )-$("&;D(
 -(
 &(
 "(
  (
 9(
 
](
` )-$("&;D(
 -(
 &(
 "(
  (
 9(
 
a(
r3   c                      e Zd ZddZy)r.   c                
   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j                        | _	        y N)
_certificatesr   to_raw_response_wrapperrM   r]   rb   rn   ru   r~   r   r0   certificatess     r1   __init__z$CertificatesWithRawResponse.__init__  s    )&>>
 )@@!!
 '>>
 %<<
	 '>>
 )@@!!
 +BB##
r3   Nr   r)   r   Noner   r   r   r   r   r3   r1   r.   r.         
r3   r.   c                      e Zd ZddZy)r   c                
   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j                        | _	        y r   )
r   r   async_to_raw_response_wrapperrM   r]   rb   rn   ru   r~   r   r   s     r1   r   z)AsyncCertificatesWithRawResponse.__init__  s    )&DD
 )FF!!
 'DD
 %BB
	 'DD
 )FF!!
 +HH##
r3   Nr   r*   r   r   r   r   r3   r1   r   r     r   r3   r   c                      e Zd ZddZy)r6   c                ~   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        t        |j                        | _        y r   )	r   r   rM   r]   rb   rn   ru   r~   r   r   s     r1   r   z*CertificatesWithStreamingResponse.__init__   s    )2
 5!!
 3
 1
	 3
 5!!
 7##
r3   Nr   r   r   r3   r1   r6   r6     r   r3   r6   c                      e Zd ZddZy)r   c                ~   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        t        |j                        | _        y r   )	r   r   rM   r]   rb   rn   ru   r~   r   r   s     r1   r   z/AsyncCertificatesWithStreamingResponse.__init__  s    )8
 ;!!
 9
 7
	 9
 ;!!
 =##
r3   Nr   r   r   r3   r1   r   r     r   r3   r   )>
__future__r   typingr   typing_extensionsr   httpx r   _typesr   r	   r
   r   r   r   r   r   _utilsr   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   r   r   _base_clientr   r   types.admin.organizationr   r   r    r!   r"   r#   $types.admin.organization.certificater$   2types.admin.organization.certificate_list_responser%   4types.admin.organization.certificate_delete_responser&   6types.admin.organization.certificate_activate_responser'   8types.admin.organization.certificate_deactivate_responser(   __all__r)   r*   r.   r   r6   r   r   r3   r1   <module>r      s    #  %  ! \ \ \ L L ' ; Z g g A  A Z ^ b f.
/O
? O
d
Q
( Q
h

 
6
 
6
 
6
 
r3   