
    d{iZ                         d Z ddlmZmZmZmZ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 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 - Trusthub
    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.
    )AnyDictListOptionalUnionIteratorAsyncIterator)values)ApiResponse)InstanceContext)InstanceResource)ListResource)Version)Pagec                        e Zd ZdZ	 ddedeeef   dee   f fdZ	e
dd       ZddZdd	Zdefd
ZdefdZdefdZ xZS )PoliciesInstanceao  
    :ivar sid: The unique string that identifies the Policy resource.
    :ivar friendly_name: A human-readable description that is assigned to describe the Policy resource. Examples can include Primary Customer profile policy
    :ivar requirements: The SID of an object that holds the policy information
    :ivar url: The absolute URL of the Policy resource.
    versionpayloadsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        d|xs | j                  i| _        d | _        y )Nr   friendly_namerequirementsurl)	super__init__getr   r   r   r   	_solution_context)selfr   r   r   	__class__s       ^/home/sas/my/fyp/ringai/.venv/lib/python3.12/site-packages/twilio/rest/trusthub/v1/policies.pyr   zPoliciesInstance.__init__!   su     	!")++e"4,3KK,H9@^9T")++e"4 3?$((
 48    returnc                     | j                   )t        | j                  | 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: PoliciesContext for this PoliciesInstance
        r   r   )r   PoliciesContext_versionr   r   s    r!   _proxyzPoliciesInstance._proxy0   s9     == +NN5)DM }}r"   c                 6    | j                   j                         S )]
        Fetch the PoliciesInstance


        :returns: The fetched PoliciesInstance
        )r)   fetchr(   s    r!   r,   zPoliciesInstance.fetch?   s     {{  ""r"   c                 R   K   | j                   j                          d{   S 7 w)w
        Asynchronous coroutine to fetch the PoliciesInstance


        :returns: The fetched PoliciesInstance
        N)r)   fetch_asyncr(   s    r!   r/   zPoliciesInstance.fetch_asyncH   s!      [[,,....   '%'c                 6    | j                   j                         S )z
        Fetch the PoliciesInstance with HTTP info


        :returns: ApiResponse with instance, status code, and headers
        )r)   fetch_with_http_infor(   s    r!   r2   z%PoliciesInstance.fetch_with_http_infoQ   s     {{//11r"   c                 R   K   | j                   j                          d{   S 7 w)z
        Asynchronous coroutine to fetch the PoliciesInstance with HTTP info


        :returns: ApiResponse with instance, status code, and headers
        N)r)   fetch_with_http_info_asyncr(   s    r!   r4   z+PoliciesInstance.fetch_with_http_info_asyncZ   s!      [[;;====r0   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,PoliciesInstance.__repr__.<locals>.<genexpr>i        SDAq7>>!Q/S   !z(<Twilio.Trusthub.V1.PoliciesInstance {}>joinr   itemsr;   r   contexts     r!   __repr__zPoliciesInstance.__repr__c   s6     ((SDNN<P<P<RSS9@@IIr"   )N)r#   r&   )r#   r   )__name__
__module____qualname____doc__r   r   strr   r   r   propertyr)   r,   r/   r   r2   r4   rH   __classcell__r    s   @r!   r   r      s|     OS88)-c3h8>Fsm8  #/2k 2>+ >J# Jr"   r   c                   |     e Zd Z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fd	Zde
fd
ZdefdZ xZS )r&   r   r   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the PoliciesContext

        :param version: Version that contains the resource
        :param sid: The unique string that identifies the Policy resource.
        r   z/Policies/{sid}N )r   r   r   r;   _uri)r   r   r   r    s      r!   r   zPoliciesContext.__init__o   s@     	! 3
 -%,,>t~~>	r"   r#   c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      S )zz
        Internal helper for fetch operation

        Returns:
            tuple: (payload, status_code, headers)
        application/jsonAcceptGETmethoduriheaders)r
   ofr'   fetch_with_response_inforT   r   r\   s     r!   _fetchzPoliciesContext._fetch~   sB     ))B-.}}55dii 6 
 	
r"   c                 t    | j                         \  }}}t        | j                  || j                  d         S )r+   r   r%   )r`   r   r'   r   r   r   _s      r!   r,   zPoliciesContext.fetch   s8     AMMu%
 	
r"   c                     | j                         \  }}}t        | j                  || j                  d         }t	        |||      S )z
        Fetch the PoliciesInstance and return response metadata


        :returns: ApiResponse with instance, status code, and headers
        r   r%   datastatus_coder\   )r`   r   r'   r   r   r   r   rg   r\   instances        r!   r2   z$PoliciesContext.fetch_with_http_info   sG     )-%g#MMu%

 k7SSr"   c                    K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   S 7 w)z
        Internal async helper for fetch operation

        Returns:
            tuple: (payload, status_code, headers)
        rV   rW   rX   rY   N)r
   r]   r'   fetch_with_response_info_asyncrT   r_   s     r!   _fetch_asynczPoliciesContext._fetch_async   sQ      ))B-.]]AAdii B 
 
 	
 
s   AAA	Ac                    K   | j                          d{   \  }}}t        | j                  || j                  d         S 7 -w)r.   Nr   r%   )rl   r   r'   r   rb   s      r!   r/   zPoliciesContext.fetch_async   sG      #//11AMMu%
 	
 2s   AA.Ac                    K   | j                          d{   \  }}}t        | j                  || j                  d         }t	        |||      S 7 ;w)z
        Asynchronous coroutine to fetch the PoliciesInstance and return response metadata


        :returns: ApiResponse with instance, status code, and headers
        Nr   r%   re   )rl   r   r'   r   r   rh   s        r!   r4   z*PoliciesContext.fetch_with_http_info_async   sW      /3.?.?.A(A%g#MMu%

 k7SS )Bs   AA<Ac                     dj                  d | j                  j                         D              }dj                  |      S )r6   r7   c              3   F   K   | ]  \  }}d j                  ||        ywr9   r:   r<   s      r!   r@   z+PoliciesContext.__repr__.<locals>.<genexpr>   rA   rB   z'<Twilio.Trusthub.V1.PoliciesContext {}>rC   rF   s     r!   rH   zPoliciesContext.__repr__   s6     ((SDNN<P<P<RSS8??HHr"   )rI   rJ   rK   r   rM   r   tupler`   r   r,   r   r2   rl   r/   r4   rH   rO   rP   s   @r!   r&   r&   m   sr    ? ?c ?
 
 
' 
Tk T
E 
 
#3 
T+ TI# Ir"   r&   c                   2    e Zd Zdeeef   defdZdefdZy)PoliciesPager   r#   c                 .    t        | j                  |      S )zn
        Build an instance of PoliciesInstance

        :param payload: Payload response from the API
        )r   r'   )r   r   s     r!   get_instancezPoliciesPage.get_instance   s      w77r"   c                      y)r6   z!<Twilio.Trusthub.V1.PoliciesPage>rS   r(   s    r!   rH   zPoliciesPage.__repr__        3r"   N)	rI   rJ   rK   r   rM   r   r   ru   rH   rS   r"   r!   rs   rs      s*    8DcN 87G 83# 3r"   rs   c            	           e Zd Zdef 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fdZ	 	 ddee   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fdZ	 	 ddee   dee   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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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 )PoliciesListr   c                 2    t         |   |       d| _        y)zj
        Initialize the PoliciesList

        :param version: Version that contains the resource

        z	/PoliciesN)r   r   rT   )r   r   r    s     r!   r   zPoliciesList.__init__   s     	!	r"   limit	page_sizer#   c                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )a^  
        Streams PoliciesInstance 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r   r{   r|   limitsr   s        r!   r   zPoliciesList.stream  sJ    ( **5)<yy6+#6y7}}##D&/::r"   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)am  
        Asynchronously streams PoliciesInstance 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PoliciesList.stream_async  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                     | j                   j                  ||      }| j                  |d         }| j                   j                  |j                  |d         }||j
                  |j                  fS )a  
        Streams PoliciesInstance and returns headers from first page


        :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: tuple of (generator, status_code, headers) where generator yields instances
        r|   r~   r{   )r'   r   page_with_http_infor   rf   rg   r\   r   r{   r|   r   page_response	generators         r!   stream_with_http_infoz"PoliciesList.stream_with_http_info4  sk    $ **5)<006+;N0OMM((););VG_M	=44m6K6KLLr"   c                   K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  |j                  |d         }||j
                  |j                  fS 7 Fw)a  
        Asynchronously streams PoliciesInstance and returns headers from first page


        :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: tuple of (generator, status_code, headers) where generator yields instances
        r|   r~   Nr{   )r'   r   page_with_http_info_asyncr   rf   rg   r\   r   s         r!   stream_with_http_info_asyncz(PoliciesList.stream_with_http_info_asyncL  s     $ **5)<"<<[) = 
 
 MM..}/A/A6'?S	=44m6K6KLL
