o
    pkj                    @   s  d Z ddlmZmZ ddlmZmZmZmZ ddl	m
Z
mZmZ ddlmZmZmZmZ ddlmZmZmZ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$m%Z%m&Z& G dd deZ'G dd dZ(G dd dZ)G dd deZ*G dd dZ+G dd dZ,d
S )zACode generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.   )AsyncBaseSDKBaseSDK)errorsmodelstypesutils)AfterParseErrorContextHookContextResponseContext)OptionalNullableUNSETinteractionswebhooks)pingwebhookrequestrotatesigningsecretrequestwebhookwebhookupdate)get_security_from_envresponse_helpers)unmarshal_json_response    N)AnyIterableListMappingOptionalUnioncastc                   @   b  e Zd Zedd Zedd Zddddddddee dee d	ee d
ee	eef  dee	ee
f  deeeejf  dejfddZddddddddeej dedee dee d
ee	eef  dee	ee
f  dee	ee
f  deeeejf  dejfddZddddddedee d
ee	eef  dee	ee
f  deeeejf  dejfddZddddddedee d
ee	eef  dee	ee
f  deeeejf  dejfddZddddddddddd
dedee dee dee deej deeej  dee d
ee	eef  dee	ee
f  dee	ee
f  deeeejf  dejfd d!Zddddddd"dedee d#eeej ej!f  d
ee	eef  dee	ee
f  dee	ee
f  deeeejf  dej"fd$d%Z#ddddddd&dedee d'ee$j% d
ee	eef  dee	ee
f  dee	ee
f  deeeejf  dej&fd(d)Z'dS )*Webhooksc                 C      t | S N)WebhooksWithRawResponseself r%   Y/home/djax/ivt_ai_plugin/venv/lib/python3.10/site-packages/google/genai/_gaos/webhooks.pywith_raw_response$      zWebhooks.with_raw_responsec                 C   r    r!   )WebhooksWithStreamingResponser#   r%   r%   r&   with_streaming_response(   r(   z Webhooks.with_streaming_responseNapi_version	page_size
page_tokenextra_headersextra_querytimeoutr,   r-   r.   r/   r0   r1   returnc                C   s  d}d}t }	d}
|}| |}|du r| jj}|
dur|
}n| ||}tj|||d}t|\}}| j	d3i ddddd|d|d	|d
dddddddddd|d|dtj
| jjjdd| jjddd|}|	t kr| jjt ur| jj}	ntjdtddddddd }	d}t|	tjr|	g d!f}d"d# }t| j|pd$d%dt| jjtjddt|d&d'd(}| j||d)d* |d+k|d,}|d-kr#td.d/g|jr|  z|| W n! ty } zt| jjd0 t||| W Y d}~nd}~ww |d+krtj ntj!}t"t#|||d1| t|| jj$d0d2S z||W S  tyJ } zt| jjd0 t||| W Y d}~dS d}~ww )4  Lists all Webhooks.

        :param api_version: Which version of the API to use.
        :param 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.
        :param page_token: Optional. A page token, received from a previous `ListWebhooks` call.
            Provide this to retrieve the subsequent page.
        :param extra_headers: Additional headers to set or replace on requests.
        :param extra_query: Additional query parameters to append to requests.
        :param timeout: Override the default request timeout configuration for this method in seconds
        Nr,   r-   r.   methodGETpath/{api_version}/webhooksbase_urlurl_variablesrequestrequest_body_requiredFrequest_has_path_paramsTrequest_has_query_paramsuser_agent_header
user-agentaccept_header_valueapplication/jsonhttp_headersextra_query_params_globalsr,   securityallow_empty_value
timeout_msattempt-count-backoff  @     0u     max_retries4084094295XXc                 S   v   t | ddrt | }td| |t | ddr&t | }td| |t | ddr5ttj| ddS td	| 
N4XX*zAPI error occurredrV   defaultrB   F)validatezUnexpected response received)r   match_responsestream_to_textr   GenAiDefaultErrorr   r   WebhookListResponsehttp_reshttp_res_textr%   r%   r&   _speakeasy_parse_response}      

