
    m>hZN                         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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e      Z G d de      Z G d de      Z G d de      Zy)a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Ip_messaging
    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	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec            
            e Zd Z G d de      Z	 	 ddedeeef   dede	e   f fdZ
edd	       Zdefd
ZdefdZddZddZdee   dd fdZdee   dd fdZdefdZ xZS )RoleInstancec                       e Zd ZdZdZy)RoleInstance.RoleTypechannel
deploymentN)__name__
__module____qualname__CHANNEL
DEPLOYMENT     l/var/www/html/DP/alpha_backend/venv/lib/python3.12/site-packages/twilio/rest/ip_messaging/v1/service/role.pyRoleTyper      s    !
r   r!   versionpayloadservice_sidsidc                 :   t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        t        j                  |j                  d            | _        |j                  d	      | _        ||xs | j                  d
| _        d | _        y )Nr%   account_sidr$   friendly_nametypepermissionsdate_createddate_updatedurlr$   r%   )super__init__getr%   r'   r$   r(   r)   r*   r   iso8601_datetimer+   r,   r-   	_solution_context)selfr"   r#   r$   r%   	__class__s        r    r0   zRoleInstance.__init__+   s     	!")++e"4*1++m*D*1++m*D,3KK,H7>{{67J	07M0J0;0L0LKK'1
 1<0L0LKK'1
 #*++e"4 '?$((
 04r   returnc                     | j                   7t        | j                  | j                  d   | j                  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: RoleContext for this RoleInstance
        r$   r%   r.   )r4   RoleContext_versionr3   r5   s    r    _proxyzRoleInstance._proxyH   sE     == ' NN=9NN5)DM
 }}r   c                 6    | j                   j                         S )g
        Deletes the RoleInstance


        :returns: True if delete succeeds, False otherwise
        )r<   deleter;   s    r    r?   zRoleInstance.deleteX   s     {{!!##r   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the RoleInstance


        :returns: True if delete succeeds, False otherwise
        N)r<   delete_asyncr;   s    r    rB   zRoleInstance.delete_asynca   s!      [[--////   '%'c                 6    | j                   j                         S )U
        Fetch the RoleInstance


        :returns: The fetched RoleInstance
        )r<   fetchr;   s    r    rF   zRoleInstance.fetchj   s     {{  ""r   c                 R   K   | j                   j                          d{   S 7 w)o
        Asynchronous coroutine to fetch the RoleInstance


        :returns: The fetched RoleInstance
        N)r<   fetch_asyncr;   s    r    rI   zRoleInstance.fetch_asyncs   s!      [[,,....rC   
permissionc                 :    | j                   j                  |      S )q
        Update the RoleInstance

        :param permission:

        :returns: The updated RoleInstance
        rJ   )r<   updater5   rJ   s     r    rN   zRoleInstance.update|   s#     {{!!! " 
 	
r   c                 V   K   | j                   j                  |       d{   S 7 w)
        Asynchronous coroutine to update the RoleInstance

        :param permission:

        :returns: The updated RoleInstance
        rM   N)r<   update_asyncrO   s     r    rR   zRoleInstance.update_async   s1      [[--! . 
 
 	
 
s    )')c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r    	<genexpr>z(RoleInstance.__repr__.<locals>.<genexpr>   "     S<RDAq7>>!Q/<R   !z'<Twilio.IpMessaging.V1.RoleInstance {}>joinr3   itemsrY   r5   contexts     r    __repr__zRoleInstance.__repr__   s6     ((SDNN<P<P<RSS8??HHr   N)r7   r9   )r7   r   )r   r   r   objectr!   r   r   strr   r   r0   propertyr<   boolr?   rB   rF   rI   r   rN   rR   rf   __classcell__r6   s   @r    r   r      s    "6 "
" "44 c3h4 	4
 c]4:  $ $0D 0#/

c 

~ 



T#Y 

> 

I# Ir   r   c                        e Zd Zdededef fdZdefdZdefdZde	fdZ
de	fd	Zd
ee   de	fdZd
ee   de	fdZdefdZ xZS )r9   r"   r$   r%   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)z
        Initialize the RoleContext

        :param version: Version that contains the resource
        :param service_sid:
        :param sid:
        r.   z#/Services/{service_sid}/Roles/{sid}Nr   r/   r0   r3   rY   _uri)r5   r"   r$   r%   r6   s       r    r0   zRoleContext.__init__   sB     	! '
 A9@@R4>>R	r   r7   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )r>   DELETEmethoduriheaders)r   ofr:   r?   rq   r5   rw   s     r    r?   zRoleContext.delete   s1     ))B-}}##8G#TTr   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)rA   rs   rt   N)r   rx   r:   rB   rq   ry   s     r    rB   zRoleContext.delete_async   sF      ))B-]]//G 0 
 
 	
 