s   5B A>AB c                 :    t        | j                  ||            S )a  
        Lists PoliciesInstance 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   )r   r{   r|   s      r!   r   zPoliciesList.listf  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 PoliciesInstance 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   )r   r{   r|   records       r!   
list_asynczPoliciesList.list_async  sT     * '+&7&7# '8 ' !
 
 !
 
 	
 
s0   ;.;620
26;26;c                 b    | j                  ||      \  }}}t        |      }t        |||      S )a  
        Lists PoliciesInstance and returns headers from first page


        :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: ApiResponse with list of instances, status code, and headers
        r   re   )r   r   r   )r   r{   r|   r   rg   r\   rE   s          r!   list_with_http_infoz PoliciesList.list_with_http_info  sA    $ +/*D*D +E +
'	; Y;PPr"   c                    K   | j                  ||       d{   \  }}}|2 cg c3 d{   }|7 7 	6 nc c}w }}t        |||      S w)a  
        Asynchronously lists PoliciesInstance and returns headers from first page


        :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: ApiResponse with list of instances, status code, and headers
        r   Nre   )r   r   )r   r{   r|   r   rg   r\   r   rE   s           r!   list_with_http_info_asyncz&PoliciesList.list_with_http_info_async  sf     $ 150P0P 1Q 1
 +
'	; -666&	+
 7666;PPs4   A4A:86
8:A8:A
page_tokenpage_numberc                     t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }t        | j                  |      S )au  
        Retrieve a single page of PoliciesInstance 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 PoliciesInstance
        	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedrV   rW   rX   rZ   r[   paramsr\   )r
   r]   r'   r   rT   rs   r   r   r   r|   rf   r\   responses          r!   r   zPoliciesList.page  sy      yy'#%
 ))^-PQR.==%%diig & 
 DMM844r"   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  |      S 7 w)	a  
        Asynchronously retrieve a single page of PoliciesInstance 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 PoliciesInstance
        r   r   r   rV   rW   rX   r   N)r
   r]   r'   r   rT   rs   r   s          r!   r   zPoliciesList.page_async  s       yy'#%
 ))^-PQR.11diig 2 
 
 DMM844
s   A"B$A?%Bc                    t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      \  }}}t        | j                  |      }	t        |	||      S )	aZ  
        Retrieve a single page with response metadata


        :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: ApiResponse with PoliciesPage, status code, and headers
        r   r   r   rV   rW   rX   r   re   )r
   r]   r'   page_with_response_inforT   rs   r   
r   r   r   r|   rf   r\   r   rg   response_headersr   s
             r!   r   z PoliciesList.page_with_http_info  s      yy'#%
 ))^-PQR.26--2W2Wdiig 3X 3
/+/ DMM84+GWXXr"   c                 *  K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   \  }}}t        | j                  |      }	t        |	||	      S 7 ,w)
ai  
        Asynchronously retrieve a single page with response metadata


        :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: ApiResponse with PoliciesPage, status code, and headers
        r   r   r   rV   rW   rX   r   Nre   )r
   r]   r'   page_with_response_info_asyncrT   rs   r   r   s
             r!   r   z&PoliciesList.page_with_http_info_async1  s       yy'#%
 ))^-PQR. --==$))D' >   	0+/
 DMM84+GWXXs   A"B$B%-B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   |      S )z
        Retrieve a specific page of PoliciesInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PoliciesInstance
        rX   )r'   domaintwiliorequestrs   r   r   r   s      r!   get_pagezPoliciesList.get_pageU  s7     ==''..66ujIDMM844r"   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   |      S 7 w)a  
        Asynchronously retrieve a specific page of PoliciesInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PoliciesInstance
        rX   N)r'   r   r   request_asyncrs   r   s      r!   get_page_asynczPoliciesList.get_page_asynca  sD      --44BB5*UUDMM844 Vs   4AAAr   c                 0    t        | j                  |      S zz
        Constructs a PoliciesContext

        :param sid: The unique string that identifies the Policy resource.
        r%   r&   r'   r   r   s     r!   r   zPoliciesList.getm       t}}#66r"   c                 0    t        | j                  |      S r   r   r   s     r!   __call__zPoliciesList.__call__u  r   r"   c                      y)r6   z!<Twilio.Trusthub.V1.PoliciesList>rS   r(   s    r!   rH   zPoliciesList.__repr__}  rw   r"   )NN)&rI   rJ   rK   r   r   r   intr   r   r   r	   r   rq   r   r   r   r   r   r   r   r   r
   unsetr   rM   objectrs   r   r   r   r   r   r   r&   r   r   rH   rO   rP   s   @r!   ry   ry      s   	  	   $#';}; C=; 
"	#	;6  $#'A}A C=A 
'	(	A6  $#'M}M C=M 
	M4  $#'M}M C=M 
	M8  $#'
}
 C=
 
		
8  $#'
}
 C=
 
		
:  $#'Q}Q C=Q 
	Q6  $#'Q}Q C=Q 
	Q6 *0*0,,(.	5#v+&5 3;'5 f%	5
 
5F *0*0,,(.	5#v+&5 3;'5 f%	5
 
5F *0*0,,(.	 Y#v+& Y 3;' Y f%	 Y
 
 YH *0*0,,(.	"Y#v+&"Y 3;'"Y f%	"Y
 
"YH
53 
5< 
5
5s 
5| 
57s 7 77C 7O 73# 3r"   ry   N)rL   typingr   r   r   r   r   r   r	   twilio.baser
   twilio.base.api_responser   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r&   rs   ry   rS   r"   r!   <module>r      sh    M L L  0 8 : 2 ' !QJ' QJhrIo rIj34 3&N3< N3r"   