
    9h^                        S SK r S SKrS SKJr  S SKJr  S SKJr  S SKJ	r	  S SK
JrJr  S SKJrJrJrJrJr  S SKJrJrJrJr  S S	KJr  S
SKJrJrJrJrJrJ r   S SK!J"r"J#r#  S
SK$J%r%  S
SK&J'r'J(r(J)r)J*r*J+r+J,r,J-r-  \S\.\/\0\ Rb                  \2\3\4\54	   r6\\.\4\54   r7 " S S\5      r8S\.S\4S jr9S\S\ S\\.\74   4S jr: " S S\'5      r; " S S\(5      r< " S S\Rz                  5      r>S\.S\\.\74   S\74S jr?S\)S\7S \6S!\+S\64
S" jr@S\)S\7S#\5S \6S!\+4
S$ jrAS\7S\*4S% jrBS&\\.   S'\\.   S\24S( jrCS\7S \6S\\7   4S) jrDS\7S\\.\\.   4   4S* jrES+\.S,\.S\\7   S-\\.\\.   4   4S. jrFS,\.S\\.   4S/ jrGg)0    N)defaultdict)deepcopy)BytesIO)loads)packunpack)DictUnionOptionalSetCallable)schemaless_readerschemaless_writer
repositoryvalidate)load_schema   )_MAGIC_BYTESchematopic_subject_name_strategyRuleModeRuleKindSchemaRegistryClient)SerializationErrorSerializationContext)RuleRegistry)BaseSerializerBaseDeserializerRuleContext	FieldTypeFieldTransformRuleConditionErrorParsedSchemaCachec                   $    \ rS rSrSrS rS rSrg)_ContextStringIO;   z9
Wrapper to allow use of StringIO via 'with' constructs.
c                     U $ N )selfs    iC:\Suresh\moveshuttle\MDcreated\moveengine\venv\Lib\site-packages\confluent_kafka/schema_registry/avro.py	__enter___ContextStringIO.__enter__@   s        c                 $    U R                  5         g)NF)close)r*   argss     r+   __exit___ContextStringIO.__exit__C   s    

r.   r)   N)__name__
__module____qualname____firstlineno____doc__r,   r2   __static_attributes__r)   r.   r+   r%   r%   ;   s    r.   r%   
schema_strreturnc                 j    U R                  5       n U S   S:w  a  U S   S:w  a  SU -   S-   n [        U SS9$ )z
Instantiate a Schema instance from a declaration string.

Args:
    schema_str (str): Avro Schema declaration.

.. _Schema declaration:
    https://avro.apache.org/docs/current/spec.html#schemas

Returns:
    Schema: A Schema instance.
