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 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 SID of the Assistant that is the parent of the Task associated with the resource
        :param task_sid: The SID of the `Task <https://www.twilio.com/docs/autopilot/api/task>`_ resource 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/venv/lib/python3.10/site-packages/twilio/rest/autopilot/v1/assistant/task/field.pyr      s   zFieldList.__init__Nc                 C   s0   | j ||}| j|d d}| j ||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)_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)methoduriparams)r   ofr   r   r   	FieldPager   )r   
page_tokenpage_numberr   data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_pagec   s
   

zFieldList.get_pagec                 C   sB   t ||d}| jjd| j|d}t| j|| jd | jd dS )aP  
        Create the FieldInstance

        :param unicode field_type: The Field Type of this field
        :param unicode unique_name: An application-defined string that uniquely identifies the new resource

        :returns: The created FieldInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldInstance
        )	FieldType
UniqueNamePOST)r#   r$   r*   r   r   r
   )r   r&   r   creater   FieldInstancer   )r   
field_typeunique_namer*   payloadr   r   r   r4   t   s   
zFieldList.createc                 C      t | j| jd | jd |dS a  
        Constructs a FieldContext

        :param sid: The unique string that identifies the 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   r0   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 )a1  
        Initialize the FieldPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param assistant_sid: The SID of the Assistant that is the parent of the Task associated with the resource
        :param task_sid: The SID of the `Task <https://www.twilio.com/docs/autopilot/api/task>`_ resource 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   rP   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 SID of the Assistant that is the parent of the Task associated with the resource to fetch
        :param task_sid: The SID of the `Task <https://www.twilio.com/docs/autopilot/api/task>`_ resource associated with the Field resource to fetch
        :param sid: The unique string that identifies the 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   s8   | j jd| jd}t| j || jd | jd | jd dS )
        Fetch the FieldInstance

        :returns: The fetched FieldInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldInstance
        r"   r#   r$   r   r   r<   r;   )r   fetchr   r5   r   rO   r   r   r   rS      s   zFieldContext.fetchc                 C   s   | j jd| jdS )|
        Deletes the FieldInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErR   )r   deleter   rE   r   r   r   rV     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   rS   rV   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| _|||pA| 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)	rh   ri   rj   r6   r   r   r<   r7   rk   Nr;   )	r   r5   r   r@   r   iso8601_datetime_properties_contextr   )r   r   r8   r   r   r<   r   r   r   r   $  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;   )rn   r>   r   r   rE   r   r   r   _proxyB  s   
	zFieldInstance._proxyc                 C   
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rh   rm   rE   r   r   r   rh   T     
zFieldInstance.account_sidc                 C   rp   )zt
        :returns: The RFC 2822 date and time in GMT when the resource was created
        :rtype: datetime
        ri   rq   rE   r   r   r   ri   \  rr   zFieldInstance.date_createdc                 C   rp   )zy
        :returns: The RFC 2822 date and time in GMT when the resource was last updated
        :rtype: datetime
        rj   rq   rE   r   r   r   rj   d  rr   zFieldInstance.date_updatedc                 C   rp   )zO
        :returns: The Field Type of the field
        :rtype: unicode
        r6   rq   rE   r   r   r   r6   l  rr   zFieldInstance.field_typec                 C   rp   )z
        :returns: The SID of the `Task <https://www.twilio.com/docs/autopilot/api/task>`_ resource associated with this Field
        :rtype: unicode
        r   rq   rE   r   r   r   r   t  rr   zFieldInstance.task_sidc                 C   rp   )z
        :returns: The SID of the Assistant that is the parent of the Task associated with the resource
        :rtype: unicode
        r   rq   rE   r   r   r   r   |  rr   zFieldInstance.assistant_sidc                 C   rp   )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r<   rq   rE   r   r   r   r<     rr   zFieldInstance.sidc                 C   rp   )zw
        :returns: An application-defined string that uniquely identifies the resource
        :rtype: unicode
        r7   rq   rE   r   r   r   r7     rr   zFieldInstance.unique_namec                 C   rp   )zZ
        :returns: The absolute URL of the Field resource
        :rtype: unicode
        rk   rq   rE   r   r   r   rk     rr   zFieldInstance.urlc                 C   
   | j  S )rQ   )ro   rS   rE   r   r   r   rS        
zFieldInstance.fetchc                 C   rs   )rT   )ro   rV   rE   r   r   r   rV     rt   zFieldInstance.deletec                 C   rW   )rD   rX   c                 s   rY   rZ   r[   r\   r   r   r   r`     ra   z)FieldInstance.__repr__.<locals>.<genexpr>z&<Twilio.Autopilot.V1.FieldInstance {}>rb   re   r   r   r   rF     rg   zFieldInstance.__repr__)N)rH   rI   rJ   rK   r   propertyro   rh   ri   rj   r6   r   r   r<   r7   rk   rS   rV   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<