+
    i+*                        ^ RI Ht ^ RIt^ RIt^ RIHtHt ^ RIHt ^ RI	H
t
 ^ RI	Ht ^ RIHt ^ RIHt R	tR
t ! R R4      tR# )    )annotationsN)IterableOptional)protos)caching_types)content_types)get_default_cache_client)field_mask_pb2usermodelc                     ] tR t^ tRtR t]R R l4       t]R R l4       t]R R l4       t	]R	 R
 l4       t
]R R l4       t]R R l4       t]R R l4       tR t]t]R R l4       tR t]RRRRRRRRRRRRRR/R R ll4       t]RRRRRRRRRRRRRR/R R  ll4       t]R! R" l4       t]R*R# R$ ll4       tR% R& ltRRRR/R' R( lltR)tR# )+CachedContentzCached content resource.c                    \        4       pRV9  d
   RV,           p\        P                  ! VR7      pVP                  V4      pW@n        R# )zFetches a `CachedContent` resource.

Identical to `CachedContent.get`.

Args:
    name: The resource name referring to the cached content.
cachedContents/nameN)r	   r   GetCachedContentRequestget_cached_content_proto)selfr   clientrequestresponses   &&   n/Users/igloo/.openclaw/workspace/scratch/fb_ad_env/lib/python3.14/site-packages/google/generativeai/caching.py__init__CachedContent.__init__#   sC     *+D($t+D00d;,,W5    c                   V ^8  d   QhRR/#    returnstr )formats   "r   __annotate__CachedContent.__annotate__5   s        c  r   c                	.    V P                   P                  # N)r   r   r   s   &r   r   CachedContent.name4   s    {{r   c                   V ^8  d   QhRR/# r   r#   )r$   s   "r   r%   r&   9   s     ! !s !r   c                	.    V P                   P                  # r(   )r   r   r)   s   &r   r   CachedContent.model8   s    {{   r   c                   V ^8  d   QhRR/# r   r#   )r$   s   "r   r%   r&   =   s     ( (c (r   c                	.    V P                   P                  # r(   )r   display_namer)   s   &r   r0   CachedContent.display_name<   s    {{'''r   c                   V ^8  d   QhRR/# )r    r!   z"protos.CachedContent.UsageMetadatar#   )r$   s   "r   r%   r&   A   s     * * B *r   c                	.    V P                   P                  # r(   )r   usage_metadatar)   s   &r   r4   CachedContent.usage_metadata@   s    {{)))r   c                   V ^8  d   QhRR/# r    r!   zdatetime.datetimer#   )r$   s   "r   r%   r&   E        ' '. 'r   c                	.    V P                   P                  # r(   )r   create_timer)   s   &r   r:   CachedContent.create_timeD       {{&&&r   c                   V ^8  d   QhRR/# r7   r#   )r$   s   "r   r%   r&   I   r8   r   c                	.    V P                   P                  # r(   )r   update_timer)   s   &r   r?   CachedContent.update_timeH   r<   r   c                   V ^8  d   QhRR/# r7   r#   )r$   s   "r   r%   r&   M   r8   r   c                	.    V P                   P                  # r(   )r   expire_timer)   s   &r   rC   CachedContent.expire_timeL   r<   r   c                	   \         P                  ! R V P                   RV P                   RV P                   RR RV P
                  P                   RR RV P                   R	V P                   R
V P                   R24      # )z1            CachedContent(
                name='z',
                model='z!',
                display_name='z"',
                usage_metadata={z*
                    'total_token_count': z,
                }z,
                create_time=z,
                update_time=z,
                expire_time=z
            ))
textwrapdedentr   r   r0   r4   total_token_countr:   r?   rC   r)   s   &r   __str__CachedContent.__str__P   s    yyk "

| $#001 2  #u %**.*=*=*O*O)P Q !--. /!--. /!--. /
 	
