
    UEj+	                     h    d Z ddlmZ ddlmZmZmZ ddlmZ ddded	e	d
e
e	ef   dede	dedefdZy)zACode generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.    )Any)	BaseModelTypeAdapterValidationError   )construct_unvalidatedF)lenientvdisc_keyvariantsunknown_cls
union_namer	   returnc                   t        | t              r| S t        | t              r|| vrt        | d| d      | |   }|j	                  |      }|L	 t        |t
              r!t        |t              r|j                  |       S t        |      j                  |       S  ||       S # t        $ r, |r	 t        | |      cY S # t        $ r Y nw xY w ||       cY S w xY w)uX  Parse an open discriminated union value with forward-compatibility.

    Known discriminator values are dispatched to their variant types.
    Unknown discriminator values — or known discriminator values whose
    payload fails variant validation (e.g. a partial variant emitted by a
    newer server) — produce an instance of the fallback class, preserving
    the raw payload for inspection.

    Non-dict values and dicts missing the discriminator deliberately raise
    instead of falling back, so pydantic can try sibling branches of an
    enclosing union (e.g. None in Optional[...]).
    z: expected object with 'z' field)raw)
isinstancer   dict
ValueErrorgettype
issubclassmodel_validater   validate_pythonr   r   	Exception)r
   r   r   r   r   r	   discvariant_clss           U/var/www/html/qr/venv/lib/python3.12/site-packages/google/genai/_gaos/utils/unions.pyparse_open_unionr      s    * !Ya(!"3J<'?zQRRX;D,,t$K
	&+t,K1S"11!44{+;;A>> 1  	&0K@@  1%%	&s<   0B% B% %C1B?<C?	CC
CCCN)__doc__typingr   pydanticr   r   r   serializersr   strr   r   boolr        r   <module>r'      sm   " H  < < . '
' ' 38n	'
 ' ' ' 	'r&   