U
    ^g%i<                     @   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                       sv   e Zd ZdZdeeeef eee	 d fddZ
edddd	Zd dd
dZd dddZed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   Ziso8601_datetimer   r   r   	_solution_context)selfr   r   r   r   	__class__ j/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/events/v1/schema/schema_version.pyr   "   s    zSchemaVersionInstance.__init__SchemaVersionContextreturnc                 C   s.   | j dk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   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>c   s     z1SchemaVersionInstance.__repr__.<locals>.<genexpr>z+<Twilio.Events.V1.SchemaVersionInstance {}>joinr   itemsr3   r    contextr#   r#   r$   __repr__]   s    zSchemaVersionInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   intr   propertyr*   r,   r.   r>   __classcell__r#   r#   r!   r$   r      s    
		r   c                       sP   e Zd Zeeed fddZedddZedddZ	edd	d
Z
  ZS )r%   )r   r   r   c                    s,   t  | ||d| _djf | 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}Nr   r   r   r3   _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,   rH   r   r   r    rO   r   r#   r#   r$   r,   z   s    
zSchemaVersionContext.fetchc                    sJ   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r-   rI   rJ   rK   rL   Nr   r   r   )r   rP   r(   r.   rH   r   r   rQ   r#   r#   r$   r.      s    
  z SchemaVersionContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r/   r0   c                 s   s   | ]\}}d  ||V  qdS r1   r2   r4   r#   r#   r$   r8      s     z0SchemaVersionContext.__repr__.<locals>.<genexpr>z*<Twilio.Events.V1.SchemaVersionContext {}>r9   r<   r#   r#   r$   r>      s    zSchemaVersionContext.__repr__)r?   r@   rA   r   rC   rD   r   r   r,   r.   r>   rF   r#   r#   r!   r$   r%   g   s   r%   c                   @   s2   e Zd Zeeef edddZedddZdS )SchemaVersionPage)r   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_instancer&   c                 C   s   dS )r/   z$<Twilio.Events.V1.SchemaVersionPage>r#   r)   r#   r#   r$   r>      s    zSchemaVersionPage.__repr__N)	r?   r@   rA   r   rC   r   r   rS   r>   r#   r#   r#   r$   rR      s   rR   c                       sf  e Zd Zeed fddZd ee ee ee	 dddZ
d!ee ee ee	 ddd	Zd"ee ee ee	 dd
dZd#ee ee ee	 dddZejejejfeeef eeef eeef edddZejejej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edddZeedddZedddZ  ZS )$SchemaVersionList)r   r   c                    s*   t  | d|i| _djf | 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}/VersionsNrG   )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
        rV   rV   rU   )r(   read_limitspagestreamr    rU   rV   ZlimitsrY   r#   r#   r$   rZ      s    zSchemaVersionList.streamc                    s6   | 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
        rV   rW   NrU   )r(   rX   
page_asyncstream_asyncr[   r#   r#   r$   r]      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
        rU   rV   )listrZ   r    rU   rV   r#   r#   r$   r_     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 )Nr#   )r5   recordr#   r#   r$   
<listcomp>4  s   z0SchemaVersionList.list_async.<locals>.<listcomp>r^   N)r]   r`   r#   r#   r$   
list_async!  s    
zSchemaVersionList.list_async)
page_tokenpage_numberrV   r'   c                 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
        Z	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedrI   rJ   rK   rM   rN   paramsrO   )r   rP   r(   rY   rH   rR   r   r    rd   re   rV   datarO   responser#   r#   r$   rY   <  s       zSchemaVersionList.pagec                    sT   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
        rf   rg   rh   rI   rJ   rK   ri   N)r   rP   r(   r\   rH   rR   r   rk   r#   r#   r$   r\   ]  s       zSchemaVersionList.page_async)
target_urlr'   c                 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
        rK   )r(   domaintwiliorequestrR   r   r    rn   rm   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
        rK   N)r(   ro   rp   Zrequest_asyncrR   r   rr   r#   r#   r$   get_page_async  s    	z SchemaVersionList.get_page_async)r   r'   c                 C   s   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     s
      zSchemaVersionList.getc                 C   s   t | j| jd |dS ru   rv   rw   r#   r#   r$   __call__  s
      zSchemaVersionList.__call__r&   c                 C   s   dS )r/   z$<Twilio.Events.V1.SchemaVersionList>r#   r)   r#   r#   r$   r>     s    zSchemaVersionList.__repr__)NN)NN)NN)NN)r?   r@   rA   r   rC   r   r   rD   r   r   rZ   r	   r]   r   r_   rc   r   unsetr   objectrR   rY   r\   rs   rt   r%   r   rx   r>   rF   r#   r#   r!   r$   rT      sh           


#


!

rT   N)rB   r   typingr   r   r   r   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   Ztwilio.base.pager   r   r%   rR   rT   r#   r#   r#   r$   <module>   s   $NI