o
    �¨ÊhE=  ã                   @   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                       sr   e Zd ZdZ‡ fdd„Zddd„Zddd„Zejejejfd	d
„Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Z‡  ZS )Ú	FieldListúÉ PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )aŽ  
        Initialize the FieldList

        :param Version version: Version that contains the resource
        :param assistant_sid: The unique ID of the Assistant.
        :param task_sid: The unique ID of the Task associated with this Field.

        :returns: twilio.rest.autopilot.v1.assistant.task.field.FieldList
        :rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldList
        ©Úassistant_sidÚtask_sidz3/Assistants/{assistant_sid}/Tasks/{task_sid}/FieldsN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr   r   ©Ú	__class__r   ú_/var/www/html/env/lib/python3.10/site-packages/twilio/rest/autopilot/v1/assistant/task/field.pyr      s   zFieldList.__init__Nc                 C   s6   | j  ||¡}| j|d d�}| j  ||d |d ¡S )aÅ  
        Streams FieldInstance 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 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.autopilot.v1.assistant.task.field.FieldInstance]
        Ú	page_size)r   ÚlimitÚ
page_limit)Ú_versionÚread_limitsÚpageÚstream)r   r   r   Úlimitsr   r   r   r   r   '   s   zFieldList.streamc                 C   s   t | j||d�ƒS )ae  
        Lists FieldInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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.autopilot.v1.assistant.task.field.FieldInstance]
        )r   r   )Úlistr   )r   r   r   r   r   r   r    >   s   zFieldList.listc                 C   s6   t  |||dœ¡}| jjd| j|d�}t| j|| jƒS )aÃ  
        Retrieve a single page of FieldInstance records from the API.
        Request is executed immediately

        :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 FieldInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldPage
        )Ú	PageTokenr   ÚPageSizeÚGET©Úparams)r   Úofr   r   r   Ú	FieldPager   )r   Ú
page_tokenÚpage_numberr   r%   Úresponser   r   r   r   P   s   ýzFieldList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )a;  
        Retrieve a specific page of FieldInstance records from the API.
        Request is executed immediately

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

        :returns: Page of FieldInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldPage
        r#   )r   ÚdomainÚtwilioÚrequestr'   r   )r   Ú
target_urlr*   r   r   r   Úget_pageg   s
   

þzFieldList.get_pagec                 C   sB   t  ||dœ¡}| jjd| j|d�}t| j|| jd | jd d�S )aã  
        Create a new FieldInstance

        :param unicode field_type: The Field Type of this field. It can be either a Built-in Field Type or the unique_name or sid of a custom Field Type.
        :param unicode unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long.

        :returns: Newly created FieldInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldInstance
        )Ú	FieldTypeÚ
UniqueNameÚPOST)Údatar   r   r
   )r   r&   r   Úcreater   ÚFieldInstancer   )r   Ú
field_typeÚunique_namer3   Úpayloadr   r   r   r4   x   s   
ýüzFieldList.createc                 C   ó   t | j| jd | jd |d�S ©a  
        Constructs a FieldContext

        :param sid: A 34-character string that uniquely identifies this resource.

        :returns: twilio.rest.autopilot.v1.assistant.task.field.FieldContext
        :rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldContext
        r   r   ©r   r   Úsid©ÚFieldContextr   r   ©r   r<   r   r   r   Úget‘   ó   	üzFieldList.getc                 C   r9   r:   r=   r?   r   r   r   Ú__call__¡   rA   zFieldList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Autopilot.V1.FieldList>r   ©r   r   r   r   Ú__repr__±   ó   zFieldList.__repr__)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r    r   Úunsetr   r/   r4   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 FieldPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param assistant_sid: The unique ID of the Assistant.
        :param task_sid: The unique ID of the Task associated with this Field.

        :returns: twilio.rest.autopilot.v1.assistant.task.field.FieldPage
        :rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldPage
        N)r   r'   r   r   )r   r   r*   Úsolutionr   r   r   r   À   s   
zFieldPage.__init__c                 C   s   t | j|| jd | jd d�S )a  
        Build an instance of FieldInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.autopilot.v1.assistant.task.field.FieldInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldInstance
        r   r   r
   )r5   r   r   )r   r8   r   r   r   Úget_instanceÑ   s   	üzFieldPage.get_instancec                 C   rC   )rD   z<Twilio.Autopilot.V1.FieldPage>r   rE   r   r   r   rF   á   rG   zFieldPage.__repr__)rH   rI   rJ   rK   r   rO   rF   rM   r   r   r   r   r'   »   s
    r'   c                       s8   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zdd	„ Z‡  ZS )
