
    jz                     6   d dl Z d dl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 dd	lmZ dd
l
mZ ddl
mZ ddlmZmZ  ej        d          Z	 d:deeeef         ef         deeeef                  deeef         fdZ	 d:deeeef         ef         deeeef                  deeef         fdZ	 d:deeeef         ef         deeeef                  deeef         fdZ	 d:deeeef         ef         deeeef                  deeef         fdZ	 d:deeeef         ef         deeeef                  deeef         fdZ 	 d:deeeef         ef         deeeef                  deeef         fdZ!	 d:dedeeeef         ef         deeeef                  deeef         fdZ"	 d:dedeeeef         ef         deeeef                  deeef         fdZ#	 d:dedeeeef         ef         deeeef                  deeef         fdZ$	 d:dedeeeef         ef         deeeef                  deeef         fdZ%	 d:deeeef         ef         deeeef                  deeef         fdZ&	 d:deeeef         ef         deeeef                  deeef         fdZ'	 d:deeeef         ef         deeeef                  deeef         fdZ(	 d:deeeef         ef         deeeef                  deeef         fdZ)	 d:deeeef         ef         deeeef                  deeef         fd Z*	 d:deeeef         ef         deeeef                  deeef         fd!Z+	 d:dedeeeef         ef         deeeef                  deeef         fd"Z,	 d:dedeeeef         ef         deeeef                  deeef         fd#Z-	 d:deeeef         ef         deeeef                  deeef         fd$Z.	 d:deeeef         ef         deeeef                  deeef         fd%Z/	 d:deeeef         ef         deeeef                  deeef         fd&Z0	 d:deeeef         ef         deeeef                  deeef         fd'Z1	 d:deeeef         ef         deeeef                  deeef         fd(Z2	 d:deeeef         ef         deeeef                  deeef         fd)Z3	 d:deeeef         ef         deeeef                  deeef         fd*Z4	 d:deeeef         ef         deeeef                  deeef         fd+Z5	 d:deeeef         ef         deeeef                  deeef         fd,Z6	 d:deeeef         ef         deeeef                  deeef         fd-Z7	 d:deeeef         ef         deeeef                  deeef         fd.Z8	 d:deeeef         ef         deeeef                  deeef         fd/Z9	 d:deeeef         ef         deeeef                  deeef         fd0Z:	 d:deeeef         ef         deeeef                  deeef         fd1Z;	 d:deeeef         ef         deeeef                  deeef         fd2Z<	 d:deeeef         ef         deeeef                  deeef         fd3Z=	 d:dedeeeef         ef         deeeef                  deeef         fd4Z>	 d:dedeeeef         ef         deeeef                  deeef         fd5Z? G d6 d7e	j@                  ZA G d8 d9e	j@                  ZBdS );    N)AnyOptionalUnion)	urlencode   )_api_module)_common)_transformers)types)BaseApiClient)get_value_by_path)set_value_by_path)
AsyncPagerPagerzgoogle_genai.cachesfrom_objectparent_objectreturnc                    i }t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          t          d          t          | dg          t          d          t          | d	g          t          d
          t          | dg          t          d          t          | dg          t          d          |S )Napi_keyapiKeyapi_key_configz8api_key_config parameter is not supported in Gemini API.	auth_typez3auth_type parameter is not supported in Gemini API.google_service_account_configzGgoogle_service_account_config parameter is not supported in Gemini API.http_basic_auth_configz@http_basic_auth_config parameter is not supported in Gemini API.oauth_configz6oauth_config parameter is not supported in Gemini API.oidc_configz5oidc_config parameter is not supported in Gemini API.getvsetv
ValueErrorr   r   	to_objects      ^/DATA/AppData/hermes/projects/honcho/.venv/lib/python3.11/site-packages/google/genai/caches.py_AuthConfig_to_mldevr$   #   s     !)	+	{##/XJ[9+ > >???	+()**6
O
P
PP	+}%%1
J
K
KK	+7899E
	  
 
+0122>
J   
+'((4
M
N
NN	+''3
L
M
MM	    c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          !t          |dgt          | dg                     |S )Ndatadisplay_name6display_name parameter is not supported in Gemini API.	mime_typemimeTyper   r!   s      r#   _Blob_to_mldevr,   E   s     !)	+x  ,VHd;99:::	+'((4
M
N
NN	+}%%1ZL${[M"B"BCCC	r%   c           	          i t          | dg          -t          dgfdt          | dg          D                        t          | dg          !t          dgt          | dg                     S )Npartsc                 0    g | ]}t          |          S  )_Part_to_mldev.0itemr"   s     r#   
<listcomp>z%_Content_to_mldev.<locals>.<listcomp>_   3     	
 	
 	
 4++	
 	
 	
