o
    f>h*                     @   s   d Z ddlmZ ddlmZ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 G d	d
 d
eZG dd de
ZG dd deZdS )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Messaging
    This is the public Twilio REST API.

    NOTE: This class is auto generated by OpenAPI Generator.
    https://openapi-generator.tech
    Do not edit the class manually.
    )datetime)AnyDictOptional)deserializevalues)InstanceContext)InstanceResource)ListResource)Versionc                       s   e Zd ZdZ	ddedeeef dee f fddZ	e
dd
dZdefddZdefddZdddZdddZdedd fddZdedd fddZdefddZ  ZS )DomainCertsInstancea  
    :ivar domain_sid: The unique string that we created to identify the Domain resource.
    :ivar date_updated: Date that this Domain was last updated.
    :ivar date_expires: Date that the private certificate associated with this domain expires. You will need to update the certificate before that date to ensure your shortened links will continue to work.
    :ivar date_created: Date that this Domain was registered to the Twilio platform to create a new Domain object.
    :ivar domain_name: Full url path for this domain.
    :ivar certificate_sid: The unique string that we created to identify this Certificate resource.
    :ivar url:
    :ivar cert_in_validation: Optional JSON field describing the status and upload date of a new certificate in the process of validation
    Nversionpayload
domain_sidc                    s   t  | |d| _t|d| _t|d| _t|d| _|d| _	|d| _
|d| _|d| _d|pD| ji| _d | _d S )	Nr   date_updateddate_expiresdate_createddomain_namecertificate_sidurlcert_in_validation)super__init__getr   r   iso8601_datetimer   r   r   r   r   r   r   	_solution_context)selfr   r   r   	__class__ X/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/messaging/v1/domain_certs.pyr   $   s(   

zDomainCertsInstance.__init__returnDomainCertsContextc                 C   s&   | j du rt| j| jd d| _ | j S )z
        Generate an instance context for the instance, the context is capable of
        performing various actions. All instance actions are proxied to the context

        :returns: DomainCertsContext for this DomainCertsInstance
        Nr   r   )r   r#   _versionr   r   r    r    r!   _proxyB   s   
zDomainCertsInstance._proxyc                 C   
   | j  S )n
        Deletes the DomainCertsInstance


        :returns: True if delete succeeds, False otherwise
        )r'   deleter&   r    r    r!   r*   Q      
zDomainCertsInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the DomainCertsInstance


        :returns: True if delete succeeds, False otherwise
        N)r'   delete_asyncr&   r    r    r!   r.   Z      z DomainCertsInstance.delete_asyncc                 C   r(   )c
        Fetch the DomainCertsInstance


        :returns: The fetched DomainCertsInstance
        )r'   fetchr&   r    r    r!   r1   c   r+   zDomainCertsInstance.fetchc                    r,   )}
        Asynchronous coroutine to fetch the DomainCertsInstance


        :returns: The fetched DomainCertsInstance
        N)r'   fetch_asyncr&   r    r    r!   r3   l   r/   zDomainCertsInstance.fetch_asynctls_certc                 C   s   | j j|dS )J  
        Update the DomainCertsInstance

        :param tls_cert: Contains the full TLS certificate and private for this domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail. Twilio uses this information to process HTTPS traffic sent to your domain.

        :returns: The updated DomainCertsInstance
        r4   )r'   updater   r4   r    r    r!   r7   u   s   zDomainCertsInstance.updatec                    s   | j j|dI dH S )d  
        Asynchronous coroutine to update the DomainCertsInstance

        :param tls_cert: Contains the full TLS certificate and private for this domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail. Twilio uses this information to process HTTPS traffic sent to your domain.

        :returns: The updated DomainCertsInstance
        r6   N)r'   update_asyncr8   r    r    r!   r:      s   z DomainCertsInstance.update_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr    r    r!   	<genexpr>       z/DomainCertsInstance.__repr__.<locals>.<genexpr>z,<Twilio.Messaging.V1.DomainCertsInstance {}>joinr   itemsrA   r   contextr    r    r!   __repr__      
