o
    �¨ÊhC  ã                   @   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
      /       /
é    )Ú	serialize)Úvalues)ÚInstanceContext)ÚInstanceResource)ÚListResource)ÚPagec                       sj   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
dd„ Zdd„ Zdd„ Z‡  ZS )ÚConnectAppListú  c                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )aP  
        Initialize the ConnectAppList

        :param Version version: Version that contains the resource
        :param account_sid: The unique sid that identifies this account

        :returns: twilio.rest.api.v2010.account.connect_app.ConnectAppList
        :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppList
        Úaccount_sidz(/Accounts/{account_sid}/ConnectApps.jsonN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr
   ©Ú	__class__r   ú[/var/www/html/env/lib/python3.10/site-packages/twilio/rest/api/v2010/account/connect_app.pyr      s   

zConnectAppList.__init__Nc                 C   s6   | j  ||¡}| j|d d�}| j  ||d |d ¡S )aË  
        Streams ConnectAppInstance 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.api.v2010.account.connect_app.ConnectAppInstance]
        Ú	page_size)r   ÚlimitÚ
page_limit)Ú_versionÚread_limitsÚpageÚstream)r   r   r   Úlimitsr   r   r   r   r   $   s   zConnectAppList.streamc                 C   s   t | j||d�ƒS )ak  
        Lists ConnectAppInstance 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.api.v2010.account.connect_app.ConnectAppInstance]
        )r   r   )Úlistr   )r   r   r   r   r   r   r   ;   s   zConnectAppList.listc                 C   s6   t  |||dœ¡}| jjd| j|d�}t| j|| jƒS )aÎ  
        Retrieve a single page of ConnectAppInstance 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 ConnectAppInstance
        :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppPage
        )Ú	PageTokenr   ÚPageSizeÚGET©Úparams)r   Úofr   r   r   ÚConnectAppPager   )r   Ú
page_tokenÚpage_numberr   r#   Úresponser   r   r   r   M   s   ýzConnectAppList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )aF  
        Retrieve a specific page of ConnectAppInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ConnectAppInstance
        :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppPage
        r!   )r   ÚdomainÚtwilioÚrequestr%   r   )r   Ú
target_urlr(   r   r   r   Úget_paged   s
   

þzConnectAppList.get_pagec                 C   ó   t | j| jd |d�S ©a   
        Constructs a ConnectAppContext

        :param sid: Fetch by unique connect-app Sid

        :returns: twilio.rest.api.v2010.account.connect_app.ConnectAppContext
        :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppContext
        r
   ©r
   Úsid©ÚConnectAppContextr   r   ©r   r1   r   r   r   Úgetu   ó   	zConnectAppList.getc                 C   r.   r/   r2   r4   r   r   r   Ú__call__€   r6   zConnectAppList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z!<Twilio.Api.V2010.ConnectAppList>r   ©r   r   r   r   Ú__repr__‹   ó   zConnectAppList.__repr__)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   Úunsetr   r-   r5   r7   r;   Ú__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 ConnectAppPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param account_sid: The unique sid that identifies this account

        :returns: twilio.rest.api.v2010.account.connect_app.ConnectAppPage
        :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppPage
        N)r   r%   r   r   )r   r   r(   Úsolutionr   r   r   r   ˜   s   
zConnectAppPage.__init__c                 C   s   t | j|| jd d�S )a  
        Build an instance of ConnectAppInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.api.v2010.account.connect_app.ConnectAppInstance
        :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppInstance
        r
   )r
   )ÚConnectAppInstancer   r   )r   Úpayloadr   r   r   Úget_instance¨   r6   zConnectAppPage.get_instancec                 C   r8   )r9   z!<Twilio.Api.V2010.ConnectAppPage>r   r:   r   r   r   r;   ³   r<   zConnectAppPage.__repr__)r=   r>   r?   r@   r   rF   r;   rB   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ejejfdd„Zdd	„ Z	‡  Z