s   AA
AA
c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d   | j                  d         S )rE   application/jsonAcceptGETrt   r$   r%   r.   )r   rx   r:   rF   rq   r   r3   r5   rw   r#   s      r    rF   zRoleContext.fetch   si     ))B-.--%%U		7%SMM}5u%	
 	
r   c                   K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)	rH   r|   r}   r~   rt   Nr$   r%   r.   )r   rx   r:   rI   rq   r   r3   r   s      r    rI   zRoleContext.fetch_async   s~      ))B-.11dii 2 
 
 MM}5u%	
 	
	
s   ABB 	8BrJ   c                 P   t        j                  dt        j                  |d       i      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d	   | j                  d
         S )rL   
Permissionc                     | S rg   r   es    r    <lambda>z$RoleContext.update.<locals>.<lambda>      !r   !application/x-www-form-urlencodedContent-Typer|   r}   POSTru   rv   datarw   r$   r%   r.   )	r   rx   r   mapr:   rN   rq   r   r3   r5   rJ   r   rw   r#   s        r    rN   zRoleContext.update   s     yyimmJD

 ))B-"E.--&&tyytW ' 
 MM}5u%	
 	
r   c                 l  K   t        j                  dt        j                  |d       i      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||       d	{   }t        | j                  || j                  d
   | j                  d         S 7 7w)rQ   r   c                     | S rg   r   r   s    r    r   z*RoleContext.update_async.<locals>.<lambda>!  r   r   r   r   r|   r}   r   r   Nr$   r%   r.   )	r   rx   r   r   r:   rR   rq   r   r3   r   s        r    rR   zRoleContext.update_async  s      yyimmJD

 ))B-"E.22tyytW 3 
 
 MM}5u%	
 	
	
s   A8B4:B2;8B4c                     dj                  d | j                  j                         D              }dj                  |      S )rT   rU   c              3   F   K   | ]  \  }}d j                  ||        ywrW   rX   rZ   s      r    r^   z'RoleContext.__repr__.<locals>.<genexpr>;  r_   r`   z&<Twilio.IpMessaging.V1.RoleContext {}>ra   rd   s     r    rf   zRoleContext.__repr__5  s6     ((SDNN<P<P<RSS7>>wGGr   )r   r   r   r   ri   r0   rk   r?   rB   r   rF   rI   r   rN   rR   rf   rl   rm   s   @r    r9   r9      s    S Sc S S"
U 
U
D 

| 
*
< 
.
c 
| 
>
T#Y 
< 
>H# Hr   r9   c                   2    e Zd Zdeeef   defdZdefdZy)RolePager#   r7   c                 L    t        | j                  || j                  d         S )zj
        Build an instance of RoleInstance

        :param payload: Payload response from the API
        r$   r$   )r   r:   r3   )r5   r#   s     r    get_instancezRolePage.get_instanceA  s%     MM7}0M
 	
r   c                      y)rT   z <Twilio.IpMessaging.V1.RolePage>r   r;   s    r    rf   zRolePage.__repr__K       2r   N)	r   r   r   r   ri   r   r   r   rf   r   r   r    r   r   ?  s)    
DcN 
| 
2# 2r   r   c            	       T    e Zd Zdedef fdZdedddee   defd	Zdedddee   defd
Z		 	 dde
e   de
e   dee   fdZ	 	 dde
e   de
e   dee   fdZ	 	 dde
e   de
e   dee   fdZ	 	 dde
e   de
e   dee   fdZej&                  ej&                  ej&                  fdeeef   deeef   deeef   defdZej&                  ej&                  ej&                  fdeeef   deeef   deeef   defdZdedefdZdedefdZdedefdZdedefdZdefdZ xZS )RoleListr"   r$   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the RoleList

        :param version: Version that contains the resource
        :param service_sid:

        r$   z/Services/{service_sid}/RolesNr   rp   )r5   r"   r$   r6   s      r    r0   zRoleList.__init__V  s@     	! ;
 ;3::LT^^L	r   r(   r)   r   rJ   r7   c                 <   t        j                  ||t        j                  |d       d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d	   
      S )z
        Create the RoleInstance

        :param friendly_name:
        :param type:
        :param permission:

        :returns: The created RoleInstance
        c                     | S rg   r   r   s    r    r   z!RoleList.create.<locals>.<lambda>w  r   r   FriendlyNameTyper   r   r   r|   r}   r   r   r$   r   )	r   rx   r   r   r:   createrq   r   r3   r5   r(   r)   rJ   r   rw   r#   s          r    r   zRoleList.createf  s     yy -'mmJD
 ))^-PQR"E.--&&tyytW ' 
 MM7}0M
 	