r%   roler   r   r!   s     @r#   _Content_to_mldevr9   V        !)	+y!!-			
 	
 	
 	
[7)44	
 	
 	
   
+x  ,VHd;99:::	r%   c           	          i t          | dg          -t          dgfdt          | dg          D                        t          | dg          !t          dgt          | dg                     S )Nr.   c                 0    g | ]}t          |          S r0   )_Part_to_vertexr2   s     r#   r5   z&_Content_to_vertex.<locals>.<listcomp>t   3     	
 	
 	
 D),,	
 	
 	
r%   r7   r8   r!   s     @r#   _Content_to_vertexr?   k   r:   r%   c                    i t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          ?t          |dgfdt          j        t          | dg                    D                        t          | dg          At          |d	gt	          t          j        t          | dg                                         t          | d
g          -t          |d
gfdt          | d
g          D                        t          | dg          /t          |dgt          t          | dg                               t          | dg          t          d          S )Nttlexpire_time
expireTimer(   displayNamecontentsc                 0    g | ]}t          |          S r0   )r9   r2   s     r#   r5   z7_CreateCachedContentConfig_to_mldev.<locals>.<listcomp>   s3     	
 	
 	
 dI..	
 	
 	
r%   system_instructionsystemInstructiontoolsc                 0    g | ]}t          |          S r0   )_Tool_to_mldevr2   s     r#   r5   z7_CreateCachedContentConfig_to_mldev.<locals>.<listcomp>   r6   r%   tool_config
toolConfigkms_key_namez6kms_key_name parameter is not supported in Gemini API.)r   r   t
t_contentsr9   	t_content_ToolConfig_to_mldevr    r!   s     @r#   #_CreateCachedContentConfig_to_mldevrS      s6    !)	+w+kE7!;!;<<<	+''3[=/(J(JKKK	+'((4kN;K)L)LMMM	+
|$$0		
 	
 	
 	
T+
|%D%DEE	
 	
 	
   
+,-..:	K[+?*@AABBI	
 	
   
+y!!-			
 	
 	
 	
[7)44	
 	
 	
   
+''3	T+??KK   
+'((4
M
N
NN	r%   c                    i t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          ?t          |dgfdt          j        t          | dg                    D                        t          | dg          At          |d	gt	          t          j        t          | dg                                         t          | d
g          -t          |d
gfdt          | d
g          D                        t          | dg          /t          |dgt          t          | dg                               t          | dg          "t          |ddgt          | dg                     S )NrA   rB   rC   r(   rD   rE   c                 0    g | ]}t          |          S r0   )r?   r2   s     r#   r5   z8_CreateCachedContentConfig_to_vertex.<locals>.<listcomp>   s3     	
 	
 	
 tY//	
 	
 	
r%   rG   rH   rI   c                 0    g | ]}t          |          S r0   )_Tool_to_vertexr2   s     r#   r5   z8_CreateCachedContentConfig_to_vertex.<locals>.<listcomp>   r>   r%   rL   rM   rN   encryption_spec
kmsKeyName)r   r   rO   rP   r?   rQ   _ToolConfig_to_vertexr!   s     @r#   $_CreateCachedContentConfig_to_vertexr[      sV    !)	+w+kE7!;!;<<<	+''3[=/(J(JKKK	+'((4kN;K)L)LMMM	+
|$$0		
 	
 	
 	
T+
|%D%DEE	
 	
 	
   
+,-..:	K[+?*@AABBI	
 	
   
+y!!-			
 	
 	
 	
[7)44	
 	
 	
   
+''3	d;@@)LL   
+'((4	L)[>*++   
r%   
api_clientc                     i }t          |dg          4t          |dgt          j        | t          |dg                               t          |dg          t	          t          |dg          |           |S Nmodelconfig)r   r   rO   t_caches_modelrS   r\   r   r   r"   s       r#   '_CreateCachedContentParameters_to_mldevrc      s    
 !)	+y!!-			T+y%A%ABB   
+z"".'[8*%%y   
r%   c                     i }t          |dg          4t          |dgt          j        | t          |dg                               t          |dg          t	          t          |dg          |           |S r^   )r   r   rO   ra   r[   rb   s       r#   (_CreateCachedContentParameters_to_vertexre     s    
 !)	+y!!-			T+y%A%ABB   
+z"".([8*%%y   
r%   c                     i }t          |dg          5t          |ddgt          j        | t          |dg                               |S Nname_urlr   r   rO   t_cached_content_namerb   s       r#   '_DeleteCachedContentParameters_to_mldevrl      \    
 !)	+x  ,		
