o
    e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   i/var/www/html/venv/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 the 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: The created CertificateInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateInstance
        )CertificateDataFriendlyName	DeviceSidPOSTmethoduridatar
   r
   )r   of_versioncreater   CertificateInstancer   )r   certificate_datafriendly_name
device_sidr   payloadr   r   r   r!   &   s   zCertificateList.createNc                 C   s2   | j ||}| j||d d}| j ||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)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-   T   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)r   r   params)r   r   r    r*   r   CertificatePager   )r   r%   
page_tokenpage_numberr'   r   responser   r   r   r*   g   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
        r0   )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   rR   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   s0   | j jd| jd}t| j || jd | jd dS )
        Fetch the CertificateInstance

        :returns: The fetched CertificateInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateInstance
        r0   r   r   r
   r>   r=   )r    fetchr   r"   r   rQ   r   r   r   rU      s   zCertificateContext.fetchc                 C   s   | j jd| jdS )
        Deletes the CertificateInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErT   )r    deleter   rG   r   r   r   rX     s   zCertificateContext.deletec                 C   sB   t ||d}| jjd| j|d}t| j|| jd | jd dS )t  
        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: The 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   rZ   
  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>&      z.CertificateContext.__repr__.<locals>.<genexpr>z6<Twilio.Preview.DeployedDevices.CertificateContext {}>joinr   itemsr   r   contextr   r   r   rH        
zCertificateContext.__repr__)rJ   rK   rL   rM   r   rU   rX   r   rN   rZ   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                    s   t t| | |d|d|d|d|d|d|dt|dt|d	d
	| _d| _||p@| 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>   rl   r$   r
   rm   r%   rn   ro   rp   Nr=   )	r   r"   r   rB   r   iso8601_datetime_properties_contextr   )r   r   r&   r
   r>   r   r   r   r   /  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=   )rs   r@   r    r   rG   r   r   r   _proxyI  s   
	zCertificateInstance._proxyc                 C   
   | j d S )zg
        :returns: A string that uniquely identifies this Certificate.
        :rtype: unicode
        r>   rr   rG   r   r   r   r>   Z     
zCertificateInstance.sidc                 C   ru   )zL
        :returns: URL of this Certificate.
        :rtype: unicode
        rl   rv   rG   r   r   r   rl   b  rw   zCertificateInstance.urlc                 C   ru   )zf
        :returns: A human readable description for this Certificate.
        :rtype: unicode
        r$   rv   rG   r   r   r   r$   j  rw   z!CertificateInstance.friendly_namec                 C   ru   )zW
        :returns: The unique identifier of the Fleet.
        :rtype: unicode
        r
   rv   rG   r   r   r   r
   r  rw   zCertificateInstance.fleet_sidc                 C   ru   )z`
        :returns: The unique SID that identifies this Account.
        :rtype: unicode
        rm   rv   rG   r   r   r   rm   z  rw   zCertificateInstance.account_sidc                 C   ru   )z]
        :returns: The unique identifier of a mapped Device.
        :rtype: unicode
        r%   rv   rG   r   r   r   r%     rw   zCertificateInstance.device_sidc                 C   ru   )zV
        :returns: A Certificate unique payload hash.
        :rtype: unicode
        rn   rv   rG   r   r   r   rn     rw   zCertificateInstance.thumbprintc                 C   ru   )z[
        :returns: The date this Certificate was created.
        :rtype: datetime
        ro   rv   rG   r   r   r   ro     rw   z CertificateInstance.date_createdc                 C   ru   )z[
        :returns: The date this Certificate was updated.
        :rtype: datetime
        rp   rv   rG   r   r   r   rp     rw   z CertificateInstance.date_updatedc                 C   
   | j  S )rS   )rt   rU   rG   r   r   r   rU        
zCertificateInstance.fetchc                 C   rx   )rV   )rt   rX   rG   r   r   r   rX     ry   zCertificateInstance.deletec                 C   s   | j j||dS )rY   )r$   r%   )rt   rZ   )r   r$   r%   r   r   r   rZ     s   
zCertificateInstance.updatec                 C   r[   )rF   r\   c                 s   r]   r^   r_   r`   r   r   r   rd     re   z/CertificateInstance.__repr__.<locals>.<genexpr>z7<Twilio.Preview.DeployedDevices.CertificateInstance {}>rf   ri   r   r   r   rH     rk   zCertificateInstance.__repr__)N)rJ   rK   rL   rM   r   propertyrt   r>   rl   r$   r
   rm   r%   rn   ro   rp   rU   rX   r   rN   rZ   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    !*O