r   c                 X  K   t        j                  ||t        j                  |d       d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||       d	{   }t        | j                  || j                  d
         S 7 )w)z
        Asynchronously create the RoleInstance

        :param friendly_name:
        :param type:
        :param permission:

        :returns: The created RoleInstance
        c                     | S rg   r   r   s    r    r   z'RoleList.create_async.<locals>.<lambda>  r   r   r   r   r   r|   r}   r   r   Nr$   r   )	r   rx   r   r   r:   create_asyncrq   r   r3   r   s          r    r   zRoleList.create_async  s      yy -'mmJD
 ))^-PQR"E.22tyytW 3 
 
 MM7}0M
 	
	
s   A<B*>B(?*B*limit	page_sizec                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )aZ  
        Streams RoleInstance 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
        r   r   r   )r:   read_limitspagestreamr5   r   r   limitsr   s        r    r   zRoleList.stream  sJ    ( **5)<yy6+#6y7}}##D&/::r   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)ai  
        Asynchronously streams RoleInstance 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
        r   r   Nr   )r:   r   
page_asyncstream_asyncr   s        r    r   zRoleList.stream_async  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        Lists RoleInstance 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
        r   r   )listr   )r5   r   r   s      r    r   zRoleList.list  s(    & KK#  
 	
r   c                 z   K   | j                  ||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a  
        Asynchronously lists RoleInstance 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
        r   N)r   )r5   r   r   records       r    
list_asynczRoleList.list_async  sY     * '+&7&7# '8 ' ! !
 
 !
 
 	
 
s0   ;.;620
26;26;
page_tokenpage_numberc                     t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                        S )am  
        Retrieve a single page of RoleInstance 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 RoleInstance
        	PageTokenr   PageSizer   r   r|   r}   r~   ru   rv   paramsrw   )r   rx   r:   r   rq   r   r3   r5   r   r   r   r   rw   responses          r    r   zRoleList.page  s      yy'#%
 ))^-PQR.==%%diig & 
 x@@r   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                        S 7 %w)	a|  
        Asynchronously retrieve a single page of RoleInstance 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 RoleInstance
        r   r   r   r|   r}   r~   r   N)r   rx   r:   r   rq   r   r3   r   s          r    r   zRoleList.page_async2  s       yy'#%
 ))^-PQR.11diig 2 
 
 x@@
s   A"B$B
%&B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )z
        Retrieve a specific page of RoleInstance records from the API.
        Request is executed immediately

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

        :returns: Page of RoleInstance
        r~   )r:   domaintwiliorequestr   r3   r5   r   r   s      r    get_pagezRoleList.get_pageS  s=     ==''..66ujIx@@r   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)z
        Asynchronously retrieve a specific page of RoleInstance records from the API.
        Request is executed immediately

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

        :returns: Page of RoleInstance
        r~   N)r:   r   r   request_asyncr   r3   r   s      r    get_page_asynczRoleList.get_page_async_  sJ      --44BB5*UUx@@ Vs   4AA&Ar%   c                 L    t        | j                  | j                  d   |      S z?
        Constructs a RoleContext

        :param sid:
        r$   r.   r9   r:   r3   r5   r%   s     r    r1   zRoleList.getk  %     MMt~~m'D#
 	
r   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r    __call__zRoleList.__call__u  r   r   c                      y)rT   z <Twilio.IpMessaging.V1.RoleList>r   r;   s    r    rf   zRoleList.__repr__  r   r   )NN) r   r   r   r   ri   r0   r   r   r   r   r   intr	   r   r
   r   r   r   r   unsetr   rh   r   r   r   r   r   r9   r1   r   rf   rl   rm   s   @r    r   r   T  so   M Mc M  
  
(? 
MQRUY 
	 
D 
  
(? 
MQRUY 
	 
H  $#';}; C=; 
,		;6  $#'A}A C=A 
|	$	A6  $#'
}
 C=
 
l		
8  $#'
}
 C=
 
l		
: *0*0,,(.	A#v+&A 3;'A f%	A
 
AF *0*0,,(.	A#v+&A 3;'A f%	A
 
AB
A3 
A8 
A
As 
Ax 
A
s 
{ 

C 
K 
2# 2r   r   N)__doc__r   typingr   r   r   r   r   r	   r
   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r9   r   r   r   r   r    <module>r      sj     L L L 6 6 8 : 2 ' !BI# BIJ^H/ ^HB2t 2*q2| q2r   