+
    i/                        R t ^ RIt^ RIt^ RIHtHtHtHt ^ RIH	t	 ^RI
Ht ^RI
Ht ^RI
Ht ^RI
Ht ]P                   ! R4      tR	 R
 ltRR R llt ! R R]P(                  4      t ! R R]P(                  4      tR# )z&[Experimental] Auth Tokens API client.N)AnyDictListOptional)	urlencode)_api_module)_common)_tokens_converters)typeszgoogle_genai.tokensc                D    V ^8  d   QhR\         P                  R\        /# )   setupreturn)r   
StringDictstr)formats   "f/Users/igloo/.openclaw/workspace/scratch/fb_ad_env/lib/python3.14/site-packages/google/genai/tokens.py__annotate__r      s       G.. 3     c                   . pV P                  4        F[  w  r#\        V\        4      '       d-   V'       d%   VP                  4        Uu. uF	  qB RV 2NK  	  ppMV.pVP	                  V4       K]  	  RP                  V4      # u upi )zReturn field_masks.,)items
isinstancedictkeysextendjoin)r   fieldskvkkfields   &     r   _get_field_masksr#      su    &kkmda!Tq%&VVX.XrAbT{Xe.ece
MM%  
&	 /s   Bc                    V ^8  d   QhR\         P                  R\        \        P                  ,          R\         P                  /# )r   request_dictconfigr   )r   r   r   r
   CreateAuthTokenConfigOrDict)r   s   "r   r   r   ,   sB     B B$$BU667B Br   c                   V P                  R4      pV'       Ed   VP                  R4      '       Ed   VP                  R4      V R&   \        V R,          4      p\        V\        4      '       d+   VP                  R4      e   VP                  R4      '       dA   \        V\        P
                  4      '       d'   VP                  e   VP                  '       g   W0R&   EMp\        V\        4      '       d   VP                  R4      e/   \        V\        P
                  4      '       d#   VP                  f   V P                  RR4       EMV R,          '       d   V P                  R4      p\        P                  ! 4       P                  4       P                  4       pV'       d)   . pV F  pWu9   d   RV 2pVP                  V4       K!  	  M. pV'       d    VR,           RP                  V4      ,           MTV R&   MUV P                  RR4       MBV P                  R. 4      pRP                  V4      pV'       d   WR&   MV P                  RR4       V P                  R4      '       g   V P                  RR4       V # )z"Converts bidiGenerateContentSetup.bidiGenerateContentSetupr   lock_additional_fieldsN	fieldMaskzgenerationConfig.r   )getr#   r   r   r
   CreateAuthTokenConfigr*   popGenerationConfig
model_dumpr   appendr   )	r%   r&   
bidi_setup
field_maskadditional_fields_listgeneration_config_listfield_mask_listr"   field_mask_strs	   &&       r   "_convert_bidi_setup_to_token_setupr8   ,   s   
  :;*ZJNN7++ 0:~~g/FL+, ",/I"JKJ 	64  JJ/0<

344656677))5--- #-;64  JJ/08656677))1 {D)	k	"	"4@4D4D
5  %557BBDIIK	+E,'w/E

 
 
' ,
   s
SXXo6
6 ; {D)!!+r2JXXj)N"0;{D)			4	5	5/6	r   c                   h   a  ] tR t^qt o Rt]P                  ! R4      RR/V 3R lR ll4       tRtV t	R# )Tokensz^[Experimental] Auth Tokens API client.