S )
r3   r	   c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )aq  
        Initialize the ConnectAppContext

        :param Version version: Version that contains the resource
        :param account_sid: The account_sid
        :param sid: Fetch by unique connect-app Sid

        :returns: twilio.rest.api.v2010.account.connect_app.ConnectAppContext
        :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppContext
        r0   z./Accounts/{account_sid}/ConnectApps/{sid}.jsonNr   )r   r3   r   r   r   r   )r   r   r
   r1   r   r   r   r   À   s   zConnectAppContext.__init__c                 C   s<   t  i ¡}| jjd| j|d�}t| j|| jd | jd d�S )ú§
        Fetch a ConnectAppInstance

        :returns: Fetched ConnectAppInstance
        :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppInstance
        r!   r"   r
   r1   r0   )r   r$   r   Úfetchr   rD   r   )r   r#   rE   r   r   r   rH   Ñ   s   
ýüzConnectAppContext.fetchc	                 C   sZ   t  |||||||t |dd„ ¡dœ¡}	| jjd| j|	d�}
t| j|
| jd | jd d�S )	á—  
        Update the ConnectAppInstance

        :param unicode authorize_redirect_url: URIL Twilio sends requests when users authorize
        :param unicode company_name: The company name set for this Connect App.
        :param unicode deauthorize_callback_method: HTTP method Twilio WIll use making requests to the url
        :param unicode deauthorize_callback_url: URL Twilio will send a request when a user de-authorizes this app
        :param unicode description: A more detailed human readable description
        :param unicode friendly_name: A human readable name for the Connect App.
        :param unicode homepage_url: The URL users can obtain more information
        :param ConnectAppInstance.Permission permissions: The set of permissions that your ConnectApp requests.

        :returns: Updated ConnectAppInstance
        :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppInstance
        c                 S   s   | S ©Nr   )Úer   r   r   Ú<lambda>  s    z*ConnectAppContext.update.<locals>.<lambda>)ÚAuthorizeRedirectUrlÚCompanyNameÚDeauthorizeCallbackMethodÚDeauthorizeCallbackUrlÚDescriptionÚFriendlyNameÚHomepageUrlÚPermissionsÚPOST)Údatar
   r1   r0   )	r   r$   r   Úmapr   Úupdater   rD   r   )r   Úauthorize_redirect_urlÚcompany_nameÚdeauthorize_callback_methodÚdeauthorize_callback_urlÚdescriptionÚfriendly_nameÚhomepage_urlÚpermissionsrV   rE   r   r   r   rX   ç   s*   øýüzConnectAppContext.updatec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )r9   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>  ó   € z-ConnectAppContext.__repr__.<locals>.<genexpr>z'<Twilio.Api.V2010.ConnectAppContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   r;     ó   
zConnectAppContext.__repr__)r=   r>   r?   r@   r   rH   r   rA   rX   r;   rB   r   r   r   r   r3   ½   s    
ü,r3   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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ejejfd!d"„Zd#d$„ Z‡  ZS )&rD   r	   c                   @   s   e Zd ZdZdZdS )zConnectAppInstance.Permissionzget-allzpost-allN)r=   r>   r?   ÚGET_ALLÚPOST_ALLr   r   r   r   Ú
Permission!  s    rt   Nc                    sz   t t| ƒ |¡ |d |d |d |d |d |d |d |d |d	 |d
 |d dœ| _d| _||p7| jd
 dœ| _dS )zÐ
        Initialize the ConnectAppInstance

        :returns: twilio.rest.api.v2010.account.connect_app.ConnectAppInstance
        :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppInstance
        r
   rY   rZ   r[   r\   r]   r^   r_   r`   r1   Úuri)r
   rY   rZ   r[   r\   r]   r^   r_   r`   r1   ru   Nr0   )r   rD   r   Ú_propertiesÚ_contextr   )r   r   rE   r
   r1   r   r   r   r   %  s   õzConnectAppInstance.__init__c                 C   s.   | j du rt| j| jd | jd d�| _ | j S )a<  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: ConnectAppContext for this ConnectAppInstance
        :rtype: twilio.rest.api.v2010.account.connect_app.ConnectAppContext
        Nr
   r1   r0   )rw   r3   r   r   r:   r   r   r   Ú_proxyA  s   
	ýzConnectAppInstance._proxyc                 C   ó
   | j d S )z_
        :returns: The unique sid that identifies this account
        :rtype: unicode
        r
   ©rv   r:   r   r   r   r
   R  ó   
