o
    �¨Êh¢B  ã                   @   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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 )ÚCertificateListúÉ 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 )ac  
        Initialize the CertificateList

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

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

zCertificateList.__init__c                 C   s<   t  |||dœ¡}| jjd| j|d�}t| j|| jd d�S )a¾  
        Create a new CertificateInstance

        :param unicode certificate_data: The public certificate data.
        :param unicode friendly_name: The human readable description for this Certificate.
        :param unicode device_sid: The unique identifier of a Device to be authenticated.

        :returns: Newly created CertificateInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateInstance
        )ÚCertificateDataÚFriendlyNameÚ	DeviceSidÚPOST©Údatar
   ©r
   )r   ÚofÚ_versionÚcreater   ÚCertificateInstancer   )r   Úcertificate_dataÚfriendly_nameÚ
device_sidr   Úpayloadr   r   r   r   &   s   ýýzCertificateList.createNc                 C   s8   | j  ||¡}| j||d d�}| j  ||d |d ¡S )a4  
        Streams CertificateInstance 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 device_sid: Find all Certificates authenticating specified Device.
        :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.certificate.CertificateInstance]
        Ú	page_size)r#   r%   ÚlimitÚ
page_limit)r   Úread_limitsÚpageÚstream)r   r#   r&   r%   Úlimitsr)   r   r   r   r*   @   s   zCertificateList.streamc                 C   s   t | j|||d�ƒS )aÔ  
        Lists CertificateInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param unicode device_sid: Find all Certificates authenticating specified Device.
        :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.certificate.CertificateInstance]
        )r#   r&   r%   )Úlistr*   )r   r#   r&   r%   r   r   r   r,   X   s   zCertificateList.listc                 C   s8   t  ||||dœ¡}| jjd| j|d�}t| j|| jƒS )a8  
        Retrieve a single page of CertificateInstance records from the API.
        Request is executed immediately

        :param unicode device_sid: Find all Certificates authenticating specified Device.
        :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 CertificateInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificatePage
        )r   Ú	PageTokenr   ÚPageSizeÚGET©Úparams)r   r   r   r)   r   ÚCertificatePager   )r   r#   Ú
page_tokenÚpage_numberr%   r1   Úresponser   r   r   r)   k   s   üýzCertificateList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )aV  
        Retrieve a specific page of CertificateInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CertificateInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificatePage
        r/   )r   ÚdomainÚtwilioÚrequestr2   r   )r   Ú
target_urlr5   r   r   r   Úget_pageˆ   s
   

þzCertificateList.get_pagec                 C   ó   t | j| jd |d�S ©a0  
        Constructs a CertificateContext

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

        :returns: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateContext
        :rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateContext
        r
   ©r
   Úsid©ÚCertificateContextr   r   ©r   r>   r   r   r   Úget™   ó   	zCertificateList.getc                 C   r;   r<   r?   rA   r   r   r   Ú__call__¤   rC   zCertificateList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z0<Twilio.Preview.DeployedDevices.CertificateList>r   ©r   r   r   r   Ú__repr__¯   ó   zCertificateList.__repr__)Ú__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 CertificatePage

        :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.certificate.CertificatePage
        :rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificatePage
        N)r   r2   r   r   )r   r   r5   Úsolutionr   r   r   r   ¾   s   
zCertificatePage.__init__c                 C   s   t | j|| jd d�S )a/  
        Build an instance of CertificateInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateInstance
        r
   r   )r    r   r   )r   r$   r   r   r   Úget_instanceÎ   rC   zCertificatePage.get_instancec                 C   rE   )rF   z0<Twilio.Preview.DeployedDevices.CertificatePage>r   rG   r   r   r   rH   Ù   rI   zCertificatePage.__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 CertificateContext

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

        :returns: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateContext
        :rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateContext
        r=   z&/Fleets/{fleet_sid}/Certificates/{sid}Nr   )r   r@   r   r   r   r   )r   r   r
   r>   r   r   r   r   è   s   zCertificateContext.__init__c                 C   s<   t  i ¡}| jjd| j|d�}t| j|| jd | jd d�S )ú·
        Fetch a CertificateInstance

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

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

        :param unicode friendly_name: The human readable description for this Certificate.
        :param unicode device_sid: The unique identifier of a Device to be authenticated.

        :returns: Updated CertificateInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateInstance
        )r   r   r   r   r
   r>   r=   )r   r   r   Úupdater   r    r   )r   r"   r#   r   r$   r   r   r   rW     s   