z0Webhooks.list.<locals>._speakeasy_parse_response ListWebhookssyncmode	executionconfigr9   operation_idoauth2_scopessecurity_sourcetags
extensionsresponsec                 S      t ddg| S NrY   rV   r   match_status_codescr%   r%   r&   <lambda>       zWebhooks.list.<locals>.<lambda>	streaminghook_ctxr;   is_error_status_codestreamretry_configparsedrY   rV   _hooksbufferedrawparserrj   
client_refr~   hooksr%   )%r   _coerce_timeout_mssdk_configurationrI   _get_urlr   ListWebhooksRequestr   consume_response_mode_build_requestListWebhooksGlobalsglobalsr,   rG   r   r   RetryConfigBackoffStrategy
isinstancer	   r   r   Securityr
   
do_requestrw   status_coderead	Exceptionraise_parse_error__dict__r   StreamedAPIResponseAPIResponser   r   getr$   r,   r-   r.   r/   r0   r1   r9   r:   retries
server_urlrC   rI   r;   _speakeasy_response_modereqr   rd   _speakeasy_hook_ctxrb   
parse_exc__speakeasy_response_clsr%   r%   r&   list,   s   

	






	

zWebhooks.listr,   namer/   r0   
extra_bodyr1   subscribed_eventsurir   r   c                   s  d}	d}
t }d}|}| |}|du r| jj}|dur|}	n| |	|
}	tj|tj|t	
|ttj |ddt|\}}| jd5i ddddd|	d	|
d
ddddddddddd|d|dtj| jjjdd| jjd fddddd|}|t kr| jjt ur| jj}nt	jdt	ddd d!dd"d#}d}t|t	jr|g d$f}d%d& }t| j|	pd'd(dt| jjtjddt|d)d*d+}| j||d,d |d-k|d.}|d/kr7t	d0d1g|jr|   z|| W n! t!y } zt"| jj#d2 t$||| W Y d}~nd}~ww |d-kr tj%ntj&}t't(|||d3| t$|| jj#)d2d4S z||W S  t!y^ } zt"| jj#d2 t$||| W Y d}~dS d}~ww )6  Creates a new Webhook.

        :param 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
        :param uri: Required. The URI to which webhook events will be sent.
        :param api_version: Which version of the API to use.
        :param name: Optional. The user-provided name of the webhook.
        :param extra_headers: Additional headers to set or replace on requests.
        :param extra_query: Additional query parameters to append to requests.
        :param extra_body: Additional JSON object fields to merge into request bodies.
        :param timeout: Override the default request timeout configuration for this method in seconds
        Nr   r   r   r,   bodyr5   POSTr7   r8   r9   r:   r;   r<   Tr=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   get_serialized_bodyc                         t jjdddtj dS NFjsonr   r   serialize_request_bodyr   r   WebhookInputr%   r   r;   r%   r&   rz         z!Webhooks.create.<locals>.<lambda>rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   c                 S   rW   rX   r   r]   r^   r   r_   r   r   Webhookra   r%   r%   r&   rd   /  re   z2Webhooks.create.<locals>._speakeasy_parse_responserf   CreateWebhookrh   ri   rl   c                 S   rt   ru   rv   rx   r%   r%   r&   rz   P  r{   r|   r}   r   rY   rV   r   r   r   r%   )*r   r   r   rI   r   r   CreateWebhookRequestr   r   r   	unmarshalr   WebhookSubscribedEventr   r   r   CreateWebhookGlobalsr   r,   rG   r   r   r   r   r	   r   r   r   r
   r   rw   r   r   r   r   r   r   r   r   r   r   r   r$   r   r   r,   r   r/   r0   r   r1   r9   r:   r   r   rC   rI   r   r   r   rd   r   rb   r   r   r%   r   r&   create   s
  


	






	

