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                       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 )al  
        Initialize the ModelBuildList

        :param Version version: Version that contains the resource
        :param assistant_sid: The SID of the Assistant that is the parent of the resource

        :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   a/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/autopilot/v1/assistant/model_build.pyr      s   

zModelBuildList.__init__Nc                 C   s0   | j ||}| j|d d}| j ||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)_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)methoduriparams)r   ofr   r   r   ModelBuildPager   )r   
page_tokenpage_numberr   data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_pageb   s
   

zModelBuildList.get_pagec                 C   s:   t ||d}| jjd| j|d}t| j|| jd dS )a  
        Create the ModelBuildInstance

        :param unicode status_callback: The URL we should call using a POST method to send status information to your application
        :param unicode unique_name: An application-defined string that uniquely identifies the new resource

        :returns: The created ModelBuildInstance
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildInstance
        )StatusCallback
UniqueNamePOSTr!   r"   r(   r
   r
   )r   r$   r   creater   ModelBuildInstancer   )r   status_callbackunique_namer(   payloadr   r   r   r4   s   s   
zModelBuildList.createc                 C      t | j| jd |dS a  
        Constructs a ModelBuildContext

        :param sid: The unique string that identifies the 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 SID of the Assistant that is the parent of the resource

        :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   rP   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 SID of the Assistant that is the parent of the resource to fetch
        :param sid: The unique string that identifies the 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   s0   | j jd| jd}t| j || jd | jd dS )
        Fetch the ModelBuildInstance

        :returns: The fetched ModelBuildInstance
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildInstance
        r    r!   r"   r
   r<   r;   )r   fetchr   r5   r   rO   r   r   r   rS      s   zModelBuildContext.fetchc                 C   s@   t d|i}| jjd| j|d}t| j|| jd | jd dS )  
        Update the ModelBuildInstance

        :param unicode unique_name: An application-defined string that uniquely identifies the resource

        :returns: The updated ModelBuildInstance
        :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildInstance
        r0   r1   r2   r
   r<   r;   )r   r$   r   updater   r5   r   )r   r7   r(   r8   r   r   r   rU      s   	zModelBuildContext.updatec                 C   s   | j jd| jdS )
        Deletes the ModelBuildInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErR   )r   deleter   rE   r   r   r   rX     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   rS   r   rL   rU   rX   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   Status   s    rt   Nc                    s   t t| | |dt|dt|d|d|d|d|d|dt|d	t|d
d
| _d| _||pJ| 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)
ru   rv   rw   r
   r<   rx   r7   ry   rz   r{   Nr;   )
r   r5   r   r@   r   iso8601_datetimeinteger_properties_contextr   )r   r   r8   r
   r<   r   r   r   r   '  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   _proxyB  s   
	zModelBuildInstance._proxyc                 C   
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        ru   r~   rE   r   r   r   ru   S     
zModelBuildInstance.account_sidc                 C   r   )zt
        :returns: The RFC 2822 date and time in GMT when the resource was created
        :rtype: datetime
        rv   r   rE   r   r   r   rv   [  r   zModelBuildInstance.date_createdc                 C   r   )zy
        :returns: The RFC 2822 date and time in GMT when the resource was last updated
        :rtype: datetime
        rw   r   rE   r   r   r   rw   c  r   zModelBuildInstance.date_updatedc                 C   r   )zo
        :returns: The SID of the Assistant that is the parent of the resource
        :rtype: unicode
        r
   r   rE   r   r   r   r
   k  r   z ModelBuildInstance.assistant_sidc                 C   r   )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r<   r   rE   r   r   r   r<   s  r   zModelBuildInstance.sidc                 C   r   )zk
        :returns: The status of the model build process
        :rtype: ModelBuildInstance.Status
        rx   r   rE   r   r   r   rx   {  r   zModelBuildInstance.statusc                 C   r   )zw
        :returns: An application-defined string that uniquely identifies the resource
        :rtype: unicode
        r7   r   rE   r   r   r   r7     r   zModelBuildInstance.unique_namec                 C   r   )z_
        :returns: The absolute URL of the ModelBuild resource
        :rtype: unicode
        ry   r   rE   r   r   r   ry     r   zModelBuildInstance.urlc                 C   r   )zb
        :returns: The time in seconds it took to build the model
        :rtype: unicode
        rz   r   rE   r   r   r   rz     r   z!ModelBuildInstance.build_durationc                 C   r   )z~
        :returns: More information about why the model build failed, if `status` is `failed`
        :rtype: unicode
        r{   r   rE   r   r   r   r{     r   zModelBuildInstance.error_codec                 C   
   | j  S )rQ   )r   rS   rE   r   r   r   rS        
zModelBuildInstance.fetchc                 C   s   | j j|dS )rT   )r7   )r   rU   )r   r7   r   r   r   rU     s   	zModelBuildInstance.updatec                 C   r   )rV   )r   rX   rE   r   r   r   rX     r   zModelBuildInstance.deletec                 C   rY   )rD   rZ   c                 s   r[   r\   r]   r^   r   r   r   rb     rc   z.ModelBuildInstance.__repr__.<locals>.<genexpr>z+<Twilio.Autopilot.V1.ModelBuildInstance {}>rd   rg   r   r   r   rF     ri   zModelBuildInstance.__repr__)N)rH   rI   rJ   rK   objectrt   r   propertyr   ru   rv   rw   r
   r<   rx   r7   ry   rz   r{   rS   r   rL   rU   rX   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    *N