o
    f>hW                     @   s   d Z ddlmZ ddl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 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 - Content
    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ListOptionalUnionIteratorAsyncIterator)deserialize	serializevalues)InstanceResource)ListResource)Version)Pagec                       s@   e Zd ZdZdedeeef f fddZdefddZ	  Z
S )	ContentInstancea  
    :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    :ivar sid: The unique string that that we created to identify the Content resource.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource.
    :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient.
    :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in.
    :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {"1": "Customer_Name"}.
    :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource.
    :ivar url: The URL of the resource, relative to `https://content.twilio.com`.
    :ivar links: A list of links related to the Content resource, such as approval_fetch and approval_create
    versionpayloadc                    s   t  | t|d| _t|d| _|d| _|d| _|d| _	|d| _
|d| _|d| _|d	| _|d
| _d S )Ndate_createddate_updatedsidaccount_sidfriendly_namelanguage	variablestypesurllinks)super__init__r
   iso8601_datetimegetr   r   r   r   r   r   r   r   r   r   )selfr   r   	__class__ Q/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/content/v2/content.pyr   '   s   zContentInstance.__init__returnc                 C      dS )f
        Provide a friendly representation

        :returns: Machine friendly representation
        z#<Twilio.Content.V2.ContentInstance>r%   r"   r%   r%   r&   __repr__9   s   zContentInstance.__repr__)__name__
__module____qualname____doc__r   r   strr   r   r+   __classcell__r%   r%   r#   r&   r      s    r   c                   @   s4   e Zd Zdeeef defddZdefddZdS )ContentPager   r'   c                 C   s   t | j|S )zm
        Build an instance of ContentInstance

        :param payload: Payload response from the API
        )r   _version)r"   r   r%   r%   r&   get_instanceE   s   zContentPage.get_instancec                 C   r(   )r)   z<Twilio.Content.V2.ContentPage>r%   r*   r%   r%   r&   r+   M      zContentPage.__repr__N)	r,   r-   r.   r   r0   r   r   r4   r+   r%   r%   r%   r&   r2   C   s    r2   c                       s  e Zd Zdef fddZejejejejejejejejejddfdeee	f deee	f dee
e	f dee
e	f d	eee	f d
eee	f deee e	f deee e	f deee e	f dee dee dee fddZejejejejejejejejejddfdeee	f deee	f dee
e	f dee
e	f d	eee	f d
eee	f deee e	f deee e	f deee e	f dee dee dee fddZejejejejejejejejejddfdeee	f deee	f dee
e	f dee
e	f d	eee	f d
eee	f deee e	f deee e	f deee e	f dee dee dee fddZejejejejejejejejejddfdeee	f deee	f dee
e	f dee
e	f d	eee	f d
eee	f deee e	f deee e	f deee e	f dee dee dee fddZejejejejejejejejejejejejfdeee	f deee	f dee
e	f dee
e	f d	eee	f d
eee	f deee e	f deee e	f deee e	f deee	f deee	f deee	f defddZejejejejejejejejejejejejfdeee	f deee	f dee
e	f dee
e	f d	eee	f d
eee	f deee e	f deee e	f deee e	f deee	f deee	f deee	f 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 )&ContentListr   c                    s   t  | d| _dS )zi
        Initialize the ContentList

        :param version: Version that contains the resource

        z/ContentN)r   r   _uri)r"   r   r#   r%   r&   r   X   s   
zContentList.__init__Nsort_by_datesort_by_content_namedate_created_afterdate_created_beforecontent_namecontentr   content_typechannel_eligibilitylimit	page_sizer'   c                 C   sB   | j |
|}| j|||||||||	|d d
}| j ||d S )aF  
        Streams ContentInstance 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 sort_by_date: Whether to sort by ascending or descending date updated
        :param str sort_by_content_name: Whether to sort by ascending or descending content name
        :param datetime date_created_after: Filter by >=[date-time]
        :param datetime date_created_before: Filter by <=[date-time]
        :param str content_name: Filter by Regex Pattern in content name
        :param str content: Filter by Regex Pattern in template content
        :param List[str] language: Filter by array of valid language(s)
        :param List[str] content_type: Filter by array of contentType(s)
        :param List[str] channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
        :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
        rA   
r8   r9   r:   r;   r<   r=   r   r>   r?   rA   r@   )r3   read_limitspagestreamr"   r8   r9   r:   r;   r<   r=   r   r>   r?   r@   rA   limitsrD   r%   r%   r&   rE   c   s   &zContentList.streamc                    sJ   | j |
|}| j|||||||||	|d d
I dH }| j ||d S )aU  
        Asynchronously streams ContentInstance 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 sort_by_date: Whether to sort by ascending or descending date updated
        :param str sort_by_content_name: Whether to sort by ascending or descending content name
        :param datetime date_created_after: Filter by >=[date-time]
        :param datetime date_created_before: Filter by <=[date-time]
        :param str content_name: Filter by Regex Pattern in content name
        :param str content: Filter by Regex Pattern in template content
        :param List[str] language: Filter by array of valid language(s)
        :param List[str] content_type: Filter by array of contentType(s)
        :param List[str] channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
        :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
        rA   rB   Nr@   )r3   rC   