This class provides methods for creating auth tokens.
[The SDK's token creation implementation is experimental, and may change in future versions.r&   Nc                ^   < V ^8  d   QhRS[ S[P                  ,          RS[P                  /# r   r&   r   r   r
   r'   	AuthToken)r   __classdict__s   "r   r   Tokens.__annotate__{   s0     O O A ABOOr   c                  \         P                  ! VR7      pV P                  P                  '       d   \	        R4      h\
        P                  ! V P                  V4      pVP                  R4      pV'       d   RP                  V4      pMRpVP                  R4      pV'       d   V R\        V4       2pVP                  RR4       V'       d   \        W14      pRpVe=   VP                  e/   VP                  P                  e   VP                  P                  p\        P                  ! V4      p\        P                   ! V4      pV P                  P#                  R	WSV4      pVP$                  '       g   / M\&        P(                  ! VP$                  4      p	\         P*                  P-                  WP/                  4       R
7      p
V P                  P1                  V
4       V
# )a  [Experimental] Creates an auth token.

Args:
  config (CreateAuthTokenConfig): Optional configuration for the request.

The CreateAuthTokenConfig's `live_constrained_parameters` attrubite
Can be used to lock the parameters of the live session so they
can't be changed client side. This behavior has two basic modes depending on
whether `lock_additional_fields` is set:

If you do not pass `lock_additional_fields` the entire
`live_constrained_parameters` is locked and can't be changed
by the token's user.

If you set `lock_additional_fields`, then the non-null fields of
`live_constrained_parameters` are locked, and any additional fields
specified in `lock_additional_fields`.

Usage:

.. code-block:: python

  # Case 1: If LiveEphemeralParameters is unset, unlock LiveConnectConfig
  # when using the token in Live API sessions. Each session connection can
  # use a different configuration.

  config = types.CreateAuthTokenConfig(
      uses=10,
      expire_time='2025-05-01T00:00:00Z',
  )
  auth_token = client.tokens.create(config=config)

.. code-block:: python

  # Case 2: If LiveEphemeralParameters is set, lock all fields in
  # LiveConnectConfig when using the token in Live API sessions. For
  # example, changing `output_audio_transcription` in the Live API
  # connection will be ignored by the API.

  auth_token = client.tokens.create(
      config=types.CreateAuthTokenConfig(
          uses=10,
          live_constrained_parameters=types.LiveEphemeralParameters(
              model='gemini-live-2.5-flash-preview',
              config=types.LiveConnectConfig(
                  system_instruction='You are an LLM called Gemini.'
              ),
          ),
      )
  )

.. code-block:: python

  # Case 3: If LiveEphemeralParameters is set and lockAdditionalFields is
  # empty, lock LiveConnectConfig with set fields (e.g.
  # system_instruction in this example) when using the token in Live API
  # sessions.
  auth_token = client.tokens.create(
      config=types.CreateAuthTokenConfig(
          uses=10,
          live_constrained_parameters=types.LiveEphemeralParameters(
              config=types.LiveConnectConfig(
                  system_instruction='You are an LLM called Gemini.'
              ),
          ),
          lock_additional_fields=[],
      )
  )

.. code-block:: python

  # Case 4: If LiveEphemeralParameters is set and lockAdditionalFields is
  # set, lock LiveConnectConfig with set and additional fields (e.g.
  # system_instruction, temperature in this example) when using the token
  # in Live API sessions.
  auth_token = client.tokens.create(
      config=types.CreateAuthTokenConfig(
          uses=10,
          live_constrained_parameters=types.LiveEphemeralParameters(
              model='gemini-live-2.5-flash-preview',
              config=types.LiveConnectConfig(
                  system_instruction='You are an LLM called Gemini.'
              ),
          ),
          lock_additional_fields=['temperature'],
      )
  )
r&   =This method is only supported in the Gemini Developer client._urlauth_tokens_query?r&   Npostresponsekwargs)r
   CreateAuthTokenParameters_api_clientvertexai
ValueErrortokens_converters#_CreateAuthTokenParameters_to_mldevr,   
format_mapr   r.   r8   r&   http_optionsr   convert_to_dictencode_unserializable_typesrequestbodyjsonloadsr?   _from_responser0   _verify_responseselfr&   parameter_modelr%   request_url_dictpathquery_paramsrT   rK   response_dictreturn_values   &$         r   createTokens.createw   s   @ 55O    
I  'JJ



l &))&1	''(89##H-LvQy./0d Xt$ 7Ml04L#"".""//;$++88l**<8L66|DL''LH 'mmmBHMM1JM??11'A'A'C 2 L 	%%l3r    
__name__
__module____qualname____firstlineno____doc__r   experimental_warningre   __static_attributes____classdictcell__r@   s   @r   r:   r:   q   s?     
 +OEIO O	Or   r:   c                   h   a  ] tR tRt o Rt]P                  ! R4      RR/V 3R lR ll4       tRtV t	R# )	AsyncTokensi  zq[Experimental] Async Auth Tokens API client.

This class provides asynchronous methods for creating auth tokens.
r;   r&   Nc                ^   < V ^8  d   QhRS[ S[P                  ,          RS[P                  /# r=   r>   )r   r@   s   "r   r   AsyncTokens.__annotate__  s0     S S A ABSSr   c                 "   \         P                  ! VR7      pV P                  P                  '       d   \	        R4      h\
        P                  ! V P                  V4      pVP                  R4      pV'       d   RP                  V4      pMRpVP                  R4      pV'       d   V R\        V4       2pVP                  RR4       \        W14      pRpVe=   VP                  e/   VP                  P                  e   VP                  P                  p\        P                  ! V4      p\        P                   ! V4      pV P                  P#                  R	VVVR
7      G Rj  xL
 pVP$                  '       g   / M\&        P(                  ! VP$                  4      p	\         P*                  P-                  WP/                  4       R7      p
V P                  P1                  V
4       V
#  L5i)a  Creates an auth token asynchronously. Support in v1alpha only.

Args:
  config (CreateAuthTokenConfig): Optional configuration for the request.

Usage:

.. code-block:: python

  client = genai.Client(
      api_key=API_KEY,
      http_options=types.HttpOptions(api_version='v1alpha'),
  )

  auth_token = await client.aio.tokens.create(
      config=types.CreateAuthTokenConfig(
          uses=10,
          live_constrained_parameters=types.LiveEphemeralParameters(
              model='gemini-live-2.5-flash-preview',
              config=types.LiveConnectConfig(
                  system_instruction='You are an LLM called Gemini.'
              ),
          ),
      )
  )
rC   rD   rE   rF   rG   rH   r&   NrI   )rT   rJ   )r
   rM   rN   rO   rP   rQ   rR   r,   rS   r   r.   r8   r&   rT   r   rU   rV   async_requestrX   rY   rZ   r?   r[   r0   r\   r]   s   &$         r   re   AsyncTokens.create  s    D 55O
    
I  'JJ



l &))&1	''(89##H-LvQy./0dXt$ 6lKL04L#"".""//;$++88l**<8L66|DL%%33!	 4  H 'mmmBHMM1JM??11'A'A'C 2 L 	%%l3s&   A8G+;,G+(B=G+%G)&G+<A.G+rg   rh   rq   s   @r   rs   rs     s?     
 +SEIS S	Sr   rs   )N)rm   rY   loggingtypingr   r   r   r   urllib.parser    r   r   r	   rQ   r
   	getLoggerloggerr#   r8   
BaseModuler:   rs   rg   r   r   <module>r      sk     -   , , "   5 			0	1BJY[## Yx]+(( ]r   