
    i?1iAg                         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 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 - Preview
    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)InstanceContext)InstanceResource)ListResource)Version)Pagec            
       :    e Zd ZdZ	 ddedeeef   dedee   f fdZ	e
dd       Zdefd	Zdefd
ZddZddZej$                  ej$                  fdeeef   deeef   dd fdZej$                  ej$                  fdeeef   deeef   dd fdZdefdZ xZS )QueryInstancea  
    :ivar account_sid: The unique ID of the Account that created this Query.
    :ivar date_created: The date that this resource was created
    :ivar date_updated: The date that this resource was last updated
    :ivar results: The natural language analysis results which include the Task recognized, the confidence score and a list of identified Fields.
    :ivar language: An ISO language-country string of the sample.
    :ivar model_build_sid: The unique ID of the Model Build queried.
    :ivar query: The end-user's natural language input.
    :ivar sample_sid: An optional reference to the Sample created from this query.
    :ivar assistant_sid: The unique ID of the parent Assistant.
    :ivar sid: A 34 character string that uniquely identifies this resource.
    :ivar status: A string that described the query status. The values can be: pending_review, reviewed, discarded
    :ivar url:
    :ivar source_channel: The communication channel where this end-user input came from
    versionpayloadassistant_sidsidc                    t         |   |       |j                  d      | _        t	        j
                  |j                  d            | _        t	        j
                  |j                  d            | _        |j                  d      | _        |j                  d      | _	        |j                  d      | _
        |j                  d      | _        |j                  d      | _        |j                  d	      | _        |j                  d
      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        ||xs | j                  d| _        d | _        y )Naccount_siddate_createddate_updatedresultslanguagemodel_build_sidquery
sample_sidr   r   statusurlsource_channelr   r   )super__init__getr   r   iso8601_datetimer   r   r   r   r   r   r    r   r   r!   r"   r#   	_solution_context)selfr   r   r   r   	__class__s        x/home/www/therecruiter.miabetepe.com/venv/lib/python3.12/site-packages/twilio/rest/preview/understand/assistant/query.pyr&   zQueryInstance.__init__,   s,    	!*1++m*D0;0L0LKK'1
 1<0L0LKK'1
 5<KK	4J'.{{:'>.5kk:K.L$+KK$8
)0\)B,3KK,H")++e"4%,[[%:")++e"4-4[[9I-J +?$((
 15    returnc                     | j                   7t        | j                  | j                  d   | 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: QueryContext for this QueryInstance
        r   r   r$   )r*   QueryContext_versionr)   r+   s    r-   _proxyzQueryInstance._proxyM   sE     == ("nn_=NN5)DM
 }}r.   c                 6    | j                   j                         S )h
        Deletes the QueryInstance


        :returns: True if delete succeeds, False otherwise
        )r4   deleter3   s    r-   r7   zQueryInstance.delete]   s     {{!!##r.   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the QueryInstance


        :returns: True if delete succeeds, False otherwise
        N)r4   delete_asyncr3   s    r-   r:   zQueryInstance.delete_asyncf   s!      [[--////   '%'c                 6    | j                   j                         S )W
        Fetch the QueryInstance


        :returns: The fetched QueryInstance
        )r4   fetchr3   s    r-   r>   zQueryInstance.fetcho   s     {{  ""r.   c                 R   K   | j                   j                          d{   S 7 w)q
        Asynchronous coroutine to fetch the QueryInstance


        :returns: The fetched QueryInstance
        N)r4   fetch_asyncr3   s    r-   rA   zQueryInstance.fetch_asyncx   s!      [[,,....r;   r    r!   c                 <    | j                   j                  ||      S )(  
        Update the QueryInstance

        :param sample_sid: An optional reference to the Sample created from this query.
        :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded

        :returns: The updated QueryInstance
        r    r!   )r4   updater+   r    r!   s      r-   rE   zQueryInstance.update   s&     {{!!! " 
 	
r.   c                 X   K   | j                   j                  ||       d{   S 7 w)B  
        Asynchronous coroutine to update the QueryInstance

        :param sample_sid: An optional reference to the Sample created from this query.
        :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded

        :returns: The updated QueryInstance
        rD   N)r4   update_asyncrF   s      r-   rI   zQueryInstance.update_async   s4      [[--! . 
 
 	
 
s   !*(*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)QueryInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z,<Twilio.Preview.Understand.QueryInstance {}>joinr)   itemsrP   r+   contexts     r-   __repr__zQueryInstance.__repr__   s6     ((SDNN<P<P<RSS=DDWMMr.   )N)r/   r1   )r/   r   )__name__
__module____qualname____doc__r   r   strr   r   r&   propertyr4   boolr7   r:   r>   rA   r   unsetr   objectrE   rI   r]   __classcell__r,   s   @r-   r   r      s   * "55 c3h5 	5
 c]5B  $ $0D 0#/ *0%+\\
#v+&
 c6k"
 
	
( *0%+\\
#v+&
 c6k"
 
	
$N# Nr.   r   c                       e Zd Zde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ej                  ej                  fd
eeef   deeef   de	fdZej                  ej                  fd
eeef   deeef   de	fdZdefdZ xZS )r1   r   r   r   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)a   
        Initialize the QueryContext

        :param version: Version that contains the resource
        :param assistant_sid: The unique ID of the parent Assistant.
        :param sid: A 34 character string that uniquely identifies this resource.
        r$   z)/Assistants/{assistant_sid}/Queries/{sid}N r%   r&   r)   rP   _uri)r+   r   r   r   r,   s       r-   r&   zQueryContext.__init__   sB     	! +
 G?FFXX	r.   r/   c                 P    | j                   j                  d| j                        S )r6   DELETEmethoduri)r2   r7   rm   r3   s    r-   r7   zQueryContext.delete   s*     }}##		 $ 
 	
