o
    �¨ÊhªQ  ã                   @   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ejejej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.v2.service.channel.member.MemberList
        :rtype: twilio.rest.chat.v2.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/v2/service/channel/member.pyr      s   zMemberList.__init__c           	   
   C   s\   t  |||t |¡t |¡t |¡dœ¡}| jjd| j|d�}t| j|| jd | jd d�S )aå  
        Create a new MemberInstance

        :param unicode identity: A unique string identifier for this User in this Service. See the access tokens docs for more details.
        :param unicode role_sid: The role to be assigned to this member. Defaults to the roles specified on the Service.
        :param unicode last_consumed_message_index: Field used to specify the last consumed Message index for the Channel for this Member.  Should only be used when recreating a Member from a backup/separate source.
        :param datetime last_consumption_timestamp: ISO8601 time indicating the last datetime the Member consumed a Message in the Channel.  Should only be used when recreating a Member from a backup/separate source
        :param datetime date_created: The ISO8601 time specifying the datetime the Members should be set as being created.  Will be set to the current time by the Chat service if not specified.  Note that this should only be used in cases where a Member is being recreated from a backup/separate source
        :param datetime date_updated: The ISO8601 time specifying the datetime the Member should be set as having been last updated.  Will be set to the null by the Chat service if not specified.  Note that this should only be used in cases where a Member is being recreated from a backup/separate source  and where a Member was previously updated.

        :returns: Newly created MemberInstance
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance
        )ÚIdentityÚRoleSidÚLastConsumedMessageIndexÚLastConsumptionTimestampÚDateCreatedÚDateUpdatedÚPOST©Údatar   r   r   )	r   Úofr   Úiso8601_datetimeÚ_versionÚcreater   ÚMemberInstancer   )	r   ÚidentityÚrole_sidÚlast_consumed_message_indexÚlast_consumption_timestampÚdate_createdÚdate_updatedr!   Úpayloadr   r   r   r%   &   s&   ú	ýüzMemberList.createNc                 C   s8   | j  ||¡}| j||d d�}| j  ||d |d ¡S )aL  
        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. See the access tokens docs for more details.
        :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.v2.service.channel.member.MemberInstance]
        Ú	page_size)r'   r.   ÚlimitÚ
page_limit)r$   Úread_limitsÚpageÚstream)r   r'   r/   r.   Úlimitsr2   r   r   r   r3   M   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. See the access tokens docs for more details.
        :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.v2.service.channel.member.MemberInstance]
        )r'   r/   r.   )Úlistr3   )r   r'   r/   r.   r   r   r   r5   e   s   zMemberList.listc                 C   sD   t  t |dd„ ¡|||dœ¡}| jjd| j|d�}t| j|| jƒS )aK  
        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. See the access tokens docs for more details.
        :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.v2.service.channel.member.MemberPage
        c                 S   s   | S ©Nr   )Úer   r   r   Ú<lambda>‡   s    z!MemberList.page.<locals>.<lambda>)r   Ú	PageTokenr   ÚPageSizeÚGET©Úparams)	r   r"   r   Úmapr$   r2   r   Ú
MemberPager   )r   r'   Ú
page_tokenÚpage_numberr.   r=   Úresponser   r   r   r2   x   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.v2.service.channel.member.MemberPage
        r;   )r$   ÚdomainÚtwilioÚrequestr?   r   )r   Ú
target_urlrB   r   r   r   Úget_page•   s
   

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

        :param sid: Key that uniquely defines the member to fetch.

        :returns: twilio.rest.chat.v2.service.channel.member.MemberContext
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberContext
        r   r   ©r   r   Úsid©ÚMemberContextr$   r   ©r   rK   r   r   r   Úget¦   ó   	üzMemberList.getc                 C   rH   rI   rL   rN   r   r   r   Ú__call__¶   rP   zMemberList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Chat.V2.MemberList>r   ©r   r   r   r   Ú__repr__Æ   ó   zMemberList.__repr__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úunsetr%   r3   r5   r2   rG   rO   rQ   rU   Ú__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 )r?   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.v2.service.channel.member.MemberPage
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberPage
        N)r   r?   r   r   )r   r   rB   Ú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.v2.service.channel.member.MemberInstance
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance
        r   r   r   )r&   r$   r   )r   r-   r   r   r   Úget_instanceä   s   	üzMemberPage.get_instancec                 C   rR   )rS   z<Twilio.Chat.V2.MemberPage>r   rT   r   r   r   rU   ô   rV   zMemberPage.__repr__)rW   rX   rY   rZ   r   r^   rU   r\   r   r   r   r   r?   Ð   s
    r?   c                       sV   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zejejejejejfdd	„Z	d
d„ Z
‡  ZS )rM   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: Sid of the Service this member belongs to.
        :param channel_sid: Key that uniquely defines the channel this member belongs to.
        :param sid: Key that uniquely defines the member to fetch.

        :returns: twilio.rest.chat.v2.service.channel.member.MemberContext
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberContext
        rJ   z</Services/{service_sid}/Channels/{channel_sid}/Members/{sid}Nr   )r   rM   r   r   r   r   )r   r   r   r   rK   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.v2.service.channel.member.MemberInstance
        r;   r<   r   r   rK   rJ   )r   r"   r$   Úfetchr   r&   r   )r   r=   r-   r   r   r   r`     s   