zWebhooks.creater,   r/   r0   r1   idc                C     d}d}t }d}	|}
| |}|du r| jj}|	dur|	}n| ||}tj||d}t|
\}}
| j	d3i ddddd|d|d	|d
dddddddddd|
d|dtj
| jjjdd| jjddd|}|t kr| jjt ur| jj}ntjdtddddddd }d}t|tjr|g d!f}d"d# }t| j|pd$d%dt| jjtjddt|d&d'd(}| j||d)d* |d+k|d,}|d-kr"td.d/g|jr|  z|| W n! ty } zt| jjd0 t||| W Y d}~nd}~ww |d+krtj ntj!}t"t#|||d1| t|| jj$d0d2S z||W S  tyI } zt| jjd0 t||| W Y d}~dS d}~ww )4  Deletes a Webhook.

        :param id: Required. The ID of the webhook to delete.
            Format: `{webhook_id}`
        :param api_version: Which version of the API to use.
        :param extra_headers: Additional headers to set or replace on requests.
        :param extra_query: Additional query parameters to append to requests.
        :param timeout: Override the default request timeout configuration for this method in seconds
        Nr,   r   r5   DELETEr7   /{api_version}/webhooks/{id}r9   r:   r;   r<   Fr=   Tr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   c                 S   rW   rX   )r   r]   r^   r   r_   r   r   Emptyra   r%   r%   r&   rd     re   z2Webhooks.delete.<locals>._speakeasy_parse_responserf   DeleteWebhookrh   ri   rl   c                 S   rt   ru   rv   rx   r%   r%   r&   rz     r{   z!Webhooks.delete.<locals>.<lambda>r|   r}   r   rY   rV   r   r   r   r%   )%r   r   r   rI   r   r   DeleteWebhookRequestr   r   r   DeleteWebhookGlobalsr   r,   rG   r   r   r   r   r   r	   r   r   r   r
   r   rw   r   r   r   r   r   r   r   r   r   r   r   r$   r   r,   r/   r0   r1   r9   r:   r   r   rC   rI   r;   r   r   r   rd   r   rb   r   r   r%   r%   r&   deletez  s   

	






	

zWebhooks.deletec                C   r   )4  Gets a specific Webhook.

        :param id: Required. The ID of the webhook to retrieve.
        :param api_version: Which version of the API to use.
        :param extra_headers: Additional headers to set or replace on requests.
        :param extra_query: Additional query parameters to append to requests.
        :param timeout: Override the default request timeout configuration for this method in seconds
        Nr   r5   r6   r7   r   r9   r:   r;   r<   Fr=   Tr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   c                 S   rW   rX   r   ra   r%   r%   r&   rd   \  re   z/Webhooks.get.<locals>._speakeasy_parse_responserf   
GetWebhookrh   ri   rl   c                 S   rt   ru   rv   rx   r%   r%   r&   rz   }  r{   zWebhooks.get.<locals>.<lambda>r|   r}   r   rY   rV   r   r   r   r%   )%r   r   r   rI   r   r   GetWebhookRequestr   r   r   GetWebhookGlobalsr   r,   rG   r   r   r   r   r   r	   r   r   r   r
   r   rw   r   r   r   r   r   r   r   r   r   r   r   r   r%   r%   r&   r     s   

	






	

zWebhooks.get
r,   update_maskr   stater   r   r/   r0   r   r1   r   r   c       
            s  d}d}t }d}|}| |}|du r| jj}|dur|}n| ||}tj|||tj||t	