r.   c                 l   K   | j                   j                  d| j                         d{   S 7 w)r9   ro   rp   N)r2   r:   rm   r3   s    r-   r:   zQueryContext.delete_async   s8      ]]//		 0 
 
 	
 
s   +424c                     | j                   j                  d| j                        }t        | j                   || j                  d   | j                  d         S )r=   GETrp   r   r   r$   )r2   r>   rm   r   r)   r+   r   s     r-   r>   zQueryContext.fetch   sX     --%%		 & 

 MM..9u%	
 	
r.   c                    K   | j                   j                  d| j                         d{   }t        | j                   || j                  d   | j                  d         S 7 7w)r@   ru   rp   Nr   r   r$   )r2   rA   rm   r   r)   rv   s     r-   rA   zQueryContext.fetch_async   sf      11		 2 
 

 MM..9u%	
 	

s   +A'A%8A'r    r!   c                     t        j                  ||d      }| j                  j                  d| j                  |      }t        | j                  || j                  d   | j                  d         S )rC   	SampleSidStatusPOSTrq   rr   datar   r   r$   )r   ofr2   rE   rm   r   r)   r+   r    r!   r~   r   s        r-   rE   zQueryContext.update  sv     yy' 
 --&&		 ' 
 MM..9u%	
 	
r.   c                   K   t        j                  ||d      }| j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)rH   ry   r|   r}   Nr   r   r$   )r   r   r2   rI   rm   r   r)   r   s        r-   rI   zQueryContext.update_async"  s      yy' 
 22		 3 
 
 MM..9u%	
 	

