o
    es(                     @   s   d 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 )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )values)InstanceContext)InstanceResource)ListResource)Pagec                       sf   e Zd Z fddZdddZdddZejejejfdd	Zd
d Z	dd Z
dd Zdd Z  ZS )PoliciesListc                    s.   t t| | i | _djdi | j| _dS )z
        Initialize the PoliciesList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.trusthub.v1.policies.PoliciesList
        :rtype: twilio.rest.trusthub.v1.policies.PoliciesList
        z	/PoliciesN )superr   __init__	_solutionformat_uri)selfversion	__class__r   S/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/trusthub/v1/policies.pyr
      s   	zPoliciesList.__init__Nc                 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 int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int 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
        :rtype: list[twilio.rest.trusthub.v1.policies.PoliciesInstance]
        	page_size)r   limit)_versionread_limitspagestream)r   r   r   limitsr   r   r   r   r   !   s   zPoliciesList.streamc                 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 int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int 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: Generator that will yield up to limit results
        :rtype: list[twilio.rest.trusthub.v1.policies.PoliciesInstance]
        )r   r   )listr   )r   r   r   r   r   r   r   8   s   zPoliciesList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of PoliciesInstance records from the API.
        Request is executed immediately

        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of PoliciesInstance
        :rtype: twilio.rest.trusthub.v1.policies.PoliciesPage
        )	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   PoliciesPager   )r   
page_tokenpage_numberr   dataresponser   r   r   r   J   s   zPoliciesList.pagec                 C   s"   | j jjd|}t| j || jS )a7  
        Retrieve a specific page of PoliciesInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PoliciesInstance
        :rtype: twilio.rest.trusthub.v1.policies.PoliciesPage
        r   )r   domaintwiliorequestr"   r   )r   
target_urlr&   r   r   r   get_page]   s
   

zPoliciesList.get_pagec                 C      t | j|dS z
        Constructs a PoliciesContext

        :param sid: The unique string that identifies the Policy resource

        :returns: twilio.rest.trusthub.v1.policies.PoliciesContext
        :rtype: twilio.rest.trusthub.v1.policies.PoliciesContext
        sidPoliciesContextr   r   r/   r   r   r   getn      	zPoliciesList.getc                 C   r,   r-   r0   r2   r   r   r   __call__y   r4   zPoliciesList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z!<Twilio.Trusthub.V1.PoliciesList>r   r   r   r   r   __repr__      zPoliciesList.__repr__)NN)__name__
__module____qualname__r
   r   r   r   unsetr   r+   r3   r5   r9   __classcell__r   r   r   r   r      s    


r   c                       ,   e Zd Z fddZdd Zdd Z  ZS )r"   c                    s   t t| || || _dS )a(  
        Initialize the PoliciesPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.trusthub.v1.policies.PoliciesPage
        :rtype: twilio.rest.trusthub.v1.policies.PoliciesPage
        N)r	   r"   r
   r   )r   r   r&   solutionr   r   r   r
      s   

zPoliciesPage.__init__c                 C   s   t | j|S )z
        Build an instance of PoliciesInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.trusthub.v1.policies.PoliciesInstance
        :rtype: twilio.rest.trusthub.v1.policies.PoliciesInstance
        )PoliciesInstancer   r   payloadr   r   r   get_instance   s   	zPoliciesPage.get_instancec                 C   r6   )r7   z!<Twilio.Trusthub.V1.PoliciesPage>r   r8   r   r   r   r9      r:   zPoliciesPage.__repr__)r;   r<   r=   r
   rE   r9   r?   r   r   r   r   r"      s    r"   c                       r@   )r1   c                    s2   t t| | d|i| _djdi | j| _dS )aC  
        Initialize the PoliciesContext

        :param Version version: Version that contains the resource
        :param sid: The unique string that identifies the Policy resource

        :returns: twilio.rest.trusthub.v1.policies.PoliciesContext
        :rtype: twilio.rest.trusthub.v1.policies.PoliciesContext
        r/   z/Policies/{sid}Nr   )r	   r1   r
   r   r   r   )r   r   r/   r   r   r   r
      s   

zPoliciesContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the PoliciesInstance

        :returns: The fetched PoliciesInstance
        :rtype: twilio.rest.trusthub.v1.policies.PoliciesInstance
        r   )r   r   r/   r.   )r   fetchr   rB   r   rC   r   r   r   rG      s   zPoliciesContext.fetchc                 C   $   d dd | j D }d|S )r7    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>       z+PoliciesContext.__repr__.<locals>.<genexpr>z'<Twilio.Trusthub.V1.PoliciesContext {}>joinr   itemsr   r   contextr   r   r   r9         
zPoliciesContext.__repr__)r;   r<   r=   r
   rG   r9   r?   r   r   r   r   r1      s    r1   c                       sz   e Zd ZG dd deZd fdd	Zedd Zedd	 Zed
d Z	edd Z
edd Zdd Zdd Z  ZS )rB   c                   @   s   e Zd ZdZdZdS )zPoliciesInstance.EndUserType
individualbusinessN)r;   r<   r=   
INDIVIDUALBUSINESSr   r   r   r   EndUserType   s    r]   Nc                    sV   t t| | |d|d|d|dd| _d| _d|p&| jd i| _dS )z
        Initialize the PoliciesInstance

        :returns: twilio.rest.trusthub.v1.policies.PoliciesInstance
        :rtype: twilio.rest.trusthub.v1.policies.PoliciesInstance
        r/   friendly_namerequirementsurl)r/   r^   r_   r`   N)r	   rB   r
   r3   _properties_contextr   )r   r   rD   r/   r   r   r   r
      s   zPoliciesInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )a-  
        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
        :rtype: twilio.rest.trusthub.v1.policies.PoliciesContext
        Nr/   r.   )rb   r1   r   r   r8   r   r   r   _proxy   s   
	zPoliciesInstance._proxyc                 C   
   | j d S )zi
        :returns: The unique string that identifies the Policy resource
        :rtype: unicode
        r/   ra   r8   r   r   r   r/        
zPoliciesInstance.sidc                 C   rd   )zg
        :returns: A human-readable description of the Policy resource
        :rtype: unicode
        r^   re   r8   r   r   r   r^     rf   zPoliciesInstance.friendly_namec                 C   rd   )zf
        :returns: The sid of a Policy object that dictates requirements
        :rtype: dict
        r_   re   r8   r   r   r   r_     rf   zPoliciesInstance.requirementsc                 C   rd   )z[
        :returns: The absolute URL of the Policy resource
        :rtype: unicode
        r`   re   r8   r   r   r   r`     rf   zPoliciesInstance.urlc                 C   s
   | j  S )rF   )rc   rG   r8   r   r   r   rG   $  s   
zPoliciesInstance.fetchc                 C   rH   )r7   rI   c                 s   rJ   rK   rL   rM   r   r   r   rQ   4  rR   z,PoliciesInstance.__repr__.<locals>.<genexpr>z(<Twilio.Trusthub.V1.PoliciesInstance {}>rS   rV   r   r   r   r9   -  rX   zPoliciesInstance.__repr__)N)r;   r<   r=   objectr]   r
   propertyrc   r/   r^   r_   r`   rG   r9   r?   r   r   r   r   rB      s    




	rB   N)__doc__twilio.baser   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r"   r1   rB   r   r   r   r   <module>   s   ~&(