a
    !fm                     @   s   d Z ddlmZ ddlmZmZmZmZmZmZm	Z	 ddl
mZ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 )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Conversations
    This is the public Twilio REST API.

    NOTE: This class is auto generated by OpenAPI Generator.
    https://openapi-generator.tech
    Do not edit the class manually.
    )datetime)AnyDictListOptionalUnionIteratorAsyncIterator)deserializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                
       s  e Zd ZG dd deZdeeeef e	e d fddZ
eddd	d
ZedddZedddZd dddZd dddZejejejejejejejfedef eeef eeef eeef eeef eeef eeef d dddZejejejejejejejfedef eeef eeef eeef eeef eeef eeef d dddZedddZ  ZS )CredentialInstancec                   @   s   e Zd ZdZdZdZdS )CredentialInstance.PushTypeZapnZgcmZfcmN)__name__
__module____qualname__ZAPNZGCMZFCM r   r   h/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/conversations/v1/credential.pyPushType   s   r   N)versionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _t	|d| _
t	|d| _|d| _d|p| ji| _d | _d S )	Nr   account_sidfriendly_nametypesandboxdate_createddate_updatedurl)super__init__getr   r   r   r   r   r
   iso8601_datetimer    r!   r"   	_solution_context)selfr   r   r   	__class__r   r   r$   +   s     
zCredentialInstance.__init__CredentialContextreturnc                 C   s&   | j du r t| j| jd d| _ | j S )z
        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
        Nr   r   )r(   r,   _versionr'   r)   r   r   r   _proxyB   s    
zCredentialInstance._proxyc                 C   s
   | j  S )m
        Deletes the CredentialInstance


        :returns: True if delete succeeds, False otherwise
        )r2   deleter1   r   r   r   r4   Q   s    zCredentialInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the CredentialInstance


        :returns: True if delete succeeds, False otherwise
        N)r2   delete_asyncr1   r   r   r   r6   Z   s    zCredentialInstance.delete_asyncc                 C   s
   | j  S )a
        Fetch the CredentialInstance


        :returns: The fetched CredentialInstance
        )r2   fetchr1   r   r   r   r8   c   s    zCredentialInstance.fetchc                    s   | j  I dH S ){
        Asynchronous coroutine to fetch the CredentialInstance


        :returns: The fetched CredentialInstance
        N)r2   fetch_asyncr1   r   r   r   r:   l   s    zCredentialInstance.fetch_asyncr   r   r   certificateprivate_keyr   api_keysecretr.   c              	   C   s   | j j|||||||dS )i  
        Update the CredentialInstance

        :param type:
        :param friendly_name: A descriptive string that you create to describe the new resource. It can be up to 64 characters long.
        :param certificate: [APN only] The URL encoded representation of the certificate. For example,  `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`.
        :param private_key: [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`.
        :param sandbox: [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production.
        :param api_key: [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential.
        :param secret: [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging.

        :returns: The updated CredentialInstance
        r   r   r<   r=   r   r>   r?   )r2   updater)   r   r   r<   r=   r   r>   r?   r   r   r   rB   u   s    zCredentialInstance.updatec              	      s    | j j|||||||dI dH S )  
        Asynchronous coroutine to update the CredentialInstance

        :param type:
        :param friendly_name: A descriptive string that you create to describe the new resource. It can be up to 64 characters long.
        :param certificate: [APN only] The URL encoded representation of the certificate. For example,  `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`.
        :param private_key: [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`.
        :param sandbox: [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production.
        :param api_key: [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential.
        :param secret: [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging.

        :returns: The updated CredentialInstance
        rA   N)r2   update_asyncrC   r   r   r   rE      s    zCredentialInstance.update_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>       z.CredentialInstance.__repr__.<locals>.<genexpr>z/<Twilio.Conversations.V1.CredentialInstance {}>joinr'   itemsrJ   r)   contextr   r   r   __repr__   s    zCredentialInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r$   propertyr2   boolr4   r6   r8   r:   r   unsetr   rB   rE   rV   __classcell__r   r   r*   r   r      s\    			






#






!r   c                
       sN  e Zd Zeed fddZedddZedddZe	dd	d
Z
e	dddZejejejejejejejfedef eeef eeef eeef eeef eeef eeef e	dddZejejejejejejejfedef eeef eeef eeef eeef eeef eeef e	dddZedddZ  ZS )r,   )r   r   c                    s.   t  | d|i| _djf i | j| _dS )z
        Initialize the CredentialContext

        :param version: Version that contains the resource
        :param sid: A 34 character string that uniquely identifies this resource.
        r   z/Credentials/{sid}N)r#   r$   r'   rJ   _uri)r)   r   r   r*   r   r   r$      s    zCredentialContext.__init__r-   c                 C   s   | j jd| jdS )r3   DELETEmethoduri)r0   r4   r]   r1   r   r   r   r4      s    zCredentialContext.deletec                    s   | j jd| jdI dH S )r5   r^   r_   N)r0   r6   r]   r1   r   r   r   r6      s    zCredentialContext.delete_asyncc                 C   s(   | j jd| jd}t| j || jd dS )r7   GETr_   r   r/   )r0   r8   r]   r   r'   r)   r   r   r   r   r8      s    zCredentialContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )r9   rb   r_   Nr   r/   )r0   r:   r]   r   r'   rc   r   r   r   r:      s    zCredentialContext.fetch_asyncr   r;   c           
   
   C   sD   t |||||||d}| jjd| j|d}	t| j|	| jd dS )r@   TypeZFriendlyNameZCertificateZ
