o
    ùT·jy  ã                   @  sˆ  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Z7G dd„ deƒZ8G dd„ deƒZ9G dd„ dƒZ:G dd„ dƒZ;G dd„ dƒZ<G dd„ dƒZ=dS ) é    )Ú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                   @  óÎ   e Zd Zed6dd„ƒZed7dd„ƒZeddded	œd8dd„Zedddedœd9dd„Z	eddded	œd:dd „Z
eeeddded!œd;d(d)„Zddded*œd<d,d-„Zddded*œd=d1d2„Zddded*œd>d4d5„ZdS )?r(   ÚreturnÚCertificatesWithRawResponsec                 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© r1   ús/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/admin/organization/certificates.pyÚwith_raw_response$   ó   zCertificates.with_raw_responseÚ!CertificatesWithStreamingResponsec                 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
        )r5   r/   r1   r1   r2   Úwith_streaming_response.   ó   z$Certificates.with_streaming_responseN©ÚnameÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚcertificateÚstrr:   ú
str | Omitr;   úHeaders | Noner<   úQuery | Noner=   úBody | Noner>   ú(float | httpx2.Timeout | None | NotGivenr#   c             
   C  s2   | j dt||dœtjƒt||||ddid�td�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©r?   r:   Úadmin_api_key_authT©r;   r<   r=   r>   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚCertificateCreateParamsr   r#   ©r0   r?   r:   r;   r<   r=   r>   r1   r1   r2   Úcreate7   s"    þûûðzCertificates.create©Úincluder;   r<   r=   r>   Úcertificate_idrU   úList[Literal['content']] | Omitc             
   C  sJ   |s	t d|›�ƒ‚| jtd|d�t||||td|itjƒddid�td�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}©rV   rU   rI   T©r;   r<   r=   r>   ÚqueryrK   ©rN   rO   )Ú
ValueErrorÚ_getr   r   r   r!   ÚCertificateRetrieveParamsr#   ©r0   rV   rU   r;   r<   r=   r>   r1   r1   r2   Úretrievej   s   
úözCertificates.retrievec             
   C  sJ   |s	t d|›�ƒ‚| jtd|d�td|itjƒt||||ddid�td�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
        rY   rZ   r[   r:   rI   TrJ   rL   )r_   rP   r   r   r   ÚCertificateUpdateParamsr   r#   ©r0   rV   r:   r;   r<   r=   r>   r1   r1   r2   Úupdate–   s   
ûözCertificates.update©ÚafterÚlimitÚorderr;   r<   r=   r>   ri   rj   ú
int | Omitrk   úLiteral['asc', 'desc'] | Omitú3SyncConversationCursorPage[CertificateListResponse]c                C  ó:   | j dtt t||||t|||dœtjƒddid�td�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
        rG   )ri   rj   rk   rI   Tr\   )ÚpagerN   Úmodel)Ú_get_api_listr   r$   r   r   r   ÚCertificateListParams©r0   ri   rj   rk   r;   r<   r=   r>   r1   r1   r2   ÚlistÀ   ó&   $ýúóîzCertificates.list©r;   r<   r=   r>   r%   c             	   C  s<   |s	t d|›�ƒ‚| jtd|d�t||||ddid�td�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
        rY   rZ   r[   rI   TrJ   r^   ©r_   Ú_deleter   r   r%   ©r0   rV   r;   r<   r=   r>   r1   r1   r2   Údeleteù   s   
û÷zCertificates.deleteÚcertificate_idsúSequenceNotStr[str]ú%SyncPage[CertificateActivateResponse]c                C  ó8   | j dtt td|itjƒt||||ddid�td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/activater~   rI   TrJ   Úpost©rq   rM   rN   rr   Úmethod)rs   r   r&   r   r    ÚCertificateActivateParamsr   ©r0   r~   r;   r<   r=   r>   r1   r1   r2   Úactivate   ó    
ÿûòzCertificates.activateú'SyncPage[CertificateDeactivateResponse]c                C  r�   ©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/deactivater~   rI   TrJ   rƒ   r„   )rs   r   r'   r   r"   ÚCertificateDeactivateParamsr   r‡   r1   r1   r2   Ú
deactivateJ  r‰   zCertificates.deactivate)r+   r,   )r+   r5   ©r?   r@   r:   rA   r;   rB   r<   rC   r=   rD   r>   rE   r+   r#   ©rV   r@   rU   rW   r;   rB   r<   rC   r=   rD   r>   rE   r+   r#   ©rV   r@   r:   rA   r;   rB   r<   rC   r=   rD   r>   rE   r+   r#   )ri   rA   rj   rl   rk   rm   r;   rB   r<   rC   r=   rD   r>   rE   r+   rn   ©rV   r@   r;   rB   r<   rC   r=   rD   r>   rE   r+   r%   )r~   r   r;   rB   r<   rC   r=   rD   r>   rE   r+   r€   )r~   r   r;   rB   r<   rC   r=   rD   r>   rE   r+   rŠ   ©Ú__name__Ú
__module__Ú__qualname__r   r3   r7   r   r   rS   rc   rg   rv   r}   rˆ   r�   r1   r1   r1   r2   r(   #   s\    	ö7ö0ö-õ?÷-÷0÷c                   @  r*   )?r)   r+   Ú AsyncCertificatesWithRawResponsec                 C  r-   r.   )r–   r/   r1   r1   r2   r3   v  r4   z#AsyncCertificates.with_raw_responseÚ&AsyncCertificatesWithStreamingResponsec                 C  r-   r6   )r—   r/   r1   r1   r2   r7   €  r8   z)AsyncCertificates.with_streaming_responseNr9   r?   r@   r:   rA   r;   rB   r<   rC   r=   rD   r>   rE   r#   c             
   Ã  s@   �| j dt||dœtjƒI dH t||||ddid�td�I dH S )rF   rG   rH   NrI   TrJ   rL   )rP   r   r   rQ   r   r#   rR   r1   r1   r2   rS   ‰  s$   € þûûðzAsyncCertificates.createrT   rV   rU   rW   c             
   Ã  sX   �|s