|tttj  |ddt|\}}| jd6i ddddd|d	|d
ddddddddddd|d|	dtj| jjjdd| jjd fddddd|}|t kr| jjt ur| jj}nt	jdt	dd d!d"dd#d$}d}t|t	jr|g d%f}d&d' }t| j|pd(d)dt| jjtjddt|d*d+d,}| j||d-d |d.k|d/}|d0kr<t	d1d2g|j r|!  z|| W n! t"y } zt#| jj$d3 t%||| W Y d}~nd}~ww |d.kr%tj&ntj'}t(t)|||d4| t%|| jj$*d3d5S z||W S  t"yc } zt#| jj$d3 t%||| W Y d}~dS d}~ww )7g  Updates an existing Webhook.

        :param id: Required. The ID of the webhook to update.
        :param api_version: Which version of the API to use.
        :param update_mask: Optional. The list of fields to update.
        :param name: Optional. The user-provided name of the webhook.
        :param state: Optional. The state of the webhook.
        :param 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
        :param uri: Optional. The URI to which webhook events will be sent.
        :param extra_headers: Additional headers to set or replace on requests.
        :param extra_query: Additional query parameters to append to requests.
        :param extra_body: Additional JSON object fields to merge into request bodies.
        :param timeout: Override the default request timeout configuration for this method in seconds
        Nr   r   r   r   r,   r   r   r   r5   PATCHr7   r   r9   r:   r;   r<   Fr=   Tr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   r   c                      *   t jd ur	jnd dddttj  dS NFTr   r   r   r   r   r   r   WebhookUpdater%   r   r%   r&   rz         z!Webhooks.update.<locals>.<lambda>rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   c                 S   rW   rX   r   ra   r%   r%   r&   rd     re   z2Webhooks.update.<locals>._speakeasy_parse_responserf   UpdateWebhookrh   ri   rl   c                 S   rt   ru   rv   rx   r%   r%   r&   rz   ;  r{   r|   r}   r   rY   rV   r   r   r   r%   )+r   r   r   rI   r   r   UpdateWebhookRequestr   r   r   r   r   r   WebhookUpdateSubscribedEventr   r   r   UpdateWebhookGlobalsr   r,   rG   r   r   r   r   r	   r   r   r   r
   r   rw   r   r   r   r   r   r   r   r   r   r   r   r$   r   r,   r   r   r   r   r   r/   r0   r   r1   r9   r:   r   r   rC   rI   r   r   r   rd   r   rb   r   r   r%   r   r&   update  s  '

	






	

zWebhooks.updater,   r   r/   r0   r   r1   r   c                   s  d}d}	t }
d}|}| |}|du r| jj}|dur|}n| ||	}tj||t|t	t
j dt|\}}| jd5i ddddd|d|	d	d
dddddddddd|d|dtj| jjjdd| jjd fddddd|}|
t kr| jjt ur| jj}
ntjdtddd d!dd"d#}
d}t|
tjr|
g d$f}d%d& }t| j|pd'd(dt| jjtjddt|d)d*d+}| j||d,d |d-k|d.}|d/kr2td0d1g|jr|  z|| W n! ty } zt | jj!d2 t"||| W Y d}~nd}~ww |d-krtj#ntj$}t%t&|||d3| t"|| jj!'d2d4S z||W S  tyY } zt | jj!d2 t"||| W Y d}~dS d}~ww )6I  Sends a ping event to a Webhook.

        :param id: Required. The ID of the webhook to ping.
            Format: `{webhook_id}`
        :param api_version: Which version of the API to use.
        :param body: The request body.
        :param extra_headers: Additional headers to set or replace on requests.
        :param extra_query: Additional query parameters to append to requests.
        :param extra_body: Additional JSON object fields to merge into request bodies.
        :param timeout: Override the default request timeout configuration for this method in seconds
        Nr,   r   r   r5   r   r7   !/{api_version}/webhooks/{id}:pingr9   r:   r;   r<   Fr=   Tr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   r   c                      r   r   r   r   r   r   r   PingWebhookRequestr%   r   r%   r&   rz     r   zWebhooks.ping.<locals>.<lambda>rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   c                 S   rW   rX   )r   r]   r^   r   r_   r   r   WebhookPingResponsera   r%   r%   r&   rd     re   z0Webhooks.ping.<locals>._speakeasy_parse_responserf   PingWebhookrh   ri   rl   c                 S   rt   ru   rv   rx   r%   r%   r&   rz     r{   r|   r}   r   rY   rV   r   r   r   r%   )(r   r   r   rI   r   r   r   r   get_pydantic_modelr   r   r   r   r   PingWebhookGlobalsr   r,   rG   r   r   r   r   r	   r   r   r   r
   r   rw   r   r   r   r   r   r   r   r   r   r   r   r$   r   r,   r   r/   r0   r   r1   r9   r:   r   r   rC   rI   r   r   r   rd   r   rb   r   r   r%   r   r&   pinge  s   

	






	

zWebhooks.pingr,   revocation_behaviorr/   r0   r   r1   r   c                   s  d}d}	t }
d}|}| |}|du r| jj}|dur|}n| ||	}tj||tj|ddt	|\}}| j
d6i ddddd|d	|	d
ddddddddddd|d|dtj| jjjdd| jjd fddddd|}|
t kr| jjt ur| jj}
ntjdtdd d!d"dd#d$}
d}t|
tjr|
g d%f}d&d' }t| j|pd(d)dt| jjtjddt|d*d+d,}| j||d-d |d.k|d/}|d0kr/td1d2g|jr|  z|| W n! ty } zt| jjd3 t ||| W Y d}~nd}~ww |d.krtj!ntj"}t#t$|||d4| t || jj%d3d5S z||W S  tyV } zt| jjd3 t ||| W Y d}~dS d}~ww )7  Generates a new signing secret for a Webhook.

        :param id: Required. The ID of the webhook for which to generate a signing secret.
            Format: `{webhook_id}`
        :param api_version: Which version of the API to use.
        :param revocation_behavior: Optional. The revocation behavior for previous signing secrets.
        :param extra_headers: Additional headers to set or replace on requests.
        :param extra_query: Additional query parameters to append to requests.
        :param extra_body: Additional JSON object fields to merge into request bodies.
        :param timeout: Override the default request timeout configuration for this method in seconds
        Nr   r   r5   r   r7   0/{api_version}/webhooks/{id}:rotateSigningSecretr9   r:   r;   r<   Fr=   Tr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   r   c                      r   r   r   r   r   r   r   RotateSigningSecretRequestr%   r   r%   r&   rz   P  r   z0Webhooks.rotate_signing_secret.<locals>.<lambda>rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   c                 S   rW   rX   )r   r]   r^   r   r_   r   r   "WebhookRotateSigningSecretResponsera   r%   r%   r&   rd   k  s"   

