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

    Twilio - Events
    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values)InstanceContext)InstanceResource)ListResource)Version)Pagec                
       sr   e Zd ZdZ	ddedeeef dedee	 f fddZ
edddZdddZdddZd	efddZ  ZS )SchemaVersionInstanceaA  
    :ivar id: The unique identifier of the schema. Each schema can have multiple versions, that share the same id.
    :ivar schema_version: The version of this schema.
    :ivar date_created: The date the schema version was created, given in ISO 8601 format.
    :ivar url: The URL of this resource.
    :ivar raw:
    Nversionpayloadidschema_versionc                    sp   t  | |d| _t|d| _t|d| _|d| _	|d| _
||p/| jd| _d | _d S )Nr   r   date_createdurlrawr   r   )super__init__getr   r
   integerr   iso8601_datetimer   r   r   	_solution_context)selfr   r   r   r   	__class__ ^/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/events/v1/schema/schema_version.pyr   "   s   
zSchemaVersionInstance.__init__returnSchemaVersionContextc                 C   s.   | j du rt| j| jd | 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: SchemaVersionContext for this SchemaVersionInstance
        Nr   r   r   )r    r'   _versionr   r!   r$   r$   r%   _proxy;   s   
zSchemaVersionInstance._proxyc                 C   s
   | j  S )g
        Fetch the SchemaVersionInstance


        :returns: The fetched SchemaVersionInstance
        )r*   fetchr)   r$   r$   r%   r,   K   s   
zSchemaVersionInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the SchemaVersionInstance


        :returns: The fetched SchemaVersionInstance
        N)r*   fetch_asyncr)   r$   r$   r%   r.   T   s   z!SchemaVersionInstance.fetch_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>c       z1SchemaVersionInstance.__repr__.<locals>.<genexpr>z+<Twilio.Events.V1.SchemaVersionInstance {}>joinr   itemsr5   r!   contextr$   r$   r%   __repr__]      
zSchemaVersionInstance.__repr__N)r&   r'   )r&   r   )__name__
__module____qualname____doc__r   r   strr   r   intr   propertyr*   r,   r.   rA   __classcell__r$   r$   r"   r%   r      s"    


		r   c                       sT   e Zd Zde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
  ZS )r'   r   r   r   c                    s0   t  | ||d| _djdi | j| _dS )a"  
        Initialize the SchemaVersionContext

        :param version: Version that contains the resource
        :param id: The unique identifier of the schema. Each schema can have multiple versions, that share the same id.
        :param schema_version: The version of the schema
        r   z'/Schemas/{id}/Versions/{schema_version}Nr$   r   r   r   r5   _uri)r!   r   r   r   r"   r$   r%   r   i   s
   zSchemaVersionContext.__init__r&   c                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r+   application/jsonAcceptGETmethoduriheadersr   r   r   )r   ofr(   r,   rM   r   r   r!   rT   r   r$   r$   r%   r,   z   s   
zSchemaVersionContext.fetchc                    sL   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r-   rN   rO   rP   rQ   Nr   r   r   )r   rU   r(   r.   rM   r   r   rV   r$   r$   r%   r.      s   
z SchemaVersionContext.fetch_asyncc                 C   r/   )r0   r1   c                 s   r2   r3   r4   r6   r$   r$   r%   r:      r;   z0SchemaVersionContext.__repr__.<locals>.<genexpr>z*<Twilio.Events.V1.SchemaVersionContext {}>r<   r?   r$   r$   r%   rA      rB   zSchemaVersionContext.__repr__)rD   rE   rF   r   rH   rI   r   r   r,   r.   rA   rK   r$   r$   r"   r%   r'   g   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 )SchemaVersionPager   r&   c                 C   s   t | j|| jd dS )zs
        Build an instance of SchemaVersionInstance

        :param payload: Payload response from the API
        r   )r   )r   r(   r   )r!   r   r$   r$   r%   get_instance   s   zSchemaVersionPage.get_instancec                 C      dS )r0   z$<Twilio.Events.V1.SchemaVersionPage>r$   r)   r$   r$   r%   rA         zSchemaVersionPage.__repr__N)	rD   rE   rF   r   rH   r   r   rX   rA   r$   r$   r$   r%   rW      s    rW   c                	       s  e Zd Zdedef fddZ		d#dee dee dee	 fd	d
