
    pig                         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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 - Verify
    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	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                   ^    e Zd Z G d de      Z G d de      Z G d de      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(                  ej(                  ej(                  ej(                  fdeeef   deee   ef   deeef   dedef   dedef   dd fdZej(                  ej(                  ej(                  ej(                  ej(                  fdeeef   deee   ef   deeef   dedef   dedef   dd fdZdefdZ xZS )WebhookInstancec                       e Zd ZdZdZy)WebhookInstance.MethodsGETPOSTN)__name__
__module____qualname__r   r        g/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/verify/v2/service/webhook.pyMethodsr      s    r   r   c                       e Zd ZdZdZy)WebhookInstance.StatusenableddisabledN)r   r   r   ENABLEDDISABLEDr   r   r   Statusr!      s    r   r&   c                       e Zd ZdZdZy)WebhookInstance.Versionv1v2N)r   r   r   V1V2r   r   r   r   r(   #   s    r   r   versionpayloadservice_sidsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _	        |j                  d      | _
        |j                  d	      | _        t        j                  |j                  d
            | _        t        j                  |j                  d            | _        |j                  d      | _        ||xs | j                  d| _        d | _        y )Nr0   r/   account_sidfriendly_nameevent_typesstatusr-   webhook_urlwebhook_methoddate_createddate_updatedurlr/   r0   )super__init__getr0   r/   r2   r3   r4   r5   r-   r6   r7   r   iso8601_datetimer8   r9   r:   	_solution_context)selfr-   r.   r/   r0   	__class__s        r   r=   zWebhookInstance.__init__6   s"    	!")++e"4*1++m*D*1++m*D,3KK,H07M0J:A++h:O<CKK	<R*1++m*DCJ;;D
 1<0L0LKK'1
 1<0L0LKK'1
 #*++e"4 '?$((
 37r   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: WebhookContext for this WebhookInstance
        r/   r0   r;   )rA   WebhookContext_versionr@   rB   s    r   _proxyzWebhookInstance._proxyX   sE     == * NN=9NN5)DM
 }}r   c                 6    | j                   j                         S )j
        Deletes the WebhookInstance


        :returns: True if delete succeeds, False otherwise
        )rI   deleterH   s    r   rL   zWebhookInstance.deleteh   s     {{!!##r   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the WebhookInstance


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


        :returns: The fetched WebhookInstance
        )rI   fetchrH   s    r   rS   zWebhookInstance.fetchz   s     {{  ""r   c                 R   K   | j                   j                          d{   S 7 w)u
        Asynchronous coroutine to fetch the WebhookInstance


        :returns: The fetched WebhookInstance
        N)rI   fetch_asyncrH   s    r   rV   zWebhookInstance.fetch_async   s!      [[,,....rP   r3   r4   r6   r5   r!   r(   c                 B    | j                   j                  |||||      S )  
        Update the WebhookInstance

        :param friendly_name: The string that you assigned to describe the webhook. **This value should not contain PII.**
        :param event_types: The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied`
        :param webhook_url: The URL associated with this Webhook.
        :param status:
        :param version:

        :returns: The updated WebhookInstance
        r3   r4   r6   r5   r-   )rI   updaterB   r3   r4   r6   r5   r-   s         r   rZ   zWebhookInstance.update   s/    & {{!!'## " 
 	
r   c                 ^   K   | j                   j                  |||||       d{   S 7 w)'  
        Asynchronous coroutine to update the WebhookInstance

        :param friendly_name: The string that you assigned to describe the webhook. **This value should not contain PII.**
        :param event_types: The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied`
        :param webhook_url: The URL associated with this Webhook.
        :param status:
        :param version:

        :returns: The updated WebhookInstance
        rY   N)rI   update_asyncr[   s         r   r^   zWebhookInstance.update_async   s=     & [[--'## . 
 
 	
 
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+WebhookInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z%<Twilio.Verify.V2.WebhookInstance {}>joinr@   itemsre   rB   contexts     r   __repr__zWebhookInstance.__repr__   s6     ((SDNN<P<P<RSS6==gFFr   N)rD   rF   )rD   r   )r   r   r   objectr   r&   r   r   strr   r   r=   propertyrI   boolrL   rO   rS   rV   r   unsetr   r   rZ   r^   rr   __classcell__rC   s   @r   r   r      s   &  & ( " 7 7 c3h 7 	 7
 c] 7D  $ $0D 0#/ -3LL06*0,,:@,,<BLL
S&[)
 49f,-
 3;'	

 .67
 0&89
 

: -3LL06*0,,:@,,<BLL
S&[)
 49f,-
 3;'	

 .67
 0&89
 

6G# G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                  ej                  ej                  ej                  fd
eeef   deee   ef   deeef   dedef   ded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   ef   deeef   dedef   dedef   de	fdZdefdZ xZS )rF   r-   r/   r0   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)a  
        Initialize the WebhookContext

        :param version: Version that contains the resource
        :param service_sid: The unique SID identifier of the Service.
        :param sid: The Twilio-provided string that uniquely identifies the Webhook resource to update.
        r;   z&/Services/{service_sid}/Webhooks/{sid}Nr   r<   r=   r@   re   _uri)rB   r-   r/   r0   rC   s       r   r=   zWebhookContext.__init__   sB     	! '
 D<CCUdnnU	r   rD   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )rK   DELETEmethoduriheaders)r   ofrG   rL   r~   rB   r   s     r   rL   zWebhookContext.delete   s1     ))B-}}##8G#TTr   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)rN   r   r   N)r   r   rG   rO   r~   r   s     r   rO   zWebhookContext.delete_async   sF      ))B-]]//G 0 
 
 	
 