Dvh,G,GHH   
r%   c                     i }t          |dg          5t          |ddgt          j        | t          |dg                               |S rg   rj   rb   s       r#   (_DeleteCachedContentParameters_to_vertexro   0  rm   r%   c                 n    i }t          | dg          !t          |dgt          | dg                     |S NsdkHttpResponsesdk_http_responser8   r!   s      r#   '_DeleteCachedContentResponse_from_mldevrt   @  P     !)	+)*++7'(${=N<O*P*P   
r%   c                 n    i }t          | dg          !t          |dgt          | dg                     |S rq   r8   r!   s      r#   (_DeleteCachedContentResponse_from_vertexrw   M  ru   r%   c                    i }t          | dg          t          d          t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     |S )Nr(   r)   file_urifileUrir*   r+   )r   r    r   r!   s      r#   _FileData_to_mldevr{   Z  s     !)	+'((4
M
N
NN	+
|$$0YKkJ<!@!@AAA	+}%%1ZL${[M"B"BCCC	r%   c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          t          d          |S )Nidargsrh   partial_argsz6partial_args parameter is not supported in Gemini API.will_continuez7will_continue parameter is not supported in Gemini API.r   r!   s      r#   _FunctionCall_to_mldevr   k  s     !)	+v*TFDtf55666	+x  ,VHd;99:::	+x  ,VHd;99:::	+'((4
M
N
NN	+())5
N
O
OO	r%   c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          t          d          |S )Nallowed_function_namesallowedFunctionNamesmodestream_function_call_argumentszHstream_function_call_arguments parameter is not supported in Gemini API.r   r!   s      r#   _FunctionCallingConfig_to_mldevr     s     !)	+0122>	 [3455   
+x  ,VHd;99:::	+89::F
	  
 
r%   c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | d	g          t          d
          |S )Ndescriptionrh   
parametersparameters_json_schemaparametersJsonSchemaresponseresponse_json_schemaresponseJsonSchemabehaviorzHbehavior parameter is not supported in Gemini Enterprise Agent Platform.r   r!   s      r#   _FunctionDeclaration_to_vertexr     s    !)	+''3]OT+%G%GHHH	+x  ,VHd;99:::	+~&&2\ND|n$E$EFFF	+0122>	 [3455   
+
|$$0ZL${ZL"A"ABBB	+./00<	[1233   
+
|$$0
	  
 
r%   c                     i }t          |dg          5t          |ddgt          j        | t          |dg                               |S rg   rj   rb   s       r#   $_GetCachedContentParameters_to_mldevr     rm   r%   c                     i }t          |dg          5t          |ddgt          j        | t          |dg                               |S rg   rj   rb   s       r#   %_GetCachedContentParameters_to_vertexr     rm   r%   c           
          i }t          | dg          /t          |dgt          t          | dg          |                     t          | dg          !t          |dgt          | dg                     |S )Nauth_config
authConfigenable_widgetenableWidget)r   r   r$   r!   s      r#   _GoogleMaps_to_mldevr     s     !)	+''3	T+??KK   
+())5^$d;8I&J&JKKK	r%   c                 R   i }t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          t          d          t          | dg          !t          |dgt          | dg                     |S )	Nsearch_typessearchTypesblocking_confidencez=blocking_confidence parameter is not supported in Gemini API.exclude_domainsz9exclude_domains parameter is not supported in Gemini API.time_range_filtertimeRangeFilterr   r!   s      r#   _GoogleSearch_to_mldevr     s     !)	+'((4]OT+7G%H%HIII	+-.//;
G   
+)*++7
C   
++,--9%&[;N:O(P(P   
r%   c                     i }t          | dg          "t          |ddgt          | dg                     t          | dg          "t          |ddgt          | dg                     |S N	page_size_querypageSize
page_token	pageTokenr8   r!   s      r#   "_ListCachedContentsConfig_to_mldevr          !)	+}%%1*-tK+/O/O   
+~&&2	;[<.))   
r%   c                     i }t          | dg          "t          |ddgt          | dg                     t          | dg          "t          |ddgt          | dg                     |S r   r8   r!   s      r#   #_ListCachedContentsConfig_to_vertexr   #  r   r%   c                 j    i }t          | dg          t          t          | dg          |           |S Nr`   )r   r   r!   s      r#   &_ListCachedContentsParameters_to_mldevr   8  s=     !)	+z"".&tK('D'DiPPP	r%   c                 j    i }t          | dg          t          t          | dg          |           |S r   )r   r   r!   s      r#   '_ListCachedContentsParameters_to_vertexr   C  sF     !)	+z"".'[8*%%y   
r%   c           	      J   i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          +t          |dgd t          | dg          D                        |S )Nrr   rs   nextPageTokennext_page_tokencachedContentscached_contentsc                     g | ]}|S r0   r0   r3   r4   s     r#   r5   z:_ListCachedContentsResponse_from_mldev.<locals>.<listcomp>a      @@@$@@@r%   r8   r!   s      r#   &_ListCachedContentsResponse_from_mldevr   P       !)	+)*++7'(${=N<O*P*P   
+())5&'kO;L)M)MNNN	+()**6	@@${-=,>??@@@   
r%   c           	      J   i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          +t          |dgd t          | dg          D                        |S )Nrr   rs   r   r   r   r   c                     g | ]}|S r0   r0   r   s     r#   r5   z;_ListCachedContentsResponse_from_vertex.<locals>.<listcomp>x  r   r%   r8   r!   s      r#   '_ListCachedContentsResponse_from_vertexr   g  r   r%   c           
         i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          /t          |dgt          t          | dg          |                     t          | d	g          /t          |d
