o
    �¨Êh³F  ã                   @   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ejejejfdd„Zejddfdd„Zejddfd	d
„Z	ejejejejfdd„Z
dd„ Zdd„ Zdd„ Zdd„ Z‡  ZS )Ú
DeviceListúÉ 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 )aJ  
        Initialize the DeviceList

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

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

zDeviceList.__init__c                 C   s@   t  |||||dœ¡}| jjd| j|d�}t| j|| jd d�S )a  
        Create a new DeviceInstance

        :param unicode unique_name: A unique, addressable name of this Device.
        :param unicode friendly_name: A human readable description for this Device.
        :param unicode identity: An identifier of the Device user.
        :param unicode deployment_sid: The unique SID of the Deployment group.
        :param bool enabled: The enabled

        :returns: Newly created DeviceInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceInstance
        )Ú
UniqueNameÚFriendlyNameÚIdentityÚDeploymentSidÚEnabledÚPOST©Údatar
   ©r
   )r   ÚofÚ_versionÚcreater   ÚDeviceInstancer   )r   Úunique_nameÚfriendly_nameÚidentityÚdeployment_sidÚenabledr   Úpayloadr   r   r   r!   &   s   ûýzDeviceList.createNc                 C   s8   | j  ||¡}| j||d d�}| j  ||d |d ¡S )a+  
        Streams DeviceInstance 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 unicode deployment_sid: Find all Devices grouped under the specified Deployment.
        :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.device.DeviceInstance]
        Ú	page_size)r&   r)   ÚlimitÚ
page_limit)r    Úread_limitsÚpageÚstream)r   r&   r*   r)   Úlimitsr-   r   r   r   r.   E   s   zDeviceList.streamc                 C   s   t | j|||d�ƒS )aË  
        Lists DeviceInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param unicode deployment_sid: Find all Devices grouped under the specified Deployment.
        :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.device.DeviceInstance]
        )r&   r*   r)   )Úlistr.   )r   r&   r*   r)   r   r   r   r0   ]   s   zDeviceList.listc                 C   s8   t  ||||dœ¡}| jjd| j|d�}t| j|| jƒS )a*  
        Retrieve a single page of DeviceInstance records from the API.
        Request is executed immediately

        :param unicode deployment_sid: Find all Devices grouped under the specified Deployment.
        :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 DeviceInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.device.DevicePage
        )r   Ú	PageTokenr   ÚPageSizeÚGET©Úparams)r   r   r    r-   r   Ú
DevicePager   )r   r&   Ú
page_tokenÚpage_numberr)   r5   Úresponser   r   r   r-   p   s   üýzDeviceList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )aB  
        Retrieve a specific page of DeviceInstance records from the API.
        Request is executed immediately

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

        :returns: Page of DeviceInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.device.DevicePage
        r3   )r    ÚdomainÚtwilioÚrequestr6   r   )r   Ú
target_urlr9   r   r   r   Úget_page�   s
   

þzDeviceList.get_pagec                 C   ó   t | j| jd |d�S ©a  
        Constructs a DeviceContext

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

        :returns: twilio.rest.preview.deployed_devices.fleet.device.DeviceContext
        :rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceContext
        r
   ©r
   Úsid©ÚDeviceContextr    r   ©r   rB   r   r   r   Úgetž   ó   	zDeviceList.getc                 C   r?   r@   rC   rE   r   r   r   Ú__call__©   rG   zDeviceList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z+<Twilio.Preview.DeployedDevices.DeviceList>r   ©r   r   r   r   Ú__repr__´   ó   zDeviceList.__repr__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úunsetr!   r.   r0   r-   r>   rF   rH   rL   Ú__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 )r6   r	   c                    s   t t| ƒ ||¡ || _dS )a‚  
        Initialize the DevicePage

        :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.device.DevicePage
        :rtype: twilio.rest.preview.deployed_devices.fleet.device.DevicePage
        N)r   r6   r   r   )r   r   r9   Úsolutionr   r   r   r   Ã   s   
zDevicePage.__init__c                 C   s   t | j|| jd d�S )a  
        Build an instance of DeviceInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.preview.deployed_devices.fleet.device.DeviceInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceInstance
        r
   r   )r"   r    r   )r   r(   r   r   r   Úget_instanceÓ   rG   zDevicePage.get_instancec                 C   rI   )rJ   z+<Twilio.Preview.DeployedDevices.DevicePage>r   rK   r   r   r   rL   Þ   rM   zDevicePage.__repr__)rN   rO   rP   rQ   r   rU   rL   rS   r   r   r   r   r6   ¾   s
    r6   c                       sR   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zejejejejfdd	„Z	d
d„ Z
‡  ZS )rD   r	   c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )a  
        Initialize the DeviceContext

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

        :returns: twilio.rest.preview.deployed_devices.fleet.device.DeviceContext
        :rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceContext
        rA   z!/Fleets/{fleet_sid}/Devices/{sid}Nr   )r   rD   r   r   r   r   )r   r   r
   rB   r   r   r   r   í   s   zDeviceContext.__init__c                 C   s<   t  i ¡}| jjd| j|d�}t| j|| jd | jd d�S )ú£
        Fetch a DeviceInstance

        :returns: Fetched DeviceInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceInstance
        r3   r4   r
   rB   rA   )r   r   r    Úfetchr   r"   r   )r   r5   r(   r   r   r   rW   þ   s   
