o
    �¨Êh?  ã                   @   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ejej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 )ÚDeploymentListúÉ 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 )a^  
        Initialize the DeploymentList

        :param Version version: Version that contains the resource
        :param fleet_sid: The unique identifier of the Fleet.

        :returns: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentList
        :rtype: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentList
        Ú	fleet_sidz/Fleets/{fleet_sid}/DeploymentsN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr
   ©Ú	__class__r   úg/var/www/html/env/lib/python3.10/site-packages/twilio/rest/preview/deployed_devices/fleet/deployment.pyr      s   

zDeploymentList.__init__c                 C   s:   t  ||dœ¡}| jjd| j|d�}t| j|| jd d�S )at  
        Create a new DeploymentInstance

        :param unicode friendly_name: A human readable description for this Deployment.
        :param unicode sync_service_sid: The unique identifier of the Sync service instance.

        :returns: Newly created DeploymentInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentInstance
        ©ÚFriendlyNameÚSyncServiceSidÚPOST©Údatar
   ©r
   )r   ÚofÚ_versionÚcreater   ÚDeploymentInstancer   ©r   Úfriendly_nameÚsync_service_sidr   Úpayloadr   r   r   r   &   s   
ýzDeploymentList.createNc                 C   s6   | j  ||¡}| j|d d�}| j  ||d |d ¡S )a×  
        Streams DeploymentInstance 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.preview.deployed_devices.fleet.deployment.DeploymentInstance]
        Ú	page_size)r%   ÚlimitÚ
page_limit)r   Úread_limitsÚpageÚstream)r   r&   r%   Úlimitsr)   r   r   r   r*   :   s   zDeploymentList.streamc                 C   s   t | j||d�ƒS )aw  
        Lists DeploymentInstance 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.preview.deployed_devices.fleet.deployment.DeploymentInstance]
        )r&   r%   )Úlistr*   )r   r&   r%   r   r   r   r,   Q   s   zDeploymentList.listc                 C   s6   t  |||dœ¡}| jjd| j|d�}t| j|| jƒS )aÚ  
        Retrieve a single page of DeploymentInstance 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 DeploymentInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentPage
        )Ú	PageTokenr   ÚPageSizeÚGET©Úparams)r   r   r   r)   r   ÚDeploymentPager   )r   Ú
page_tokenÚpage_numberr%   r1   Úresponser   r   r   r)   c   s   ýzDeploymentList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )aR  
        Retrieve a specific page of DeploymentInstance records from the API.
        Request is executed immediately

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

        :returns: Page of DeploymentInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentPage
        r/   )r   ÚdomainÚtwilioÚrequestr2   r   )r   Ú
target_urlr5   r   r   r   Úget_pagez   s
   

þzDeploymentList.get_pagec                 C   ó   t | j| jd |d�S ©a*  
        Constructs a DeploymentContext

        :param sid: A string that uniquely identifies the Deployment.

        :returns: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentContext
        :rtype: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentContext
        r
   ©r
   Úsid©ÚDeploymentContextr   r   ©r   r>   r   r   r   Úget‹   ó   	zDeploymentList.getc                 C   r;   r<   r?   rA   r   r   r   Ú__call__–   rC   zDeploymentList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z/<Twilio.Preview.DeployedDevices.DeploymentList>r   ©r   r   r   r   Ú__repr__¡   ó   zDeploymentList.__repr__)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úunsetr   r*   r,   r)   r:   rB   rD   rH   Ú__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 )r2   r	   c                    s   t t| ƒ ||¡ || _dS )a–  
        Initialize the DeploymentPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param fleet_sid: The unique identifier of the Fleet.

        :returns: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentPage
        :rtype: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentPage
        N)r   r2   r   r   )r   r   r5   Úsolutionr   r   r   r   °   s   
zDeploymentPage.__init__c                 C   s   t | j|| jd d�S )a*  
        Build an instance of DeploymentInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentInstance
        r
   r   )r    r   r   )r   r$   r   r   r   Úget_instanceÀ   rC   zDeploymentPage.get_instancec                 C   rE   )rF   z/<Twilio.Preview.DeployedDevices.DeploymentPage>r   rG   r   r   r   rH   Ë   rI   zDeploymentPage.__repr__)rJ   rK   rL   rM   r   rQ   rH   rO   r   r   r   r   r2   «   s
    r2   c                       sJ   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zejejf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 DeploymentContext

        :param Version version: Version that contains the resource
        :param fleet_sid: The fleet_sid
        :param sid: A string that uniquely identifies the Deployment.

        :returns: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentContext
        :rtype: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentContext
        r=   z%/Fleets/{fleet_sid}/Deployments/{sid}Nr   )r   r@   r   r   r   r   )r   r   r
   r>   r   r   r   r   Ú   s   zDeploymentContext.__init__c                 C   s<   t  i ¡}| jjd| j|d�}t| j|| jd | jd d�S )ú³
        Fetch a DeploymentInstance

        :returns: Fetched DeploymentInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentInstance
        r/   r0   r
   r>   r=   )r   r   r   Úfetchr   r    r   )r   r1   r$   r   r   r   rS   ë   s   
