U
    ^g%iZ                     @   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 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 - Chat
    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)InstanceContext)InstanceResource)ListResource)Version)Pagec                       s   e Zd ZdZdeeeef eeee d fddZ	e
dddd	Zedd
dZedddZd dddZd dddZedddZ  ZS )InviteInstanceaG  
    :ivar sid: The unique string that we created to identify the Invite resource.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Invite resource.
    :ivar channel_sid: The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the Invite resource belongs to.
    :ivar service_sid: The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the Invite resource is associated with.
    :ivar identity: The application-defined string that uniquely identifies the resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info.
    :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar role_sid: The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the resource.
    :ivar created_by: The `identity` of the User that created the invite.
    :ivar url: The absolute URL of the Invite resource.
    N)versionpayloadservice_sidchannel_sidsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _t	|d| _
t	|d| _|d| _|d	| _|d
| _|||p| jd| _d | _d S )Nr   account_sidr   r   identitydate_createddate_updatedrole_sid
created_byurlr   r   r   )super__init__getr   r   r   r   r   r
   Ziso8601_datetimer   r   r   r   r   	_solution_context)selfr   r   r   r   r   	__class__ i/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/chat/v2/service/channel/invite.pyr!   '   s(    zInviteInstance.__init__InviteContextreturnc                 C   s6   | j dkr0t| j| jd | 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: InviteContext for this InviteInstance
        Nr   r   r   r   )r$   r*   _versionr#   r%   r(   r(   r)   _proxyG   s    
zInviteInstance._proxyc                 C   s
   | j  S )i
        Deletes the InviteInstance


        :returns: True if delete succeeds, False otherwise
        )r/   deleter.   r(   r(   r)   r1   X   s    zInviteInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the InviteInstance


        :returns: True if delete succeeds, False otherwise
        N)r/   delete_asyncr.   r(   r(   r)   r3   a   s    zInviteInstance.delete_asyncc                 C   s
   | j  S )Y
        Fetch the InviteInstance


        :returns: The fetched InviteInstance
        )r/   fetchr.   r(   r(   r)   r5   j   s    zInviteInstance.fetchc                    s   | j  I dH S )s
        Asynchronous coroutine to fetch the InviteInstance


        :returns: The fetched InviteInstance
        N)r/   fetch_asyncr.   r(   r(   r)   r7   s   s    zInviteInstance.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>   s     z*InviteInstance.__repr__.<locals>.<genexpr>z"<Twilio.Chat.V2.InviteInstance {}>joinr#   itemsr<   r%   contextr(   r(   r)   __repr__|   s    zInviteInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r!   propertyr/   boolr1   r3   r5   r7   rG   __classcell__r(   r(   r&   r)   r      s     
 				r   c                       sn   e Zd Zeeeed fddZedddZedddZe	dd	d
Z
e	dddZedddZ  ZS )r*   )r   r   r   r   c                    s.   t  | |||d| _djf | j| _dS )a  
        Initialize the InviteContext

        :param version: Version that contains the resource
        :param service_sid: The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to fetch the Invite resource from.
        :param channel_sid: The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the Invite resource to fetch belongs to. This value can be the Channel resource's `sid` or `unique_name`.
        :param sid: The SID of the Invite resource to fetch.
        r   z</Services/{service_sid}/Channels/{channel_sid}/Invites/{sid}Nr    r!   r#   r<   _uri)r%   r   r   r   r   r&   r(   r)   r!      s    	zInviteContext.__init__r+   c                 C   s   t i }| jjd| j|dS )r0   DELETEmethoduriheaders)r   ofr-   r1   rQ   r%   rV   r(   r(   r)   r1      s    
zInviteContext.deletec                    s$   t i }| jjd| j|dI dH S )r2   rR   rS   N)r   rW   r-   r3   rQ   rX   r(   r(   r)   r3      s    
  zInviteContext.delete_asyncc                 C   sL   t i }d|d< | jjd| j|d}t| j|| jd | jd | jd dS )	r4   application/jsonAcceptGETrS   r   r   r   r   )r   rW   r-   r5   rQ   r   r#   r%   rV   r   r(   r(   r)   r5      s    
zInviteContext.fetchc                    sR   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd | jd d	S )
r6   rY   rZ   r[   rS   Nr   r   r   r   )r   rW   r-   r7   rQ   r   r#   r\   r(   r(   r)   r7      s    
  zInviteContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r8   r9   c                 s   s   | ]\}}d  ||V  qdS r:   r;   r=   r(   r(   r)   rA      s     z)InviteContext.__repr__.<locals>.<genexpr>z!<Twilio.Chat.V2.InviteContext {}>rB   rE   r(   r(   r)   rG      s    zInviteContext.__repr__)rH   rI   rJ   r   rL   r!   rN   r1   r3   r   r5   r7   rG   rO   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 )
InvitePage)r   r,   c                 C   s   t | j|| jd | jd dS )zl
        Build an instance of InviteInstance

        :param payload: Payload response from the API
        r   r   r   r   )r   r-   r#   )r%   r   r(   r(   r)   get_instance   s    zInvitePage.get_instancer+   c                 C   s   dS )r8   z<Twilio.Chat.V2.InvitePage>r(   r.   r(   r(   r)   rG      s    zInvitePage.__repr__N)	rH   rI   rJ   r   rL   r   r   r_   rG   r(   r(   r(   r)   r]      s   r]   c                       s$  e Zd Zeeed fddZejfeeee	f e
dddZejfeeee	f e
dddZejd	d	feee e	f ee ee ee
 d
ddZejd	d	feee e	f ee ee ee
 d
ddZejd	d	feee e	f ee ee ee
 d
