
    R-j                       d dl mZ d dlmZmZ d dlmZ d dlZddlm	Z	m
Z
mZmZ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mZ ddl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. ddgZ/ G d de      Z0 G d de      Z1 G d d      Z2 G d d      Z3 G d d      Z4 G d d      Z5y)    )annotations)ListUnion)LiteralN   )webhook_list_paramswebhook_ping_paramswebhook_create_paramswebhook_update_params$webhook_rotate_signing_secret_params)BodyOmitQueryHeadersNotGivenomit	not_given)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_raw_response_wrapperto_streamed_response_wrapperasync_to_raw_response_wrapper"async_to_streamed_response_wrapper)make_request_options)Webhook)WebhookListResponse)WebhookPingResponse)WebhookDeleteResponse)"WebhookRotateSigningSecretResponseWebhooksResourceAsyncWebhooksResourcec                     e Zd Zedd       Zedd       Zdeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdeeeeeddded
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	deeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Z
dddded
	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdddded
	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r#   c                    t        |       S a$  
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/stainless-sdks/gemini-next-gen-api-python#accessing-raw-response-data-eg-headers
        )WebhooksResourceWithRawResponseselfs    {/Users/jameslopez/projects/TradingBot25/.venv/lib/python3.12/site-packages/google/genai/_interactions/resources/webhooks.pywith_raw_responsez"WebhooksResource.with_raw_response5   s     /t44    c                    t        |       S z
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/stainless-sdks/gemini-next-gen-api-python#with_streaming_response
        )%WebhooksResourceWithStreamingResponser)   s    r+   with_streaming_responsez(WebhooksResource.with_streaming_response?   s     5T::r-   Napi_versionnameextra_headersextra_query
extra_bodytimeoutc          
        || j                   j                         }|st        d|      | j                  | j                   j	                  |d      t        |||dt        j                        t        ||||      t              S );  Creates a new Webhook.

        Args:
          subscribed_events:
              Required.

        The events that the webhook is subscribed to. Available events:

              - batch.succeeded
              - batch.expired
              - batch.failed
              - interaction.requires_action
              - interaction.completed
              - interaction.failed
              - video.generated

          uri: Required. The URI to which webhook events will be sent.

          name: Optional. The user-provided name of the webhook.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        :Expected a non-empty value for `api_version` but received webhooksr3   pathsubscribed_eventsurir4   r5   r6   r7   r8   bodyoptionscast_to)
_client_get_api_version_path_param
ValueError_post_build_maybe_vertex_pathr   r
   WebhookCreateParamsr   r   	r*   r3   r@   rA   r4   r5   r6   r7   r8   s	            r+   createzWebhooksResource.createH   s    n ,,BBDKYZeYhijjzzLL11kPZ1[ ): 
 &99 )+Q[el   
 	
r-   
r3   update_maskr4   stater@   rA   r5   r6   r7   r8   c       
        r   || j                   j                         }|st        d|      |st        d|      | j                  | j                   j	                  |d|       t        ||||dt        j                        t        ||	|
|t        d|it        j                              t              S )	  Updates an existing Webhook.

        Args:
          update_mask: Optional.

        The list of fields to update.

          name: Optional. The user-provided name of the webhook.

          state: Optional. The state of the webhook.

          subscribed_events:
              Optional. The events that the webhook is subscribed to. Available events:

              - batch.succeeded
              - batch.expired
              - batch.failed
              - interaction.requires_action
              - interaction.completed
              - interaction.failed
              - video.generated

          uri: Optional. The URI to which webhook events will be sent.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        r;   1Expected a non-empty value for `id` but received 	webhooks/r=   r4   rQ   r@   rA   rP   r5   r6   r7   r8   queryrC   )
