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ddd„Zddd„Zejejejfd	d
„Z	dd„ Z
ejejejejejejfdd„Zdd„ Zdd„ Zdd„ Z‡  ZS )ÚCredentialListúk PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. c                    s.   t t| ƒ |¡ i | _djdi | j¤Ž| _dS )zö
        Initialize the CredentialList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.notify.v1.credential.CredentialList
        :rtype: twilio.rest.notify.v1.credential.CredentialList
        z/CredentialsN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversion©Ú	__class__r
   úR/var/www/html/env/lib/python3.10/site-packages/twilio/rest/notify/v1/credential.pyr      s   	zCredentialList.__init__Nc                 C   s6   | j  ||¡}| j|d d�}| j  ||d |d ¡S )aÂ  
        Streams CredentialInstance 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.notify.v1.credential.CredentialInstance]
        Ú	page_size)r   ÚlimitÚ
page_limit)Ú_versionÚread_limitsÚpageÚstream)r   r   r   Úlimitsr   r
   r
   r   r   $   s   zCredentialList.streamc                 C   s   t | j||d�ƒS )ab  
        Lists CredentialInstance 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.notify.v1.credential.CredentialInstance]
        )r   r   )Úlistr   )r   r   r   r
   r
   r   r   ;   s   zCredentialList.listc                 C   s6   t  |||dœ¡}| jjd| j|d�}t| j|| jƒS )aÅ  
        Retrieve a single page of CredentialInstance 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 CredentialInstance
        :rtype: twilio.rest.notify.v1.credential.CredentialPage
        )Ú	PageTokenr   ÚPageSizeÚGET©Úparams)r   Úofr   r   r   ÚCredentialPager   )r   Ú
page_tokenÚpage_numberr   r"   Úresponser
   r
   r   r   M   s   ýzCredentialList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )a=  
        Retrieve a specific page of CredentialInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CredentialInstance
        :rtype: twilio.rest.notify.v1.credential.CredentialPage
        r    )r   ÚdomainÚtwilioÚrequestr$   r   )r   Ú
target_urlr'   r
   r
   r   Úget_paged   s
   

þzCredentialList.get_pagec           
   
   C   s:   t  |||||||dœ¡}| jjd| j|d�}	t| j|	ƒS )a�  
        Create a new CredentialInstance

        :param CredentialInstance.PushService type: Credential type, one of "gcm", "fcm", or "apn"
        :param unicode friendly_name: Friendly name for stored credential
        :param unicode certificate: [APN only] URL encoded representation of the certificate.
        :param unicode private_key: [APN only] URL encoded representation of the private key.
        :param bool sandbox: [APN only] use this credential for sending to production or sandbox APNs
        :param unicode api_key: [GCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging.
        :param unicode secret: [FCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging.

        :returns: Newly created CredentialInstance
        :rtype: twilio.rest.notify.v1.credential.CredentialInstance
        )ÚTypeÚFriendlyNameÚCertificateÚ
PrivateKeyÚSandboxÚApiKeyÚSecretÚPOST©Údata)r   r#   r   Úcreater   ÚCredentialInstance)
r   ÚtypeÚfriendly_nameÚcertificateÚprivate_keyÚsandboxÚapi_keyÚsecretr6   Úpayloadr
   r
   r   r7   u   s   ù
ýzCredentialList.createc                 C   ó   t | j|d�S ©zÖ
        Constructs a CredentialContext

        :param sid: The sid

        :returns: twilio.rest.notify.v1.credential.CredentialContext
        :rtype: twilio.rest.notify.v1.credential.CredentialContext
        ©Úsid©ÚCredentialContextr   ©r   rD   r
   r
   r   Úget˜   ó   	zCredentialList.getc                 C   rA   rB   rE   rG   r
   r
   r   Ú__call__£   rI   zCredentialList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z!<Twilio.Notify.V1.CredentialList>r
   ©r   r
   r
   r   Ú__repr__®   ó   zCredentialList.__repr__)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   Úunsetr   r,   r7   rH   rJ   rN   Ú__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 )r$   r	   c                    s   t t| ƒ ||¡ || _dS )a.  
        Initialize the CredentialPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.notify.v1.credential.CredentialPage
        :rtype: twilio.rest.notify.v1.credential.CredentialPage
        N)r   r$   r   r   )r   r   r'   Úsolutionr   r
   r   r   ¼   s   

