o
    �¨Êh}=  ã                   @   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 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)Úvalues)ÚInstanceContext)ÚInstanceResource)ÚListResource)ÚPagec                       s˜   e Zd ZdZ‡ fdd„Zejejddfdd„Zejejddfdd„Zejejejejejfd	d
„Z	dd„ Z
ejfdd„Zdd„ Zdd„ Zdd„ Z‡  ZS )ÚActivityListú  c                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )ad  
        Initialize the ActivityList

        :param Version version: Version that contains the resource
        :param workspace_sid: The unique ID of the Workspace that this Activity belongs to.

        :returns: twilio.rest.taskrouter.v1.workspace.activity.ActivityList
        :rtype: twilio.rest.taskrouter.v1.workspace.activity.ActivityList
        Úworkspace_sidz&/Workspaces/{workspace_sid}/ActivitiesN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr
   ©Ú	__class__r   ú^/var/www/html/env/lib/python3.10/site-packages/twilio/rest/taskrouter/v1/workspace/activity.pyr      s   

zActivityList.__init__Nc                 C   s:   | j  ||¡}| j|||d d�}| j  ||d |d ¡S )ap  
        Streams ActivityInstance 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 friendly_name: Filter by an Activity's friendly name
        :param unicode available: Filter by activities that are available or unavailable.
        :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.taskrouter.v1.workspace.activity.ActivityInstance]
        Ú	page_size)Úfriendly_nameÚ	availabler   ÚlimitÚ
page_limit)Ú_versionÚread_limitsÚpageÚstream)r   r   r   r   r   Úlimitsr   r   r   r   r   $   s   zActivityList.streamc                 C   s   t | j||||d�ƒS )a  
        Lists ActivityInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param unicode friendly_name: Filter by an Activity's friendly name
        :param unicode available: Filter by activities that are available or unavailable.
        :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.taskrouter.v1.workspace.activity.ActivityInstance]
        )r   r   r   r   )Úlistr   )r   r   r   r   r   r   r   r   r    >   s   üzActivityList.listc                 C   s:   t  |||||dœ¡}| jjd| j|d�}t| j|| jƒS )aq  
        Retrieve a single page of ActivityInstance records from the API.
        Request is executed immediately

        :param unicode friendly_name: Filter by an Activity's friendly name
        :param unicode available: Filter by activities that are available or unavailable.
        :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 ActivityInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.activity.ActivityPage
        )ÚFriendlyNameÚ	AvailableÚ	PageTokenr   ÚPageSizeÚGET©Úparams)r   Úofr   r   r   ÚActivityPager   )r   r   r   Ú
page_tokenÚpage_numberr   r'   Úresponser   r   r   r   X   s   ûýzActivityList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )aC  
        Retrieve a specific page of ActivityInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ActivityInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.activity.ActivityPage
        r%   )r   ÚdomainÚtwilioÚrequestr)   r   )r   Ú
target_urlr,   r   r   r   Úget_pagex   s
   

þzActivityList.get_pagec                 C   s:   t  ||dœ¡}| jjd| j|d�}t| j|| jd d�S )a¸  
        Create a new ActivityInstance

        :param unicode friendly_name: A human-readable name for the Activity, such as 'On Call', 'Break', 'Email', etc.
        :param bool available: Boolean value indicating whether the worker should be eligible to receive a Task when they occupy this Activity.

        :returns: Newly created ActivityInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.activity.ActivityInstance
        )r!   r"   ÚPOST©Údatar
   ©r
   )r   r(   r   Úcreater   ÚActivityInstancer   )r   r   r   r4   Úpayloadr   r   r   r6   ‰   s   
ýzActivityList.createc                 C   ó   t | j| jd |d�S ©zè
        Constructs a ActivityContext

        :param sid: The sid

        :returns: twilio.rest.taskrouter.v1.workspace.activity.ActivityContext
        :rtype: twilio.rest.taskrouter.v1.workspace.activity.ActivityContext
        r
   ©r
   Úsid©ÚActivityContextr   r   ©r   r<   r   r   r   Úget�   ó   	zActivityList.getc                 C   r9   r:   r=   r?   r   r   r   Ú__call__¨   rA   zActivityList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z#<Twilio.Taskrouter.V1.ActivityList>r   ©r   r   r   r   Ú__repr__³   ó   zActivityList.__repr__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úunsetr   r    r   r1   r6   r@   rB   rF   Ú__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 ActivityPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param workspace_sid: The unique ID of the Workspace that this Activity belongs to.

        :returns: twilio.rest.taskrouter.v1.workspace.activity.ActivityPage
        :rtype: twilio.rest.taskrouter.v1.workspace.activity.ActivityPage
        N)r   r)   r   r   )r   r   r,   Úsolutionr   r   r   r   À   s   
zActivityPage.__init__c                 C   s   t | j|| jd d�S )a  
        Build an instance of ActivityInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.taskrouter.v1.workspace.activity.ActivityInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.activity.ActivityInstance
        r
   r5   )r7   r   r   )r   r8   r   r   r   Úget_instanceÐ   rA   zActivityPage.get_instancec                 C   rC   )rD   z#<Twilio.Taskrouter.V1.ActivityPage>r   rE   r   r   r   rF   Û   rG   zActivityPage.__repr__)rH   rI   rJ   rK   r   rO   rF   rM   r   r   r   r   r)   ½   s
    r)   c                       sF   e Zd ZdZ‡ fdd„Zdd„ Zejfdd„Zdd	„ Z	d