gt          t          | d	g          |                     t          | dg          !t          |dgt          | dg                     t          | dg          /t          |dgt	          t          | dg          |                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     |S )Nmedia_resolutionmediaResolutioncode_execution_resultcodeExecutionResultexecutable_codeexecutableCode	file_datafileDatafunction_callfunctionCallfunction_responsefunctionResponseinline_data
inlineDatatextthoughtthought_signaturethoughtSignaturevideo_metadatavideoMetadata	tool_calltoolCalltool_responsetoolResponsepart_metadatapartMetadata)r   r   r{   r   r,   r!   s      r#   r1   r1   ~  s]    !)	+*+,,8%&[;M:N(O(O   
+/011=	[2344   
+)*++7%&[;L:M(N(NOOO	+}%%1	4k];;YGG   
+())5	tK/1BCCYOO   
++,--9	[./00   
+''3	tK-999EE   
+x  ,VHd;99:::	+	{##/YKkI;!?!?@@@	++,--9	[./00   
+()**6_%tK:J9K'L'LMMM	+}%%1ZL${[M"B"BCCC	+())5^$d;8I&J&JKKK	+())5^$d;8I&J&JKKK	r%   c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | d	g          !t          |d
gt          | d	g                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          t          d          t          | dg          t          d          |S )Nr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   zItool_call parameter is not supported in Gemini Enterprise Agent Platform.r   zMtool_response parameter is not supported in Gemini Enterprise Agent Platform.r   zMpart_metadata parameter is not supported in Gemini Enterprise Agent Platform.r   r!   s      r#   r=   r=     s    !)	+*+,,8%&[;M:N(O(O   
+/011=	[2344   
+)*++7%&[;L:M(N(NOOO	+}%%1ZL${[M"B"BCCC	+())5^$d;8I&J&JKKK	++,--9	[./00   
+''3\ND}o$F$FGGG	+x  ,VHd;99:::	+	{##/YKkI;!?!?@@@	++,--9	[./00   
+()**6_%tK:J9K'L'LMMM	+}%%1
	  
 
+())5
	  
 
+())5
	  
 
r%   c           
      R   i }t          | dg          !t          |dgt          | dg                     t          | dg          /t          |dgt          t          | dg          |                     t          | dg          !t          |dgt          | dg                     |S )Nretrieval_configretrievalConfigfunction_calling_configfunctionCallingConfig$include_server_side_tool_invocations includeServerSideToolInvocations)r   r   r   r!   s      r#   rR   rR     s     !)	+*+,,8%&[;M:N(O(O   
+1233?	 !'89::I	
 	
   
+>?@@L	+,[ABCC   
r%   c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          t          d          |S )Nr   r   r   r   r   zdinclude_server_side_tool_invocations parameter is not supported in Gemini Enterprise Agent Platform.r   r!   s      r#   rZ   rZ   0  s     !)	+*+,,8%&[;M:N(O(O   
+1233?	 ![4566   
+>?@@L
	-  
 
r%   c           
         i }t          | dg          t          d          t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          /t          |dgt          t          | dg          |                     t          | d	g          /t          |d