PrivateKeyZSandboxZApiKeyZSecretPOSTr`   ra   datar   r/   )r   ofr0   rB   r]   r   r'   
r)   r   r   r<   r=   r   r>   r?   rh   r   r   r   r   rB     s     zCredentialContext.updatec           
   
      sJ   t |||||||d}| jjd| j|dI dH }	t| j|	| jd dS )rD   rd   rf   rg   Nr   r/   )r   ri   r0   rE   r]   r   r'   rj   r   r   r   rE   :  s     zCredentialContext.update_asyncc                 C   s$   d dd | j D }d|S )rF   rG   c                 s   s   | ]\}}d  ||V  qdS rH   rI   rK   r   r   r   rO   k  rP   z-CredentialContext.__repr__.<locals>.<genexpr>z.<Twilio.Conversations.V1.CredentialContext {}>rQ   rT   r   r   r   rV   e  s    zCredentialContext.__repr__)r   r   r   r   rX   r$   rZ   r4   r6   r   r8   r:   r   r[   r   rW   rB   rE   rV   r\   r   r   r*   r   r,      sP   






-






+r,   c                   @   s2   e Zd Zeeef edddZedddZdS )CredentialPage)r   r.   c                 C   s   t | j|S )zp
        Build an instance of CredentialInstance

        :param payload: Payload response from the API
        )r   r0   rc   r   r   r   get_instancep  s    zCredentialPage.get_instancer-   c                 C   s   dS )rF   z(<Twilio.Conversations.V1.CredentialPage>r   r1   r   r   r   rV   x  s    zCredentialPage.__repr__N)	r   r   r   r   rX   r   r   rl   rV   r   r   r   r   rk   o  s   rk   c                
       s0  e Zd Zed fddZejejejejejejfdeee	f eee	f eee	f ee
e	f eee	f eee	f edddZejejejejejejfdeee	f eee	f eee	f ee
e	f eee	f eee	f eddd	Zd&ee ee ee dddZd'ee ee ee dddZd(ee ee ee dddZd)ee ee ee dddZejejejfeee	f eee	f eee	f edddZejejejfeee	f eee	f eee	f edddZeedddZeedddZeeddd Zeedd!d"Zed#d$d%Z  Z S )*CredentialList)r   c                    s   t  | d| _dS )zl
        Initialize the CredentialList

        :param version: Version that contains the resource

        z/CredentialsN)r#   r$   r]   )r)   r   r*   r   r   r$     s    zCredentialList.__init__r   r;   c           
   
   C   s:   t |||||||d}| jjd| j|d}	t| j|	S )ai  
        Create the CredentialInstance

        :param type:
        :param friendly_name: A descriptive string that you create to describe the new resource. It can be up to 64 characters long.
        :param certificate: [APN only] The URL encoded representation of the certificate. For example,  `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`.
        :param private_key: [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`.
        :param sandbox: [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production.
        :param api_key: [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential.
        :param secret: [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging.

        :returns: The created CredentialInstance
        rd   rf   rg   )r   ri   r0   creater]   r   rj   r   r   r   rn     s     zCredentialList.createc           
   
      s@   t |||||||d}| jjd| j|dI dH }	t| j|	S )ax  
        Asynchronously create the CredentialInstance

        :param type:
        :param friendly_name: A descriptive string that you create to describe the new resource. It can be up to 64 characters long.
        :param certificate: [APN only] The URL encoded representation of the certificate. For example,  `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`.
        :param private_key: [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`.
        :param sandbox: [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production.
        :param api_key: [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential.
        :param secret: [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging.

        :returns: The created CredentialInstance
        rd   rf   rg   N)r   ri   r0   create_asyncr]   r   rj   r   r   r   ro     s     zCredentialList.create_asyncN)limit	page_sizer.   c                 C   s0   | j ||}| j|d d}| j ||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 limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param 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
        rq   rq   rp   )r0   read_limitspagestreamr)   rp   rq   Zlimitsrt   r   r   r   ru     s    zCredentialList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )ao  
        Asynchronously 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 limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param 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
        rq   rr   Nrp   )r0   rs   
page_asyncstream_asyncrv   r   r   r   rx     s    zCredentialList.stream_asyncc                 C   s   t | j||dS )a  
        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 limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param 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: list that will contain up to limit results
        rp   rq   )listru   r)   rp   rq   r   r   r   rz     s    zCredentialList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously 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 limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param 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: list that will contain up to limit results
        c                    s   g | z3 d H W }|q6 S )Nr   )rL   recordr   r   r   
<listcomp>B  s   z-CredentialList.list_async.<locals>.<listcomp>ry   N)rx   r{   r   r   r   
list_async/  s    
zCredentialList.list_async)
page_tokenpage_numberrq   r.   c                 C   s2   t |||d}| jjd| j|d}t| j|S )ay  
        Retrieve a single page of CredentialInstance records from the API.
        Request is executed immediately

        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of CredentialInstance
        Z	PageTokenr   ZPageSizerb   r`   ra   params)r   ri   r0   rt   r]   rk   r)   r   r   rq   rh   responser   r   r   rt   J  s    zCredentialList.pagec                    s8   t |||d}| jjd| j|dI dH }t| j|S )a  
        Asynchronously retrieve a single page of CredentialInstance records from the API.
        Request is executed immediately

        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of CredentialInstance
        r   rb   r   N)r   ri   r0   rw   r]   rk   r   r   r   r   rw   e  s    zCredentialList.page_async)
target_urlr.   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of CredentialInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CredentialInstance
        rb   )r0   domaintwiliorequestrk   r)   r   r   r   r   r   get_page  s    	zCredentialList.get_pagec                    s$   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of CredentialInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CredentialInstance
        rb   N)r0   r   r   Zrequest_asyncrk   r   r   r   r   get_page_async  s    	zCredentialList.get_page_async)r   r.   c                 C   s   t | j|dS z
        Constructs a CredentialContext

        :param sid: A 34 character string that uniquely identifies this resource.
        r/   r,   r0   r)   r   r   r   r   r%     s    zCredentialList.getc                 C   s   t | j|dS r   r   r   r   r   r   __call__  s    zCredentialList.__call__r-   c                 C   s   dS )rF   z(<Twilio.Conversations.V1.CredentialList>r   r1   r   r   r   rV     s    zCredentialList.__repr__)NN)NN)NN)NN)!r   r   r   r   r$   r   r[   r   rX   rW   rZ   r   rn   ro   r   intr   ru   r	   rx   r   rz   r~   rk   rt   rw   r   r   r,   r%   r   rV   r\   r   r   r*   r   rm     s   





.





-        





rm   N)__doc__r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r,   rk   rm   r   r   r   r   <module>   s   $ ( /