text: ###############################################################
  # Autogenerated module. Please don't modify.                  #
  # Edit according file in protocol_generator/templates instead #
  ###############################################################
  
  from typing import Dict
  
  from ...structs.api.add_partitions_to_txn_request import AddPartitionsToTxnRequestData, Topic
  from ._main_serializers import (
      ArraySerializer,
      ClassSerializer,
      Schema,
      int16Serializer,
      int32Serializer,
      int64Serializer,
      stringSerializer,
  )
  
  topicSchemas: Dict[int, Schema] = {
      0: [("topic", stringSerializer), ("partitions", ArraySerializer(int32Serializer))],
      1: [("topic", stringSerializer), ("partitions", ArraySerializer(int32Serializer))],
  }
  
  
  topicSerializers: Dict[int, ClassSerializer[Topic]] = {
      version: ClassSerializer(Topic, schema) for version, schema in topicSchemas.items()
  }
  
  topicSerializers[-1] = topicSerializers[1]
  
  
  addPartitionsToTxnRequestDataSchemas: Dict[int, Schema] = {
      0: [
          ("transactional_id", stringSerializer),
          ("producer_id", int64Serializer),
          ("producer_epoch", int16Serializer),
          ("topics", ArraySerializer(topicSerializers[0])),
      ],
      1: [
          ("transactional_id", stringSerializer),
          ("producer_id", int64Serializer),
          ("producer_epoch", int16Serializer),
          ("topics", ArraySerializer(topicSerializers[1])),
      ],
  }
  
  
  addPartitionsToTxnRequestDataSerializers: Dict[int, ClassSerializer[AddPartitionsToTxnRequestData]] = {
      version: ClassSerializer(AddPartitionsToTxnRequestData, schema)
      for version, schema in addPartitionsToTxnRequestDataSchemas.items()
  }
  
  addPartitionsToTxnRequestDataSerializers[-1] = addPartitionsToTxnRequestDataSerializers[1]
  