zAWebhooks.rotate_signing_secret.<locals>._speakeasy_parse_responserf   RotateSigningSecretrh   ri   rl   c                 S   rt   ru   rv   rx   r%   r%   r&   rz     r{   r|   r}   r   rY   rV   r   r   r   r%   )&r   r   r   rI   r   r   r   r   r   r   r   RotateSigningSecretGlobalsr   r,   rG   r   r   r   r   r   r	   r   r   r   r
   r   rw   r   r   r   r   r   r   r   r   r   r   r   r$   r   r,   r   r/   r0   r   r1   r9   r:   r   r   rC   rI   r   r   r   rd   r   rb   r   r   r%   r   r&   rotate_signing_secret  s  

	






	

zWebhooks.rotate_signing_secret(__name__
__module____qualname__propertyr'   r*   r   strintr   r   r   floathttpxTimeoutr   r`   r   r   webhooks_webhookr   r   r   r   r   r   r   webhooks_webhookupdateWebhookUpdateStater   r   webhooks_pingwebhookrequestr   PingWebhookRequestParamr   r   #webhooks_rotatesigningsecretrequestRevocationBehaviorr   r   r%   r%   r%   r&   r   #   sl   

	
 "	

 7
 
 
 C
 .	
r   c                   @      e Zd ZdeddfddZdS )r"   sdkr2   Nc                 C   z   || _ t|jd| _t|jd| _t|jd| _t|jd| _t|jd| _t|jd| _t|j	d| _	d S Nr/   )
_sdkr   to_raw_response_wrapperr   r   r   r   r   r   r   r$   r  r%   r%   r&   __init__  s    
z WebhooksWithRawResponse.__init__r  r  r  r   r  r%   r%   r%   r&   r"         r"   c                   @   r  )r)   r  r2   Nc                 C   r  r  )
r  r   to_streamed_response_wrapperr   r   r   r   r   r   r   r  r%   r%   r&   r    ,   
z&WebhooksWithStreamingResponse.__init__r  r%   r%   r%   r&   r)     r  r)   c                   @   r   )*AsyncWebhooksc                 C   r    r!   )AsyncWebhooksWithRawResponser#   r%   r%   r&   r'     r(   zAsyncWebhooks.with_raw_responsec                 C   r    r!   )"AsyncWebhooksWithStreamingResponser#   r%   r%   r&   r*     r(   z%AsyncWebhooks.with_streaming_responseNr+   r,   r-   r.   r/   r0   r1   r2   c                   s  d}d}t }	d}
|}| |}|du r| jj}|
dur|
}n| ||}tj|||d}t|\}}| j	d4i ddddd|d|d	|d
dddddddddd|d|dtj
| jjjdd| jjddd|}|	t kr| jjt ur| jj}	ntjdtddddddd }	d}t|	tjr|	g d!f}d"d# }t| j|pd$d%dt| jjtjddt|d&d'd(}| j||d)d* |d+k|d,I dH }|d-kr=td.d/g|jr| I dH  z	||I dH  W n+ ty } zt| jjd0| jjd1t |||I dH  W Y d}~nd}~ww |d+kr tj!ntj"}t#t$|||d2| t || jjd1| jjd0d3S z||I dH W S  tyq } zt| jjd0| jjd1t |||I dH  W Y d}~dS d}~ww )5r3   Nr4   r5   r6   r7   r8   r9   r:   r;   r<   Fr=   Tr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   c                       t | ddrt | I d H }td| |t | ddr-t | I d H }td| |t | ddr<ttj| ddS td	| rX   )r   r]   stream_to_text_asyncr   r_   r   r   r`   ra   r%   r%   r&   rd   A      z5AsyncWebhooks.list.<locals>._speakeasy_parse_responserf   rg   asyncri   rl   c                 S   rt   ru   rv   rx   r%   r%   r&   rz   b  r{   z$AsyncWebhooks.list.<locals>.<lambda>r|   r}   r   rY   rV   _async_hooksr   r   r   r   rj   r   r~   r   async_hooksr%   )%r   r   r   rI   r   r   r   r   r   _build_request_asyncr   r   r,   rG   r   r   r   r   r   r	   r   r   r   r
   do_request_asyncrw   r   areadr   raise_parse_error_asyncr   r   r   AsyncStreamedAPIResponseAsyncAPIResponser   r   r   r%   r%   r&   r     s  

	