gt	          t          | d	g          |                     t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          +t          |dgd t          | dg          D                        t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          !t          |dgt          | dg                     t          | dg          +t          |dgd t          | dg          D                        |S )N	retrievalz3retrieval parameter is not supported in Gemini API.computer_usecomputerUsefile_search
fileSearchgoogle_searchgoogleSearchgoogle_maps
googleMapscode_executioncodeExecutionenterprise_web_searchz?enterprise_web_search parameter is not supported in Gemini API.function_declarationsfunctionDeclarationsc                     g | ]}|S r0   r0   r   s     r#   r5   z"_Tool_to_mldev.<locals>.<listcomp>r  s    GGG$GGGr%   google_search_retrievalgoogleSearchRetrievalparallel_ai_searchz<parallel_ai_search parameter is not supported in Gemini API.url_context
urlContextmcp_servers
mcpServersc                     g | ]}|S r0   r0   r   s     r#   r5   z"_Tool_to_mldev.<locals>.<listcomp>  s    ===$===r%   )r   r    r   r   r   r!   s      r#   rK   rK   J  s    !)	+}%%1
J
K
KK	+'((4]OT+7G%H%HIII	+''3\ND}o$F$FGGG	+())5	tK/1BCCYOO   
+''3	T+??KK   
+()**6_%tK:J9K'L'LMMM	+/011=
I   
+/011=	 GG${-D,EFFGGG   
+1233?	 ![4566   
+,-..:
F   
+''3\ND}o$F$FGGG	+''3	==${]O<<===   
r%   c           	         i t          | dg          !t          dgt          | dg                     t          | dg          !t          dgt          | dg                     t          | dg          t          d          t          | dg          !t          dgt          | dg                     t          | dg          !t          d	gt          | dg                     t          | d
g          !t          dgt          | d
g                     t          | dg          !t          dgt          | dg                     t          | dg          -t          dgfdt          | dg          D                        t          | dg          !t          dgt          | dg                     t          | dg          !t          dgt          | dg                     t          | dg          !t          dgt          | dg                     t          | dg          t          d          S )Nr   r   r   r   zKfile_search parameter is not supported in Gemini Enterprise Agent Platform.r   r   r   r   r   r   r   enterpriseWebSearchr   r   c                 0    g | ]}t          |          S r0   )r   r2   s     r#   r5   z#_Tool_to_vertex.<locals>.<listcomp>  s3     	
 	
 	
 +4;;	
 	
 	
r%   r   r   r   parallelAiSearchr   r   r   zKmcp_servers parameter is not supported in Gemini Enterprise Agent Platform.r   r!   s     @r#   rW   rW     s    !)	+}%%1[M4k]#C#CDDD	+'((4]OT+7G%H%HIII	+''3
	  
 
+())5^$d;8I&J&JKKK	+''3\ND}o$F$FGGG	+()**6_%tK:J9K'L'LMMM	+/011=	[2344   
+/011=	 	
 	
 	
 	
[+B*CDD	
 	
 	
   
+1233?	 ![4566   
+,-..:	[/011   
+''3\ND}o$F$FGGG	+''3
	  
 
r%   c                     i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     |S NrA   rB   rC   r8   r!   s      r#   #_UpdateCachedContentConfig_to_mldevr    s     !)	+w+kE7!;!;<<<	+''3[=/(J(JKKK	r%   c                     i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     |S r  r8   r!   s      r#   $_UpdateCachedContentConfig_to_vertexr    r  r%   c                     i }t          |dg          5t          |ddgt          j        | t          |dg                               t          |dg          t	          t          |dg          |           |S Nrh   ri   r`   )r   r   rO   rk   r  rb   s       r#   '_UpdateCachedContentParameters_to_mldevr	    s    
 !)	+x  ,		
Dvh,G,GHH   
+z"".'[8*%%y   
r%   c                     i }t          |dg          5t          |ddgt          j        | t          |dg                               t          |dg          t	          t          |dg          |           |S r  )r   r   rO   rk   r  rb   s       r#   (_UpdateCachedContentParameters_to_vertexr    s    
 !)	+x  ,		
Dvh,G,GHH   
+z"".([8*%%y   
r%   c                   n   e Zd Zdddedeej                 dej        fdZdddedeej	                 dej        fdZ
dddedeej                 dej        fd	Zdddedeej                 dej        fd
Zdddeej                 dej        fdZdddeej                 deej                 fdZdS )CachesNr`   r_   r`   r   c                   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d|||          }	|	j        si nt#          j        |	j                  }
t           j                            |
t+          |dd          rDdt+          |j
        d	d          t+          |j
        d
d          t+          |j
        dd          dini           }| j                            |           |S )a  Creates a cached contents resource.

    Usage:

    .. code-block:: python

      contents = ... // Initialize the content to cache.
      response = client.caches.create(
          model= ... // The publisher model id
          contents=contents,
          config={
              'display_name': 'test cache',
              'system_instruction': 'What is the sum of the two pdfs?',
              'ttl': '86400s',
          },
      )
    r_   r`   ri   r   r   ?r`   Npostresponse_schemar   include_all_fieldsr  r   r  r   kwargs)r   _CreateCachedContentParameters_api_clientvertexaire   get
format_maprc   r   popr`   http_optionsr	   convert_to_dictencode_unserializable_typesrequestbodyjsonloadsCachedContent_from_responsegetattr_verify_responseselfr_   r`   parameter_modelrequest_dictrequest_url_dictpathquery_paramsr  r   response_dictreturn_values               r#   createzCaches.create  s`   0 :  O    =

O l &))&11	  **+;<<<

O l &))&11	  **+;<<##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL''lL H 'mJBBHM1J1JM&55 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! 6  L& 	%%l333r%   rh   c                   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d|||          }	|	j        si nt#          j        |	j                  }
t           j                            |
t+          |dd          rDdt+          |j
        d	d          t+          |j
        d