s   AB A>8B c                     dj                  d | j                  j                         D              }dj                  |      S )rK   rL   c              3   F   K   | ]  \  }}d j                  ||        ywrN   rO   rQ   s      r-   rU   z(QueryContext.__repr__.<locals>.<genexpr>I  rV   rW   z+<Twilio.Preview.Understand.QueryContext {}>rX   r[   s     r-   r]   zQueryContext.__repr__C  s6     ((SDNN<P<P<RSS<CCGLLr.   )r^   r_   r`   r   rb   r&   rd   r7   r:   r   r>   rA   r   re   r   rf   rE   rI   r]   rg   rh   s   @r-   r1   r1      s    Y Y Y# Y"

 



D 


} 
(
= 
, *0%+\\
#v+&
 c6k"
 
	
F *0%+\\
#v+&
 c6k"
 
	
BM# Mr.   r1   c                   2    e Zd Zdeeef   defdZdefdZy)	QueryPager   r/   c                 L    t        | j                  || j                  d         S )zk
        Build an instance of QueryInstance

        :param payload: Payload response from the API
        r   r   )r   r2   r)   rv   s     r-   get_instancezQueryPage.get_instanceN  s%     MM7$..2Q
 	
r.   c                      y)rK   z%<Twilio.Preview.Understand.QueryPage>rk   r3   s    r-   r]   zQueryPage.__repr__X       7r.   N)	r^   r_   r`   r   rb   r   r   r   r]   rk   r.   r-   r   r   M  s)    
DcN 
} 
7# 7r.   r   c                       e Zd Zdedef fdZej                  ej                  ej                  fdede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de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                  ddfdeee	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                  ddfdeee	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                  ddfdeee	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                  ddfdeee	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                  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ee	f   d	efdZej                  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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 )	QueryListr   r   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the QueryList

        :param version: Version that contains the resource
        :param assistant_sid: The unique ID of the parent Assistant.

        r   z#/Assistants/{assistant_sid}/QueriesNrk   rl   )r+   r   r   r,   s      r-   r&   zQueryList.__init__b  sA     	! ]
 A9@@R4>>R	r.   r   r   tasksmodel_buildfieldr/   c                     t        j                  |||||d      }| j                  j                  d| j                  |      }t        | j                  || j                  d         S )a*  
        Create the QueryInstance

        :param language: An ISO language-country string of the sample.
        :param query: A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long.
        :param tasks: Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2*
        :param model_build: The Model Build Sid or unique name of the Model Build to be queried.
        :param field: Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name*

        :returns: The created QueryInstance
        LanguageQueryTasks
ModelBuildFieldr|   r}   r   r   )r   r   r2   createrm   r   r)   r+   r   r   r   r   r   r~   r   s           r-   r   zQueryList.creater  sq    & yy$)
 --&&		 ' 
 MM7$..2Q
 	
r.   c                    K   t        j                  |||||d      }| j                  j                  d| j                  |       d{   }t        | j                  || j                  d         S 7 )w)a9  
        Asynchronously create the QueryInstance

        :param language: An ISO language-country string of the sample.
        :param query: A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long.
        :param tasks: Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2*
        :param model_build: The Model Build Sid or unique name of the Model Build to be queried.
        :param field: Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name*

        :returns: The created QueryInstance
        r   r|   r}   Nr   r   )r   r   r2   create_asyncrm   r   r)   r   s           r-   r   zQueryList.create_async  s     & yy$)
 22		 3 
 
 MM7$..2Q
 	

s   AA5	A3
*A5Nr!   limit	page_sizec                     | j                   j                  ||      }| j                  ||||d         }| j                   j                  ||d         S )a  
        Streams QueryInstance 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 language: An ISO language-country string of the sample.
        :param str model_build: The Model Build Sid or unique name of the Model Build to be queried.
        :param str status: A string that described the query status. The values can be: pending_review, reviewed, discarded
        :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!   r   r   )r2   read_limitspagestreamr+   r   r   r!   r   r   limitsr   s           r-   r   zQueryList.stream  s[    4 **5)<yy#[)	  
 }}##D&/::r.   c                    K   | j                   j                  ||      }| j                  ||||d          d{   }| j                   j                  ||d         S 7 #w)a  
        Asynchronously streams QueryInstance 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 language: An ISO language-country string of the sample.
        :param str model_build: The Model Build Sid or unique name of the Model Build to be queried.
        :param str status: A string that described the query status. The values can be: pending_review, reviewed, discarded
        :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   )r2   r   
page_asyncstream_asyncr   s           r-   r   zQueryList.stream_async  si     4 **5)<__#[)	 % 
 
 }}))$w@@
s   8A A$A c           	      @    t        | j                  |||||            S )a$  
        Lists QueryInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str language: An ISO language-country string of the sample.
        :param str model_build: The Model Build Sid or unique name of the Model Build to be queried.
        :param str status: A string that described the query status. The values can be: pending_review, reviewed, discarded
        :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   r!   r   r   )listr   )r+   r   r   r!   r   r   s         r-   r   zQueryList.list  s1    2 KK!'#  
 	
r.   c                    K   | j                  |||||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a3  
        Asynchronously lists QueryInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str language: An ISO language-country string of the sample.
        :param str model_build: The Model Build Sid or unique name of the Model Build to be queried.
        :param str status: A string that described the query status. The values can be: pending_review, reviewed, discarded
        :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   r!   r   r   records          r-   