zAsyncWebhooks.listr   r   r   r   r   c                   s  d}	d}
t }d}|}| |}|du r| jj}|dur|}	n| |	|
}	tj|tj|t	
|ttj |ddt|\}}| jd6i ddddd|	d	|
d
ddddddddddd|d|dtj| jjjdd| jjd fddddd|}|t kr| jjt ur| jj}nt	jdt	ddd d!dd"d#}d}t|t	jr|g d$f}d%d& }t| j|	pd'd(dt| jjtjddt|d)d*d+}| j||d,d |d-k|d.I dH }|d/krQt	d0d1g|jr,|  I dH  z	||I dH  W n+ t!y+ } zt"| jj#$d2| jj#$d3t%|||I dH  W Y d}~nd}~ww |d-kr4tj&ntj'}t(t)|||d4| t%|| jj#$d3| jj#$d2d5S z||I dH W S  t!y } zt"| jj#$d2| jj#$d3t%|||I dH  W Y d}~dS d}~ww )7r   Nr   r   r5   r   r7   r8   r9   r:   r;   r<   Tr=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   r   c                      r   r   r   r%   r   r%   r&   rz     r   z&AsyncWebhooks.create.<locals>.<lambda>rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   c                    r   rX   r   r]   r!  r   r_   r   r   r   ra   r%   r%   r&   rd     r"  z7AsyncWebhooks.create.<locals>._speakeasy_parse_responserf   r   r#  ri   rl   c                 S   rt   ru   rv   rx   r%   r%   r&   rz     r{   r|   r}   r   rY   rV   r$  r   r   r%  r%   )*r   r   r   rI   r   r   r   r   r   r   r   r   r   r   r   r'  r   r   r,   rG   r   r   r   r   r	   r   r   r   r
   r(  rw   r   r)  r   r*  r   r   r   r+  r,  r   r   r   r%   r   r&   r     s  


	