ýüzCertificateContext.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>8  ó   € z.CertificateContext.__repr__.<locals>.<genexpr>z6<Twilio.Preview.DeployedDevices.CertificateContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rH   1  ó   
zCertificateContext.__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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                    sz   t t| ƒ |¡ |d |d |d |d |d |d |d t |d ¡t |d	 ¡d
œ	| _d| _||p7| jd dœ| _dS )zí
        Initialize the CertificateInstance

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

        :returns: CertificateContext for this CertificateInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateContext
        Nr
   r>   r=   )rp   r@   r   r   rG   r   r   r   Ú_proxy[  s   
	ýzCertificateInstance._proxyc                 C   ó
   | j d S )zg
        :returns: A string that uniquely identifies this Certificate.
        :rtype: unicode
        r>   ©ro   rG   r   r   r   r>   l  ó   
zCertificateInstance.sidc                 C   rr   )zL
        :returns: URL of this Certificate.
        :rtype: unicode
        ri   rs   rG   r   r   r   ri   t  rt   zCertificateInstance.urlc                 C   rr   )zf
        :returns: A human readable description for this Certificate.
        :rtype: unicode
        r"   rs   rG   r   r   r   r"   |  rt   z!CertificateInstance.friendly_namec                 C   rr   )zW
        :returns: The unique identifier of the Fleet.
        :rtype: unicode
        r
   rs   rG   r   r   r   r
   „  rt   zCertificateInstance.fleet_sidc                 C   rr   )z`
        :returns: The unique SID that identifies this Account.
        :rtype: unicode
        rj   rs   rG   r   r   r   rj   Œ  rt   zCertificateInstance.account_sidc                 C   rr   )z]
        :returns: The unique identifier of a mapped Device.
        :rtype: unicode
        r#   rs   rG   r   r   r   r#   ”  rt   zCertificateInstance.device_sidc                 C   rr   )zV
        :returns: A Certificate unique payload hash.
        :rtype: unicode
        rk   rs   rG   r   r   r   rk   œ  rt   zCertificateInstance.thumbprintc                 C   rr   )z[
        :returns: The date this Certificate was created.
        :rtype: datetime
        rl   rs   rG   r   r   r   rl   ¤  rt   z CertificateInstance.date_createdc                 C   rr   )z[
        :returns: The date this Certificate was updated.
        :rtype: datetime
        rm   rs   rG   r   r   r   rm   ¬  rt   z CertificateInstance.date_updatedc                 C   ó
   | j  ¡ S )rR   )rq   rS   rG   r   r   r   rS   ´  ó   
zCertificateInstance.fetchc                 C   ru   )rT   )rq   rU   rG   r   r   r   rU   ½  rv   zCertificateInstance.deletec                 C   s   | j j||d�S )rV   )r"   r#   )rq   rW   )r   r"   r#   r   r   r   rW   Æ  s   
zCertificateInstance.updatec                 C   rX   )rF   rY   c                 s   rZ   r[   r\   r]   r   r   r   ra   Ù  rb   z/CertificateInstance.__repr__.<locals>.<genexpr>z7<Twilio.Preview.DeployedDevices.CertificateInstance {}>rc   rf   r   r   r   rH   Ò  rh   zCertificateInstance.__repr__)N)rJ   rK   rL   rM   r   Úpropertyrq   r>   ri   r"   r
   rj   r#   rk   rl   rm   rS   rU   r   rN   rW   rH   rO   r   r   r   r   r    <  s6    









		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