ýüzDeviceContext.fetchc                 C   s   | j  d| j¡S )ú}
        Deletes the DeviceInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r    rY   r   rK   r   r   r   rY     s   zDeviceContext.deletec                 C   sF   t  ||||dœ¡}| jjd| j|d�}t| j|| jd | jd d�S )á¶  
        Update the DeviceInstance

        :param unicode friendly_name: A human readable description for this Device.
        :param unicode identity: An identifier of the Device user.
        :param unicode deployment_sid: The unique SID of the Deployment group.
        :param bool enabled: The enabled

        :returns: Updated DeviceInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceInstance
        )r   r   r   r   r   r   r
   rB   rA   )r   r   r    Úupdater   r"   r   )r   r$   r%   r&   r'   r   r(   r   r   r   r[     s"   üýüzDeviceContext.updatec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rJ   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>E  ó   € z)DeviceContext.__repr__.<locals>.<genexpr>z1<Twilio.Preview.DeployedDevices.DeviceContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rL   >  ó   
zDeviceContext.__repr__)rN   rO   rP   rQ   r   rW   rY   r   rR   r[   rL   rS   r   r   r   r   rD   è   s    	
ÿ!rD   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edd„ ƒZedd„ ƒZedd„ ƒZdd „ Zd!d"„ Zejejejejfd#d$„Zd%d&„ Z‡  ZS )(r"   r	   Nc                    s’   t t| ƒ |¡ |d |d |d |d |d |d |d |d |d	 t |d
 ¡t |d ¡t |d ¡dœ| _d| _||pC| jd dœ| _dS )zÔ
        Initialize the DeviceInstance

        :returns: twilio.rest.preview.deployed_devices.fleet.device.DeviceInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceInstance
        rB   Úurlr#   r$   r
   r'   Úaccount_sidr%   r&   Údate_createdÚdate_updatedÚdate_authenticated)rB   rm   r#   r$   r
   r'   rn   r%   r&   ro   rp   rq   NrA   )r   r"   r   r   Úiso8601_datetimeÚ_propertiesÚ_contextr   )r   r   r(   r
   rB   r   r   r   r   N  s    ôzDeviceInstance.__init__c                 C   s.   | j du rt| j| jd | jd d�| _ | j S )a8  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: DeviceContext for this DeviceInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceContext
        Nr
   rB   rA   )rt   rD   r    r   rK   r   r   r   Ú_proxyk  s   
	ýzDeviceInstance._proxyc                 C   ó
   | j d S )zb
        :returns: A string that uniquely identifies this Device.
        :rtype: unicode
        rB   ©rs   rK   r   r   r   rB   |  ó   
zDeviceInstance.sidc                 C   rv   )zG
        :returns: URL of this Device.
        :rtype: unicode
        rm   rw   rK   r   r   r   rm   „  rx   zDeviceInstance.urlc                 C   rv   )z^
        :returns: A unique, addressable name of this Device.
        :rtype: unicode
        r#   rw   rK   r   r   r   r#   Œ  rx   zDeviceInstance.unique_namec                 C   rv   )z`
        :returns: A human readable description for this Device
        :rtype: unicode
        r$   rw   rK   r   r   r   r$   ”  rx   zDeviceInstance.friendly_namec                 C   rv   )zW
        :returns: The unique identifier of the Fleet.
        :rtype: unicode
        r
   rw   rK   r   r   r   r
   œ  rx   zDeviceInstance.fleet_sidc                 C   rv   )zE
        :returns: Device enabled flag.
        :rtype: bool
        r'   rw   rK   r   r   r   r'   ¤  rx   zDeviceInstance.enabledc                 C   rv   )z`
        :returns: The unique SID that identifies this Account.
        :rtype: unicode
        rn   rw   rK   r   r   r   rn   ¬  rx   zDeviceInstance.account_sidc                 C   rv   )zU
        :returns: An identifier of the Device user.
        :rtype: unicode
        r%   rw   rK   r   r   r   r%   ´  rx   zDeviceInstance.identityc                 C   rv   )z[
        :returns: The unique SID of the Deployment group.
        :rtype: unicode
        r&   rw   rK   r   r   r   r&   ¼  rx   zDeviceInstance.deployment_sidc                 C   rv   )zV
        :returns: The date this Device was created.
        :rtype: datetime
        ro   rw   rK   r   r   r   ro   Ä  rx   zDeviceInstance.date_createdc                 C   rv   )zV
        :returns: The date this Device was updated.
        :rtype: datetime
        rp   rw   rK   r   r   r   rp   Ì  rx   zDeviceInstance.date_updatedc                 C   rv   )z\
        :returns: The date this Device was authenticated.
        :rtype: datetime
        rq   rw   rK   r   r   r   rq   Ô  rx   z!DeviceInstance.date_authenticatedc                 C   ó
   | j  ¡ S )rV   )ru   rW   rK   r   r   r   rW   Ü  ó   
zDeviceInstance.fetchc                 C   ry   )rX   )ru   rY   rK   r   r   r   rY   å  rz   zDeviceInstance.deletec                 C   s   | j j||||d�S )rZ   )r$   r%   r&   r'   )ru   r[   )r   r$   r%   r&   r'   r   r   r   r[   î  s   üzDeviceInstance.updatec                 C   r\   )rJ   r]   c                 s   r^   r_   r`   ra   r   r   r   re   	  rf   z*DeviceInstance.__repr__.<locals>.<genexpr>z2<Twilio.Preview.DeployedDevices.DeviceInstance {}>rg   rj   r   r   r   rL     rl   zDeviceInstance.__repr__)N)rN   rO   rP   rQ   r   Úpropertyru   rB   rm   r#   r$   r
   r'   rn   r%   r&   ro   rp   rq   rW   rY   r   rR   r[   rL   rS   r   r   r   r   r"   I  sF    












		
ÿr"   N)rQ   Útwilio.baser   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r   r6   rD   r"   r   r   r   r   Ú<module>   s    .*a