ddZejd	d	fe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 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 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edddZeedd d!Zed"d#d$Z  ZS )%
InviteList)r   r   r   c                    s,   t  | ||d| _djf | j| _dS )a  
        Initialize the InviteList

        :param version: Version that contains the resource
        :param service_sid: The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to read the Invite resources from.
        :param channel_sid: The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the Invite resources to read belong to. This value can be the Channel resource's `sid` or `unique_name`.

        r^   z6/Services/{service_sid}/Channels/{channel_sid}/InvitesNrP   )r%   r   r   r   r&   r(   r)   r!     s    	zInviteList.__init__)r   r   r,   c                 C   sb   t ||d}t ddi}d|d< d|d< | jjd| j||d}t| j|| jd | jd	 d
S )a  
        Create the InviteInstance

        :param identity: The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info.
        :param role_sid: The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member.

        :returns: The created InviteInstance
        IdentityZRoleSidContent-Type!application/x-www-form-urlencodedrY   rZ   POSTrT   rU   datarV   r   r   r^   )r   rW   r-   createrQ   r   r#   r%   r   r   rg   rV   r   r(   r(   r)   rh     s(       zInviteList.createc                    sh   t ||d}t ddi}d|d< d|d< | jjd| j||dI dH }t| j|| jd	 | jd
 dS )a   
        Asynchronously create the InviteInstance

        :param identity: The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info.
        :param role_sid: The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member.

        :returns: The created InviteInstance
        ra   rc   rd   rY   rZ   re   rf   Nr   r   r^   )r   rW   r-   create_asyncrQ   r   r#   ri   r(   r(   r)   rj   B  s(       zInviteList.create_asyncN)r   limit	page_sizer,   c                 C   s2   | j ||}| j||d d}| j ||d S )aB  
        Streams InviteInstance 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 List[str] identity: The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details.
        :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
        rl   r   rl   rk   )r-   read_limitspagestreamr%   r   rk   rl   Zlimitsro   r(   r(   r)   rp   e  s    zInviteList.streamc                    s8   | j ||}| j||d dI dH }| j ||d S )aQ  
        Asynchronously streams InviteInstance 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 List[str] identity: The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details.
        :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
        rl   rm   Nrk   )r-   rn   
page_asyncstream_asyncrq   r(   r(   r)   rs     s    zInviteList.stream_asyncc                 C   s   t | j|||dS )a  
        Lists InviteInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param List[str] identity: The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details.
        :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   rk   rl   )listrp   r%   r   rk   rl   r(   r(   r)   ru     s    zInviteList.listc                    s&   dd | j |||dI dH 2 I dH S )a  
        Asynchronously lists InviteInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param List[str] identity: The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details.
        :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(   )r>   recordr(   r(   r)   
<listcomp>  s   z)InviteList.list_async.<locals>.<listcomp>rt   N)rs   rv   r(   r(   r)   
list_async  s    
zInviteList.list_async)r   
page_tokenpage_numberrl   r,   c                 C   s\   t t|dd |||d}t ddi}d|d< | jjd| j||d	}t| j|| jS )
aM  
        Retrieve a single page of InviteInstance records from the API.
        Request is executed immediately

        :param identity: The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details.
        :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 InviteInstance
        c                 S   s   | S rw   r(   er(   r(   r)   <lambda>      z!InviteList.page.<locals>.<lambda>rb   Z	PageTokenr   ZPageSizerc   rd   rY   rZ   r[   rT   rU   paramsrV   )	r   rW   r   mapr-   ro   rQ   r]   r#   r%   r   r{   r|   rl   rg   rV   responser(   r(   r)   ro     s     	   zInviteList.pagec                    sb   t t|dd |||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 InviteInstance records from the API.
        Request is executed immediately

        :param identity: The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details.
        :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 InviteInstance
        c                 S   s   | S rw   r(   r}   r(   r(   r)   r     r   z'InviteList.page_async.<locals>.<lambda>r   rc   rd   rY   rZ   r[   r   N)	r   rW   r   r   r-   rr   rQ   r]   r#   r   r(   r(   r)   rr     s     	   zInviteList.page_async)
target_urlr,   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of InviteInstance records from the API.
        Request is executed immediately

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

        :returns: Page of InviteInstance
        r[   )r-   domaintwiliorequestr]   r#   r%   r   r   r(   r(   r)   get_page  s    	zInviteList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a   
        Asynchronously retrieve a specific page of InviteInstance records from the API.
        Request is executed immediately

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

        :returns: Page of InviteInstance
        r[   N)r-   r   r   Zrequest_asyncr]   r#   r   r(   r(   r)   get_page_async*  s    	zInviteList.get_page_async)r   r,   c                 C   s   t | j| jd | jd |dS zj
        Constructs a InviteContext

        :param sid: The SID of the Invite resource to fetch.
        r   r   r   r*   r-   r#   r%   r   r(   r(   r)   r"   6  s    zInviteList.getc                 C   s   t | j| jd | jd |dS r   r   r   r(   r(   r)   __call__C  s    zInviteList.__call__r+   c                 C   s   dS )r8   z<Twilio.Chat.V2.InviteList>r(   r.   r(   r(   r)   rG   P  s    zInviteList.__repr__) rH   rI   rJ   r   rL   r!   r   unsetr   objectr   rh   rj   r   r   intr   rp   r	   rs   ru   rz   r]   ro   rr   r   r   r*   r"   r   rG   rO   r(   r(   r&   r)   r`   	  s    
$ 
% 


&


$r`   N)rK   r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   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*   r]   r`   r(   r(   r(   r)   <module>   s   $mk