o
    �¨Êh¹C  ã                   @   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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 )Ú
MemberListú  c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )a™  
        Initialize the MemberList

        :param Version version: Version that contains the resource
        :param service_sid: The unique id of the Service this member belongs to.
        :param channel_sid: The unique id of the Channel for this member.

        :returns: twilio.rest.chat.v1.service.channel.member.MemberList
        :rtype: twilio.rest.chat.v1.service.channel.member.MemberList
        ©Úservice_sidÚchannel_sidz6/Services/{service_sid}/Channels/{channel_sid}/MembersN© )Úsuperr	   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr   r   ©Ú	__class__r   ú\/var/www/html/env/lib/python3.10/site-packages/twilio/rest/chat/v1/service/channel/member.pyr      s   zMemberList.__init__c                 C   sB   t  ||dœ¡}| jjd| j|d�}t| j|| jd | jd d�S )aF  
        Create a new MemberInstance

        :param unicode identity: A unique string identifier for this User in this Service.
        :param unicode role_sid: The Role assigned to this member.

        :returns: Newly created MemberInstance
        :rtype: twilio.rest.chat.v1.service.channel.member.MemberInstance
        )ÚIdentityÚRoleSidÚPOST©Údatar   r   r   )r   ÚofÚ_versionÚcreater   ÚMemberInstancer   )r   ÚidentityÚrole_sidr   Úpayloadr   r   r   r    &   s   
ýüzMemberList.createNc                 C   s8   | j  ||¡}| j||d d�}| j  ||d |d ¡S )a  
        Streams MemberInstance 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 unicode identity: A unique string identifier for this User in this Service.
        :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.member.MemberInstance]
        Ú	page_size)r"   r%   ÚlimitÚ
page_limit)r   Úread_limitsÚpageÚstream)r   r"   r&   r%   Úlimitsr)   r   r   r   r*   ?   s   zMemberList.streamc                 C   s   t | j|||d�ƒS )a¿  
        Lists MemberInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param unicode identity: A unique string identifier for this User in this Service.
        :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.member.MemberInstance]
        )r"   r&   r%   )Úlistr*   )r   r"   r&   r%   r   r   r   r,   W   s   zMemberList.listc                 C   sD   t  t |dd„ ¡|||dœ¡}| jjd| j|d�}t| j|| jƒS )a  
        Retrieve a single page of MemberInstance records from the API.
        Request is executed immediately

        :param unicode identity: A unique string identifier for this User in this Service.
        :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 MemberInstance
        :rtype: twilio.rest.chat.v1.service.channel.member.MemberPage
        c                 S   s   | S ©Nr   )Úer   r   r   Ú<lambda>y   s    z!MemberList.page.<locals>.<lambda>)r   Ú	PageTokenr   ÚPageSizeÚGET©Úparams)	r   r   r   Úmapr   r)   r   Ú
MemberPager   )r   r"   Ú
page_tokenÚpage_numberr%   r4   Úresponser   r   r   r)   j   s   üýzMemberList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )a;  
        Retrieve a specific page of MemberInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MemberInstance
        :rtype: twilio.rest.chat.v1.service.channel.member.MemberPage
        r2   )r   ÚdomainÚtwilioÚrequestr6   r   )r   Ú
target_urlr9   r   r   r   Úget_page‡   s
   

þzMemberList.get_pagec                 C   ó   t | j| jd | jd |d�S ©zÞ
        Constructs a MemberContext

        :param sid: The sid

        :returns: twilio.rest.chat.v1.service.channel.member.MemberContext
        :rtype: twilio.rest.chat.v1.service.channel.member.MemberContext
        r   r   ©r   r   Úsid©ÚMemberContextr   r   ©r   rB   r   r   r   Úget˜   ó   	üzMemberList.getc                 C   r?   r@   rC   rE   r   r   r   Ú__call__¨   rG   zMemberList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Chat.V1.MemberList>r   ©r   r   r   r   Ú__repr__¸   ó   zMemberList.__repr__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úunsetr    r*   r,   r)   r>   rF   rH   rL   Ú__classcell__r   r   r   r   r	      s    
