o
    f>h2                     @   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 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 - 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                       s@   e Zd ZdZdedeeef f fddZdefddZ	  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                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	t
|d| _t
|d	| _d S )
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/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/assistants/v1/policy.pyr   &   s   
zPolicyInstance.__init__returnc                 C      dS )f
        Provide a friendly representation

        :returns: Machine friendly representation
        z%<Twilio.Assistants.V1.PolicyInstance>r#   r    r#   r#   r$   __repr__7   s   zPolicyInstance.__repr__)__name__
__module____qualname____doc__r   r   strr   r   r)   __classcell__r#   r#   r!   r$   r      s    r   c                   @   s4   e Zd Zdeeef defddZdefddZdS )
PolicyPager   r%   c                 C   s   t | j|S )zl
        Build an instance of PolicyInstance

        :param payload: Payload response from the API
        )r   _version)r    r   r#   r#   r$   get_instanceC   s   zPolicyPage.get_instancec                 C   r&   )r'   z!<Twilio.Assistants.V1.PolicyPage>r#   r(   r#   r#   r$   r)   K      zPolicyPage.__repr__N)	r*   r+   r,   r   r.   r   r   r2   r)   r#   r#   r#   r$   r0   A   s    r0   c                       s4  e Zd Zdef fd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
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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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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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dZded	efddZded	efddZd	efddZ  ZS )
PolicyListr   c                    s   t  | d| _dS )zh
        Initialize the PolicyList

        :param version: Version that contains the resource

        z	/PoliciesN)r   r   _uri)r    r   r!   r#   r$   r   V   s   
zPolicyList.__init__Ntool_idknowledge_idlimit	page_sizer%   c                 C   s4   | j ||}| j|||d d}| 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
        r9   r6   r7   r9   r8   )r1   read_limitspagestreamr    r6   r7   r8   r9   limitsr<   r#   r#   r$   r=   a   s
   
zPolicyList.streamc                    s<   | j ||}| j|||d dI dH }| j ||d S )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
        r9   r:   Nr8   )r1   r;   
page_asyncstream_asyncr>   r#   r#   r$   rA      s   
zPolicyList.stream_asyncc                 C   s   t | j||||d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
        r6   r7   r8   r9   )listr=   r    r6   r7   r8   r9   r#   r#   r$   rC      s   zPolicyList.listc                    s*   dd | j ||||dI dH 2 I dH S )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
        c                    s   g | z3 d H W }|q6 S )Nr#   ).0recordr#   r#   r$   
<listcomp>   s
    z)PolicyList.list_async.<locals>.<listcomp>rB   N)rA   rD   r#   r#   r$   
list_async   s   
zPolicyList.list_async
page_tokenpage_numberc           	      C   sN   t |||||d}t ddi}d|d< | jjd| j||d}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   ofr1   r<   r5   r0   	r    r6   r7   rI   rJ   r9   datarY   responser#   r#   r$   r<      s   

zPolicyList.pagec           	         sV   t |||||d}t ddi}d|d< | jjd| j||dI dH }t| j|S )	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
        rK   rP   rQ   rR   rS   rT   rU   N)r   rZ   r1   r@   r5   r0   r[   r#   r#   r$   r@     s   

zPolicyList.page_async
target_urlc                 C   s   | 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
        rT   )r1   domaintwiliorequestr0   r    r^   r]   r#   r#   r$   get_page.  s   	zPolicyList.get_pagec                    s&   | j jjd|I dH }t| j |S )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
        rT   N)r1   r_   r`   request_asyncr0   rb   r#   r#   r$   get_page_async:  s   	zPolicyList.get_page_asyncc                 C   r&   )r'   z!<Twilio.Assistants.V1.PolicyList>r#   r(   r#   r#   r$   r)   F  r3   zPolicyList.__repr__)r*   r+   r,   r   r   r   unsetr   r.   objectr   intr   r   r=   r	   rA   r   rC   rH   r0   r<   r@   rc   re   r)   r/   r#   r#   r!   r$   r4   T   s    


!


!


"


#





)





'r4   N)r-   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   r0   r4   r#   r#   r#   r$   <module>   s    $(