a
    !f4                     @   s   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 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 )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)InstanceContext)InstanceResource)ListResource)Version)Pagec                       st   e Zd ZdZdeeeef ee d fddZ	e
dddd	Zd dd
dZd dddZedddZ  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.
    N)versionpayloadsidc                    sV   t  | |d| _|d| _|d| _|d| _d|pF| ji| _d | _d S )Nr   friendly_namerequirementsurl)	super__init__getr   r   r   r   	_solution_context)selfr   r   r   	__class__ a/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/trusthub/v1/policies.pyr   "   s    
zPoliciesInstance.__init__PoliciesContextreturnc                 C   s&   | j du r t| j| jd 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
        Nr   r   )r   r    _versionr   r   r   r   r   _proxy1   s    
zPoliciesInstance._proxyc                 C   s
   | j  S )]
        Fetch the PoliciesInstance


        :returns: The fetched PoliciesInstance
        )r&   fetchr%   r   r   r   r(   @   s    zPoliciesInstance.fetchc                    s   | j  I dH S )w
        Asynchronous coroutine to fetch the PoliciesInstance


        :returns: The fetched PoliciesInstance
        N)r&   fetch_asyncr%   r   r   r   r*   I   s    zPoliciesInstance.fetch_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>X       z,PoliciesInstance.__repr__.<locals>.<genexpr>z(<Twilio.Trusthub.V1.PoliciesInstance {}>joinr   itemsr/   r   contextr   r   r   __repr__R   s    zPoliciesInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr&   r(   r*   r;   __classcell__r   r   r   r   r      s    		r   c                       sN   e Zd Zeed fddZedddZedddZedd	d
Z	  Z
S )r    )r   r   c                    s.   t  | d|i| _djf i | j| _dS )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   r   r   r   ]   s    zPoliciesContext.__init__r!   c                 C   s(   | j jd| jd}t| j || jd dS )r'   GETmethodurir   r#   )r$   r(   rC   r   r   r   r   r   r   r   r(   l   s    zPoliciesContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )r)   rD   rE   Nr   r#   )r$   r*   rC   r   r   rH   r   r   r   r*      s    zPoliciesContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r+   r,   c                 s   s   | ]\}}d  ||V  qdS r-   r.   r0   r   r   r   r4      r5   z+PoliciesContext.__repr__.<locals>.<genexpr>z'<Twilio.Trusthub.V1.PoliciesContext {}>r6   r9   r   r   r   r;      s    zPoliciesContext.__repr__)r<   r=   r>   r   r@   r   r   r(   r*   r;   rB   r   r   r   r   r    \   s   r    c                   @   s2   e Zd Zeeef edddZedddZdS )PoliciesPage)r   r"   c                 C   s   t | j|S )zn
        Build an instance of PoliciesInstance

        :param payload: Payload response from the API
        )r   r$   rH   r   r   r   get_instance   s    zPoliciesPage.get_instancer!   c                 C   s   dS )r+   z!<Twilio.Trusthub.V1.PoliciesPage>r   r%   r   r   r   r;      s    zPoliciesPage.__repr__N)	r<   r=   r>   r   r@   r   r   rJ   r;   r   r   r   r   rI      s   rI   c                       sd  e Zd Zed fddZd ee ee ee dddZ	d!ee ee e
e ddd	Zd"ee ee ee dd
dZd#ee ee ee dddZejejejfeeef eeef eeef edddZejejejfeeef eeef eeef edddZeedddZeedddZeedddZeedddZedddZ  ZS )$PoliciesList)r   c                    s   t  | d| _dS )zj
        Initialize the PoliciesList

        :param version: Version that contains the resource

        z	/PoliciesN)r   r   rC   )r   r   r   r   r   r      s    zPoliciesList.__init__N)limit	page_sizer"   c                 C   s0   | j ||}| j|d d}| 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
        rM   rM   rL   )r$   read_limitspagestreamr   rL   rM   ZlimitsrP   r   r   r   rQ      s    zPoliciesList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )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
        rM   rN   NrL   )r$   rO   
page_asyncstream_asyncrR   r   r   r   rT      s    zPoliciesList.stream_asyncc                 C   s   t | j||d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
        rL   rM   )listrQ   r   rL   rM   r   r   r   rV      s    zPoliciesList.listc                    s$   dd | j ||dI dH 2 I dH S )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
        c                    s   g | z3 d H W }|q6 S )Nr   )r1   recordr   r   r   
<listcomp>  s   z+PoliciesList.list_async.<locals>.<listcomp>rU   N)rT   rW   r   r   r   
list_async  s    
zPoliciesList.list_async)
page_tokenpage_numberrM   r"   c                 C   s2   t |||d}| jjd| j|d}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
        Z	PageTokenr   ZPageSizerD   rF   rG   params)r	   ofr$   rP   rC   rI   r   r[   r\   rM   dataresponser   r   r   rP   !  s    zPoliciesList.pagec                    s8   t |||d}| jjd| j|dI dH }t| j|S )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]   rD   r^   N)r	   r`   r$   rS   rC   rI   ra   r   r   r   rS   <  s    zPoliciesList.page_async)
target_urlr"   c                 C   s   | 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
        rD   )r$   domaintwiliorequestrI   r   rd   rc   r   r   r   get_pageY  s    	zPoliciesList.get_pagec                    s$   | j jjd|I dH }t| j |S )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
        rD   N)r$   re   rf   Zrequest_asyncrI   rh   r   r   r   get_page_asynce  s    	zPoliciesList.get_page_async)r   r"   c                 C   s   t | j|dS zz
        Constructs a PoliciesContext

        :param sid: The unique string that identifies the Policy resource.
        r#   r    r$   r   r   r   r   r   r   q  s    zPoliciesList.getc                 C   s   t | j|dS rk   rl   rm   r   r   r   __call__y  s    zPoliciesList.__call__r!   c                 C   s   dS )r+   z!<Twilio.Trusthub.V1.PoliciesList>r   r%   r   r   r   r;     s    zPoliciesList.__repr__)NN)NN)NN)NN)r<   r=   r>   r   r   r   intr   r   rQ   r   rT   r   rV   rZ   r	   unsetr   r@   objectrI   rP   rS   ri   rj   r    r   rn   r;   rB   r   r   r   r   rK      sh           





rK   N)r?   typingr   r   r   r   r   r   r   Ztwilio.baser	   Ztwilio.base.instance_contextr
   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r    rI   rK   r   r   r   r   <module>   s   $C@