r   {[z{"type":}AVRO)schema_type)stripr   )r:   s    r+   _schema_loadsrC   H   sG     !!#J !}
1 4*,s2
*&11r.   schemaschema_registry_clientc                 >   0 nU R                   b  U R                    H}  nUR                  UR                  UR                  S5      n[	        UR
                  U5      n[        UR
                  R                  US9nUR                  U5        XbUR                  '   M     U$ )z
Resolves named schemas referenced by the provided schema recursively.
:param schema: Schema to resolve named schemas for.
:param schema_registry_client: SchemaRegistryClient to use for retrieval.
:return: named_schemas dict.
Tnamed_schemas)

referencesget_versionsubjectversion_resolve_named_schemarD   parse_schema_with_repor:   updatename)rD   rE   rH   refreferenced_schemaref_named_schemasparsed_schemas          r+   rM   rM   _   s     M$$$C 6 B B3;;PSP[P[]a b 56G6N6NPf g2!((33CTVM  !23&3#((# % r.   c                      ^  \ rS rSrSr/ SQrSSSSS\S.r     SS\S	\	\
\S4   S
\\\\/\4      S\\   S\\   S\\   4U 4S jjjrSS\S\\   S\\   4S jjrS\S\4S jrSrU =r$ )AvroSerializert   aA  
Serializer that outputs Avro binary encoded data with Confluent Schema Registry framing.

Configuration properties:

+-----------------------------+----------+--------------------------------------------------+
| Property Name               | Type     | Description                                      |
+=============================+==========+==================================================+
|                             |          | If True, automatically register the configured   |
| ``auto.register.schemas``   | bool     | schema with Confluent Schema Registry if it has  |
|                             |          | not previously been associated with the relevant |
|                             |          | subject (determined via subject.name.strategy).  |
|                             |          |                                                  |
|                             |          | Defaults to True.                                |
+-----------------------------+----------+--------------------------------------------------+
|                             |          | Whether to normalize schemas, which will         |
| ``normalize.schemas``       | bool     | transform schemas to have a consistent format,   |
|                             |          | including ordering properties and references.    |
+-----------------------------+----------+--------------------------------------------------+
|                             |          | Whether to use the given schema ID for           |
| ``use.schema.id``           | int      | serialization.                                   |
|                             |          |                                                  |
+-----------------------------+----------+--------------------------------------------------+
|                             |          | Whether to use the latest subject version for    |
| ``use.latest.version``      | bool     | serialization.                                   |
|                             |          |                                                  |
|                             |          | WARNING: There is no check that the latest       |
|                             |          | schema is backwards compatible with the object   |
|                             |          | being serialized.                                |
|                             |          |                                                  |
|                             |          | Defaults to False.                               |
+-----------------------------+----------+--------------------------------------------------+
|                             |          | Whether to use the latest subject version with   |
| ``use.latest.with.metadata``| dict     | the given metadata.                              |
|                             |          |                                                  |
|                             |          | WARNING: There is no check that the latest       |
|                             |          | schema is backwards compatible with the object   |
|                             |          | being serialized.                                |
|                             |          |                                                  |
|                             |          | Defaults to None.                                |
+-----------------------------+----------+--------------------------------------------------+
|                             |          | Callable(SerializationContext, str) -> str       |
|                             |          |                                                  |
| ``subject.name.strategy``   | callable | Defines how Schema Registry subject names are    |
|                             |          | constructed. Standard naming strategies are      |
|                             |          | defined in the confluent_kafka.schema_registry   |
|                             |          | namespace.                                       |
|                             |          |                                                  |
|                             |          | Defaults to topic_subject_name_strategy.         |
+-----------------------------+----------+--------------------------------------------------+

Schemas are registered against subject names in Confluent Schema Registry that
define a scope in which the schemas can be evolved. By default, the subject name
is formed by concatenating the topic name with the message field (key or value)
separated by a hyphen.

i.e. {topic name}-{message field}

Alternative naming strategies may be configured with the property
``subject.name.strategy``.

Supported subject name strategies:

+--------------------------------------+------------------------------+
| Subject Name Strategy                | Output Format                |
+======================================+==============================+
| topic_subject_name_strategy(default) | {topic name}-{message field} |
+--------------------------------------+------------------------------+
| topic_record_subject_name_strategy   | {topic name}-{record name}   |
+--------------------------------------+------------------------------+
| record_subject_name_strategy         | {record name}                |
+--------------------------------------+------------------------------+

See `Subject name strategy <https://docs.confluent.io/current/schema-registry/serializer-formatter.html#subject-name-strategy>`_ for additional details.

Note:
    Prior to serialization, all values must first be converted to
    a dict instance. This may handled manually prior to calling
    :py:func:`Producer.produce()` or by registering a `to_dict`
    callable with AvroSerializer.

    See ``avro_producer.py`` in the examples directory for example usage.

Note:
   Tuple notation can be used to determine which branch of an ambiguous union to take.

   See `fastavro notation <https://fastavro.readthedocs.io/en/latest/writer.html#using-the-tuple-notation-to-specify-which-branch-of-a-union-to-take>`_

Args:
    schema_registry_client (SchemaRegistryClient): Schema Registry client instance.

    schema_str (str or Schema):
        Avro `Schema Declaration. <https://avro.apache.org/docs/current/spec.html#schemas>`_
        Accepts either a string or a :py:class:`Schema` instance. Note that string
        definitions cannot reference other schemas. For referencing other schemas,
        use a :py:class:`Schema` instance.

    to_dict (callable, optional): Callable(object, SerializationContext) -> dict. Converts object to a dict.

    conf (dict): AvroSerializer configuration.
)_known_subjects_parsed_schema_schema
_schema_id_schema_name_to_dict_parsed_schemasTFN)auto.register.schemasnormalize.schemasuse.schema.iduse.latest.versionuse.latest.with.metadatasubject.name.strategyrE   r:   to_dictconf	rule_confrule_registryc                   > [         TU ]  5         [        U[        5      (       a  [	        U5      nO[        U[
        5      (       a  UnOS nXl        S U l        U(       a  UO[        R                  " 5       U l
        [        5       U l        [        5       U l        Ub  [        U5      (       d  [!        S5      eX0l        U R$                  R'                  5       nUb  UR)                  U5        UR+                  S5      U l        [        U R,                  [.        5      (       d  [!        S5      eUR+                  S5      U l        [        U R0                  [.        5      (       d  [!        S5      eUR+                  S5      U l        U R2                  b*  [        U R2                  [4        5      (       d  [!        S5      eUR+                  S5      U l        [        U R6                  [.        5      (       d  [!        S	5      eU R6                  (       a  U R,                  (       a  [!        S
5      eUR+                  S5      U l        U R8                  b*  [        U R8                  [:        5      (       d  [!        S5      eUR+                  S5      U l        [        U R<                  5      (       d  [!        S5      e[?        U5      S:  a7  [!        SRA                  SRC                  URE                  5       5      5      5      eU(       a`  U RG                  U5      n	[        U	[H        5      (       a  S n
O;[K        URL                  5      nU	RO                  SURO                  S5      5      n
OS n
S n	Xpl(        Xl)        Xl*        U R                  RW                  5        HI  nURY                  U R                  (       a  U R                  R[                  5       O0 U(       a  UO0 5        MK     g )NzWto_dict must be callable with the signature to_dict(object, SerializationContext)->dictr_   z-auto.register.schemas must be a boolean valuer`   z)normalize.schemas must be a boolean valuera   z"use.schema.id must be an int valuerb   *use.latest.version must be a boolean valuez?cannot enable both use.latest.version and auto.register.schemasrc   -use.latest.with.metadata must be a dict valuerd   &subject.name.strategy must be callabler   Unrecognized properties: {}, rP   type).super__init__
isinstancestrrC   r   	_registryr[   r   get_global_instance_rule_registrysetrX   r#   r^   callable
ValueErrorr]   _default_confcopyrO   pop_auto_registerbool_normalize_schemas_use_schema_idint_use_latest_version_use_latest_with_metadatadict_subject_name_funclenformatjoinkeys_get_parsed_schemalistr   r:   getrZ   r\   rY   get_executors	configureconfig)r*   rE   r:   re   rf   rg   rh   rD   	conf_copyrT   schema_nameschema_dictrule	__class__s                r+   rq   AvroSerializer.__init__   s    	j#&&":.F
F++FF//<m,BbBbBd"u02x'8'8 K L L  &&++-	T"'mm,CD$--t44LMM"+--0C"D$11488HII'mmO<+t22C88ABB#,==1E#F $22D99IJJ##(;(;^__)27Q)R&**6t==tDDLMM"+--0G"H//00EFFy>A:$fTYYy~~/?%@AC C  33F;M-.. # $F$5$56+//8OPK M'+''557DNNdnn4>>002"(19r; 8r.   objctxr;   c                   ^	 Uc  gU R                  X R                  5      nU R                  U5      nUb  UR                  U l        OX0R
                  ;  a  U R                  (       a6  U R                  R                  X0R                  U R                  5      U l        OAU R                  R                  X0R                  U R                  5      nUR                  U l        U R
                  R                  U5        U R                  b  U R                  X5      nOUnUbZ  U R                  UR                  5      m	U	4S jnU R!                  X#["        R$                  SUR                  U['        T	5      U5      nOU R(                  m	[+        5        nUR-                  [/        S[0        U R                  5      5        [3        UT	U5        UR5                  5       sSSS5        $ ! , (       d  f       g= f)aK  
Serializes an object to Avro binary format, prepending it with Confluent
Schema Registry framing.

Args:
    obj (object): The object instance to serialize.

    ctx (SerializationContext): Metadata pertaining to the serialization operation.

Raises:
    SerializerError: If any error occurs serializing obj.
    SchemaRegistryError: If there was an error registering the schema with
                         Schema Registry, or auto.register.schemas is
                         false and the schema was not registered.

Returns:
    bytes: Confluent Schema Registry encoded Avro bytes
Nc                    > [        U TX!5      $ r(   	transform)rule_ctxfield_transformmsgrT   s      r+   <lambda>)AvroSerializer.__call__.<locals>.<lambda>s  s    (M3Hr.   >bI)r   r\   _get_reader_schema	schema_idr[   rX   r}   rt   register_schemarZ   r   lookup_schemaaddr]   r   rD   _execute_rulesr   WRITEget_inline_tagsrY   r%   writer   r   r   getvalue)
r*   r   r   rK   latest_schemaregistered_schemavaluefield_transformerforT   s
            @r+   __call__AvroSerializer.__call__B  s   ( ;))#/@/@A//8$+55DO000"" #'.."@"@\\4+B+B#D %)NN$@$@\\4+B+B%D!"3"="=  $$W-==$MM#+EE$ 33M4H4HIM!J''hnnd(5(<(<e_UbEc(9;E !//M2HHT%doo>?b-7;;=  s   AG
G,rD   c                     U R                   R                  U5      nUb  U$ [        XR                  5      n[	        UR
                  5      n[        UR
                  US9nU R                   R                  X5        U$ NrG   r^   get_parsed_schemarM   rt   rC   r:   rN   rw   r*   rD   rT   rH   prepared_schemas        r+   r   !AvroSerializer._get_parsed_schema  t    ,,>>vF$  -fnnE'(9(9:.&&mE 	  7r.   )r}   rX   r   rY   r^   rt   rv   rZ   r[   r\   r   r]   r   r   r   )NNNNNr(   )r4   r5   r6   r7   r8   	__slots__r   rz   r   r
   rs   r   r   r   objectr   r   r   rq   bytesr   
AvroSchemar   r9   __classcell__r   s   @r+   rV   rV   t   s    dJNI /3*/&*+015.IKM 04LP#$(04\; 4\; #vt+,\; (F,@#A4#GHI	\;
 tn\; D>\;  -\; \;|?!F ?!2F)G ?!S[\aSb ?!B J  r.   rV   c                      ^  \ rS rSrSr/ SQrSS\S.r      SS\S\	\
\S4   S	\\\\/\4      S
\S\\   S\\   S\\   4U 4S jjjrSS\S\\   S\	\\S4   4S jjrS\S\4S jrSrU =r$ )AvroDeserializeri  a  
Deserializer for Avro binary encoded data with Confluent Schema Registry
framing.

+-----------------------------+----------+--------------------------------------------------+
| Property Name               | Type     | Description                                      |
+-----------------------------+----------+--------------------------------------------------+
|                             |          | Whether to use the latest subject version for    |
| ``use.latest.version``      | bool     | deserialization.                                 |
|                             |          |                                                  |
|                             |          | Defaults to False.                               |
+-----------------------------+----------+--------------------------------------------------+
|                             |          | Whether to use the latest subject version with   |
| ``use.latest.with.metadata``| dict     | the given metadata.                              |
|                             |          |                                                  |
|                             |          | Defaults to None.                                |
+-----------------------------+----------+--------------------------------------------------+
|                             |          | Callable(SerializationContext, str) -> str       |
|                             |          |                                                  |
| ``subject.name.strategy``   | callable | Defines how Schema Registry subject names are    |
|                             |          | constructed. Standard naming strategies are      |
|                             |          | defined in the confluent_kafka.schema_registry   |
|                             |          | namespace.                                       |
|                             |          |                                                  |
|                             |          | Defaults to topic_subject_name_strategy.         |
+-----------------------------+----------+--------------------------------------------------+

Note:
    By default, Avro complex types are returned as dicts. This behavior can
    be overridden by registering a callable ``from_dict`` with the deserializer to
    convert the dicts to the desired type.

    See ``avro_consumer.py`` in the examples directory in the examples
    directory for example usage.

Args:
    schema_registry_client (SchemaRegistryClient): Confluent Schema Registry
        client instance.

    schema_str (str, Schema, optional): Avro reader schema declaration Accepts
        either a string or a :py:class:`Schema` instance. If not provided, the
        writer schema will be used as the reader schema. Note that string
        definitions cannot reference other schemas. For referencing other schemas,
        use a :py:class:`Schema` instance.

    from_dict (callable, optional): Callable(dict, SerializationContext) -> object.
        Converts a dict to an instance of some object.

    return_record_name (bool): If True, when reading a union of records, the result will
                               be a tuple where the first value is the name of the record and the second value is
                               the record itself.  Defaults to False.

See Also:
    `Apache Avro Schema Declaration <https://avro.apache.org/docs/current/spec.html#schemas>`_

    `Apache Avro Schema Resolution <https://avro.apache.org/docs/1.8.2/spec.html#Schema+Resolution>`_
)_reader_schema
_from_dict_return_record_namerZ   r^   FN)rb   rc   rd   rE   r:   	from_dictreturn_record_namerf   rg   rh   c                   > [         TU ]  5         S nUbD  [        U[        5      (       a  [	        U5      nO#[        U[
        5      (       a  UnO[        S5      eXl        Xl        U(       a  UO[        R                  " 5       U l        [        5       U l        S U l        U R                  R!                  5       n	Ub  U	R#                  U5        U	R%                  S5      U l        [        U R&                  [(        5      (       d  [+        S5      eU	R%                  S5      U l        U R,                  b*  [        U R,                  [.        5      (       d  [+        S5      eU	R%                  S5      U l        [3        U R0                  5      (       d  [+        S5      e[5        U	5      S:  a7  [+        S	R7                  S
R9                  U	R;                  5       5      5      5      eU(       a!  U R=                  U R                  5      U l        OS U l        Ub  [3        U5      (       d  [+        S5      eX0l         X@l!        [        U RB                  [(        5      (       d  [+        S5      eU R                  RE                  5        HI  n
U
RG                  U R                  (       a  U R                  RI                  5       O0 U(       a  UO0 5        MK     g )Nz3You must pass either schema string or schema objectrb   rj   rc   rk   rd   rl   r   rm   rn   z]from_dict must be callable with the signature from_dict(SerializationContext, dict) -> objectz*return_record_name must be a boolean value)%rp   rq   rr   rs   rC   r   	TypeErrorrZ   rt   r   ru   rv   r#   r^   r   rz   r{   rO   r|   r   r~   ry   r   r   r   rx   r   r   r   r   r   r   r   r   r   r   r   )r*   rE   r:   r   r   rf   rg   rh   rD   r   r   r   s              r+   rq   AvroDeserializer.__init__  s5    	!*c**&z2J//# UVV//<m,BbBbBd02"&&++-	T"#,==1E#F $22D99IJJ)27Q)R&**6t==tDDLMM"+--0G"H//00EFFy>A:$fTYYy~~/?%@AC C "&"9"9$,,"GD"&D ))<)< O P P##5 $22D99IJJ''557DNNdnn4>>002"(19r; 8r.   datar   r;   c                 x  ^ Uc  g[        U5      S::  a#  [        SR                  [        U5      5      5      eU R                  US5      nSnUb  U R	                  U5      n[        U5       n[        SUR                  S5      5      u  pgU[        :w  a  [        SR                  U5      5      eU R                  R                  U5      nU R                  U5      n	Uc4  U R                  X)R                  S5      5      nUb  U R	                  U5      nUb;  U R                  X8US5      n
UR                  nU R                  UR                  5      mO.U R                  b  Sn
U R                  nU R                   mOSn
UnU	mU
(       a+  [#        UU	SU R$                  5      nU R'                  X#X5      nO[#        UU	TU R$                  5      nU4S jnU R)                  X#[*        R,                  SX[/        T5      U5      nU R0                  b  U R1                  X5      sSSS5        $ UsSSS5        $ ! , (       d  f       g= f)a  
Deserialize Avro binary encoded data with Confluent Schema Registry framing to
a dict, or object instance according to from_dict, if specified.

Arguments:
    data (bytes): bytes

    ctx (SerializationContext): Metadata relevant to the serialization
        operation.

Raises:
    SerializerError: if an error occurs parsing data.

Returns:
    object: If data is None, then None. Else, a dict, or object instance according
            to from_dict, if specified.
N   zExpecting data framing of length 6 bytes or more but total data size is {} bytes. This message was not produced with a Confluent Schema Registry serializerr   zcUnexpected magic byte {}. This message was not produced with a Confluent Schema Registry serializerrP   c                    > [        U TX!5      $ r(   r   )r   r   messagereader_schemas      r+   r   +AvroDeserializer.__call__.<locals>.<lambda>]  s    (M7Lr.   )r   r   r   r   r   r%   r   readr   rt   
get_schemar   r   _get_migrationsrD   rZ   r   r   r   _execute_migrationsr   r   READr   r   )r*   r   r   rK   r   payloadmagicr   writer_schema_rawwriter_schema
migrationsreader_schema_rawobj_dictr   r   s                 @r+   r   AvroDeserializer.__call__  s8   & <t9>$ &B CI&TBSU U
 ))#t4 33G<Md#w%eW\\!_=E#( *FFLfUmU U !% 9 9) D 334EFM11#7H7H7PQ&$($;$;G$DM(!11'm]ab
$1$8$8! $ 7 78L8L M)!
$(LL! $ 3 3!
$5! -,W-:-1-1-E-EG  33C*W,W-:-:-1-E-EG
!N**3+<XeHf+<>H *x5_ $#b c $##s   +F+H+ H++
H9rD   c                     U R                   R                  U5      nUb  U$ [        XR                  5      n[	        UR
                  5      n[        UR
                  US9nU R                   R                  X5        U$ r   r   r   s        r+   r   #AvroDeserializer._get_parsed_schemah  r   r.   )r   r^   r   rt   r   rv   rZ   r   r   r   r   )NNFNNNr(   )r4   r5   r6   r7   r8   r   r   rz   r   r
   rs   r   r   r   r   r   r   r~   r   rq   r   r   r   r   r9   r   r   s   @r+   r   r     s   8t/I ,115.IKM 04NR#(#$(04?; 4?; #vt+,?; Hd,@%A6%IJK	?;
 !?; tn?; D>?;  -?; ?;BRU R2F)G RSXY]_egkYkSl Rh J  r.   r   c                        \ rS rSrS rS rSrg)LocalSchemaRepositoryiv  c                     Xl         g r(   schemas)r*   r   s     r+   rq   LocalSchemaRepository.__init__w  s    r.   c                 8    U R                   R                  U5      $ r(   )r   r   )r*   rK   s     r+   loadLocalSchemaRepository.loadz  s    ||((r.   r   N)r4   r5   r6   r7   rq   r   r9   r)   r.   r+   r   r   v  s    )r.   r   rH   c                 ^    [        U5      n[        U 5      US'   [        U5      n[        SUS9$ )Nz$root)repo)r   r   r   r   )r:   rH   r{   r   s       r+   rN   rN   ~  s1    M"D*%DM &DwT**r.   r   r   r   c                    Ub  Uc  U$ U R                  5       nUb  [        U5      Ul        [        U[        5      (       a  [        X5      nUc  U$ [        XX#5      $ [        U[        5      (       a  UR                  S5      nUS:X  a   U Vs/ s H  n[        XS   Xs5      PM     sn$ US:X  a3  UR                  5        VV	s0 s H  u  pU[        XS   X5      _M     sn	n$ US:X  a  US   n
U
 H  n[        XXU5        M     U$ UbJ  U R                  R                  nU(       a$  [        [        U5      UR                  5      (       d	  U" XU5      $ U$ s  snf s  sn	nf )Nro   arrayitemsmapvaluesrecordfields)current_fieldget_type
field_typerr   r   _resolve_unionr   r   r   r   _transform_fieldr   tags	_disjointrw   )r   rD   r   r   	field_ctx	subschemarA   itemkeyr   r   field	rule_tagss                r+   r   r     sd    &.!!#I'/	&$"63	NBB	FD	!	!jj('! ') ' c'?DJ ') )E!&-mmo7&5
 3x(8%QQ&57 7H$H%F eoN  NHHMM		#i.).. I I"37;;N)7s   EEr   c                 d   US   nUS   nUS   S-   U-   n U R                  UUU[        U5      S 5        X6   n[        XX5      n	U R                  R                  [
        R                  :X  a  U	SL a  [        U R                  5      eOXU'   U R                  5         g ! U R                  5         f = f)Nro   rP   .F)	enter_fieldr   r   r   kindr   	CONDITIONr"   
exit_field)
r   rD   r   r   r   r   rP   	full_namer   	new_values
             r+   r   r     s     vJ=Dv$t+IZ 	
 cuF	88==H...E!(22 " &DMs   A5B B/c                 &   [        U [        5      (       a  [        R                  $ [        U [        5      (       a  U R                  S5      nOU nUS:X  a  [        R                  $ US:X  a  [        R                  $ US:X  a  [        R                  $ US:X  a  [        R                  $ US:X  a  [        R                  $ US:X  a  [        R                  $ US:X  a  [        R                  $ US	:X  a  [        R                  $ US
:X  a  [        R                  $ US:X  a  [        R                  $ US:X  a  [        R                  $ US:X  a  [        R                   $ US:X  a  [        R"                  $ US:X  a  [        R$                  $ [        R$                  $ )Nro   r   enumr   r   unionfixedstringr   r   longfloatdoublebooleannull)rr   r   r    COMBINEDr   r   RECORDENUMARRAYMAPFIXEDSTRINGBYTESINTLONGFLOATDOUBLEBOOLEANNULL)rD   rA   s     r+   r   r     sM   &$!!!	FD	!	!jj( h		~~				}}		!!!				 				}}		~~				 			!   		~~~~r.   tags1tags2c                 $    U  H
  nX!;   d  M
    g   g)NFTr)   )r   r!  tags      r+   r   r     s    <  r.   c                 B    U  H  n [        X5        Us  $    g !    M  = fr(   )r   )rD   r   r   s      r+   r   r     s0    		W(   	s   c                 >    [        [        5      n[        SSX5        U$ )N )r   rw   _get_inline_tags_recursively)rD   inline_tagss     r+   r   r     s    c"K R=r.   nsrP   r   c                    Uc  g [        U[        5      (       a  U H  n[        XXC5        M     g [        U[        5      (       d  g UR	                  S5      nUS:X  a  [        XUR	                  S5      U5        g US:X  a  [        XUR	                  S5      U5        g US:X  a  UR	                  S5      nUR	                  S5      nUc  [        U5      nUc  U nUS	:w  a  UR                  U5      (       d  U S
U 3nUS   nU Hf  n	U	R	                  S5      n
U	R	                  S5      nU	R	                  S5      nU
b  Ub  X7S
-   U-      R                  U
5        Uc  MZ  [        XgX5        Mh     g g )Nro   r   r   r   r   r   	namespacerP   r&  r  r   zconfluent:tags)rr   r   r'  r   r   _implied_namespace
startswithrO   )r)  rP   rD   r   r   rA   	record_nsrecord_namer   r   
field_tags
field_namer   s                r+   r'  r'    se    ~&$I(9C  %%jj('!(6::g3FME!(6::h3GNH$

;/I **V,K .t4	 	B{'='=i'H'H!*1[M:H%F"YY'78
"YYv.
"YYv.
)j.Ds*Z78??
K)0Z   %r.   c                 d    [         R                  " SU 5      nU(       a  UR                  S5      $ S $ )Nz^(.*)\.[^.]+$r   )rematchgroup)rP   r4  s     r+   r,  r,  (  s(    HH%t,E"5;;q>,,r.   )Hdecimalr3  collectionsr   r{   r   ior   jsonr   structr   r   typingr	   r
   r   r   r   fastavror   r   r   r   fastavro.schemar   r&  r   r   r   r   r   r   confluent_kafka.serializationr   r   rh   r   serder   r   r   r    r!   r"   r#   rs   r  r   Decimalr~   r   r   r   AvroMessager   r%   rC   rM   rV   r   AbstractSchemaRepositoryr   rN   r   r   r   r   r   r   r'  r,  r)   r.   r+   <module>rC     sU  $  	 #     7 7    (/ /
A ': : : 	OO	

 3d?#

w 
2c 2f 2.,@	#z/*Z^ Zzb' bJ)J?? )+s +4Z;P +U_ + 	 ( 3> #   F	(15+94&Z &I &RSX c#h 4 :  @T J 4SX+> #[#[#[ ( 4#[
sCH}
#[L-S -Xc] -r.   