o
    �¨ÊhßA  ã                   @   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ddd„Zddd„Zejejejfd	d
„Z	dd„ Z
ejejfdd„Zdd„ Zdd„ Zdd„ Z‡  ZS )ÚModelBuildListúÉ 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                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )aW  
        Initialize the ModelBuildList

        :param Version version: Version that contains the resource
        :param assistant_sid: The unique ID of the parent Assistant.

        :returns: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildList
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildList
        Úassistant_sidz'/Assistants/{assistant_sid}/ModelBuildsN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr
   ©Ú	__class__r   ú`/var/www/html/env/lib/python3.10/site-packages/twilio/rest/autopilot/v1/assistant/model_build.pyr      s   

zModelBuildList.__init__Nc                 C   s6   | j  ||¡}| j|d d�}| j  ||d |d ¡S )aÐ  
        Streams ModelBuildInstance 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.model_build.ModelBuildInstance]
        Ú	page_size)r   ÚlimitÚ
page_limit)Ú_versionÚread_limitsÚpageÚstream)r   r   r   Úlimitsr   r   r   r   r   &   s   zModelBuildList.streamc                 C   s   t | j||d�ƒS )ap  
        Lists ModelBuildInstance 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.model_build.ModelBuildInstance]
        )r   r   )Úlistr   )r   r   r   r   r   r   r   =   s   zModelBuildList.listc                 C   s6   t  |||dœ¡}| jjd| j|d�}t| j|| jƒS )aÓ  
        Retrieve a single page of ModelBuildInstance 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 ModelBuildInstance
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildPage
        )Ú	PageTokenr   ÚPageSizeÚGET©Úparams)r   Úofr   r   r   ÚModelBuildPager   )r   Ú
page_tokenÚpage_numberr   r#   Úresponser   r   r   r   O   s   ýzModelBuildList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )aK  
        Retrieve a specific page of ModelBuildInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ModelBuildInstance
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildPage
        r!   )r   ÚdomainÚtwilioÚrequestr%   r   )r   Ú
target_urlr(   r   r   r   Úget_pagef   s
   

þzModelBuildList.get_pagec                 C   s:   t  ||dœ¡}| jjd| j|d�}t| j|| jd d�S )a§  
        Create a new ModelBuildInstance

        :param unicode status_callback: The status_callback
        :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. For example: v0.1

        :returns: Newly created ModelBuildInstance
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildInstance
        )ÚStatusCallbackÚ
UniqueNameÚPOST©Údatar
   ©r
   )r   r$   r   Úcreater   ÚModelBuildInstancer   )r   Ústatus_callbackÚunique_namer2   Úpayloadr   r   r   r4   w   s   
ýzModelBuildList.createc                 C   ó   t | j| jd |d�S ©a(  
        Constructs a ModelBuildContext

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

        :returns: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildContext
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildContext
        r
   ©r
   Úsid©ÚModelBuildContextr   r   ©r   r<   r   r   r   Úget‹   ó   	zModelBuildList.getc                 C   r9   r:   r=   r?   r   r   r   Ú__call__–   rA   zModelBuildList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z$<Twilio.Autopilot.V1.ModelBuildList>r   ©r   r   r   r   Ú__repr__¡   ó   zModelBuildList.__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 ModelBuildPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param assistant_sid: The unique ID of the parent Assistant.

        :returns: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildPage
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildPage
        N)r   r%   r   r   )r   r   r(   Úsolutionr   r   r   r   °   s   
zModelBuildPage.__init__c                 C   s   t | j|| jd d�S )a  
        Build an instance of ModelBuildInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildInstance
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildInstance
        r
   r3   )r5   r   r   )r   r8   r   r   r   Úget_instanceÀ   rA   zModelBuildPage.get_instancec                 C   rC   )rD   z$<Twilio.Autopilot.V1.ModelBuildPage>r   rE   r   r   r   rF   Ë   rG   zModelBuildPage.__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 ModelBuildContext

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

        :returns: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildContext
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildContext
        r;   z-/Assistants/{assistant_sid}/ModelBuilds/{sid}Nr   )r   r>   r   r   r   r   )r   r   r
   r<   r   r   r   r   Ú   s   zModelBuildContext.__init__c                 C   s<   t  i ¡}| jjd| j|d�}t| j|| jd | jd d�S )ú¬
        Fetch a ModelBuildInstance

        :returns: Fetched ModelBuildInstance
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildInstance
        r!   r"   r
   r<   r;   )r   r$   r   Úfetchr   r5   r   )r   r#   r8   r   r   r   rQ   ë   s   
ýüzModelBuildContext.fetchc                 C   s@   t  d|i¡}| jjd| j|d�}t| j|| jd | jd d�S )ác  
        Update the ModelBuildInstance

        :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. For example: v0.1

        :returns: Updated ModelBuildInstance
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildInstance
        r/   r0   r1   r
   r<   r;   )r   r$   r   Úupdater   r5   r   )r   r7   r2   r8   r   r   r   rS     s   	ýüzModelBuildContext.updatec                 C   s   | j  d| j¡S )ú�
        Deletes the ModelBuildInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rU   r   rE   r   r   r   rU     s   zModelBuildContext.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-ModelBuildContext.__repr__.<locals>.<genexpr>z*<Twilio.Autopilot.V1.ModelBuildContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rF   "  ó   
zModelBuildContext.__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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dd„ Zejfdd „Zd!d"„ Zd#d$„ Z‡  ZS )&r5   r	   c                   @   s    e Zd ZdZdZdZdZdZdS )zModelBuildInstance.StatusÚenqueuedÚbuildingÚ	completedÚfailedÚcanceledN)rH   rI   rJ   ÚENQUEUEDÚBUILDINGÚ	COMPLETEDÚFAILEDÚCANCELEDr   r   r   r   ÚStatus2  s    rq   Nc                    sŒ   t t| ƒ |¡ |d t |d ¡t |d ¡|d |d |d |d |d t |d	 ¡t |d
 ¡dœ
| _d| _||p@| jd dœ| _dS )zÚ
        Initialize the ModelBuildInstance

        :returns: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildInstance
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildInstance
        Úaccount_sidÚdate_createdÚdate_updatedr
   r<   Ústatusr7   ÚurlÚbuild_durationÚ
error_code)
rr   rs   rt   r
   r<   ru   r7   rv   rw   rx   Nr;   )	r   r5   r   r   Úiso8601_datetimeÚintegerÚ_propertiesÚ_contextr   )r   r   r8   r
   r<   r   r   r   r   9  s   özModelBuildInstance.__init__c                 C   s.   | j du rt| j| jd | jd d�| _ | j S )aA  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: ModelBuildContext for this ModelBuildInstance
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildContext
        Nr
   r<   r;   )r|   r>   r   r   rE   r   r   r   Ú_proxyT  s   
	ýzModelBuildInstance._proxyc                 C   ó
   | j d S )zo
        :returns: The unique ID of the Account that created this Model Build.
        :rtype: unicode
        rr   ©r{   rE   r   r   r   rr   e  ó   
zModelBuildInstance.account_sidc                 C   r~   )z\
        :returns: The date that this resource was created
        :rtype: datetime
        rs   r   rE   r   r   r   rs   m  r€   zModelBuildInstance.date_createdc                 C   r~   )za
        :returns: The date that this resource was last updated
        :rtype: datetime
        rt   r   rE   r   r   r   rt   u  r€   zModelBuildInstance.date_updatedc                 C   r~   )zZ
        :returns: The unique ID of the parent Assistant.
        :rtype: unicode
        r
   r   rE   r   r   r   r
   }  r€   z ModelBuildInstance.assistant_sidc                 C   r~   )zq
        :returns: A 34-character string that uniquely identifies this resource.
        :rtype: unicode
        r<   r   rE   r   r   r   r<   …  r€   zModelBuildInstance.sidc                 C   r~   )z¶
        :returns: A string that described the model build status. The values can be: `enqueued`, `building`, `completed`, `failed`
        :rtype: ModelBuildInstance.Status
        ru   r   rE   r   r   r   ru   �  r€   zModelBuildInstance.statusc                 C   r~   )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   r   rE   r   r   r   r7   •  r€   zModelBuildInstance.unique_namec                 C   r~   )z;
        :returns: The url
        :rtype: unicode
        rv   r   rE   r   r   r   rv   �  r€   zModelBuildInstance.urlc                 C   r~   )zc
        :returns: The time in seconds it took to build the model.
        :rtype: unicode
        rw   r   rE   r   r   r   rw   ¥  r€   z!ModelBuildInstance.build_durationc                 C   r~   )zB
        :returns: The error_code
        :rtype: unicode
        rx   r   rE   r   r   r   rx   ­  r€   zModelBuildInstance.error_codec                 C   ó
   | j  ¡ S )rP   )r}   rQ   rE   r   r   r   rQ   µ  ó   
zModelBuildInstance.fetchc                 C   s   | j j|d�S )rR   )r7   )r}   rS   )r   r7   r   r   r   rS   ¾  s   	zModelBuildInstance.updatec                 C   r�   )rT   )r}   rU   rE   r   r   r   rU   É  r‚   zModelBuildInstance.deletec                 C   rV   )rD   rW   c                 s   rX   rY   rZ   r[   r   r   r   r_   Ù  r`   z.ModelBuildInstance.__repr__.<locals>.<genexpr>z+<Twilio.Autopilot.V1.ModelBuildInstance {}>ra   rd   r   r   r   rF   Ò  rf   zModelBuildInstance.__repr__)N)rH   rI   rJ   rK   Úobjectrq   r   Úpropertyr}   rr   rs   rt   r
   r<   ru   r7   rv   rw   rx   rQ   r   rL   rS   rU   rF   rM   r   r   r   r   r5   -  s<    










		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    *X