list_asynczQueryList.list_async+  s]     6 '+&7&7!'# '8 ' !	
 	
 !	
 	
 		
 	
s0   >1>953
59>59>
page_tokenpage_numberc           	          t        j                  ||||||d      }| j                  j                  d| j                  |      }t        | j                  || j                        S )a  
        Retrieve a single page of QueryInstance records from the API.
        Request is executed immediately

        :param language: An ISO language-country string of the sample.
        :param model_build: The Model Build Sid or unique name of the Model Build to be queried.
        :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded
        :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 QueryInstance
        r   r   r{   	PageTokenr   PageSizeru   rq   rr   params)r   r   r2   r   rm   r   r)   	r+   r   r   r!   r   r   r   r~   responses	            r-   r   zQueryList.pageO  sa    , yy$) '#%	
 ==%%U		$%O$..AAr.   c           	         K   t        j                  ||||||d      }| j                  j                  d| j                  |       d{   }t        | j                  || j                        S 7 %w)a  
        Asynchronously retrieve a single page of QueryInstance records from the API.
        Request is executed immediately

        :param language: An ISO language-country string of the sample.
        :param model_build: The Model Build Sid or unique name of the Model Build to be queried.
        :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded
        :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 QueryInstance
        r   ru   r   N)r   r   r2   r   rm   r   r)   r   s	            r-   r   zQueryList.page_asyncs  sv     , yy$) '#%	
 11dii 2 
 
 $..AA
s   AA2
A0&A2
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )z
        Retrieve a specific page of QueryInstance records from the API.
        Request is executed immediately

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

        :returns: Page of QueryInstance
        ru   )r2   domaintwiliorequestr   r)   r+   r   r   s      r-   get_pagezQueryList.get_page  s=     ==''..66ujI$..AAr.   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)z
        Asynchronously retrieve a specific page of QueryInstance records from the API.
        Request is executed immediately

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

        :returns: Page of QueryInstance
        ru   N)r2   r   r   request_asyncr   r)   r   s      r-   get_page_asynczQueryList.get_page_async  sJ      --44BB5*UU$..AA Vs   4AA&Ar   c                 L    t        | j                  | j                  d   |      S z~
        Constructs a QueryContext

        :param sid: A 34 character string that uniquely identifies this resource.
        r   r$   r1   r2   r)   r+   r   s     r-   r'   zQueryList.get  %     MM)Hc
 	
r.   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r-   __call__zQueryList.__call__  r   r.   c                      y)rK   z%<Twilio.Preview.Understand.QueryList>rk   r3   s    r-   r]   zQueryList.__repr__  r   r.   ) r^   r_   r`   r   rb   r&   r   re   r   rf   r   r   r   r   intr	   r   r
   r   r   r   r   r   r   r   r   r   r1   r'   r   r]   rg   rh   s   @r-   r   r   a  s   S S S( %+LL*0,,$*LL%
%
 %
 S&[!	%

 3;'%
 S&[!%
 
%
V %+LL*0,,$*LL%
%
 %
 S&[!	%

 3;'%
 S&[!%
 
%
R (.||*0,,%+\\##'";V$"; 3;'"; c6k"	";
 }"; C="; 
-	 ";L (.||*0,,%+\\##'"AV$"A 3;'"A c6k"	"A
 }"A C="A 
}	%"AL (.||*0,,%+\\##'!
V$!
 3;'!
 c6k"	!

 }!
 C=!
 
m	!
J (.||*0,,%+\\##'"
V$"
 3;'"
 c6k"	"

 }"
 C="
 
m	"
L (.||*0,,%+\\)/*0,,(."BV$"B 3;'"B c6k"	"B
 #v+&"B 3;'"B f%"B 
"BL (.||*0,,%+\\)/*0,,(.$BV$$B 3;'$B c6k"	$B
 #v+&$B 3;'$B f%$B 
$BL
B3 
B9 
B
Bs 
By 
B
s 
| 

C 
L 
7# 7r.   r   N)ra   r   typingr   r   r   r   r   r	   r
   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r1   r   r   rk   r.   r-   <module>r      sg     L L L + 8 : 2 ' !RN$ RNj[M? [M|7 7(j7 j7r.   