o
    e4                     @   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                       sf   e 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  ZS )FlowRevisionListc                    s2   t t| | d|i| _djdi | j| _dS )aO  
        Initialize the FlowRevisionList

        :param Version version: Version that contains the resource
        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionList
        :rtype: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionList
        sidz/Flows/{sid}/RevisionsN )superr   __init__	_solutionformat_uri)selfversionr	   	__class__r
   [/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/studio/v2/flow/flow_revision.pyr      s   

zFlowRevisionList.__init__Nc                 C   s0   | j ||}| j|d d}| j ||d S )a  
        Streams FlowRevisionInstance 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.studio.v2.flow.flow_revision.FlowRevisionInstance]
        	page_size)r   limit)_versionread_limitspagestream)r   r   r   limitsr   r
   r
   r   r   #   s   zFlowRevisionList.streamc                 C   s   t | j||dS )an  
        Lists FlowRevisionInstance 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.studio.v2.flow.flow_revision.FlowRevisionInstance]
        )r   r   )listr   )r   r   r   r
   r
   r   r   :   s   zFlowRevisionList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of FlowRevisionInstance 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 FlowRevisionInstance
        :rtype: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionPage
        )	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   FlowRevisionPager   )r   
page_tokenpage_numberr   dataresponser
   r
   r   r   L   s   zFlowRevisionList.pagec                 C   s"   | j jjd|}t| j || jS )aK  
        Retrieve a specific page of FlowRevisionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of FlowRevisionInstance
        :rtype: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionPage
        r   )r   domaintwiliorequestr$   r   )r   
target_urlr(   r
   r
   r   get_page_   s
   

zFlowRevisionList.get_pagec                 C      t | j| jd |dS a3  
        Constructs a FlowRevisionContext

        :param revision: Specific Revision number or can be `LatestPublished` and `LatestRevision`

        :returns: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionContext
        :rtype: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionContext
        r	   r	   revisionFlowRevisionContextr   r   r   r1   r
   r
   r   getp      	zFlowRevisionList.getc                 C   r.   r/   r2   r4   r
   r
   r   __call__{   r6   zFlowRevisionList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z#<Twilio.Studio.V2.FlowRevisionList>r
   r   r
   r
   r   __repr__      zFlowRevisionList.__repr__)NN)__name__
__module____qualname__r   r   r   r   unsetr   r-   r5   r7   r;   __classcell__r
   r
   r   r   r      s    


r   c                       ,   e Zd Z fddZdd Zdd Z  ZS )r$   c                    s   t t| || || _dS )a  
        Initialize the FlowRevisionPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionPage
        :rtype: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionPage
        N)r   r$   r   r   )r   r   r(   solutionr   r
   r   r      s   
zFlowRevisionPage.__init__c                 C   s   t | j|| jd dS )a  
        Build an instance of FlowRevisionInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionInstance
        :rtype: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionInstance
        r	   )r	   )FlowRevisionInstancer   r   r   payloadr
   r
   r   get_instance   r6   zFlowRevisionPage.get_instancec                 C   r8   )r9   z#<Twilio.Studio.V2.FlowRevisionPage>r
   r:   r
   r
   r   r;      r<   zFlowRevisionPage.__repr__)r=   r>   r?   r   rG   r;   rA   r
   r
   r   r   r$      s    r$   c                       rB   )r3   c                    s4   t t| | ||d| _djdi | j| _dS )a  
        Initialize the FlowRevisionContext

        :param Version version: Version that contains the resource
        :param sid: The SID that identifies the resource to fetch
        :param revision: Specific Revision number or can be `LatestPublished` and `LatestRevision`

        :returns: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionContext
        :rtype: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionContext
        r0   z!/Flows/{sid}/Revisions/{revision}Nr
   )r   r3   r   r   r   r   )r   r   r	   r1   r   r
   r   r      s   zFlowRevisionContext.__init__c                 C   s0   | j jd| jd}t| j || jd | jd dS )
        Fetch the FlowRevisionInstance

        :returns: The fetched FlowRevisionInstance
        :rtype: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionInstance
        r   )r    r!   r	   r1   r0   )r   fetchr   rD   r   rE   r
   r
   r   rI      s   zFlowRevisionContext.fetchc                 C   $   d dd | j D }d|S )r9    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr
   r
   r   	<genexpr>       z/FlowRevisionContext.__repr__.<locals>.<genexpr>z)<Twilio.Studio.V2.FlowRevisionContext {}>joinr   itemsr   r   contextr
   r
   r   r;         
