
    pi2                         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  G d	 d
e      Z G d de      Z G d de      Zy)a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Assistants
    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)InstanceResource)ListResource)Version)Pagec                   B     e Zd ZdZdedeeef   f fdZdefdZ	 xZ
S )PolicyInstancea  
    :ivar id: The Policy ID.
    :ivar name: The name of the policy.
    :ivar description: The description of the policy.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Policy resource.
    :ivar user_sid: The SID of the User that created the Policy resource.
    :ivar type: The type of the policy.
    :ivar policy_details: The details of the policy based on the type.
    :ivar date_created: The date and time in GMT when the Policy was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar date_updated: The date and time in GMT when the Policy was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    versionpayloadc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _	        t        j                  |j                  d            | _        t        j                  |j                  d	            | _        y )
Nidnamedescriptionaccount_siduser_sidtypepolicy_detailsdate_createddate_updated)super__init__getr   r   r   r   r   r   r   r   iso8601_datetimer   r   )selfr   r   	__class__s      b/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/assistants/v1/policy.pyr    zPolicyInstance.__init__&   s    !!(T!2#*;;v#6	*1++m*D*1++m*D'.{{:'>#*;;v#6	;B;;GW;X0;0L0LKK'1
 1<0L0LKK'1
    returnc                      y)f
        Provide a friendly representation

        :returns: Machine friendly representation
        z%<Twilio.Assistants.V1.PolicyInstance> r#   s    r%   __repr__zPolicyInstance.__repr__7   s     7r&   )__name__
__module____qualname____doc__r   r   strr   r    r,   __classcell__r$   s   @r%   r   r      s/    

 
$sCx. 
"7# 7r&   r   c                   2    e Zd Zdeeef   defdZdefdZy)
PolicyPager   r'   c                 .    t        | j                  |      S )zl
        Build an instance of PolicyInstance

        :param payload: Payload response from the API
        )r   _version)r#   r   s     r%   get_instancezPolicyPage.get_instanceC   s     dmmW55r&   c                      y)r)   z!<Twilio.Assistants.V1.PolicyPage>r*   r+   s    r%   r,   zPolicyPage.__repr__K        3r&   N)	r-   r.   r/   r   r1   r   r   r8   r,   r*   r&   r%   r5   r5   A   s)    6DcN 6~ 63# 3r&   r5   c                       e Zd Zdef fdZej                  ej                  ddfdeee	f   deee	f   de
e   de
e   dee   f
d	Zej                  ej                  ddfdeee	f   deee	f   de
e   de
e   dee   f
d
Zej                  ej                  ddfdeee	f   deee	f   de
e   de
e   dee   f
dZej                  ej                  ddfdeee	f   deee	f   de
e   de
e   dee   f
dZej                  ej                  ej                  ej                  ej                  fdeee	f   deee	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                  ej                  ej                  fdeee	f   deee	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fdZ xZS )
PolicyListr   c                 2    t         |   |       d| _        y)zh
        Initialize the PolicyList

        :param version: Version that contains the resource

        z	/PoliciesN)r   r    _uri)r#   r   r$   s     r%   r    zPolicyList.__init__V   s     	!	r&   Ntool_idknowledge_idlimit	page_sizer'   c                     | j                   j                  ||      }| j                  |||d         }| j                   j                  ||d         S )a  
        Streams PolicyInstance 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 str tool_id: The tool ID.
        :param str knowledge_id: The knowledge ID.
        :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
        rB   r?   r@   rB   rA   )r7   read_limitspagestreamr#   r?   r@   rA   rB   limitsrF   s          r%   rG   zPolicyList.streama   sV    0 **5)<yy,&BU  
 }}##D&/::r&   c                    K   | j                   j                  ||      }| j                  |||d          d{   }| j                   j                  ||d         S 7 #w)a  
        Asynchronously streams PolicyInstance 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 str tool_id: The tool ID.
        :param str knowledge_id: The knowledge ID.
        :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
        rB   rD   NrA   )r7   rE   