r   c                    V ^8  d   QhRRRR/# )r    objz+CachedContent | protos.CachedContent | dictr!   r   r#   )r$   s   "r   r%   r&   c   s      G M r   c                ~    V P                  V 4      p\        P                  ! 4       Vn        VP	                  V4       V# )zKCreates an instance of CachedContent form an object, without calling `get`.)__new__r   r   r   _update)clsrN   r   s   && r   	_from_objCachedContent._from_objb   s3     {{3**,Sr   c                   \        V\        4      '       d   VP                  p\        V\        4      '       g   \	        V4      P                  VRR7      pVP                  4        F  w  r#\        V P                  W#4       K  	  R# )zFUpdates this instance inplace, does not call the API's `update` methodF)including_default_value_fieldsN)
isinstancer   r   dicttypeto_dictitemssetattr)r   updateskeyvalues   &&  r   rQ   CachedContent._updatej   s_    g}--nnG'4((7m++GTY+ZG!--/JCDKK, *r   r0   Nsystem_instructioncontentstoolstool_configttlrC   c               <    V ^8  d   QhRRRRRRRRR	R
RRRRRRRR/	# )r    r   r"   r0   
str | Nonera   #Optional[content_types.ContentType]rb   $Optional[content_types.ContentsType]rc   +Optional[content_types.FunctionLibraryType]rd   &Optional[content_types.ToolConfigType]re    Optional[caching_types.TTLTypes]rC   'Optional[caching_types.ExpireTimeTypes]r!   z!protos.CreateCachedContentRequestr#   )r$   s   "r   r%   r&   v   sp     4P 4P4P !4P @	4P
 74P ;4P <4P .4P =4P 
+4Pr   c                  V'       d   V'       d   \        R4      hRV 9  d
   RV ,           p V'       d   \        V4      ^8  d   \        R4      hV'       d   \        P                  ! V4      p\        P                  ! V4      pV'       d   VP                  4       pV'       d   \        P                  ! V4      pV'       dB   \        P                  ! V4      pVR,          P                  '       g   \        VR,          n        \        P                  ! V4      p\        P                  ! V4      p\        P                  ! V VVVVVVVR7      p	\        P                  ! V	R7      # )z&Prepares a CreateCachedContentRequest.LExclusive arguments: Please provide either `ttl` or `expire_time`, not both./zmodels/z;`display_name` must be no more than 128 unicode characters.r   r0   ra   rb   rc   rd   re   rC   )cached_content)
ValueErrorlenr   
to_contentto_function_libraryto_prototo_tool_configto_contentsrole
_USER_ROLEr   to_optional_ttlto_optional_expire_timer   r   CreateCachedContentRequest)
r   r0   ra   rb   rc   rd   re   rC   	tools_librr   s
   &$$$$$$$  r   _prepare_create_request%CachedContent._prepare_create_requestu   s    ;^  e%EC-3Z[[!.!9!9:L!M!55e<	!**,I'66{CK$00:HB<$$$$.!++C0#;;KH--%1##	
 00OOr   c               <    V ^8  d   QhRRRRRRRRR	R
RRRRRRRR/	# )r    r   r"   r0   rg   ra   rh   rb   ri   rc   rj   rd   rk   re   rl   rC   rm   r!   r   r#   )r$   s   "r   r%   r&      se     0 00 !	0
 @0 70 ;0 <0 .0 =0 
0r   c                   \        4       p	V P                  VVVVVVVVR7      p
V	P                  V
4      p\        P	                  V4      pV# )a  Creates `CachedContent` resource.

Args:
    model: The name of the `model` to use for cached content creation.
           Any `CachedContent` resource can be only used with the
           `model` it was created for.
    display_name: The user-generated meaningful display name
                  of the cached content. `display_name` must be no
                  more than 128 unicode characters.
    system_instruction: Developer set system instruction.
    contents: Contents to cache.
    tools: A list of `Tools` the model may use to generate response.
    tool_config: Config to apply to all tools.
    ttl: TTL for cached resource (in seconds). Defaults to 1 hour.
         `ttl` and `expire_time` are exclusive arguments.
    expire_time: Expiration time for cached resource.
                 `ttl` and `expire_time` are exclusive arguments.

Returns:
    `CachedContent` resource with specified name.
rq   )r	   r   create_cached_contentr   rS   )rR   r   r0   ra   rb   rc   rd   re   rC   r   r   r   results   &&$$$$$$$    r   createCachedContent.create   sa    D *+--%1## . 	
 //8((2r   c                    V ^8  d   QhRRRR/# )r    r   r"   r!   r   r#   )r$   s   "r   r%   r&      s      s } r   c                    \        4       pRV9  d
   RV,           p\        P                  ! VR7      pVP                  V4      p\        P                  V4      pV# )zFetches required `CachedContent` resource.