ýûzMemberContext.fetchc                 C   s   | j  d| j¡S )ú}
        Deletes the MemberInstance

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

        :param unicode role_sid: The role to be assigned to this member.
        :param unicode last_consumed_message_index: Field used to specify the last consumed Message index for the Channel for this Member.
        :param datetime last_consumption_timestamp: ISO8601 time indicating the last datetime the Member consumed a Message in the Channel.
        :param datetime date_created: The ISO8601 time specifying the datetime the Members should be set as being created.
        :param datetime date_updated: The ISO8601 time specifying the datetime the Member should be set as having been last updated.

        :returns: Updated MemberInstance
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance
        )r   r   r   r   r   r   r    r   r   rK   rJ   )	r   r"   r   r#   r$   Úupdater   r&   r   )r   r(   r)   r*   r+   r,   r!   r-   r   r   r   rd   3  s&   ûýûzMemberContext.updatec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rS   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>`  ó   € z)MemberContext.__repr__.<locals>.<genexpr>z!<Twilio.Chat.V2.MemberContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rU   Y  ó   
zMemberContext.__repr__)rW   rX   rY   rZ   r   r`   rb   r   r[   rd   rU   r\   r   r   r   r   rM   þ   s    	
ý&rM   c                       sø   e Zd ZdZG dd„ deƒ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ejejejfd#d$„Zd%d&„ Z‡  ZS )(r&   r
   c                   @   s   e Zd ZdZdZdS )z!MemberInstance.WebhookEnabledTypeÚtrueÚfalseN)rW   rX   rY   ÚTRUEÚFALSEr   r   r   r   ÚWebhookEnabledTypeg  s    rz   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.v2.service.channel.member.MemberInstance
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance
        rK   Úaccount_sidr   r   r'   r+   r,   r(   r)   r*   Úurl)rK   r{   r   r   r'   r+   r,   r(   r)   r*   r|   NrJ   )	r   r&   r   r   r#   ÚintegerÚ_propertiesÚ_contextr   )r   r   r-   r   r   rK   r   r   r   r   k  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.v2.service.channel.member.MemberContext
        Nr   r   rK   rJ   )r   rM   r$   r   rT   r   r   r   Ú_proxy‹  s   
	üzMemberInstance._proxyc                 C   ó
   | j d S )zq
        :returns: A 34 character string that uniquely identifies this resource.
        :rtype: unicode
        rK   ©r~   rT   r   r   r   rK   �  ó   
zMemberInstance.sidc                 C   r�   )zm
        :returns: The unique id of the Account responsible for this member.
        :rtype: unicode
        r{   r‚   rT   r   r   r   r{   ¥  rƒ   zMemberInstance.account_sidc                 C   r�   )za
        :returns: The unique id of the Channel for this member.
        :rtype: unicode
        r   r‚   rT   r   r   r   r   ­  rƒ   zMemberInstance.channel_sidc                 C   r�   )zh
        :returns: The unique id of the Service this member belongs to.
        :rtype: unicode
        r   r‚   rT   r   r   r   r   µ  rƒ   zMemberInstance.service_sidc                 C   r�   )zm
        :returns: A unique string identifier for this User in this Service.
        :rtype: unicode
        r'   r‚   rT   r   r   r   r'   ½  rƒ   zMemberInstance.identityc                 C   r�   )z]
        :returns: The date that this resource was created.
        :rtype: datetime
        r+   r‚   rT   r   r   r   r+   Å  rƒ   zMemberInstance.date_createdc                 C   r�   )zb
        :returns: The date that this resource was last updated.
        :rtype: datetime
        r,   r‚   rT   r   r   r   r,   Í  rƒ   zMemberInstance.date_updatedc                 C   r�   )zU
        :returns: The Role assigned to this member.
        :rtype: unicode
        r(   r‚   rT   r   r   r   r(   Õ  rƒ   zMemberInstance.role_sidc                 C   r�   )zŽ
        :returns: An Integer representing index of the last Message this Member has read within this Channel
        :rtype: unicode
        r)   r‚   rT   r   r   r   r)   Ý  rƒ   z*MemberInstance.last_consumed_message_indexc                 C   r�   )z³
        :returns: An ISO8601 based timestamp string representing the datetime of the last Message read event for this Member within this Channel
        :rtype: datetime
        r*   r‚   rT   r   r   r   r*   å  rƒ   z)MemberInstance.last_consumption_timestampc                 C   r�   )zT
        :returns: An absolute URL for this member.
        :rtype: unicode
        r|   r‚   rT   r   r   r   r|   í  rƒ   zMemberInstance.urlc                 C   ó
   | j  ¡ S )r_   )r€   r`   rT   r   r   r   r`   õ  ó   
zMemberInstance.fetchc                 C   r„   )ra   )r€   rb   rT   r   r   r   rb   þ  r…   zMemberInstance.deletec                 C   s   | j j|||||d�S )rc   )r(   r)   r*   r+   r,   )r€   rd   )r   r(   r)   r*   r+   r,   r   r   r   rd     s   ûzMemberInstance.updatec                 C   re   )rS   rf   c                 s   rg   rh   ri   rj   r   r   r   rn   &  ro   z*MemberInstance.__repr__.<locals>.<genexpr>z"<Twilio.Chat.V2.MemberInstance {}>rp   rs   r   r   r   rU     ru   zMemberInstance.__repr__r6   )rW   rX   rY   rZ   Úobjectrz   r   Úpropertyr€   rK   r{   r   r   r'   r+   r,   r(   r)   r*   r|   r`   rb   r   r[   rd   rU   r\   r   r   r   r   r&   d  sH     











		
ýr&   N)rZ   Útwilio.baser   r   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r	   r?   rM   r&   r   r   r   r   Ú<module>   s    ?.f