s   AA
AA
c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d   | j                  d         S )rR   application/jsonAcceptr   r   r/   r0   r;   )r   r   rG   rS   r~   r   r@   rB   r   r.   s      r   rS   zWebhookContext.fetch   si     ))B-.--%%U		7%SMM}5u%	
 	
r   c                   K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)	rU   r   r   r   r   Nr/   r0   r;   )r   r   rG   rV   r~   r   r@   r   s      r   rV   zWebhookContext.fetch_async  s~      ))B-.11dii 2 
 
 MM}5u%	
 	
	
s   ABB 	8Br3   r4   r6   r5   r!   r(   c                 X   t        j                  |t        j                  |d       |||d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d	   | j                  d
         S )rX   c                     | S rs   r   es    r   <lambda>z'WebhookContext.update.<locals>.<lambda><      1 r   FriendlyName
EventTypes
WebhookUrlr&   r   !application/x-www-form-urlencodedContent-Typer   r   r   r   r   datar   r/   r0   r;   )	r   r   r   maprG   rZ   r~   r   r@   	rB   r3   r4   r6   r5   r-   r   r   r.   s	            r   rZ   zWebhookContext.update%  s    ( yy -'mmKE) "
 ))B-"E.--&&tyytW ' 
 MM}5u%	
 	
r   c                 t  K   t        j                  |t        j                  |d       |||d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||       d	{   }t        | j                  || j                  d
   | j                  d         S 7 7w)r]   c                     | S rs   r   r   s    r   r   z-WebhookContext.update_async.<locals>.<lambda>j  r   r   r   r   r   r   r   r   r   Nr/   r0   r;   )	r   r   r   r   rG   r^   r~   r   r@   r   s	            r   r^   zWebhookContext.update_asyncS  s     ( yy -'mmKE) "
 ))B-"E.22tyytW 3 
 
 MM}5u%	
 	
	