zAsyncWebhooks.creater   r   c                     d}d}t }d}	|}
| |}|du r| jj}|	dur|	}n| ||}tj||d}t|
\}}
| j	d4i ddddd|d|d	|d
dddddddddd|
d|dtj
| jjjdd| jjddd|}|t kr| jjt ur| jj}ntjdtddddddd }d}t|tjr|g d!f}d"d# }t| j|pd$d%dt| jjtjddt|d&d'd(}| j||d)d* |d+k|d,I dH }|d-kr<td.d/g|jr| I dH  z	||I dH  W n+ ty } zt| jjd0| jjd1t |||I dH  W Y d}~nd}~ww |d+krtj!ntj"}t#t$|||d2| t || jjd1| jjd0d3S z||I dH W S  typ } zt| jjd0| jjd1t |||I dH  W Y d}~dS d}~ww )5r   Nr   r5   r   r7   r   r9   r:   r;   r<   Fr=   Tr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   c                    r   rX   )r   r]   r!  r   r_   r   r   r   ra   r%   r%   r&   rd     r"  z7AsyncWebhooks.delete.<locals>._speakeasy_parse_responserf   r   r#  ri   rl   c                 S   rt   ru   rv   rx   r%   r%   r&   rz     r{   z&AsyncWebhooks.delete.<locals>.<lambda>r|   r}   r   rY   rV   r$  r   r   r%  r%   )%r   r   r   rI   r   r   r   r   r   r'  r   r   r,   rG   r   r   r   r   r   r	   r   r   r   r
   r(  rw   r   r)  r   r*  r   r   r   r+  r,  r   r   r   r%   r%   r&   r   D  s  

	






zAsyncWebhooks.deletec                   r.  )5r   Nr   r5   r6   r7   r   r9   r:   r;   r<   Fr=   Tr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   c                    r   rX   r-  ra   r%   r%   r&   rd   )  r"  z4AsyncWebhooks.get.<locals>._speakeasy_parse_responserf   r   r#  ri   rl   c                 S   rt   ru   rv   rx   r%   r%   r&   rz   J  r{   z#AsyncWebhooks.get.<locals>.<lambda>r|   r}   r   rY   rV   r$  r   r   r%  r%   )%r   r   r   rI   r   r   r   r   r   r'  r   r   r,   rG   r   r   r   r   r   r	   r   r   r   r
   r(  rw   r   r)  r   r*  r   r   r   r+  r,  r   r   r   r%   r%   r&   r     s  

	






zAsyncWebhooks.getr   r   r   c       
            s  d}d}t }d}|}| |}|du r| jj}|dur|}n| ||}tj|||tj||t	
|tttj  |ddt|\}}| jd7i ddddd|d	|d
ddddddddddd|d|	dtj| jjjdd| jjd fddddd|}|t kr| jjt ur| jj}nt	jdt	dd d!d"dd#d$}d}t|t	jr|g d%f}d&d' }t| j|pd(d)dt| jjtjddt|d*d+d,}| j||d-d |d.k|d/I dH }|d0krVt	d1d2g|j r1|! I dH  z	||I dH  W n+ t"y0 } zt#| jj$%d3| jj$%d4t&|||I dH  W Y d}~nd}~ww |d.kr9tj'ntj(}t)t*|||d5| t&|| jj$%d4| jj$%d3d6S z||I dH W S  t"y } zt#| jj$%d3| jj$%d4t&|||I dH  W Y d}~dS d}~ww )8r   Nr   r   r5   r   r7   r   r9   r:   r;   r<   Fr=   Tr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   r   c                      r   r   r   r%   r   r%   r&   rz     r   z&AsyncWebhooks.update.<locals>.<lambda>rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   c                    r   rX   r-  ra   r%   r%   r&   rd     r"  z7AsyncWebhooks.update.<locals>._speakeasy_parse_responserf   r   r#  ri   rl   c                 S   rt   ru   rv   rx   r%   r%   r&   rz     r{   r|   r}   r   rY   rV   r$  r   r   r%  r%   )+r   r   r   rI   r   r   r   r   r   r   r   r   r   r   r   r   r'  r   r   r,   rG   r   r   r   r   r	   r   r   r   r
   r(  rw   r   r)  r   r*  r   r   r   r+  r,  r   r   r   r%   r   r&   r   w  s  '

	