zDomainCertsInstance.__repr__)N)r"   r#   )r"   r   )__name__
__module____qualname____doc__r   r   strr   r   r   propertyr'   boolr*   r.   r1   r3   r7   r:   rM   __classcell__r    r    r   r!   r      s&    
	
	
		r   c                       s   e Zd Zdedef fddZdefddZdefdd	Zde	fd
dZ
de	fddZdede	fddZdede	fddZdefddZ  ZS )r#   r   r   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the DomainCertsContext

        :param version: Version that contains the resource
        :param domain_sid: Unique string used to identify the domain that this certificate should be associated with.
        r   z0/LinkShortening/Domains/{domain_sid}/CertificateNr    )r   r   r   rA   _uri)r   r   r   r   r    r!   r      s   zDomainCertsContext.__init__r"   c                 C   s   t i }| jjd| j|dS )r)   DELETEmethoduriheaders)r   ofr%   r*   rW   r   r\   r    r    r!   r*      s   
zDomainCertsContext.deletec                    s&   t i }| jjd| j|dI dH S )r-   rX   rY   N)r   r]   r%   r.   rW   r^   r    r    r!   r.      s
   
zDomainCertsContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r0   application/jsonAcceptGETrY   r   r$   )r   r]   r%   r1   rW   r   r   r   r\   r   r    r    r!   r1      s   
zDomainCertsContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r2   r_   r`   ra   rY   Nr   r$   )r   r]   r%   r3   rW   r   r   rb   r    r    r!   r3      s   
zDomainCertsContext.fetch_asyncr4   c                 C   sT   t d|i}t i }d|d< d|d< | jjd| j||d}t| j|| jd d	S )
r5   TlsCert!application/x-www-form-urlencodedContent-Typer_   r`   POSTrZ   r[   datar\   r   r$   )r   r]   r%   r7   rW   r   r   r   r4   rh   r\   r   r    r    r!   r7      s   	

zDomainCertsContext.updatec                    s\   t d|i}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )r9   rc   rd   re   r_   r`   rf   rg   Nr   r$   )r   r]   r%   r:   rW   r   r   ri   r    r    r!   r:   
  s   	

zDomainCertsContext.update_asyncc                 C   r;   )r<   r=   c                 s   r>   r?   r@   rB   r    r    r!   rF   ,  rG   z.DomainCertsContext.__repr__.<locals>.<genexpr>z+<Twilio.Messaging.V1.DomainCertsContext {}>rH   rK   r    r    r!   rM   &  rN   zDomainCertsContext.__repr__)rO   rP   rQ   r   rS   r   rU   r*   r.   r   r1   r3   r7   r:   rM   rV   r    r    r   r!   r#      s    r#   c                       sT   e Zd Zdef fddZdedefddZdedefdd	Zdefd
dZ	  Z
S )DomainCertsListr   c                    s   t  | dS )zm
        Initialize the DomainCertsList

        :param version: Version that contains the resource

        N)r   r   )r   r   r   r    r!   r   2  s   zDomainCertsList.__init__r   r"   c                 C      t | j|dS z
        Constructs a DomainCertsContext

        :param domain_sid: Unique string used to identify the domain that this certificate should be associated with.
        r$   r#   r%   r   r   r    r    r!   r   ;     zDomainCertsList.getc                 C   rk   rl   rm   rn   r    r    r!   __call__C  ro   zDomainCertsList.__call__c                 C   s   dS )r<   z%<Twilio.Messaging.V1.DomainCertsList>r    r&   r    r    r!   rM   K  s   zDomainCertsList.__repr__)rO   rP   rQ   r   r   rS   r#   r   rp   rM   rV   r    r    r   r!   rj   0  s
    	rj   N)rR   r   typingr   r   r   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer	   twilio.base.list_resourcer
   twilio.base.versionr   r   r#   rj   r    r    r    r!   <module>   s     