zCredentialPage.__init__c                 C   s   t | j|ƒS )a   
        Build an instance of CredentialInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.notify.v1.credential.CredentialInstance
        :rtype: twilio.rest.notify.v1.credential.CredentialInstance
        )r8   r   )r   r@   r
   r
   r   Úget_instanceË   s   	zCredentialPage.get_instancec                 C   rK   )rL   z!<Twilio.Notify.V1.CredentialPage>r
   rM   r
   r
   r   rN   Ö   rO   zCredentialPage.__repr__)rP   rQ   rR   rS   r   rW   rN   rU   r
   r
   r   r   r$   ¸   s
    r$   c                       sZ   e Zd ZdZ‡ fdd„Zdd„ Zejejejejejejfdd„Zdd	„ Z	d
d„ Z
‡  ZS )rF   r	   c                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )a  
        Initialize the CredentialContext

        :param Version version: Version that contains the resource
        :param sid: The sid

        :returns: twilio.rest.notify.v1.credential.CredentialContext
        :rtype: twilio.rest.notify.v1.credential.CredentialContext
        rD   z/Credentials/{sid}Nr
   )r   rF   r   r   r   r   )r   r   rD   r   r
   r   r   ä   s   

zCredentialContext.__init__c                 C   s4   t  i ¡}| jjd| j|d�}t| j|| jd d�S )úž
        Fetch a CredentialInstance

        :returns: Fetched CredentialInstance
        :rtype: twilio.rest.notify.v1.credential.CredentialInstance
        r    r!   rD   rC   )r   r#   r   Úfetchr   r8   r   )r   r"   r@   r
   r
   r   rY   ô   s   
ýzCredentialContext.fetchc           	   	   C   sB   t  ||||||dœ¡}| jjd| j|d�}t| j|| jd d�S )á%  
        Update the CredentialInstance

        :param unicode friendly_name: Friendly name for stored credential
        :param unicode certificate: [APN only] URL encoded representation of the certificate.
        :param unicode private_key: [APN only] URL encoded representation of the private key.
        :param bool sandbox: [APN only] use this credential for sending to production or sandbox APNs
        :param unicode api_key: [GCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging.
        :param unicode secret: [FCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging.

        :returns: Updated CredentialInstance
        :rtype: twilio.rest.notify.v1.credential.CredentialInstance
        )r.   r/   r0   r1   r2   r3   r4   r5   rD   rC   )r   r#   r   Úupdater   r8   r   )	r   r:   r;   r<   r=   r>   r?   r6   r@   r
   r
   r   r[     s   ú	ýzCredentialContext.updatec                 C   s   | j  d| j¡S )ú�
        Deletes the CredentialInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   r]   r   rM   r
   r
   r   r]   &  s   zCredentialContext.deletec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rL   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr
   r
   r   Ú	<genexpr>6  ó   € z-CredentialContext.__repr__.<locals>.<genexpr>z'<Twilio.Notify.V1.CredentialContext {}>©Újoinr   Úitemsr   ©r   Úcontextr
   r
   r   rN   /  ó   
zCredentialContext.__repr__)rP   rQ   rR   rS   r   rY   r   rT   r[   r]   rN   rU   r
   r
   r   r   rF   à   s    
þ!	rF   c                       sØ   e Zd 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dd„ Zejejejejejejfdd„Zdd„ Zdd „ Z‡  ZS )"r8   r	   c                   @   s   e Zd ZdZdZdZdS )zCredentialInstance.PushServiceÚgcmÚapnÚfcmN)rP   rQ   rR   ÚGCMÚAPNÚFCMr
   r
   r
   r   ÚPushService>  s    ru   Nc              
      sr   t t| ƒ |¡ |d |d |d |d |d t |d ¡t |d ¡|d d	œ| _d
