a
    !f36                     @   s   d Z ddl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 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Union)deserializevalues)InstanceContext)InstanceResource)ListResource)Versionc                       s  e Zd ZdZdeeeef ee d fddZ	e
dddd	Zd dd
dZd dddZejejejejfeeef eeef eeef eeef d dddZejejejejfeeef eeef eeef eeef d dddZedddZ  ZS )DomainConfigInstancea  
    :ivar domain_sid: The unique string that we created to identify the Domain resource.
    :ivar config_sid: The unique string that we created to identify the Domain config (prefix ZK).
    :ivar fallback_url: Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping.
    :ivar callback_url: URL to receive click events to your webhook whenever the recipients click on the shortened links.
    :ivar continue_on_failure: Boolean field to set customer delivery preference when there is a failure in linkShortening service
    :ivar date_created: Date this Domain Config was created.
    :ivar date_updated: Date that this Domain Config was last updated.
    :ivar url:
    :ivar disable_https: Customer's choice to send links with/without "https://" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified.
    N)versionpayload
domain_sidc                    s   t  | |d| _|d| _|d| _|d| _|d| _t	|d| _
t	|d| _|d| _|d	| _d|p| ji| _d | _d S )
Nr   
config_sidfallback_urlcallback_urlcontinue_on_failuredate_createddate_updatedurldisable_https)super__init__getr   r   r   r   r   r   iso8601_datetimer   r   r   r   	_solution_context)selfr   r   r   	__class__ g/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/messaging/v1/domain_config.pyr   '   s"    
zDomainConfigInstance.__init__DomainConfigContextreturnc                 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: DomainConfigContext for this DomainConfigInstance
        Nr   r   )r   r$   _versionr   r   r"   r"   r#   _proxyB   s    
zDomainConfigInstance._proxyc                 C   s
   | j  S )e
        Fetch the DomainConfigInstance


        :returns: The fetched DomainConfigInstance
        )r*   fetchr)   r"   r"   r#   r,   Q   s    zDomainConfigInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the DomainConfigInstance


        :returns: The fetched DomainConfigInstance
        N)r*   fetch_asyncr)   r"   r"   r#   r.   Z   s    z DomainConfigInstance.fetch_asyncr   r   r   r   r&   c                 C   s   | j j||||dS )  
        Update the DomainConfigInstance

        :param fallback_url: Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping.
        :param callback_url: URL to receive click events to your webhook whenever the recipients click on the shortened links
        :param continue_on_failure: Boolean field to set customer delivery preference when there is a failure in linkShortening service
        :param disable_https: Customer's choice to send links with/without \"https://\" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified.

        :returns: The updated DomainConfigInstance
        r   r   r   r   )r*   updater   r   r   r   r   r"   r"   r#   r2   c   s    zDomainConfigInstance.updatec                    s   | j j||||dI dH S )  
        Asynchronous coroutine to update the DomainConfigInstance

        :param fallback_url: Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping.
        :param callback_url: URL to receive click events to your webhook whenever the recipients click on the shortened links
        :param continue_on_failure: Boolean field to set customer delivery preference when there is a failure in linkShortening service
        :param disable_https: Customer's choice to send links with/without \"https://\" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified.

        :returns: The updated DomainConfigInstance
        r1   N)r*   update_asyncr3   r"   r"   r#   r5   {   s    z!DomainConfigInstance.update_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr"   r"   r#   	<genexpr>       z0DomainConfigInstance.__repr__.<locals>.<genexpr>z-<Twilio.Messaging.V1.DomainConfigInstance {}>joinr   itemsr:   r   contextr"   r"   r#   __repr__   s    zDomainConfigInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr*   r,   r.   r   unsetr   objectboolr2   r5   rF   __classcell__r"   r"   r    r#   r      sD    
	







r   c                       s   e Zd Zeed fddZedddZedddZe	j
e	j
e	j
e	j
feeef eeef eeef eeef ed	d
dZe	j
e	j
e	j
e	j
feeef eeef eeef eeef ed	ddZedddZ  ZS )r$   )r   r   c                    s.   t  | d|i| _djf i | j| _dS )z
        Initialize the DomainConfigContext

        :param version: Version that contains the resource
        :param domain_sid: Unique string used to identify the domain that this config should be associated with.
        r   z+/LinkShortening/Domains/{domain_sid}/ConfigN)r   r   r   r:   _uri)r   r   r   r    r"   r#   r      s    zDomainConfigContext.__init__r%   c                 C   s(   | j jd| jd}t| j || jd dS )r+   GETmethodurir   r'   )r(   r,   rQ   r   r   r   r   r"   r"   r#   r,      s    zDomainConfigContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )r-   rR   rS   Nr   r'   )r(   r.   rQ   r   r   rV   r"   r"   r#   r.      s    zDomainConfigContext.fetch_asyncr/   c                 C   s>   t ||||d}| jjd| j|d}t| j|| jd dS )r0   ZFallbackUrlZCallbackUrlZContinueOnFailureZDisableHttpsPOSTrT   rU   datar   r'   )r   ofr(   r2   rQ   r   r   r   r   r   r   r   rZ   r   r"   r"   r#   r2      s    	zDomainConfigContext.updatec                    sD   t ||||d}| jjd| j|dI dH }t| j|| jd dS )r4   rW   rX   rY   Nr   r'   )r   r[   r(   r5   rQ   r   r   r\   r"   r"   r#   r5      s    	z DomainConfigContext.update_asyncc                 C   s$   d dd | j D }d|S )r6   r7   c                 s   s   | ]\}}d  ||V  qdS r8   r9   r;   r"   r"   r#   r?   #  r@   z/DomainConfigContext.__repr__.<locals>.<genexpr>z,<Twilio.Messaging.V1.DomainConfigContext {}>rA   rD   r"   r"   r#   rF     s    zDomainConfigContext.__repr__)rG   rH   rI   r   rK   r   r   r,   r.   r   rM   r   rN   rO   r2   r5   rF   rP   r"   r"   r    r#   r$      s4   



&



$r$   c                       sP   e Zd Zed fddZeedddZeedddZed	d
dZ	  Z
S )DomainConfigList)r   c                    s   t  | dS )zn
        Initialize the DomainConfigList

        :param version: Version that contains the resource

        N)r   r   )r   r   r    r"   r#   r   (  s    zDomainConfigList.__init__)r   r&   c                 C   s   t | j|dS z
        Constructs a DomainConfigContext

        :param domain_sid: Unique string used to identify the domain that this config should be associated with.
        r'   r$   r(   r   r   r"   r"   r#   r   1  s    zDomainConfigList.getc                 C   s   t | j|dS r^   r_   r`   r"   r"   r#   __call__9  s    zDomainConfigList.__call__r%   c                 C   s   dS )r6   z&<Twilio.Messaging.V1.DomainConfigList>r"   r)   r"   r"   r#   rF   A  s    zDomainConfigList.__repr__)rG   rH   rI   r   r   rK   r$   r   ra   rF   rP   r"   r"   r    r#   r]   '  s   	r]   N)rJ   r   typingr   r   r   r   Ztwilio.baser   r   Ztwilio.base.instance_contextr	   Ztwilio.base.instance_resourcer
   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   r   r$   r]   r"   r"   r"   r#   <module>   s     