o
    e;                     @   s   d 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 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 )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )deserialize)	serialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       s   e Zd Z fddZejfddZejddfddZejddfdd	Zejejejejfd
dZ	dd Z
dd Zdd Zdd Z  ZS )
InviteListc                    s4   t t| | ||d| _djdi | j| _dS )a  
        Initialize the InviteList

        :param Version version: Version that contains the resource
        :param service_sid: The SID of the Service that the resource is associated with
        :param channel_sid: The SID of the Channel the new resource belongs to

        :returns: twilio.rest.chat.v1.service.channel.invite.InviteList
        :rtype: twilio.rest.chat.v1.service.channel.invite.InviteList
        service_sidchannel_sidz6/Services/{service_sid}/Channels/{channel_sid}/InvitesN )superr	   __init__	_solutionformat_uri)selfversionr   r   	__class__r   ]/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/chat/v1/service/channel/invite.pyr      s   zInviteList.__init__c                 C   sB   t ||d}| jjd| j|d}t| j|| jd | jd dS )aG  
        Create the InviteInstance

        :param unicode identity: The `identity` value that identifies the new resource's User
        :param unicode role_sid: The Role assigned to the new member

        :returns: The created InviteInstance
        :rtype: twilio.rest.chat.v1.service.channel.invite.InviteInstance
        )IdentityRoleSidPOST)methoduridatar   r   r
   )r   of_versioncreater   InviteInstancer   )r   identityrole_sidr   payloadr   r   r   r    %   s   
zInviteList.createNc                 C   s2   | j ||}| j||d d}| j ||d S )a  
        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[unicode] identity: The `identity` value of the resources to read
        :param int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int 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
        :rtype: list[twilio.rest.chat.v1.service.channel.invite.InviteInstance]
        	page_size)r"   r%   limit)r   read_limitspagestream)r   r"   r&   r%   limitsr(   r   r   r   r)   :   s   zInviteList.streamc                 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[unicode] identity: The `identity` value of the resources to read
        :param int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int 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: Generator that will yield up to limit results
        :rtype: list[twilio.rest.chat.v1.service.channel.invite.InviteInstance]
        )r"   r&   r%   )listr)   )r   r"   r&   r%   r   r   r   r+   R   s   zInviteList.listc                 C   sD   t t|dd |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of InviteInstance records from the API.
        Request is executed immediately

        :param list[unicode] identity: The `identity` value of the resources to read
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of InviteInstance
        :rtype: twilio.rest.chat.v1.service.channel.invite.InvitePage
        c                 S   s   | S Nr   )er   r   r   <lambda>t   s    z!InviteList.page.<locals>.<lambda>)r   	PageTokenr   PageSizeGET)r   r   params)	r   r   r   mapr   r(   r   
InvitePager   )r   r"   
page_tokenpage_numberr%   r   responser   r   r   r(   e   s   zInviteList.pagec                 C   s"   | j jjd|}t| j || jS )a;  
        Retrieve a specific page of InviteInstance records from the API.
        Request is executed immediately

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

        :returns: Page of InviteInstance
        :rtype: twilio.rest.chat.v1.service.channel.invite.InvitePage
        r1   )r   domaintwiliorequestr4   r   )r   
target_urlr7   r   r   r   get_page~   s
   

zInviteList.get_pagec                 C      t | j| jd | jd |dS a  
        Constructs a InviteContext

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.chat.v1.service.channel.invite.InviteContext
        :rtype: twilio.rest.chat.v1.service.channel.invite.InviteContext
        r   r   r   r   sidInviteContextr   r   r   r@   r   r   r   get      	zInviteList.getc                 C   r=   r>   rA   rC   r   r   r   __call__   rE   zInviteList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Chat.V1.InviteList>r   r   r   r   r   __repr__      zInviteList.__repr__)__name__
__module____qualname__r   r   unsetr    r)   r+   r(   r<   rD   rF   rJ   __classcell__r   r   r   r   r	      s    
r	   c                       s,   e Zd Z fddZdd Zdd Z  ZS )r4   c                    s   t t| || || _dS )a  
        Initialize the InvitePage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param service_sid: The SID of the Service that the resource is associated with
        :param channel_sid: The SID of the Channel the new resource belongs to

        :returns: twilio.rest.chat.v1.service.channel.invite.InvitePage
        :rtype: twilio.rest.chat.v1.service.channel.invite.InvitePage
        N)r   r4   r   r   )r   r   r7   solutionr   r   r   r      s   
