a
    !f-                     @   s   d Z ddlmZmZmZmZmZmZmZ ddl	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 - Verify
    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.
    )AnyDictListOptionalUnionIteratorAsyncIterator)values)InstanceResource)ListResource)Version)Pagec                       s>   e Zd ZdZeeeef d fddZedddZ	  Z
S )TemplateInstanceai  
    :ivar sid: A 34 character string that uniquely identifies a Verification Template.
    :ivar account_sid: The unique SID identifier of the Account.
    :ivar friendly_name: A descriptive string that you create to describe a Template. It can be up to 32 characters long.
    :ivar channels: A list of channels that support the Template. Can include: sms, voice.
    :ivar translations: An object that contains the different translations of the template. Every translation is identified by the language short name and contains its respective information as the approval status, text and created/modified date.
    )versionpayloadc                    sL   t  | |d| _|d| _|d| _|d| _|d| _d S )Nsidaccount_sidfriendly_namechannelstranslations)super__init__getr   r   r   r   r   )selfr   r   	__class__ _/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/verify/v2/template.pyr   #   s    zTemplateInstance.__init__returnc                 C   s   dS )f
        Provide a friendly representation

        :returns: Machine friendly representation
        z#<Twilio.Verify.V2.TemplateInstance>r   r   r   r   r   __repr__,   s    zTemplateInstance.__repr__)__name__
__module____qualname____doc__r   r   strr   r   r"   __classcell__r   r   r   r   r      s   	r   c                   @   s2   e Zd Zeeef edddZedddZdS )TemplatePage)r   r   c                 C   s   t | j|S )zn
        Build an instance of TemplateInstance

        :param payload: Payload response from the API
        )r   _version)r   r   r   r   r   get_instance7   s    zTemplatePage.get_instancer   c                 C   s   dS )r    z<Twilio.Verify.V2.TemplatePage>r   r!   r   r   r   r"   ?   s    zTemplatePage.__repr__N)	r#   r$   r%   r   r'   r   r   r+   r"   r   r   r   r   r)   6   s   r)   c                       s  e Zd Zed fddZejddfeee	f e
e e
e ee dddZejddfeee	f e
e e
e ee ddd	Zejddfeee	f e
e e
e ee dd
dZejddfeee	f e
e e
e e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edddZeedddZedddZ  ZS )TemplateList)r   c                    s   t  | d| _dS )zj
        Initialize the TemplateList

        :param version: Version that contains the resource

        z
/TemplatesN)r   r   _uri)r   r   r   r   r   r   I   s    zTemplateList.__init__N)r   limit	page_sizer   c                 C   s2   | j ||}| j||d d}| j ||d S )a  
        Streams TemplateInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param str friendly_name: String filter used to query templates with a given friendly name.
        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, stream() will attempt to read the
                          limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        r/   r   r/   r.   )r*   read_limitspagestreamr   r   r.   r/   Zlimitsr2   r   r   r   r3   T   s    zTemplateList.streamc                    s8   | j ||}| j||d dI dH }| j ||d S )a  
        Asynchronously streams TemplateInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param str friendly_name: String filter used to query templates with a given friendly name.
        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, stream() will attempt to read the
                          limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        r/   r0   Nr.   )r*   r1   
page_asyncstream_asyncr4   r   r   r   r6   o   s
    zTemplateList.stream_asyncc                 C   s   t | j|||dS )a_  
        Lists TemplateInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str friendly_name: String filter used to query templates with a given friendly name.
        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, list() will attempt to read the limit
                          with the most efficient page size, i.e. min(limit, 1000)

        :returns: list that will contain up to limit results
        r   r.   r/   )listr3   r   r   r.   r/   r   r   r   r8      s    zTemplateList.listc                    s&   dd | j |||dI dH 2 I dH S )an  
        Asynchronously lists TemplateInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str friendly_name: String filter used to query templates with a given friendly name.
        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, list() will attempt to read the limit
                          with the most efficient page size, i.e. min(limit, 1000)

        :returns: list that will contain up to limit results
        c                    s   g | z3 d H W }|q6 S )Nr   ).0recordr   r   r   
<listcomp>   s   z+TemplateList.list_async.<locals>.<listcomp>r7   N)r6   r9   r   r   r   
list_async   s    
zTemplateList.list_async)r   
page_tokenpage_numberr/   r   c                 C   s4   t ||||d}| jjd| j|d}t| j|S )a  
        Retrieve a single page of TemplateInstance records from the API.
        Request is executed immediately

        :param friendly_name: String filter used to query templates with a given friendly name.
        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of TemplateInstance
        ZFriendlyNameZ	PageTokenr   ZPageSizeGETmethoduriparams)r	   ofr*   r2   r-   r)   r   r   r>   r?   r/   dataresponser   r   r   r2      s    	zTemplateList.pagec                    s:   t ||||d}| jjd| j|dI dH }t| j|S )a  
        Asynchronously retrieve a single page of TemplateInstance records from the API.
        Request is executed immediately

        :param friendly_name: String filter used to query templates with a given friendly name.
        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of TemplateInstance
        r@   rA   rB   N)r	   rF   r*   r5   r-   r)   rG   r   r   r   r5      s    	zTemplateList.page_async)
target_urlr   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of TemplateInstance records from the API.
        Request is executed immediately

        :param target_url: API-generated URL for the requested results page

        :returns: Page of TemplateInstance
        rA   )r*   domaintwiliorequestr)   r   rJ   rI   r   r   r   get_page  s    	zTemplateList.get_pagec                    s$   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of TemplateInstance records from the API.
        Request is executed immediately

        :param target_url: API-generated URL for the requested results page

        :returns: Page of TemplateInstance
        rA   N)r*   rK   rL   Zrequest_asyncr)   rN   r   r   r   get_page_async  s    	zTemplateList.get_page_asyncr   c                 C   s   dS )r    z<Twilio.Verify.V2.TemplateList>r   r!   r   r   r   r"     s    zTemplateList.__repr__)r#   r$   r%   r   r   r	   unsetr   r'   objectr   intr   r   r3   r   r6   r   r8   r=   r)   r2   r5   rO   rP   r"   r(   r   r   r   r   r,   H   s|   



 



 



 r,   N)r&   typingr   r   r   r   r   r   r   Ztwilio.baser	   Ztwilio.base.instance_resourcer
   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r)   r,   r   r   r   r   <module>   s   $