ÿr	   c                       s0   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Z‡  ZS )r6   r
   c                    s   t t| ƒ ||¡ || _dS )aÑ  
        Initialize the MemberPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param service_sid: The unique id of the Service this member belongs to.
        :param channel_sid: The unique id of the Channel for this member.

        :returns: twilio.rest.chat.v1.service.channel.member.MemberPage
        :rtype: twilio.rest.chat.v1.service.channel.member.MemberPage
        N)r   r6   r   r   )r   r   r9   Úsolutionr   r   r   r   Å   s   
zMemberPage.__init__c                 C   s   t | j|| jd | jd d�S )a  
        Build an instance of MemberInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.chat.v1.service.channel.member.MemberInstance
        :rtype: twilio.rest.chat.v1.service.channel.member.MemberInstance
        r   r   r   )r!   r   r   )r   r$   r   r   r   Úget_instanceÖ   s   	üzMemberPage.get_instancec                 C   rI   )rJ   z<Twilio.Chat.V1.MemberPage>r   rK   r   r   r   rL   æ   rM   zMemberPage.__repr__)rN   rO   rP   rQ   r   rU   rL   rS   r   r   r   r   r6   Â   s
    r6   c                       sJ   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zejejfdd	„Z	d
d„ Z
‡  ZS )rD   r
   c                    s6   t t| ƒ |¡ |||dœ| _djdi | j¤Ž| _dS )a{  
        Initialize the MemberContext

        :param Version version: Version that contains the resource
        :param service_sid: The service_sid
        :param channel_sid: The channel_sid
        :param sid: The sid

        :returns: twilio.rest.chat.v1.service.channel.member.MemberContext
        :rtype: twilio.rest.chat.v1.service.channel.member.MemberContext
        rA   z</Services/{service_sid}/Channels/{channel_sid}/Members/{sid}Nr   )r   rD   r   r   r   r   )r   r   r   r   rB   r   r   r   r   ó   s   zMemberContext.__init__c                 C   sD   t  i ¡}| jjd| j|d�}t| j|| jd | jd | jd d�S )úœ
        Fetch a MemberInstance

        :returns: Fetched MemberInstance
        :rtype: twilio.rest.chat.v1.service.channel.member.MemberInstance
        r2   r3   r   r   rB   rA   )r   r   r   Úfetchr   r!   r   )r   r4   r$   r   r   r   rW     s   
ýûzMemberContext.fetchc                 C   s   | j  d| j¡S )ú}
        Deletes the MemberInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rY   r   rK   r   r   r   rY     s   zMemberContext.deletec                 C   sJ   t  ||dœ¡}| jjd| j|d�}t| j|| jd | jd | jd d�S )ár  
        Update the MemberInstance

        :param unicode role_sid: The Role assigned to this member.
        :param unicode last_consumed_message_index: An Integer representing index of the last Message this Member has read within this Channel

        :returns: Updated MemberInstance
        :rtype: twilio.rest.chat.v1.service.channel.member.MemberInstance
        )r   ÚLastConsumedMessageIndexr   r   r   r   rB   rA   )r   r   r   Úupdater   r!   r   )r   r#   Úlast_consumed_message_indexr   r$   r   r   r   r\   %  s   ýûzMemberContext.updatec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rJ   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>G  ó   € z)MemberContext.__repr__.<locals>.<genexpr>z!<Twilio.Chat.V1.MemberContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rL   @  ó   