zInvitePage.__init__c                 C   s   t | j|| jd | jd dS )a  
        Build an instance of InviteInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.chat.v1.service.channel.invite.InviteInstance
        :rtype: twilio.rest.chat.v1.service.channel.invite.InviteInstance
        r   r   r
   )r!   r   r   r   r$   r   r   r   get_instance   s   	zInvitePage.get_instancec                 C   rG   )rH   z<Twilio.Chat.V1.InvitePage>r   rI   r   r   r   rJ      rK   zInvitePage.__repr__)rL   rM   rN   r   rS   rJ   rP   r   r   r   r   r4      s    r4   c                       s4   e Zd Z fddZdd Zdd Zdd Z  ZS )	rB   c                    s6   t t| | |||d| _djdi | j| _dS )a  
        Initialize the InviteContext

        :param Version version: Version that contains the resource
        :param service_sid: The SID of the Service to fetch the resource from
        :param channel_sid: The SID of the Channel the resource to fetch belongs to
        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.chat.v1.service.channel.invite.InviteContext
        :rtype: twilio.rest.chat.v1.service.channel.invite.InviteContext
        r?   z</Services/{service_sid}/Channels/{channel_sid}/Invites/{sid}Nr   )r   rB   r   r   r   r   )r   r   r   r   r@   r   r   r   r      s   zInviteContext.__init__c                 C   s8   | j jd| jd}t| j || jd | jd | jd dS )
        Fetch the InviteInstance

        :returns: The fetched InviteInstance
        :rtype: twilio.rest.chat.v1.service.channel.invite.InviteInstance
        r1   r   r   r   r   r@   r?   )r   fetchr   r!   r   rR   r   r   r   rV      s   zInviteContext.fetchc                 C   s   | j jd| jdS )}
        Deletes the InviteInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErU   )r   deleter   rI   r   r   r   rY     s   zInviteContext.deletec                 C   $   d dd | j D }d|S )rH    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>      z)InviteContext.__repr__.<locals>.<genexpr>z!<Twilio.Chat.V1.InviteContext {}>joinr   itemsr   r   contextr   r   r   rJ        
zInviteContext.__repr__)rL   rM   rN   r   rV   rY   rJ   rP   r   r   r   r   rB      s
    	rB   c                       s   e Zd Zd  fdd	Zedd Zedd Zedd	 Zed
d Zedd Z	edd Z
edd Zedd Zedd Zedd Zedd Zdd Zdd Zdd Z  ZS )!r!   Nc                    s   t t| | |d|d|d|d|dt|dt|d|d|d	|d
d
| _d| _|||pE| jd d| _dS )z
        Initialize the InviteInstance

        :returns: twilio.rest.chat.v1.service.channel.invite.InviteInstance
        :rtype: twilio.rest.chat.v1.service.channel.invite.InviteInstance
        r@   account_sidr   r   r"   date_createddate_updatedr#   
created_byurl)
r@   rk   r   r   r"   rl   rm   r#   rn   ro   Nr?   )	r   r!   r   rD   r   iso8601_datetime_properties_contextr   )r   r   r$   r   r   r@   r   r   r   r   !  s"   zInviteInstance.__init__c                 C   s6   | j du rt| j| jd | jd | jd d| _ | j S )a1  
        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
        :rtype: twilio.rest.chat.v1.service.channel.invite.InviteContext
        Nr   r   r@   r?   )rr   rB   r   r   rI   r   r   r   _proxy@  s   
	zInviteInstance._proxyc                 C   
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r@   rq   rI   r   r   r   r@   R     
zInviteInstance.sidc                 C   rt   )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rk   ru   rI   r   r   r   rk   Z  rv   zInviteInstance.account_sidc                 C   rt   )zf
        :returns: The SID of the Channel the new resource belongs to
        :rtype: unicode
        r   ru   rI   r   r   r   r   b  rv   zInviteInstance.channel_sidc                 C   rt   )zo
        :returns: The SID of the Service that the resource is associated with
        :rtype: unicode
        r   ru   rI   r   r   r   r   j  rv   zInviteInstance.service_sidc                 C   rt   )zb
        :returns: The string that identifies the resource's User
        :rtype: unicode
        r"   ru   rI   r   r   r   r"   r  rv   zInviteInstance.identityc                 C   rt   )zt
        :returns: The RFC 2822 date and time in GMT when the resource was created
        :rtype: datetime
        rl   ru   rI   r   r   r   rl   z  rv   zInviteInstance.date_createdc                 C   rt   )zy
        :returns: The RFC 2822 date and time in GMT when the resource was last updated
        :rtype: datetime
        rm   ru   rI   r   r   r   rm     rv   zInviteInstance.date_updatedc                 C   rt   )z^
        :returns: The SID of the Role assigned to the member
        :rtype: unicode
        r#   ru   rI   r   r   r   r#     rv   zInviteInstance.role_sidc                 C   rt   )zd
        :returns: The identity of the User that created the invite
        :rtype: unicode
        rn   ru   rI   r   r   r   rn     rv   zInviteInstance.created_byc                 C   rt   )z[
        :returns: The absolute URL of the Invite resource
        :rtype: unicode
        ro   ru   rI   r   r   r   ro     rv   zInviteInstance.urlc                 C   
   | j  S )rT   )rs   rV   rI   r   r   r   rV        
zInviteInstance.fetchc                 C   rw   )rW   )rs   rY   rI   r   r   r   rY     rx   zInviteInstance.deletec                 C   rZ   )rH   r[   c                 s   r\   r]   r^   r_   r   r   r   rc     rd   z*InviteInstance.__repr__.<locals>.<genexpr>z"<Twilio.Chat.V1.InviteInstance {}>re   rh   r   r   r   rJ     rj   zInviteInstance.__repr__r,   )rL   rM   rN   r   propertyrs   r@   rk   r   r   r"   rl   rm   r#   rn   ro   rV   rY   rJ   rP   r   r   r   r   r!     s6    










		r!   N)__doc__twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r4   rB   r!   r   r   r   r   <module>   s    (-9