zAsyncWebhooks.updater   r   c                   s  d}d}	t }
d}|}| |}|du r| jj}|dur|}n| ||	}tj||t|t	t
j dt|\}}| jd6i ddddd|d|	d	d
dddddddddd|d|dtj| jjjdd| jjd fddddd|}|
t kr| jjt ur| jj}
ntjdtddd d!dd"d#}
d}t|
tjr|
g d$f}d%d& }t| j|pd'd(dt| jjtjddt|d)d*d+}| j||d,d |d-k|d.I dH }|d/krLtd0d1g|jr'| I dH  z	||I dH  W n+ ty& } zt | jj!"d2| jj!"d3t#|||I dH  W Y d}~nd}~ww |d-kr/tj$ntj%}t&t'|||d4| t#|| jj!"d3| jj!"d2d5S z||I dH W S  ty } zt | jj!"d2| jj!"d3t#|||I dH  W Y d}~dS d}~ww )7r   Nr   r5   r   r7   r   r9   r:   r;   r<   Fr=   Tr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   r   c                      r   r   r   r%   r   r%   r&   rz   {  r   z$AsyncWebhooks.ping.<locals>.<lambda>rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   c                    r   rX   )r   r]   r!  r   r_   r   r   r   ra   r%   r%   r&   rd     r"  z5AsyncWebhooks.ping.<locals>._speakeasy_parse_responserf   r   r#  ri   rl   c                 S   rt   ru   rv   rx   r%   r%   r&   rz     r{   r|   r}   r   rY   rV   r$  r   r   r%  r%   )(r   r   r   rI   r   r   r   r   r   r   r   r   r   r'  r   r   r,   rG   r   r   r   r   r	   r   r   r   r
   r(  rw   r   r)  r   r*  r   r   r   r+  r,  r   r   r   r%   r   r&   r   8  s  

	






zAsyncWebhooks.pingr   r   c                   s  d}d}	t }
d}|}| |}|du r| jj}|dur|}n| ||	}tj||tj|ddt	|\}}| j
d7i ddddd|d	|	d
ddddddddddd|d|dtj| jjjdd| jjd fddddd|}|
t kr| jjt ur| jj}
ntjdtdd d!d"dd#d$}
d}t|
tjr|
g d%f}d&d' }t| j|pd(d)dt| jjtjddt|d*d+d,}| j||d-d |d.k|d/I dH }|d0krItd1d2g|jr$| I dH  z	||I dH  W n+ ty# } zt| jj d3| jj d4t!|||I dH  W Y d}~nd}~ww |d.kr,tj"ntj#}t$t%|||d5| t!|| jj d4| jj d3d6S z||I dH W S  ty} } zt| jj d3| jj d4t!|||I dH  W Y d}~dS d}~ww )8r   Nr   r   r5   r   r7   r   r9   r:   r;   r<   Fr=   Tr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   r   c                      r   r   r   r%   r   r%   r&   rz   &	  r   z5AsyncWebhooks.rotate_signing_secret.<locals>.<lambda>rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   c                    r   rX   )r   r]   r!  r   r_   r   r   r   ra   r%   r%   r&   rd   A	  s$   zFAsyncWebhooks.rotate_signing_secret.<locals>._speakeasy_parse_responserf   r   r#  ri   rl   c                 S   rt   ru   rv   rx   r%   r%   r&   rz   d	  r{   r|   r}   r   rY   rV   r$  r   r   r%  r%   )&r   r   r   rI   r   r   r   r   r   r   r'  r   r   r,   rG   r   r   r   r   r   r	   r   r   r   r
   r(  rw   r   r)  r   r*  r   r   r   r+  r,  r   r   r   r%   r   r&   r     s  

	






z#AsyncWebhooks.rotate_signing_secretr   r%   r%   r%   r&   r    sl   

	
 %	

 :
 
 
 F
 1	
r  c                   @   r  )r  r  r2   Nc                 C   r  r  )
r  r   async_to_raw_response_wrapperr   r   r   r   r   r   r   r  r%   r%   r&   r  	  r  z%AsyncWebhooksWithRawResponse.__init__r  r  r  r  r  r%   r%   r%   r&   r  	  r  r  c                   @   r  )r  r  r2   Nc                 C   r  r  )
r  r   "async_to_streamed_response_wrapperr   r   r   r   r   r   r   r  r%   r%   r&   r  	  s.   z+AsyncWebhooksWithStreamingResponse.__init__r0  r%   r%   r%   r&   r  	  r  r  )-__doc__basesdkr   r   rf   r   r   r   r   r   r   r	   r
   r   r   r   r   types.webhooksr   r  r   r  r   r
  r   r  r   r   utils.unmarshal_json_responser   r  typingr   r   r   r   r   r   r   r   r"   r)   r  r  r  r%   r%   r%   r&   <module>   sD   $                  4