s   A<B8>B6?8B8c                     dj                  d | j                  j                         D              }dj                  |      S )r`   ra   c              3   F   K   | ]  \  }}d j                  ||        ywrc   rd   rf   s      r   rj   z*WebhookContext.__repr__.<locals>.<genexpr>  rk   rl   z$<Twilio.Verify.V2.WebhookContext {}>rm   rp   s     r   rr   zWebhookContext.__repr__  s6     ((SDNN<P<P<RSS5<<WEEr   )r   r   r   r   ru   r=   rw   rL   rO   r   rS   rV   r   rx   r   rt   r   rZ   r^   rr   ry   rz   s   @r   rF   rF      s   V Vc V V"
U 
U
D 

 
*
? 
2 -3LL06*0,,:@,,<BLL,
S&[),
 49f,-,
 3;'	,

 .67,
 0&89,
 
,
` -3LL06*0,,:@,,<BLL,
S&[),
 49f,-,
 3;'	,

 .67,
 0&89,
 
,
\F# Fr   rF   c                   2    e Zd Zdeeef   defdZdefdZy)WebhookPager.   rD   c                 L    t        | j                  || j                  d         S )zm
        Build an instance of WebhookInstance

        :param payload: Payload response from the API
        r/   r/   )r   rG   r@   )rB   r.   s     r   get_instancezWebhookPage.get_instance  s%     MM7}0M
 	
r   c                      y)r`   z<Twilio.Verify.V2.WebhookPage>r   rH   s    r   rr   zWebhookPage.__repr__       0r   N)	r   r   r   r   ru   r   r   r   rr   r   r   r   r   r     s)    
DcN 
 
0# 0r   r   c                       e Zd Zdedef fdZej                  ej                  fdedee   dede	de
f   de	d	e
f   d
efdZej                  ej                  fdedee   dede	de
f   de	d	e
f   d
efdZ	 	 ddee   dee   d
ee   fdZ	 	 ddee   dee   d
ee   fdZ	 	 ddee   dee   d
ee   fdZ	 	 ddee   dee   d
ee   fdZej                  ej                  ej                  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                  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 )WebhookListr-   r/   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the WebhookList

        :param version: Version that contains the resource
        :param service_sid: The unique SID identifier of the Service.

        r/   z /Services/{service_sid}/WebhooksNr   r}   )rB   r-   r/   rC   s      r   r=   zWebhookList.__init__  s@     	! ;
 >6==OO	r   r3   r4   r6   r5   r!   r(   rD   c                 @   t        j                  |t        j                  |d       |||d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d	   
      S )a  
        Create the WebhookInstance

        :param friendly_name: The string that you assigned to describe the webhook. **This value should not contain PII.**
        :param event_types: The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied`
        :param webhook_url: The URL associated with this Webhook.
        :param status:
        :param version:

        :returns: The created WebhookInstance
        c                     | S rs   r   r   s    r   r   z$WebhookList.create.<locals>.<lambda>  r   r   r   r   r   r   r   r   r   r/   r   )	r   r   r   r   rG   creater~   r   r@   r   s	            r   r   zWebhookList.create  s    ( yy -'mmKE) "
 ))^-PQR"E.--&&tyytW ' 
 MM7}0M
 	