t d|›�ƒ‚| jtd|d�t||||td|itjƒI dH ddid�td	�I dH S )
rX   rY   rZ   r[   rU   NrI   Tr\   r^   )r_   r`   r   r   r   r!   ra   r#   rb   r1   r1   r2   rc   ¼  s"   €

ÿø
ôzAsyncCertificates.retrievec             
   Ã  sX   �|s
t d|›�ƒ‚| jtd|d�td|itjƒI dH t||||ddid�td	�I dH S )
rd   rY   rZ   r[   r:   NrI   TrJ   rL   )r_   rP   r   r   r   re   r   r#   rf   r1   r1   r2   rg   ê  s   €
ûözAsyncCertificates.updaterh   ri   rj   rl   rk   rm   ú]AsyncPaginator[CertificateListResponse, AsyncConversationCursorPage[CertificateListResponse]]c                C  ro   rp   )rs   r   r$   r   r   r   rt   ru   r1   r1   r2   rv     rw   zAsyncCertificates.listrx   r%   c             	   Ã  sD   �|s
t d|›�ƒ‚| jtd|d�t||||ddid�td�I dH S )	ry   rY   rZ   r[   rI   TrJ   r^   Nrz   r|   r1   r1   r2   r}   M  s   €
û÷zAsyncCertificates.deleter~   r   úSAsyncPaginator[CertificateActivateResponse, AsyncPage[CertificateActivateResponse]]c                C  r�   r‚   )rs   r   r&   r   r    r†   r   r‡   r1   r1   r2   rˆ   t  r‰   zAsyncCertificates.activateúWAsyncPaginator[CertificateDeactivateResponse, AsyncPage[CertificateDeactivateResponse]]c                C  r�   r‹   )rs   r   r'   r   r"   rŒ   r   r‡   r1   r1   r2   r�   ž  r‰   zAsyncCertificates.deactivate)r+   r–   )r+   r—   rŽ   r�   r�   )ri   rA   rj   rl   rk   rm   r;   rB   r<   rC   r=   rD   r>   rE   r+   r˜   r‘   )r~   r   r;   rB   r<   rC   r=   rD   r>   rE   r+   r™   )r~   r   r;   rB   r<   rC   r=   rD   r>   rE   r+   rš   r’   r1   r1   r1   r2   r)   u  s\    	ö7ö2ö-õ?÷-÷0÷c                   @  ó   e Zd Zddd„ZdS )	r,   Úcertificatesr(   r+   ÚNonec                 C  ól   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j	¡| _	d S ©N)
Ú_certificatesr   Úto_raw_response_wrapperrS   rc   rg   rv   r}   rˆ   r�   ©r0   rœ   r1   r1   r2   Ú__init__Ê  ó,   ÿÿÿÿÿÿ
ÿz$CertificatesWithRawResponse.__init__N©rœ   r(   r+   r�   ©r“   r”   r•   r£   r1   r1   r1   r2   r,   É  ó    r,   c                   @  r›   )	r–   rœ   r)   r+   r�   c                 C  rž   rŸ   )
r    r   Úasync_to_raw_response_wrapperrS   rc   rg   rv   r}   rˆ   r�   r¢   r1   r1   r2   r£   å  r¤   z)AsyncCertificatesWithRawResponse.__init__N©rœ   r)   r+   r�   r¦   r1   r1   r1   r2   r–   ä  r§   r–   c                   @  r›   )	r5   rœ   r(   r+   r�   c                 C  ó^   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S rŸ   )	r    r   rS   rc   rg   rv   r}   rˆ   r�   r¢   r1   r1   r2   r£      ó,   ÿÿÿÿÿÿ
ÿz*CertificatesWithStreamingResponse.__init__Nr¥   r¦   r1   r1   r1   r2   r5   ÿ  r§   r5   c                   @  r›   )	r—   rœ   r)   r+   r�   c                 C  rª   rŸ   )	r    r   rS   rc   rg   rv   r}   rˆ   r�   r¢   r1   r1   r2   r£     r«   z/AsyncCertificatesWithStreamingResponse.__init__Nr©   r¦   r1   r1   r1   r2   r—     r§   r—   )>Ú
__future__r   Útypingr   Útyping_extensionsr   Úhttpx2Ú 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–   r5   r—   r1   r1   r1   r2   Ú<module>   s:   (   T  V