rG   rH   rI   _patchrK   r   r   WebhookUpdateParamsr   r   r*   idr3   rP   r4   rQ   r@   rA   r5   r6   r7   r8   s               r+   updatezWebhooksResource.update   s    ~ ,,BBDKYZeYhijjPQSPVWXX{{LL11kR[\^[_P`1a  "):	 &99 )+'%%}k&BDYDmDmn %  
 	
r-   r3   	page_size
page_tokenr5   r6   r7   r8   c                  || j                   j                         }|st        d|      | j                  | j                   j	                  |d      t        ||||t        ||dt        j                              t              S )  Lists all Webhooks.

        Args:
          page_size: Optional.

        The maximum number of webhooks to return. The service may return fewer
              than this value. If unspecified, at most 50 webhooks will be returned. The
              maximum value is 1000.

          page_token: Optional. A page token, received from a previous `ListWebhooks` call. Provide
              this to retrieve the subsequent page.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        r;   r<   r=   r_   r`   rW   rE   rF   )
rG   rH   rI   _getrK   r   r   r   WebhookListParamsr   r*   r3   r_   r`   r5   r6   r7   r8   s           r+   listzWebhooksResource.list   s    B ,,BBDKYZeYhijjyyLL11kPZ1[(+'%%%.&0 (99 (  
 	
r-   r3   r5   r6   r7   r8   c          	         || j                   j                         }|st        d|      |st        d|      | j                  | j                   j	                  |d|       t        ||||      t              S )F  
        Deletes a Webhook.

        Args:
          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        r;   rT   rU   r=   rB   rd   rG   rH   rI   _deleterK   r   r!   r*   r\   r3   r5   r6   r7   r8   s          r+   deletezWebhooksResource.delete$  s    0 ,,BBDKYZeYhijjPQSPVWXX||LL11kR[\^[_P`1a(+Q[el *  
 	
r-   c          	         || j                   j                         }|st        d|      |st        d|      | j                  | j                   j	                  |d|       t        ||||      t              S )L  
        Gets a specific Webhook.

        Args:
          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        r;   rT   rU   r=   rB   rd   rG   rH   rI   re   rK   r   r   rn   s          r+   getzWebhooksResource.getJ  s    0 ,,BBDKYZeYhijjPQSPVWXXyyLL11kR[\^[_P`1a(+Q[el   
 	
r-   r3   rD   r5   r6   r7   r8   c          
     4   || j                   j                         }|st        d|      |st        d|      | j                  | j                   j	                  |d| d      t        |t        j                        t        ||||      t              S )  
        Sends a ping event to a Webhook.

        Args:
          body: Request message for WebhookService.PingWebhook.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        r;   rT   rU   :pingr=   rB   rC   )
rG   rH   rI   rJ   rK   r   r	   WebhookPingParamsr   r    r*   r\   r3   rD   r5   r6   r7   r8   s           r+   pingzWebhooksResource.pingp  s    6 ,,BBDKYZeYhijjPQSPVWXXzzLL11kR[\^[__dPe1f ':'L'LM(+Q[el (  
 	
r-   r3   revocation_behaviorr5   r6   r7   r8   c          
     8   || j                   j                         }|st        d|      |st        d|      | j                  | j                   j	                  |d| d      t        d|it        j                        t        ||||      t              S )	  
        Generates a new signing secret for a Webhook.

        Args:
          revocation_behavior: Optional. The revocation behavior for previous signing secrets.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        r;   rT   rU   :rotateSigningSecretr=   r|   rB   rC   )
rG   rH   rI   rJ   rK   r   r    WebhookRotateSigningSecretParamsr   r"   r*   r\   r3   r|   r5   r6   r7   r8   s           r+   rotate_signing_secretz&WebhooksResource.rotate_signing_secret  s    8 ,,BBDKYZeYhijjPQSPVWXXzzLL11kR[\^[__sPt1u &(;<4UU )+Q[el 7  

 
	
r-   )returnr(   )r   r0   r3   
str | Noner@   zList[Union[Literal['batch.succeeded', 'batch.expired', 'batch.failed', 'interaction.requires_action', 'interaction.completed', 'interaction.failed', 'video.generated'], str]]rA   strr4   
str | Omitr5   Headers | Noner6   Query | Noner7   Body | Noner8   'float | httpx.Timeout | None | NotGivenr   r   r\   r   r3   r   rP   r   r4   r   rQ   zJLiteral['enabled', 'disabled', 'disabled_due_to_failed_deliveries'] | Omitr@   zList[Union[Literal['batch.succeeded', 'batch.expired', 'batch.failed', 'interaction.requires_action', 'interaction.completed', 'interaction.failed', 'video.generated'], str]] | OmitrA   r   r5   r   r6   r   r7   r   r8   r   r   r   r3   r   r_   z
int | Omitr`   r   r5   r   r6   r   r7   r   r8   r   r   r   r\   r   r3   r   r5   r   r6   r   r7   r   r8   r   r   r!   r\   r   r3   r   r5   r   r6   r   r7   r   r8   r   r   r   r\   r   r3   r   rD   zwebhook_ping_params.Body | Omitr5   r   r6   r   r7   r   r8   r   r   r    r\   r   r3   r   r|   zZLiteral['revoke_previous_secrets_after_h24', 'revoke_previous_secrets_immediately'] | Omitr5   r   r6   r   r7   r   r8   r   r   r"   __name__
__module____qualname__r   r,   r1   r   r   rN   r]   rh   ro   rs   rz   r    r-   r+   r#   r#   4   sT   5 5 ; ; #'    )-$("&;D3I
  I

	I
$ %I
& 'I
, &-I
. "/I
0  1I
2 93I
4 
5I
^ #'"&\`  )-$("&;D;X
X
  	X

  X
 X
 ZX
X
. /X
4 &5X
6 "7X
8  9X
: 9;X
< 
=X
z #' $!% )-$("&;D5
  5
 	5

 5
 &5
 "5
  5
 95
 
5
v #' )-$("&;D$
$
  	$
 &$
 "$
  $
 9$
 
$
T #' )-$("&;D$
$
  	$
 &$
 "$
  $
 9$
 
$
T #'04 )-$("&;D(
(
  	(

 .(
 &(
 "(
  (
 9(
 
(
\ #' )-$("&;D,
,
  	,

,
 &,
 ",
  ,
 9,
 
,,
r-   c                     e Zd Zedd       Zedd       Zdeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdeeeeeddded
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	deeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Z
dddded
	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdddded
	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r$   c                    t        |       S r'   )$AsyncWebhooksResourceWithRawResponser)   s    r+   r,   z'AsyncWebhooksResource.with_raw_response  s     4D99r-   c                    t        |       S r/   )*AsyncWebhooksResourceWithStreamingResponser)   s    r+   r1   z-AsyncWebhooksResource.with_streaming_response  s     :$??r-   Nr2   c          
     D  K   || j                   j                         }|st        d|      | j                  | j                   j	                  |d      t        |||dt        j                         d{   t        ||||      t               d{   S 7 $7 w)r:   Nr;   r<   r=   r?   rB   rC   )
rG   rH   rI   rJ   rK   r   r
   rL   r   r   rM   s	            r+   rN   zAsyncWebhooksResource.create  s     n ,,BBDKYZeYhijjZZLL11kPZ1[,): 
 &99  )+Q[el    
 
 	

s$   A5B 7B
8B BB B rO   c       
          K   || j                   j                         }|st        d|      |st        d|      | j                  | j                   j	                  |d|       t        ||||dt        j                         d{   t        ||	|
|t        d|it        j                         d{         t        	       d{   S 7 G7 7 w)
rS   Nr;   rT   rU   r=   rV   rP   rW   rC   )
rG   rH   rI   rY   rK   r   r   rZ   r   r   r[   s               r+   r]   zAsyncWebhooksResource.update(  s     ~ ,,BBDKYZeYhijjPQSPVWXX[[LL11kR[\^[_P`1a, "):	 &99  )+'%1"K02G2[2[  ) ! 
 
 	
!
s6   B	CC
+C7C8CCCCCr^   c               B  K   || j                   j                         }|st        d|      | j                  | j                   j	                  |d      t        ||||t        ||dt        j                         d{         t               d{   S 7 7 w)rb   Nr;   r<   r=   rc   rW   rd   )
rG   rH   rI   re   rK   r   r   r   rf   r   rg   s           r+   rh   zAsyncWebhooksResource.list  s     B ,,BBDKYZeYhijjYYLL11kPZ1[(+'%1%.&0 (99  (  
 
 	

s$   A=B?B BBBBri   c          	       K   || j                   j                         }|st        d|      |st        d|      | j                  | j                   j	                  |d|       t        ||||      t               d{   S 7 w)rk   Nr;   rT   rU   r=   rB   rd   rl   rn   s          r+   ro   zAsyncWebhooksResource.delete  s     0 ,,BBDKYZeYhijjPQSPVWXX\\LL11kR[\^[_P`1a(+Q[el * " 
 
 	
 
   BBB
Bc          	       K   || j                   j                         }|st        d|      |st        d|      | j                  | j                   j	                  |d|       t        ||||      t               d{   S 7 w)rq   Nr;   rT   rU   r=   rB   rd   rr   rn   s          r+   rs   zAsyncWebhooksResource.get  s     0 ,,BBDKYZeYhijjPQSPVWXXYYLL11kR[\^[_P`1a(+Q[el   
 
 	
 
r   rt   c          
     d  K   || j                   j                         }|st        d|      |st        d|      | j                  | j                   j	                  |d| d      t        |t        j                         d{   t        ||||      t               d{   S 7 $7 w)	rv   Nr;   rT   rU   rw   r=   rB   rC   )
rG   rH   rI   rJ   rK   r   r	   rx   r   r    ry   s           r+   rz   zAsyncWebhooksResource.ping  s     6 ,,BBDKYZeYhijjPQSPVWXXZZLL11kR[\^[__dPe1f,T3F3X3XYY(+Q[el (   
 
 	
Y
s$   BB0B,
B0'B.(B0.B0r{   c          
     h  K   || j                   j                         }|st        d|      |st        d|      | j                  | j                   j	                  |d| d      t        d|it        j                         d{   t        ||||      t        	       d{   S 7 $7 w)
r~   Nr;   rT   rU   r   r=   r|   rB   rC   )
rG   rH   rI   rJ   rK   r   r   r   r   r"   r   s           r+   r   z+AsyncWebhooksResource.rotate_signing_secret1  s     8 ,,BBDKYZeYhijjPQSPVWXXZZLL11kR[\^[__sPt1u,&(;<4UU  )+Q[el 7   

 

 
	


s$   BB2	B.

B2)B0*B20B2)r   r   )r   r   r   r   r   r   r   r   r   r   r   r-   r+   r$   r$     sV   : : @ @ #'    )-$("&;D3I
  I

	I
$ %I
& 'I
, &-I
. "/I
0  1I
2 93I
4 
5I
^ #'"&\`  )-$("&;D;Z
Z
  	Z

  Z
 Z
 ZZ
Z
. /Z
4 &5Z
6 "7Z
8  9Z
: 9;Z
< 
=Z
~ #' $!% )-$("&;D5
  5
 	5

 5
 &5
 "5
  5
 95
 
5
v #' )-$("&;D$
$
  	$
 &$
 "$
  $
 9$
 
$
T #' )-$("&;D$
$
  	$
 &$
 "$
  $
 9$
 
$
T #'04 )-$("&;D(
(
  	(

 .(
 &(
 "(
  (
 9(
 
(
\ #' )-$("&;D,
,
  	,

,
 &,
 ",
  ,
 9,
 
,,
r-   c                      e Zd ZddZy)r(   c                ~   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        t        |j                        | _        y N)		_webhooksr   rN   r]   rh   ro   rs   rz   r   r*   r<   s     r+   __init__z(WebhooksResourceWithRawResponse.__init__a  s    !-OO
 .OO
 ,MM
	 .OO
 +LL
 ,MM
	 &=**&
"r-   Nr<   r#   r   Noner   r   r   r   r   r-   r+   r(   r(   `      
r-   r(   c                      e Zd ZddZy)r   c                ~   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        t        |j                        | _        y r   )	r   r   rN   r]   rh   ro   rs   rz   r   r   s     r+   r   z-AsyncWebhooksResourceWithRawResponse.__init__|  s    !3OO
 4OO
 2MM
	 4OO
 1LL
 2MM
	 &C**&
"r-   Nr<   r$   r   r   r   r   r-   r+   r   r   {  r   r-   r   c                      e Zd ZddZy)r0   c                ~   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        t        |j                        | _        y r   )	r   r   rN   r]   rh   ro   rs   rz   r   r   s     r+   r   z.WebhooksResourceWithStreamingResponse.__init__  s    !2OO
 3OO
 1MM
	 3OO
 0LL
 1MM
	 &B**&
"r-   Nr   r   r   r-   r+   r0   r0     r   r-   r0   c                      e Zd ZddZy)r   c                ~   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        t        |j                        | _        y r   )	r   r   rN   r]   rh   ro   rs   rz   r   r   s     r+   r   z3AsyncWebhooksResourceWithStreamingResponse.__init__  s    !8OO
 9OO
 7MM
	 9OO
 6LL
 7MM
	 &H**&
"r-   Nr   r   r   r-   r+   r   r     r   r-   r   )6
__future__r   typingr   r   typing_extensionsr   httpxtypesr   r	   r
   r   r   _typesr   r   r   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   r   r   _base_clientr   types.webhookr   types.webhook_list_responser   types.webhook_ping_responser    types.webhook_delete_responser!   ,types.webhook_rotate_signing_secret_responser"   __all__r#   r$   r(   r   r0   r   r   r-   r+   <module>r      s   $ #  %   K J J ; % 9  0 # = = A ]6
7R
 R
jT
, T
n
 
6
 
6
 
6
 
r-   