Args:
    name: The resource name referring to the cached content.

Returns:
    `CachedContent` resource with specified `name`.
r   r   )r	   r   r   r   r   rS   )rR   r   r   r   r   r   s   &&    r   getCachedContent.get   sS     *+D($t+D00d;,,W5((2r   c                    V ^8  d   QhRRRR/# )r    	page_sizezOptional[int]r!   zIterable[CachedContent]r#   )r$   s   "r   r%   r&      s     ! !] !3J !r   c              #     "   \        4       p\        P                  ! VR7      pVP                  V4       F  p\        P                  V4      pVx  K  	  R# 5i)zLists `CachedContent` objects associated with the project.

Args:
    page_size: The maximum number of permissions to return (per page).
    The service may return fewer `CachedContent` objects.

Returns:
    A paginated list of `CachedContent` objects.
)r   N)r	   r   ListCachedContentsRequestlist_cached_contentsr   rS   )rR   r   r   r   rr   s   &&   r   listCachedContent.list   sK      *+22YG$99'BN*44^DN   Cs   AAc                   V ^8  d   QhRR/# )r    r!   Noner#   )r$   s   "r   r%   r&     s       r   c                ~    \        4       p\        P                  ! V P                  R7      pVP	                  V4       R# )z!Deletes `CachedContent` resource.r   N)r	   r   DeleteCachedContentRequestr   delete_cached_content)r   r   r   s   &  r   deleteCachedContent.delete  s/    )+33C$$W-r   c               $    V ^8  d   QhRRRRRR/# )r    re   rl   rC   rm   r!   r   r#   )r$   s   "r   r%   r&     s*     - - .- =	-
 
-r   c               0   \        4       pV'       d   V'       d   \        R4      h\        P                  ! V4      p\        P                  ! V4      p\
        P                  ! V P                  VVR7      p\        P                  ! 4       pV'       d   VP                  P                  R4       M/V'       d   VP                  P                  R4       M\        R4      h\
        P                  ! WER7      pVP                  V4      pV P                  V4       R# )a(  Updates requested `CachedContent` resource.

Args:
    ttl: TTL for cached resource (in seconds). Defaults to 1 hour.
         `ttl` and `expire_time` are exclusive arguments.
    expire_time: Expiration time for cached resource.
                 `ttl` and `expire_time` are exclusive arguments.
ro   )r   re   rC   re   rC   zQBad update name: Only `ttl`  or `expire_time` can be updated for `CachedContent`.)rr   update_maskN)r	   rt   r   r}   r~   r   r   r   r
   	FieldMaskpathsappendUpdateCachedContentRequestupdate_cached_contentrQ   )r   re   rC   r   r]   
field_maskr   
updated_ccs   &$$     r   updateCachedContent.update  s     *+;^  ++C0#;;KH&&#
 $--/
##E*##M2c  337c11':
Z r   )r   )   )__name__
__module____qualname____firstlineno____doc__r   propertyr   r   r0   r4   r:   r?   rC   rK   __repr__classmethodrS   rQ   staticmethodr   r   r   r   r   r   __static_attributes__r#   r   r   r   r       s   ""     ! ! ( ( * * ' ' ' ' ' '
  H 	- 4P $(4P CG	4P
 :>4P >B4P ?C4P 154P @D4P 4Pl 0 $(	0
 CG0 :>0 >B0 ?C0 150 @D0 0d  & ! !"- 15- @D	- -r   r   )
__future__r   datetimerH   typingr   r   google.generativeair   google.generativeai.typesr   r   google.generativeai.clientr	   google.protobufr
   r|   _MODEL_ROLEr   r#   r   r   <module>r      s8    #   % & 3 3 ? *
Z Zr   