zFlowRevisionContext.__repr__)r=   r>   r?   r   rI   r;   rA   r
   r
   r   r   r3      s    r3   c                       s   e 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edd Zedd Zd d! Zd"d# Z  ZS )%rD   c                   @   s   e Zd ZdZdZdS )zFlowRevisionInstance.Statusdraft	publishedN)r=   r>   r?   DRAFT	PUBLISHEDr
   r
   r
   r   Status   s    r_   Nc                    s   t t| | |d|d|d|d|dt|d|d|d|d	t|d
t|d|dd| _d| _||pO| jd d| _	dS )z
        Initialize the FlowRevisionInstance

        :returns: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionInstance
        :rtype: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionInstance
        r	   account_sidfriendly_name
definitionstatusr1   commit_messagevaliderrorsdate_createddate_updatedurl)r	   r`   ra   rb   rc   r1   rd   re   rf   rg   rh   ri   Nr0   )
r   rD   r   r5   r   integeriso8601_datetime_properties_contextr   )r   r   rF   r	   r1   r   r
   r   r      s    zFlowRevisionInstance.__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: FlowRevisionContext for this FlowRevisionInstance
        :rtype: twilio.rest.studio.v2.flow.flow_revision.FlowRevisionContext
        Nr	   r1   r0   )rm   r3   r   r   r:   r
   r
   r   _proxy  s   
	zFlowRevisionInstance._proxyc                 C   
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r	   rl   r:   r
   r
   r   r	        
zFlowRevisionInstance.sidc                 C   ro   )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r`   rp   r:   r
   r
   r   r`   !  rq   z FlowRevisionInstance.account_sidc                 C   ro   )ze
        :returns: The string that you assigned to describe the Flow
        :rtype: unicode
        ra   rp   r:   r
   r
   r   ra   )  rq   z"FlowRevisionInstance.friendly_namec                 C   ro   )zW
        :returns: JSON representation of flow definition
        :rtype: dict
        rb   rp   r:   r
   r
   r   rb   1  rq   zFlowRevisionInstance.definitionc                 C   ro   )z^
        :returns: The status of the Flow
        :rtype: FlowRevisionInstance.Status
        rc   rp   r:   r
   r
   r   rc   9  rq   zFlowRevisionInstance.statusc                 C   ro   )zg
        :returns: The latest revision number of the Flow's definition
        :rtype: unicode
        r1   rp   r:   r
   r
   r   r1   A  rq   zFlowRevisionInstance.revisionc                 C   ro   )z^
        :returns: Description of change made in the revision
        :rtype: unicode
        rd   rp   r:   r
   r
   r   rd   I  rq   z#FlowRevisionInstance.commit_messagec                 C   ro   )zX
        :returns: Boolean if the flow definition is valid
        :rtype: bool
        re   rp   r:   r
   r
   r   re   Q  rq   zFlowRevisionInstance.validc                 C   ro   )z[
        :returns: List of error in the flow definition
        :rtype: list[dict]
        rf   rp   r:   r
   r
   r   rf   Y  rq   zFlowRevisionInstance.errorsc                 C   ro   )zt
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        rg   rp   r:   r
   r
   r   rg   a  rq   z!FlowRevisionInstance.date_createdc                 C   ro   )zy
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        rh   rp   r:   r
   r
   r   rh   i  rq   z!FlowRevisionInstance.date_updatedc                 C   ro   )zT
        :returns: The absolute URL of the resource
        :rtype: unicode
        ri   rp   r:   r
   r
   r   ri   q  rq   zFlowRevisionInstance.urlc                 C   s
   | j  S )rH   )rn   rI   r:   r
   r
   r   rI   y  s   
zFlowRevisionInstance.fetchc                 C   rJ   )r9   rK   c                 s   rL   rM   rN   rO   r
   r
   r   rS     rT   z0FlowRevisionInstance.__repr__.<locals>.<genexpr>z*<Twilio.Studio.V2.FlowRevisionInstance {}>rU   rX   r
   r
   r   r;     rZ   zFlowRevisionInstance.__repr__)N)r=   r>   r?   objectr_   r   propertyrn   r	   r`   ra   rb   rc   r1   rd   re   rf   rg   rh   ri   rI   r;   rA   r
   r
   r   r   rD      s>    












	rD   N)__doc__twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r$   r3   rD   r
   r
   r
   r   <module>   s   '.