Z
		d#dee dee dee	 fddZ		d#dee dee dee	 fddZ		d#dee dee dee	 fddZejejej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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defddZdedefdd Zdefd!d"Z  ZS )$SchemaVersionListr   r   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the SchemaVersionList

        :param version: Version that contains the resource
        :param id: The unique identifier of the schema. Each schema can have multiple versions, that share the same id.

        r   z/Schemas/{id}/VersionsNr$   rL   )r!   r   r   r"   r$   r%   r      s   zSchemaVersionList.__init__Nlimit	page_sizer&   c                 C   s0   | j ||}| j|d d}| j ||d S )ac  
        Streams SchemaVersionInstance 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 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(   read_limitspagestreamr!   r\   r]   limitsr`   r$   r$   r%   ra      s   zSchemaVersionList.streamc                    s8   | j ||}| j|d dI dH }| j ||d S )ar  
        Asynchronously streams SchemaVersionInstance 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 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^   Nr\   )r(   r_   
page_asyncstream_asyncrb   r$   r$   r%   re      s   zSchemaVersionList.stream_asyncc                 C   s   t | j||dS )a   
        Lists SchemaVersionInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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]   )listra   r!   r\   r]   r$   r$   r%   rg     s   zSchemaVersionList.listc                    s&   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists SchemaVersionInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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 rC   r$   )r7   recordr$   r$   r%   
<listcomp>4  s
    z0SchemaVersionList.list_async.<locals>.<listcomp>rf   N)re   rh   r$   r$   r%   
list_async!  s   
zSchemaVersionList.list_async
page_tokenpage_numberc                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}t| j|| jS )a  
        Retrieve a single page of SchemaVersionInstance records from the API.
        Request is executed immediately

        :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 SchemaVersionInstance
        	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedrN   rO   rP   rR   rS   paramsrT   )r   rU   r(   r`   rM   rW   r   r!   rl   rm   r]   datarT   responser$   r$   r%   r`   <  s   
zSchemaVersionList.pagec                    sV   t |||d}t ddi}d|d< | jjd| j||dI dH }t| j|| jS )	a  
        Asynchronously retrieve a single page of SchemaVersionInstance records from the API.
        Request is executed immediately

        :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 SchemaVersionInstance
        rn   rq   rr   rN   rO   rP   rs   N)r   rU   r(   rd   rM   rW   r   ru   r$   r$   r%   rd   ]  s   
zSchemaVersionList.page_async
target_urlc                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of SchemaVersionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SchemaVersionInstance
        rP   )r(   domaintwiliorequestrW   r   r!   rx   rw   r$   r$   r%   get_page~  s   	zSchemaVersionList.get_pagec                    s*   | j jjd|I dH }t| j || jS )a  
        Asynchronously retrieve a specific page of SchemaVersionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SchemaVersionInstance
        rP   N)r(   ry   rz   request_asyncrW   r   r|   r$   r$   r%   get_page_async  s   	z SchemaVersionList.get_page_asyncr   c                 C      t | j| jd |dS zm
        Constructs a SchemaVersionContext

        :param schema_version: The version of the schema
        r   r   r'   r(   r   r!   r   r$   r$   r%   r        zSchemaVersionList.getc                 C   r   r   r   r   r$   r$   r%   __call__  r   zSchemaVersionList.__call__c                 C   rY   )r0   z$<Twilio.Events.V1.SchemaVersionList>r$   r)   r$   r$   r%   rA     rZ   zSchemaVersionList.__repr__)NN)rD   rE   rF   r   rH   r   r   rI   r   r   ra   r	   re   r   rg   rk   r   unsetr   objectrW   r`   rd   r}   r   r'   r   r   rA   rK   r$   r$   r"   r%   r[      s    







#



!

r[   N)rG   r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r'   rW   r[   r$   r$   r$   r%   <module>   s    $NI