d          t+          |j
        dd          dini           }| j                            |           |S )zGets cached content configurations.

    .. code-block:: python

      client.caches.get(name= ... ) // The server-generated resource name.
    rh   r`   ri   {name}r   r  r`   Nr  r  r   r  r  r  )r   _GetCachedContentParametersr  r  r   r  r  r   r   r  r`   r  r	   r  r   r!  r"  r#  r$  r%  r&  r'  r(  r*  rh   r`   r+  r,  r-  r.  r/  r  r   r0  r1  s               r#   r  z
Caches.getz  sY    7  O   :

O l &))&11	 ""#3449

O l &))&11	 ""#344##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL''t\<PPH&mJBBHM1J1JM&55 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! 6  L& 	%%l333r%   c                   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d|||          }	|	j        si nt#          j        |	j                  }
| j        j        rt'          |
          }
| j        j        st)          |
          }
t           j                            |
t/          |dd          rDdt/          |j
        d	d          t/          |j
        d
d          t/          |j
        dd          dini           }t          j        |	j                  |_        | j                            |           |S )zDeletes cached content.

    Usage:

    .. code-block:: python

      client.caches.delete(name= ... ) // The server-generated resource name.
    r4  ri   r5  r   r  r`   Ndeleter  r   r  r  r  headers)r   _DeleteCachedContentParametersr  r  ro   r  r  rl   r   r  r`   r  r	   r  r   r!  r"  r#  r$  rw   rt   DeleteCachedContentResponser&  r'  HttpResponser;  rs   r(  r7  s               r#   r9  zCaches.delete  s    :  O   =

O l &))&11	 ""#344<

O l &))&11	 ""#344##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL''$l H 'mJBBHM1J1JM  N>}MMm$ M=mLLm4CC ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! D  L$ &+%7 & & &L" 	%%l333r%   c                   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d|||          }	|	j        si nt#          j        |	j                  }
t           j                            |
t+          |dd          rDdt+          |j
        d	d          t+          |j
        d
d          t+          |j
        dd          dini           }| j                            |           |S )zUpdates cached content configurations.

    .. code-block:: python

      response = client.caches.update(
          name= ... // The server-generated resource name.
          config={
              'ttl': '7600s',
          },
      )
    r4  ri   r5  r   r  r`   Npatchr  r   r  r  r  )r   _UpdateCachedContentParametersr  r  r  r  r  r	  r   r  r`   r  r	   r  r   r!  r"  r#  r$  r%  r&  r'  r(  r7  s               r#   updatezCaches.update&  s`   $ :  O   =

O l &))&11	 ""#344<

O l &))&11	 ""#344##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL''|\ H 'mJBBHM1J1JM&55 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! 6  L& 	%%l333r%   c                   t          j        |          }| j        j        r?t	          |          }|                    d          }|rd                    |          }nAd}n>t          |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd            d }|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d|||          }|j        si nt#          j        |j                  }	| j        j        rt'          |	          }	| j        j        st)          |	          }	t           j                            |	t/          |dd           rDdt/          |j
        dd           t/          |j
        d	d           t/          |j
        d
d           dini           }
t          j        |j                  |
_        | j                            |
           |
S Nr  ri   r   r   r  r`   r  r  r   r  r  r  r:  )r   _ListCachedContentsParametersr  r  r   r  r  r   r   r  r`   r  r	   r  r   r!  r"  r#  r$  r   r   ListCachedContentsResponser&  r'  r>  r;  rs   r(  r*  r`   r+  r,  r-  r.  r/  r  r   r0  r1  s              r#   _listzCaches._list}  s    9  O    <_MMl%))&11	  **+;<<;OLLl%))&11	  **+;<<##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL''t\<PPH&mJBBHM1J1JM  M=mLLm$ L<]KKm3BB ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! C  L$ &+%7 & & &L" 	%%l333r%   c                \    | j         }t          d||                      |          |          S )a  Lists cached contents.

    Args:
      config (ListCachedContentsConfig): Optional configuration for the list
        request.

    Returns:
      A Pager object that contains one page of cached contents. When iterating
      over
      the pager, it automatically fetches the next page if there are more.

    Usage:

    .. code-block:: python
      for cached_content in client.caches.list():
        print(cached_content.name)
    r   r  )rH  r   r*  r`   list_requests      r#   listzCaches.list  s7    * :L

&
!!	  r%   )__name__
__module____qualname__strr   r   CreateCachedContentConfigOrDictr%  r2  GetCachedContentConfigOrDictr  DeleteCachedContentConfigOrDictr=  r9  UpdateCachedContentConfigOrDictrB  ListCachedContentsConfigOrDictrF  rH  r   rL  r0   r%   r#   r  r    s        AE	[ [ [ [ u<=	[
 [ [ [ [B >B	N N N N u9:	N
 N N N Nh AE	Z Z Z Z u<=	Z
 (Z Z Z Z@ AE	U U U U u<=	U
 U U U Up IMG G G DEG'G G G GT IM   DEU !     r%   r  c                   n   e Zd Zdddedeej                 dej        fdZdddedeej	                 dej        fdZ
dddedeej                 dej        fd	Zdddedeej                 dej        fd
Zdddeej                 dej        fdZdddeej                 deej                 fdZdS )AsyncCachesNr  r_   r`   r   c                  K   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d|||           d{V }	|	j        si nt#          j        |	j                  }
t           j                            |
t+          |dd          rDdt+          |j
        d	d          t+          |j
        d