r>   r	   c                    s6   t t| ƒ |¡ |||dœ| _djdi | j¤Ž| _dS )aé  
        Initialize the FieldContext

        :param Version version: Version that contains the resource
        :param assistant_sid: The unique ID of the Assistant.
        :param task_sid: The unique ID of the Task associated with this Field.
        :param sid: A 34-character string that uniquely identifies this resource.

        :returns: twilio.rest.autopilot.v1.assistant.task.field.FieldContext
        :rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldContext
        r;   z9/Assistants/{assistant_sid}/Tasks/{task_sid}/Fields/{sid}Nr   )r   r>   r   r   r   r   )r   r   r   r   r<   r   r   r   r   ð   s   zFieldContext.__init__c                 C   sD   t  i ¡}| jjd| j|d�}t| j|| jd | jd | jd d�S )úœ
        Fetch a FieldInstance

        :returns: Fetched FieldInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldInstance
        r#   r$   r   r   r<   r;   )r   r&   r   Úfetchr   r5   r   )r   r%   r8   r   r   r   rQ     s   
ýûzFieldContext.fetchc                 C   s   | j  d| j¡S )ú|
        Deletes the FieldInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rS   r   rE   r   r   r   rS     s   zFieldContext.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>)  ó   € z(FieldContext.__repr__.<locals>.<genexpr>z%<Twilio.Autopilot.V1.FieldContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rF   "  ó   
zFieldContext.__repr__)	rH   rI   rJ   rK   r   rQ   rS   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edd„ ƒZdd„ Zdd„ Zdd„ Z‡  ZS ) r5   r	   Nc              
      s|   t t| ƒ |¡ |d t |d ¡t |d ¡|d |d |d |d |d |d	 d
œ	| _d| _|||p8| jd dœ| _dS )zÉ
        Initialize the FieldInstance

        :returns: twilio.rest.autopilot.v1.assistant.task.field.FieldInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldInstance
        Úaccount_sidÚdate_createdÚdate_updatedr6   r   r   r<   r7   Úurl)	re   rf   rg   r6   r   r   r<   r7   rh   Nr;   )r   r5   r   r   Úiso8601_datetimeÚ_propertiesÚ_contextr   )r   r   r8   r   r   r<   r   r   r   r   2  s    ÷ýzFieldInstance.__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: FieldContext for this FieldInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldContext
        Nr   r   r<   r;   )rk   r>   r   r   rE   r   r   r   Ú_proxyP  s   
	üzFieldInstance._proxyc                 C   ó
   | j d S )zi
        :returns: The unique ID of the Account that created this Field.
        :rtype: unicode
        re   ©rj   rE   r   r   r   re   b  ó   
zFieldInstance.account_sidc                 C   rm   )z\
        :returns: The date that this resource was created
        :rtype: datetime
        rf   rn   rE   r   r   r   rf   j  ro   zFieldInstance.date_createdc                 C   rm   )za
        :returns: The date that this resource was last updated
        :rtype: datetime
        rg   rn   rE   r   r   r   rg   r  ro   zFieldInstance.date_updatedc                 C   rm   )zª
        :returns: The Field Type of this field. It can be either a Built-in Field Type or the unique_name or sid of a custom Field Type.
        :rtype: unicode
        r6   rn   rE   r   r   r   r6   z  ro   zFieldInstance.field_typec                 C   rm   )zi
        :returns: The unique ID of the Task associated with this Field.
        :rtype: unicode
        r   rn   rE   r   r   r   r   ‚  ro   zFieldInstance.task_sidc                 C   rm   )zS
        :returns: The unique ID of the Assistant.
        :rtype: unicode
        r   rn   rE   r   r   r   r   Š  ro   zFieldInstance.assistant_sidc                 C   rm   )zq
        :returns: A 34-character string that uniquely identifies this resource.
        :rtype: unicode
        r<   rn   rE   r   r   r   r<   ’  ro   zFieldInstance.sidc                 C   rm   )z°
        :returns: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long.
        :rtype: unicode
        r7   rn   rE   r   r   r   r7   š  ro   zFieldInstance.unique_namec                 C   rm   )z;
        :returns: The url
        :rtype: unicode
        rh   rn   rE   r   r   r   rh   ¢  ro   zFieldInstance.urlc                 C   ó
   | j  ¡ S )rP   )rl   rQ   rE   r   r   r   rQ   ª  ó   
zFieldInstance.fetchc                 C   rp   )rR   )rl   rS   rE   r   r   r   rS   ³  rq   zFieldInstance.deletec                 C   rT   )rD   rU   c                 s   rV   rW   rX   rY   r   r   r   r]   Ã  r^   z)FieldInstance.__repr__.<locals>.<genexpr>z&<Twilio.Autopilot.V1.FieldInstance {}>r_   rb   r   r   r   rF   ¼  rd   zFieldInstance.__repr__)N)rH   rI   rJ   rK   r   Úpropertyrl   re   rf   rg   r6   r   r   r<   r7   rh   rQ   rS   rF   rM   r   r   r   r   r5   -  s4    









		r5   N)rK   Útwilio.baser   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r   r'   r>   r5   r   r   r   r   Ú<module>   s    +0B