r   c                 \  K   t        j                  |t        j                  |d       |||d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||       d	{   }t        | j                  || j                  d
         S 7 )w)a  
        Asynchronously create the WebhookInstance

        :param friendly_name: The string that you assigned to describe the webhook. **This value should not contain PII.**
        :param event_types: The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied`
        :param webhook_url: The URL associated with this Webhook.
        :param status:
        :param version:

        :returns: The created WebhookInstance
        c                     | S rs   r   r   s    r   r   z*WebhookList.create_async.<locals>.<lambda>  r   r   r   r   r   r   r   r   r   Nr/   r   )	r   r   r   r   rG   create_asyncr~   r   r@   r   s	            r   r   zWebhookList.create_async  s     ( yy -'mmKE) "
 ))^-PQR"E.22tyytW 3 
 
 MM7}0M
 	
	
s   A>B, B**B,limit	page_sizec                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )a]  
        Streams WebhookInstance 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
        r   r   r   )rG   read_limitspagestreamrB   r   r   limitsr   s        r   r   zWebhookList.stream  sJ    ( **5)<yy6+#6y7}}##D&/::r   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)al  
        Asynchronously streams WebhookInstance 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
        r   r   Nr   )rG   r   
page_asyncstream_asyncr   s        r   r   zWebhookList.stream_async!  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        Lists WebhookInstance 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
        r   r   )listr   )rB   r   r   s      r   r   zWebhookList.list:  s(    & KK#  
 	
r   c                 z   K   | j                  ||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a	  
        Asynchronously lists WebhookInstance 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
        r   N)r   )rB   r   r   records       r   
list_asynczWebhookList.list_asyncT  sT     * '+&7&7# '8 ' !
 
 !
 
 	
 
s0   ;.;620
26;26;
page_tokenpage_numberc                     t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                        S )as  
        Retrieve a single page of WebhookInstance 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 WebhookInstance
        	PageTokenr   PageSizer   r   r   r   r   r   r   paramsr   )r   r   rG   r   r~   r   r@   rB   r   r   r   r   r   responses          r   r   zWebhookList.pageo  s      yy'#%
 ))^-PQR.==%%diig & 
 4==(DNNCCr   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                        S 7 %w)	a  
        Asynchronously retrieve a single page of WebhookInstance 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 WebhookInstance
        r   r   r   r   r   r   r   N)r   r   rG   r   r~   r   r@   r   s          r   r   zWebhookList.page_async  s       yy'#%
 ))^-PQR.11diig 2 
 
 4==(DNNCC
s   A"B$B
%&B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )z
        Retrieve a specific page of WebhookInstance records from the API.
        Request is executed immediately

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

        :returns: Page of WebhookInstance
        r   )rG   domaintwiliorequestr   r@   rB   r   r   s      r   get_pagezWebhookList.get_page  s=     ==''..66ujI4==(DNNCCr   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)a  
        Asynchronously retrieve a specific page of WebhookInstance records from the API.
        Request is executed immediately

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

        :returns: Page of WebhookInstance
        r   N)rG   r   r   request_asyncr   r@   r   s      r   get_page_asynczWebhookList.get_page_async  sJ      --44BB5*UU4==(DNNCC Vs   4AA&Ar0   c                 L    t        | j                  | j                  d   |      S z
        Constructs a WebhookContext

        :param sid: The Twilio-provided string that uniquely identifies the Webhook resource to update.
        r/   r;   rF   rG   r@   rB   r0   s     r   r>   zWebhookList.get  %     MMt~~m'D#
 	
r   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r   __call__zWebhookList.__call__  r   r   c                      y)r`   z<Twilio.Verify.V2.WebhookList>r   rH   s    r   rr   zWebhookList.__repr__  r   r   )NN) r   r   r   r   ru   r=   r   rx   r   r   rt   r   r   r   r   intr	   r   r
   r   r   r   r   r   r   r   r   rF   r>   r   rr   ry   rz   s   @r   r   r     s   P Pc P* ;A,,<BLL)
)
 #Y)
 	)

 .67)
 0&89)
 
)
` ;A,,<BLL)
)
 #Y)
 	)

 .67)
 0&89)
 
)
Z  $#';}; C=; 
/	"	;6  $#'A}A C=A 
	'	A6  $#'
}
 C=
 
o		
8  $#'
}
 C=
 
o		
: *0*0,,(.	D#v+&D 3;'D f%	D
 
DF *0*0,,(.	D#v+&D 3;'D f%	D
 
DB
D3 
D; 
D
Ds 
D{ 
D
s 
~ 

C 
N 
0# 0r   r   N)__doc__r   typingr   r   r   r   r   r	   r
   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   rF   r   r   r   r   r   <module>r      sj     L L L 6 6 8 : 2 ' !pG& pGf|F_ |F~0$ 0*C0, C0r   