d          t+          |j
        dd          dini           }| j                            |           |S )a  Creates a cached contents resource.

    Usage:

    .. code-block:: python

      contents = ... // Initialize the content to cache.
      response = await client.aio.caches.create(
          model= ... // The publisher model id
          contents=contents,
          config={
              'display_name': 'test cache',
              'system_instruction': 'What is the sum of the two pdfs?',
              'ttl': '86400s',
          },
      )
    r  ri   r   r   r  r`   Nr  r  r   r  r  r  )r   r  r  r  re   r  r  rc   r   r  r`   r  r	   r  r   async_requestr"  r#  r$  r%  r&  r'  r(  r)  s               r#   r2  zAsyncCaches.create  s     0 :  O    =

O l &))&11	  **+;<<<

O l &))&11	  **+;<<##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL%33lL       H 'mJBBHM1J1JM&55 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! 6  L& 	%%l333r%   rh   c                  K   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d|||           d{V }	|	j        si nt#          j        |	j                  }
t           j                            |
t+          |dd          rDdt+          |j
        d	d          t+          |j
        d
d          t+          |j
        dd          dini           }| j                            |           |S )zGets cached content configurations.

    .. code-block:: python

      await client.aio.caches.get(name= ... ) // The server-generated resource
      name.
    r4  ri   r5  r   r  r`   Nr  r  r   r  r  r  )r   r6  r  r  r   r  r  r   r   r  r`   r  r	   r  r   rY  r"  r#  r$  r%  r&  r'  r(  r7  s               r#   r  zAsyncCaches.getC  s      7  O   :

O l &))&11	 ""#3449

O l &))&11	 ""#344##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL%33t\<       H 'mJBBHM1J1JM&55 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! 6  L& 	%%l333r%   c                  K   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d|||           d{V }	|	j        si nt#          j        |	j                  }
| j        j        rt'          |
          }
| j        j        st)          |
          }
t           j                            |
t/          |dd          rDdt/          |j
        d	d          t/          |j
        d
d          t/          |j
        dd          dini           }t          j        |	j                  |_        | j                            |           |S )zDeletes cached content.

    Usage:

    .. code-block:: python

      await client.aio.caches.delete(name= ... ) // The server-generated
      resource name.
    r4  ri   r5  r   r  r`   Nr9  r  r   r  r  r  r:  )r   r<  r  r  ro   r  r  rl   r   r  r`   r  r	   r  r   rY  r"  r#  r$  rw   rt   r=  r&  r'  r>  r;  rs   r(  r7  s               r#   r9  zAsyncCaches.delete  s       :  O   =

O l &))&11	 ""#344<

O l &))&11	 ""#344##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL%33$l       H 'mJBBHM1J1JM  N>}MMm$ M=mLLm4CC ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! D  L$ &+%7 & & &L" 	%%l333r%   c                  K   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d|||           d{V }	|	j        si nt#          j        |	j                  }
t           j                            |
t+          |dd          rDdt+          |j
        d	d          t+          |j
        d
d          t+          |j
        dd          dini           }| j                            |           |S )zUpdates cached content configurations.

    .. code-block:: python

      response = await client.aio.caches.update(
          name= ... // The server-generated resource name.
          config={
              'ttl': '7600s',
          },
      )
    r4  ri   r5  r   r  r`   Nr@  r  r   r  r  r  )r   rA  r  r  r  r  r  r	  r   r  r`   r  r	   r  r   rY  r"  r#  r$  r%  r&  r'  r(  r7  s               r#   rB  zAsyncCaches.update  s     $ :  O   =

O l &))&11	 ""#344<

O l &))&11	 ""#344##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL%33|\       H 'mJBBHM1J1JM&55 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! 6  L& 	%%l333r%   c                  K   t          j        |          }| j        j        r?t	          |          }|                    d          }|rd                    |          }nAd}n>t          |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd            d }|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d|||           d {V }|j        si nt#          j        |j                  }	| j        j        rt'          |	          }	| j        j        st)          |	          }	t           j                            |	t/          |dd           rDdt/          |j
        dd           t/          |j
        d	d           t/          |j
        d