zMemberContext.__repr__)rN   rO   rP   rQ   r   rW   rY   r   rR   r\   rL   rS   r   r   r   r   rD   ð   s    	
ÿrD   c                       sÜ   e Zd 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edd„ ƒZdd„ Zdd „ Zejejfd!d"„Zd#d$„ Z‡  ZS )&r!   r
   Nc                    s”   t t| ƒ |¡ |d |d |d |d |d t |d ¡t |d ¡|d t |d	 ¡t |d
 ¡|d dœ| _d| _|||pD| jd dœ| _dS )zÆ
        Initialize the MemberInstance

        :returns: twilio.rest.chat.v1.service.channel.member.MemberInstance
        :rtype: twilio.rest.chat.v1.service.channel.member.MemberInstance
        rB   Úaccount_sidr   r   r"   Údate_createdÚdate_updatedr#   r]   Úlast_consumption_timestampÚurl)rB   ro   r   r   r"   rp   rq   r#   r]   rr   rs   NrA   )	r   r!   r   r   Úiso8601_datetimeÚintegerÚ_propertiesÚ_contextr   )r   r   r$   r   r   rB   r   r   r   r   N  s$   õýzMemberInstance.__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: MemberContext for this MemberInstance
        :rtype: twilio.rest.chat.v1.service.channel.member.MemberContext
        Nr   r   rB   rA   )rw   rD   r   r   rK   r   r   r   Ú_proxyn  s   
	üzMemberInstance._proxyc                 C   ó
   | j d S )zq
        :returns: A 34 character string that uniquely identifies this resource.
        :rtype: unicode
        rB   ©rv   rK   r   r   r   rB   €  ó   
zMemberInstance.sidc                 C   ry   )zm
        :returns: The unique id of the Account responsible for this member.
        :rtype: unicode
        ro   rz   rK   r   r   r   ro   ˆ  r{   zMemberInstance.account_sidc                 C   ry   )za
        :returns: The unique id of the Channel for this member.
        :rtype: unicode
        r   rz   rK   r   r   r   r   �  r{   zMemberInstance.channel_sidc                 C   ry   )zh
        :returns: The unique id of the Service this member belongs to.
        :rtype: unicode
        r   rz   rK   r   r   r   r   ˜  r{   zMemberInstance.service_sidc                 C   ry   )zm
        :returns: A unique string identifier for this User in this Service.
        :rtype: unicode
        r"   rz   rK   r   r   r   r"      r{   zMemberInstance.identityc                 C   ry   )z]
        :returns: The date that this resource was created.
        :rtype: datetime
        rp   rz   rK   r   r   r   rp   ¨  r{   zMemberInstance.date_createdc                 C   ry   )zb
        :returns: The date that this resource was last updated.
        :rtype: datetime
        rq   rz   rK   r   r   r   rq   °  r{   zMemberInstance.date_updatedc                 C   ry   )zU
        :returns: The Role assigned to this member.
        :rtype: unicode
        r#   rz   rK   r   r   r   r#   ¸  r{   zMemberInstance.role_sidc                 C   ry   )zŽ
        :returns: An Integer representing index of the last Message this Member has read within this Channel
        :rtype: unicode
        r]   rz   rK   r   r   r   r]   À  r{   z*MemberInstance.last_consumed_message_indexc                 C   ry   )z³
        :returns: An ISO8601 based timestamp string representing the datetime of the last Message read event for this Member within this Channel
        :rtype: datetime
        rr   rz   rK   r   r   r   rr   È  r{   z)MemberInstance.last_consumption_timestampc                 C   ry   )zT
        :returns: An absolute URL for this member.
        :rtype: unicode
        rs   rz   rK   r   r   r   rs   Ð  r{   zMemberInstance.urlc                 C   ó
   | j  ¡ S )rV   )rx   rW   rK   r   r   r   rW   Ø  ó   
zMemberInstance.fetchc                 C   r|   )rX   )rx   rY   rK   r   r   r   rY   á  r}   zMemberInstance.deletec                 C   s   | j j||d�S )rZ   )r#   r]   )rx   r\   )r   r#   r]   r   r   r   r\   ê  s   þzMemberInstance.updatec                 C   r^   )rJ   r_   c                 s   r`   ra   rb   rc   r   r   r   rg     rh   z*MemberInstance.__repr__.<locals>.<genexpr>z"<Twilio.Chat.V1.MemberInstance {}>ri   rl   r   r   r   rL   ú  rn   zMemberInstance.__repr__r-   )rN   rO   rP   rQ   r   Úpropertyrx   rB   ro   r   r   r"   rp   rq   r#   r]   rr   rs   rW   rY   r   rR   r\   rL   rS   r   r   r   r   r!   K  sB     











		
ÿr!   N)rQ   Útwilio.baser   r   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r	   r6   rD   r!   r   r   r   r   Ú<module>   s    1.[