d„ Z
‡  ZS )r>   r	   c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )a]  
        Initialize the ActivityContext

        :param Version version: Version that contains the resource
        :param workspace_sid: The workspace_sid
        :param sid: The sid

        :returns: twilio.rest.taskrouter.v1.workspace.activity.ActivityContext
        :rtype: twilio.rest.taskrouter.v1.workspace.activity.ActivityContext
        r;   z,/Workspaces/{workspace_sid}/Activities/{sid}Nr   )r   r>   r   r   r   r   )r   r   r
   r<   r   r   r   r   è   s   zActivityContext.__init__c                 C   s<   t  i ¡}| jjd| j|d�}t| j|| jd | jd d�S )ú¤
        Fetch a ActivityInstance

        :returns: Fetched ActivityInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.activity.ActivityInstance
        r%   r&   r
   r<   r;   )r   r(   r   Úfetchr   r7   r   )r   r'   r8   r   r   r   rQ   ù   s   
ýüzActivityContext.fetchc                 C   s@   t  d|i¡}| jjd| j|d�}t| j|| jd | jd d�S )á   
        Update the ActivityInstance

        :param unicode friendly_name: A human-readable name for the Activity, such as 'on-call', 'break', 'email', etc.

        :returns: Updated ActivityInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.activity.ActivityInstance
        r!   r2   r3   r
   r<   r;   )r   r(   r   Úupdater   r7   r   )r   r   r4   r8   r   r   r   rS     s   	ýüzActivityContext.updatec                 C   s   | j  d| j¡S )ú
        Deletes the ActivityInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rU   r   rE   r   r   r   rU   '  s   zActivityContext.deletec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rD   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>7  ó   € z+ActivityContext.__repr__.<locals>.<genexpr>z)<Twilio.Taskrouter.V1.ActivityContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rF   0  ó   
zActivityContext.__repr__)rH   rI   rJ   rK   r   rQ   r   rL   rS   rU   rF   rM   r   r   r   r   r>   å   s    	r>   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dd„ Zejfdd„Zdd„ Zdd„ Z‡  ZS ) r7   r	   Nc              	      st   t t| ƒ |¡ |d |d t |d ¡t |d ¡|d |d |d |d d	œ| _d
| _||p4| jd dœ| _d
S )zÐ
        Initialize the ActivityInstance

        :returns: twilio.rest.taskrouter.v1.workspace.activity.ActivityInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.activity.ActivityInstance
        Úaccount_sidr   Údate_createdÚdate_updatedr   r<   r
   Úurl)rg   r   rh   ri   r   r<   r
   rj   Nr;   )r   r7   r   r   Úiso8601_datetimeÚ_propertiesÚ_contextr   )r   r   r8   r
   r<   r   r   r   r   >  s   øzActivityInstance.__init__c                 C   s.   | j du rt| j| jd | jd d�| _ | j S )a9  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: ActivityContext for this ActivityInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.activity.ActivityContext
        Nr
   r<   r;   )rm   r>   r   r   rE   r   r   r   Ú_proxyW  s   
	ýzActivityInstance._proxyc                 C   ó
   | j d S )zi
        :returns: The unique ID of the Account that owns this Activity.
        :rtype: unicode
        rg   ©rl   rE   r   r   r   rg   h  ó   
zActivityInstance.account_sidc                 C   ro   )zh
        :returns: Filter by activities that are available or unavailable.
        :rtype: bool
        r   rp   rE   r   r   r   r   p  rq   zActivityInstance.availablec                 C   ro   )zX
        :returns: The date this Activity was created.
        :rtype: datetime
        rh   rp   rE   r   r   r   rh   x  rq   zActivityInstance.date_createdc                 C   ro   )zX
        :returns: The date this Activity was updated.
        :rtype: datetime
        ri   rp   rE   r   r   r   ri   €  rq   zActivityInstance.date_updatedc                 C   ro   )zY
        :returns: Filter by an Activity's friendly name
        :rtype: unicode
        r   rp   rE   r   r   r   r   ˆ  rq   zActivityInstance.friendly_namec                 C   ro   )zT
        :returns: The unique ID for this Activity.
        :rtype: unicode
        r<   rp   rE   r   r   r   r<   �  rq   zActivityInstance.sidc                 C   ro   )zq
        :returns: The unique ID of the Workspace that this Activity belongs to.
        :rtype: unicode
        r
   rp   rE   r   r   r   r
   ˜  rq   zActivityInstance.workspace_sidc                 C   ro   )z;
        :returns: The url
        :rtype: unicode
        rj   rp   rE   r   r   r   rj      rq   zActivityInstance.urlc                 C   ó
   | j  ¡ S )rP   )rn   rQ   rE   r   r   r   rQ   ¨  ó   
zActivityInstance.fetchc                 C   s   | j j|d�S )rR   )r   )rn   rS   )r   r   r   r   r   rS   ±  s   	zActivityInstance.updatec                 C   rr   )rT   )rn   rU   rE   r   r   r   rU   ¼  rs   zActivityInstance.deletec                 C   rV   )rD   rW   c                 s   rX   rY   rZ   r[   r   r   r   r_   Ì  r`   z,ActivityInstance.__repr__.<locals>.<genexpr>z*<Twilio.Taskrouter.V1.ActivityInstance {}>ra   rd   r   r   r   rF   Å  rf   zActivityInstance.__repr__)N)rH   rI   rJ   rK   r   Úpropertyrn   rg   r   rh   ri   r   r<   r
   rj   rQ   r   rL   rS   rU   rF   rM   r   r   r   r   r7   ;  s2    








		r7   N)rK   Útwilio.baser   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r   r)   r>   r7   r   r   r   r   Ú<module>   s    -(V