ýüzDeploymentContext.fetchc                 C   s   | j  d| j¡S )ú�
        Deletes the DeploymentInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rU   r   rG   r   r   r   rU     s   zDeploymentContext.deletec                 C   sB   t  ||dœ¡}| jjd| j|d�}t| j|| jd | jd d�S )ál  
        Update the DeploymentInstance

        :param unicode friendly_name: A human readable description for this Deployment.
        :param unicode sync_service_sid: The unique identifier of the Sync service instance.

        :returns: Updated DeploymentInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentInstance
        r   r   r   r
   r>   r=   )r   r   r   Úupdater   r    r   r!   r   r   r   rW   
  s   
ýüzDeploymentContext.updatec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rF   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>*  ó   € z-DeploymentContext.__repr__.<locals>.<genexpr>z5<Twilio.Preview.DeployedDevices.DeploymentContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rH   #  ó   
zDeploymentContext.__repr__)rJ   rK   rL   rM   r   rS   rU   r   rN   rW   rH   rO   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dd„ Zdd„ Zejejfdd„Zdd„ Z‡  ZS ) r    r	   Nc                    st   t t| ƒ |¡ |d |d |d |d |d |d t |d ¡t |d ¡d	œ| _d
| _||p4| jd dœ| _d
S )zè
        Initialize the DeploymentInstance

        :returns: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentInstance
        r>   Úurlr"   r
   Úaccount_sidr#   Údate_createdÚdate_updated)r>   ri   r"   r
   rj   r#   rk   rl   Nr=   )r   r    r   r   Úiso8601_datetimeÚ_propertiesÚ_contextr   )r   r   r$   r
   r>   r   r   r   r   3  s   øzDeploymentInstance.__init__c                 C   s.   | j du rt| j| jd | jd d�| _ | j S )aH  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: DeploymentContext for this DeploymentInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentContext
        Nr
   r>   r=   )ro   r@   r   r   rG   r   r   r   Ú_proxyL  s   
	ýzDeploymentInstance._proxyc                 C   ó
   | j d S )zf
        :returns: A string that uniquely identifies this Deployment.
        :rtype: unicode
        r>   ©rn   rG   r   r   r   r>   ]  ó   
zDeploymentInstance.sidc                 C   rq   )zK
        :returns: URL of this Deployment.
        :rtype: unicode
        ri   rr   rG   r   r   r   ri   e  rs   zDeploymentInstance.urlc                 C   rq   )zd
        :returns: A human readable description for this Deployment
        :rtype: unicode
        r"   rr   rG   r   r   r   r"   m  rs   z DeploymentInstance.friendly_namec                 C   rq   )zW
        :returns: The unique identifier of the Fleet.
        :rtype: unicode
        r
   rr   rG   r   r   r   r
   u  rs   zDeploymentInstance.fleet_sidc                 C   rq   )z`
        :returns: The unique SID that identifies this Account.
        :rtype: unicode
        rj   rr   rG   r   r   r   rj   }  rs   zDeploymentInstance.account_sidc                 C   rq   )zg
        :returns: The unique identifier of the Sync service instance.
        :rtype: unicode
        r#   rr   rG   r   r   r   r#   …  rs   z#DeploymentInstance.sync_service_sidc                 C   rq   )zZ
        :returns: The date this Deployment was created.
        :rtype: datetime
        rk   rr   rG   r   r   r   rk   �  rs   zDeploymentInstance.date_createdc                 C   rq   )zZ
        :returns: The date this Deployment was updated.
        :rtype: datetime
        rl   rr   rG   r   r   r   rl   •  rs   zDeploymentInstance.date_updatedc                 C   ó
   | j  ¡ S )rR   )rp   rS   rG   r   r   r   rS   �  ó   
zDeploymentInstance.fetchc                 C   rt   )rT   )rp   rU   rG   r   r   r   rU   ¦  ru   zDeploymentInstance.deletec                 C   s   | j j||d�S )rV   )r"   r#   )rp   rW   )r   r"   r#   r   r   r   rW   ¯  s   
zDeploymentInstance.updatec                 C   rX   )rF   rY   c                 s   rZ   r[   r\   r]   r   r   r   ra   Â  rb   z.DeploymentInstance.__repr__.<locals>.<genexpr>z6<Twilio.Preview.DeployedDevices.DeploymentInstance {}>rc   rf   r   r   r   rH   »  rh   zDeploymentInstance.__repr__)N)rJ   rK   rL   rM   r   Úpropertyrp   r>   ri   r"   r
   rj   r#   rk   rl   rS   rU   r   rN   rW   rH   rO   r   r   r   r   r    .  s2    








		r    N)rM   Útwilio.baser   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r   r2   r@   r    r   r   r   r   Ú<module>   s    *Y