zConnectAppInstance.account_sidc                 C   ry   )zc
        :returns: URIL Twilio sends requests when users authorize
        :rtype: unicode
        rY   rz   r:   r   r   r   rY   Z  r{   z)ConnectAppInstance.authorize_redirect_urlc                 C   ry   )z^
        :returns: The company name set for this Connect App.
        :rtype: unicode
        rZ   rz   r:   r   r   r   rZ   b  r{   zConnectAppInstance.company_namec                 C   ry   )zj
        :returns: HTTP method Twilio will use making requests to the url
        :rtype: unicode
        r[   rz   r:   r   r   r   r[   j  r{   z.ConnectAppInstance.deauthorize_callback_methodc                 C   ry   )zu
        :returns: URL Twilio will send a request when a user de-authorizes this app
        :rtype: unicode
        r\   rz   r:   r   r   r   r\   r  r{   z+ConnectAppInstance.deauthorize_callback_urlc                 C   ry   )z^
        :returns: A more detailed human readable description
        :rtype: unicode
        r]   rz   r:   r   r   r   r]   z  r{   zConnectAppInstance.descriptionc                 C   ry   )z^
        :returns: A human readable name for the Connect App.
        :rtype: unicode
        r^   rz   r:   r   r   r   r^   ‚  r{   z ConnectAppInstance.friendly_namec                 C   ry   )z]
        :returns: The URL users can obtain more information
        :rtype: unicode
        r_   rz   r:   r   r   r   r_   Š  r{   zConnectAppInstance.homepage_urlc                 C   ry   )z
        :returns: The set of permissions that your ConnectApp requests.
        :rtype: ConnectAppInstance.Permission
        r`   rz   r:   r   r   r   r`   ’  r{   zConnectAppInstance.permissionsc                 C   ry   )zg
        :returns: A string that uniquely identifies this connect-apps
        :rtype: unicode
        r1   rz   r:   r   r   r   r1   š  r{   zConnectAppInstance.sidc                 C   ry   )zM
        :returns: The URI for this resource
        :rtype: unicode
        ru   rz   r:   r   r   r   ru   ¢  r{   zConnectAppInstance.uric                 C   s
   | j  ¡ S )rG   )rx   rH   r:   r   r   r   rH   ª  s   
zConnectAppInstance.fetchc	           	   
   C   s   | j j||||||||d�S )rI   )rY   rZ   r[   r\   r]   r^   r_   r`   )rx   rX   )	r   rY   rZ   r[   r\   r]   r^   r_   r`   r   r   r   rX   ³  s   øzConnectAppInstance.updatec                 C   ra   )r9   rb   c                 s   rc   rd   re   rf   r   r   r   rj   Ù  rk   z.ConnectAppInstance.__repr__.<locals>.<genexpr>z(<Twilio.Api.V2010.ConnectAppInstance {}>rl   ro   r   r   r   r;   Ò  rq   zConnectAppInstance.__repr__rJ   )r=   r>   r?   r@   Úobjectrt   r   Úpropertyrx   r
   rY   rZ   r[   r\   r]   r^   r_   r`   r1   ru   rH   r   rA   rX   r;   rB   r   r   r   r   rD     sH    











	
ürD   N)r@   Útwilio.baser   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r   r%   r3   rD   r   r   r   r   Ú<module>   s    (a