| _d|p4| jd i| _d
S )z¾
        Initialize the CredentialInstance

        :returns: twilio.rest.notify.v1.credential.CredentialInstance
        :rtype: twilio.rest.notify.v1.credential.CredentialInstance
        rD   Úaccount_sidr:   r9   r=   Údate_createdÚdate_updatedÚurl)rD   rv   r:   r9   r=   rw   rx   ry   N)r   r8   r   r   Úiso8601_datetimeÚ_propertiesÚ_contextr   )r   r   r@   rD   r   r
   r   r   C  s   øzCredentialInstance.__init__c                 C   s&   | j du rt| j| jd d�| _ | j S )a3  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: CredentialContext for this CredentialInstance
        :rtype: twilio.rest.notify.v1.credential.CredentialContext
        NrD   rC   )r|   rF   r   r   rM   r
   r
   r   Ú_proxy\  s   
	zCredentialInstance._proxyc                 C   ó
   | j d S )z;
        :returns: The sid
        :rtype: unicode
        rD   ©r{   rM   r
   r
   r   rD   i  ó   
zCredentialInstance.sidc                 C   r~   )zC
        :returns: The account_sid
        :rtype: unicode
        rv   r   rM   r
   r
   r   rv   q  r€   zCredentialInstance.account_sidc                 C   r~   )zW
        :returns: Friendly name for stored credential
        :rtype: unicode
        r:   r   rM   r
   r
   r   r:   y  r€   z CredentialInstance.friendly_namec                 C   r~   )zy
        :returns: Credential type, one of "gcm", "fcm", or "apn"
        :rtype: CredentialInstance.PushService
        r9   r   rM   r
   r
   r   r9   �  r€   zCredentialInstance.typec                 C   r~   )z|
        :returns: [APN only] use this credential for sending to production or sandbox APNs
        :rtype: unicode
        r=   r   rM   r
   r
   r   r=   ‰  r€   zCredentialInstance.sandboxc                 C   r~   )zE
        :returns: The date_created
        :rtype: datetime
        rw   r   rM   r
   r
   r   rw   ‘  r€   zCredentialInstance.date_createdc                 C   r~   )zE
        :returns: The date_updated
        :rtype: datetime
        rx   r   rM   r
   r
   r   rx   ™  r€   zCredentialInstance.date_updatedc                 C   r~   )z;
        :returns: The url
        :rtype: unicode
        ry   r   rM   r
   r
   r   ry   ¡  r€   zCredentialInstance.urlc                 C   ó
   | j  ¡ S )rX   )r}   rY   rM   r
   r
   r   rY   ©  ó   
zCredentialInstance.fetchc                 C   s   | j j||||||d�S )rZ   )r:   r;   r<   r=   r>   r?   )r}   r[   )r   r:   r;   r<   r=   r>   r?   r
   r
   r   r[   ²  s   úzCredentialInstance.updatec                 C   r�   )r\   )r}   r]   rM   r
   r
   r   r]   Ë  r‚   zCredentialInstance.deletec                 C   r^   )rL   r_   c                 s   r`   ra   rb   rc   r
   r
   r   rg   Û  rh   z.CredentialInstance.__repr__.<locals>.<genexpr>z(<Twilio.Notify.V1.CredentialInstance {}>ri   rl   r
   r
   r   rN   Ô  rn   zCredentialInstance.__repr__)N)rP   rQ   rR   rS   Úobjectru   r   Úpropertyr}   rD   rv   r:   r9   r=   rw   rx   ry   rY   r   rT   r[   r]   rN   rU   r
   r
   r   r   r8   :  s:    








	
þ	r8   N)rS   Útwilio.baser   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r   r$   rF   r8   r
   r
   r
   r   Ú<module>   s    ((Z