page_asyncstream_asyncrF   r%   r%   r&   rI      s   &zContentList.stream_asyncc                 C   s$   t | j|||||||||	|
|dS )a  
        Lists ContentInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str sort_by_date: Whether to sort by ascending or descending date updated
        :param str sort_by_content_name: Whether to sort by ascending or descending content name
        :param datetime date_created_after: Filter by >=[date-time]
        :param datetime date_created_before: Filter by <=[date-time]
        :param str content_name: Filter by Regex Pattern in content name
        :param str content: Filter by Regex Pattern in template content
        :param List[str] language: Filter by array of valid language(s)
        :param List[str] content_type: Filter by array of contentType(s)
        :param List[str] channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
        :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
        r8   r9   r:   r;   r<   r=   r   r>   r?   r@   rA   )listrE   r"   r8   r9   r:   r;   r<   r=   r   r>   r?   r@   rA   r%   r%   r&   rK      s   %zContentList.listc                    s8   dd | j |||||||||	|
|dI dH 2 I dH S )a  
        Asynchronously lists ContentInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str sort_by_date: Whether to sort by ascending or descending date updated
        :param str sort_by_content_name: Whether to sort by ascending or descending content name
        :param datetime date_created_after: Filter by >=[date-time]
        :param datetime date_created_before: Filter by <=[date-time]
        :param str content_name: Filter by Regex Pattern in content name
        :param str content: Filter by Regex Pattern in template content
        :param List[str] language: Filter by array of valid language(s)
        :param List[str] content_type: Filter by array of contentType(s)
        :param List[str] channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
        :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*ContentList.list_async.<locals>.<listcomp>rJ   N)rI   rL   r%   r%   r&   
list_async  s    %
zContentList.list_async
page_tokenpage_numberc                 C   s   t ||t|t|||t|dd t|dd t|	dd |
||d}t ddi}d|d	< | jjd
| j||d}t| j|S )a  
        Retrieve a single page of ContentInstance records from the API.
        Request is executed immediately

        :param sort_by_date: Whether to sort by ascending or descending date updated
        :param sort_by_content_name: Whether to sort by ascending or descending content name
        :param date_created_after: Filter by >=[date-time]
        :param date_created_before: Filter by <=[date-time]
        :param content_name: Filter by Regex Pattern in content name
        :param content: Filter by Regex Pattern in template content
        :param language: Filter by array of valid language(s)
        :param content_type: Filter by array of contentType(s)
        :param channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
        :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 ContentInstance
        c                 S      | S rM   r%   er%   r%   r&   <lambda>d      z"ContentList.page.<locals>.<lambda>c                 S   rT   rM   r%   rU   r%   r%   r&   rW   e  rX   c                 S   rT   rM   r%   rU   r%   r%   r&   rW   f  rX   
SortByDateSortByContentNameDateCreatedAfterDateCreatedBeforeContentNameContentLanguageContentTypeChannelEligibility	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedapplication/jsonAcceptGETmethoduriparamsheaders)	r   ofr   r    mapr3   rD   r7   r2   r"   r8   r9   r:   r;   r<   r=   r   r>   r?   rR   rS   rA   datarn   responser%   r%   r&   rD   :  s*   "
zContentList.pagec                    s   t ||t|t|||t|dd t|dd t|	dd |
||d}t ddi}d|d	< | jjd
| j||dI dH }t| j|S )a+  
        Asynchronously retrieve a single page of ContentInstance records from the API.
        Request is executed immediately

        :param sort_by_date: Whether to sort by ascending or descending date updated
        :param sort_by_content_name: Whether to sort by ascending or descending content name
        :param date_created_after: Filter by >=[date-time]
        :param date_created_before: Filter by <=[date-time]
        :param content_name: Filter by Regex Pattern in content name
        :param content: Filter by Regex Pattern in template content
        :param language: Filter by array of valid language(s)
        :param content_type: Filter by array of contentType(s)
        :param channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
        :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 ContentInstance
        c                 S   rT   rM   r%   rU   r%   r%   r&   rW     rX   z(ContentList.page_async.<locals>.<lambda>c                 S   rT   rM   r%   rU   r%   r%   r&   rW     rX   c                 S   rT   rM   r%   rU   r%   r%   r&   rW     rX   rY   re   rf   rg   rh   ri   rj   N)	r   ro   r   r    rp   r3   rH   r7   r2   rq   r%   r%   r&   rH   v  s,   "
zContentList.page_async
target_urlc                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of ContentInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ContentInstance
        ri   )r3   domaintwiliorequestr2   r"   rt   rs   r%   r%   r&   get_page  s   	zContentList.get_pagec                    s&   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of ContentInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ContentInstance
        ri   N)r3   ru   rv   request_asyncr2   rx   r%   r%   r&   get_page_async  s   	zContentList.get_page_asyncc                 C   r(   )r)   z<Twilio.Content.V2.ContentList>r%   r*   r%   r%   r&   r+     r5   zContentList.__repr__)r,   r-   r.   r   r   r   unsetr   r0   objectr   r   r   intr   r   rE   r	   rI   rK   rQ   r2   rD   rH   ry   r{   r+   r1   r%   r%   r#   r&   r6   V   s   





	

8





	

8





	

7





	

8





	




>





	




<r6   N)r/   r   typingr   r   r   r   r   r   r	   twilio.baser
   r   r   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r2   r6   r%   r%   r%   r&   <module>   s    $*