d           dini           }
t          j        |j                  |
_        | j                            |
           |
S rD  )r   rE  r  r  r   r  r  r   r   r  r`   r  r	   r  r   rY  r"  r#  r$  r   r   rF  r&  r'  r>  r;  rs   r(  rG  s              r#   rH  zAsyncCaches._listJ  s      9  O    <_MMl%))&11	  **+;<<;OLLl%))&11	  **+;<<##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL%33t\<       H 'mJBBHM1J1JM  M=mLLm$ L<]KKm3BB ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! C  L$ &+%7 & & &L" 	%%l333r%   c                l   K   | j         }t          d||                      |           d{V |          S )a  Lists cached contents asynchronously.

    Args:
      config (ListCachedContentsConfig): Optional configuration for the list
        request.

    Returns:
      A Pager object that contains one page of cached contents. When iterating
      over
      the pager, it automatically fetches the next page if there are more.

    Usage:

    .. code-block:: python
      async for cached_content in await client.aio.caches.list():
        print(cached_content.name)
    r   r  N)rH  r   rJ  s      r#   rL  zAsyncCaches.list  sM      * :Ljjj''''''''	  r%   )rM  rN  rO  rP  r   r   rQ  r%  r2  rR  r  rS  r=  r9  rT  rB  rU  rF  rH  r   rL  r0   r%   r#   rW  rW    s        AE	[ [ [ [ u<=	[
 [ [ [ [B >B	Q Q Q Q u9:	Q
 Q Q Q Qn AE	[ [ [ [ u<=	[
 ([ [ [ [B AE	U U U U u<=	U
 U U U Up IMI I I DEI'I I I IX IM   DE%%&     r%   rW  )N)Cr#  loggingtypingr   r   r   urllib.parser    r   r	   r
   rO   r   r  r   r   r   r   r   pagersr   r   	getLoggerloggerdictrP  objectr$   r,   r9   r?   rS   r[   rc   re   rl   ro   rt   rw   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r1   r=   rR   rZ   rK   rW   r  r  r	  r  
BaseModuler  rW  r0   r%   r#   <module>ri     s=  $   ' ' ' ' ' ' ' ' ' ' " " " " " "                               & & & & & & . . . . . . . . . . . . % % % % % % % %		0	1	1
 /3 tCH~v-.DcN+ 
#s(^   H /3 tCH~v-.DcN+ 
#s(^   & /3 tCH~v-.DcN+ 
#s(^   . /3 tCH~v-.DcN+ 
#s(^   . /36 6tCH~v-.6DcN+6 
#s(^6 6 6 6v /3: :tCH~v-.:DcN+: 
#s(^: : : :@ /3 tCH~v-. DcN+ 
#s(^	   0 /3 tCH~v-. DcN+ 
#s(^	   0 /3 tCH~v-. DcN+ 
#s(^	   & /3 tCH~v-. DcN+ 
#s(^	   $ /3
 
tCH~v-.
DcN+
 
#s(^
 
 
 
 /3
 
tCH~v-.
DcN+
 
#s(^
 
 
 
 /3 tCH~v-.DcN+ 
#s(^   & /3 tCH~v-.DcN+ 
#s(^   2 /3 tCH~v-.DcN+ 
#s(^   4 /3% %tCH~v-.%DcN+% 
#s(^% % % %V /3 tCH~v-. DcN+ 
#s(^	   & /3 tCH~v-. DcN+ 
#s(^	   $ /3 tCH~v-.DcN+ 
#s(^   ( /3 tCH~v-.DcN+ 
#s(^   8 /3 tCH~v-.DcN+ 
#s(^   . /3 tCH~v-.DcN+ 
#s(^   . /3 tCH~v-.DcN+ 
#s(^    /3
 
tCH~v-.
DcN+
 
#s(^
 
 
 
 /3 tCH~v-.DcN+ 
#s(^   2 /3 tCH~v-.DcN+ 
#s(^   2 /3I ItCH~v-.IDcN+I 
#s(^I I I I\ /3F FtCH~v-.FDcN+F 
#s(^F F F FV /3 tCH~v-.DcN+ 
#s(^   > /3 tCH~v-.DcN+ 
#s(^   8 /3A AtCH~v-.ADcN+A 
#s(^A A A AL /3B BtCH~v-.BDcN+B 
#s(^B B B BN /3 tCH~v-.DcN+ 
#s(^   " /3 tCH~v-.DcN+ 
#s(^   $ /3 tCH~v-. DcN+ 
#s(^	   0 /3 tCH~v-. DcN+ 
#s(^	   *F F F F F[# F F FRL L L L L+( L L L L Lr%   