page_asyncstream_asyncrH   s          r%   rL   zPolicyList.stream_async   sd     0 **5)<__,&BU % 
 
 }}))$w@@	
s   7AA$Ac                 >    t        | j                  ||||            S )aU  
        Lists PolicyInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str tool_id: The tool ID.
        :param str knowledge_id: The knowledge ID.
        :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@   rA   rB   )listrG   )r#   r?   r@   rA   rB   s        r%   rO   zPolicyList.list   s.    . KK)#	  
 	
r&   c                 ~   K   | j                  ||||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)ad  
        Asynchronously lists PolicyInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str tool_id: The tool ID.
        :param str knowledge_id: The knowledge ID.
        :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
        rN   N)rL   )r#   r?   r@   rA   rB   records         r%   
list_asynczPolicyList.list_async   sZ     2 '+&7&7)#	 '8 ' !
 
 !
 
 	
 
s0   =0=842
48=48=
page_tokenpage_numberc                     t        j                  |||||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }t        | j                  |      S )a  
        Retrieve a single page of PolicyInstance records from the API.
        Request is executed immediately

        :param tool_id: The tool ID.
        :param knowledge_id: The knowledge ID.
        :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 PolicyInstance
        ToolIdKnowledgeId	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedapplication/jsonAcceptGETmethoduriparamsheaders)r   ofr7   rF   r>   r5   	r#   r?   r@   rS   rT   rB   datard   responses	            r%   rF   zPolicyList.page   s    ( yy!+'#%
 ))^-PQR.==%%diig & 
 $--22r&   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 PolicyInstance records from the API.
        Request is executed immediately

        :param tool_id: The tool ID.
        :param knowledge_id: The knowledge ID.
        :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 PolicyInstance
        rV   r[   r\   r]   r^   r_   r`   N)r   re   r7   rK   r>   r5   rf   s	            r%   rK   zPolicyList.page_async  s     ( yy!+'#%
 ))^-PQR.11diig 2 
 
 $--22
s   A$B&B'B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   |      S )z
        Retrieve a specific page of PolicyInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PolicyInstance
        r_   )r7   domaintwiliorequestr5   r#   rj   rh   s      r%   get_pagezPolicyList.get_page.  s7     ==''..66ujI$--22r&   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   |      S 7 w)a   
        Asynchronously retrieve a specific page of PolicyInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PolicyInstance
        r_   N)r7   rl   rm   request_asyncr5   ro   s      r%   get_page_asynczPolicyList.get_page_async:  sD      --44BB5*UU$--22 Vs   4AAAc                      y)r)   z!<Twilio.Assistants.V1.PolicyList>r*   r+   s    r%   r,   zPolicyList.__repr__F  r:   r&   )r-   r.   r/   r   r    r   unsetr   r1   objectr   intr	   r   rG   r
   rL   r   rO   rR   r5   rF   rK   rp   rs   r,   r2   r3   s   @r%   r<   r<   T   s   	  	  '-ll+1<<##';sF{#; CK(; }	;
 C=; 
.	!;B '-ll+1<<##'AsF{#A CK(A }	A
 C=A 
~	&AB '-ll+1<<##'
sF{#
 CK(
 }	

 C=
 
n	
D '-ll+1<<##'
sF{#
 CK(
 }	

 C=
 
n	
F '-ll+1<<)/*0,,(.%3sF{#%3 CK(%3 #v+&	%3
 3;'%3 f%%3 
%3R '-ll+1<<)/*0,,(.%3sF{#%3 CK(%3 #v+&	%3
 3;'%3 f%%3 
%3N
33 
3: 
3
3s 
3z 
33# 3r&   r<   N)r0   r   typingr   r   r   r   r   r	   r
   twilio.baser   r   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r5   r<   r*   r&   r%   <module>r~      sO     L L L + : 2 ' !%7% %7P3 3&x3 x3r&   