// TaskIDs contains a subtopology and its partitions.
TaskIDs => not top level, no encoding, flexible v0+
  // SubtopologyID is a string that uniquely identifies the subtopology.
  SubtopologyID: string
  // Partitions are the partitions of the input topics processed by this
  // member.
  Partitions: [int32]

// TopicInfo describes a topic's configuration for streams.
TopicInfo => not top level, no encoding, flexible v0+
  // Topic is the name of the topic.
  Topic: string
  // NumPartitions is the number of partitions in the topic. 0 if no specific
  // number is enforced; always 0 for changelog topics.
  NumPartitions: int32
  // ReplicationFactor is the replication factor of the topic. 0 if the
  // default replication factor should be used.
  ReplicationFactor: int16
  // Configs are topic-level configurations as key-value pairs.
  Configs: [=>]
    // Key is the config key.
    Key: string
    // Value is the config value.
    Value: string

// Endpoint describes a host:port endpoint.
Endpoint => not top level, no encoding, flexible v0+
  // Host is the hostname.
  Host: string
  // Port is the port.
  Port: uint16

// TaskOffset describes a changelog offset for a task.
TaskOffset => not top level, no encoding, flexible v0+
  // SubtopologyID is the subtopology identifier.
  SubtopologyID: string
  // Partition is the partition.
  Partition: int32
  // Offset is the offset.
  Offset: int64

// StreamsGroupHeartbeatRequest is a part of KIP-1071; documentation is left
// to the KIP itself for brevity.
StreamsGroupHeartbeatRequest => key 88, max version 0, flexible v0+, group coordinator
  // Group is the group identifier.
  Group: string
  // MemberID is the member ID generated by the streams consumer. Must be
  // kept during the entire lifetime of the streams consumer process.
  MemberID: string
  // MemberEpoch is the current member epoch; 0 to join the group; -1 to
  // leave the group; -2 to indicate that the static member will rejoin.
  MemberEpoch: int32
  // EndpointInformationEpoch is the current endpoint epoch of this client,
  // represents the latest endpoint epoch this client received.
  EndpointInformationEpoch: int32
  // InstanceID is the instance ID for static membership; null if not provided
  // or if unchanged since the last heartbeat.
  InstanceID: nullable-string
  // RackID is the rack ID of the member; null if not provided or if unchanged
  // since the last heartbeat.
  RackID: nullable-string
  // RebalanceTimeoutMillis is the maximum time in milliseconds that the
  // coordinator will wait on the member to revoke its tasks. -1 if unchanged
  // since last heartbeat.
  RebalanceTimeoutMillis: int32(-1)
  // Topology is the topology metadata of the streams application. Only sent
  // when memberEpoch = 0. Null otherwise.
  Topology: nullable=>
    // Epoch is the epoch of the topology.
    Epoch: int32
    // Subtopologies are the sub-topologies of the streams application.
    Subtopologies: [=>]
      // SubtopologyID uniquely identifies the subtopology.
      SubtopologyID: string
      // SourceTopics are the topics the topology reads from.
      SourceTopics: [string]
      // SourceTopicRegex are regular expressions identifying topics the
      // subtopology reads from.
      SourceTopicRegex: [string]
      // StateChangelogTopics are changelog topics associated with this
      // subtopology, created automatically.
      StateChangelogTopics: [TopicInfo]
      // RepartitionSinkTopics are the repartition topics the subtopology
      // writes to.
      RepartitionSinkTopics: [string]
      // RepartitionSourceTopics are source topics that are internally created
      // repartition topics, created automatically.
      RepartitionSourceTopics: [TopicInfo]
      // CopartitionGroups are subsets of source topics that must be
      // copartitioned.
      CopartitionGroups: [=>]
        // SourceTopics are indexes into the subtopology's SourceTopics array.
        SourceTopics: [int16]
        // SourceTopicRegex are indexes into the subtopology's SourceTopicRegex
        // array.
        SourceTopicRegex: [int16]
        // RepartitionSourceTopics are indexes into the subtopology's
        // RepartitionSourceTopics array.
        RepartitionSourceTopics: [int16]
  // ActiveTasks are the currently owned active tasks. Null if unchanged since
  // last heartbeat.
  ActiveTasks: nullable[TaskIDs]
  // StandbyTasks are the currently owned standby tasks. Null if unchanged
  // since last heartbeat.
  StandbyTasks: nullable[TaskIDs]
  // WarmupTasks are the currently owned warm-up tasks. Null if unchanged
  // since last heartbeat.
  WarmupTasks: nullable[TaskIDs]
  // ProcessID is the identity of the streams instance that may have multiple
  // consumers. Null if unchanged since last heartbeat.
  ProcessID: nullable-string
  // UserEndpoint is the user-defined endpoint for Interactive Queries. Null
  // if unchanged since last heartbeat or if not defined on the client.
  UserEndpoint: nullable=>
    // Host is the hostname.
    Host: string
    // Port is the port.
    Port: uint16
  // ClientTags are used for rack-aware assignment. Null if unchanged since
  // last heartbeat.
  ClientTags: nullable[=>]
    // Key is the tag key.
    Key: string
    // Value is the tag value.
    Value: string
  // TaskOffsets are cumulative changelog offsets for tasks. Null if unchanged
  // since last heartbeat.
  TaskOffsets: nullable[TaskOffset]
  // TaskEndOffsets are cumulative changelog end-offsets for tasks. Null if
  // unchanged since last heartbeat.
  TaskEndOffsets: nullable[TaskOffset]
  // ShutdownApplication indicates whether all Streams clients in the group
  // should shut down.
  ShutdownApplication: bool

// StreamsGroupHeartbeatResponse is returned from a StreamsGroupHeartbeatRequest.
StreamsGroupHeartbeatResponse =>
  ThrottleMillis
  // ErrorCode is the top-level error code, or 0 if there was no error.
  ErrorCode: int16
  // ErrorMessage is the top-level error message, or null if there was no
  // error.
  ErrorMessage: nullable-string
  // MemberID is the member ID.
  MemberID: string
  // MemberEpoch is the member epoch.
  MemberEpoch: int32
  // HeartbeatIntervalMillis is the heartbeat interval in milliseconds.
  HeartbeatIntervalMillis: int32
  // AcceptableRecoveryLag is the maximal lag a warm-up task can have to be
  // considered caught-up.
  AcceptableRecoveryLag: int32
  // TaskOffsetIntervalMillis is the interval in which the task changelog
  // offsets on a client are updated on the broker.
  TaskOffsetIntervalMillis: int32
  // Status indicates zero or more statuses for the group membership.
  Status: nullable[=>]
    // StatusCode indicates a particular status; 0:STALE_TOPOLOGY,
    // 1:MISSING_SOURCE_TOPICS, 2:INCORRECTLY_PARTITIONED_TOPICS,
    // 3:MISSING_INTERNAL_TOPICS, 4:SHUTDOWN_APPLICATION,
    // 5:ASSIGNMENT_DELAYED.
    StatusCode: int8
    // StatusDetail is a string representation of the status.
    StatusDetail: string
  // ActiveTasks are assigned active tasks. Null if unchanged since last
  // heartbeat.
  ActiveTasks: nullable[TaskIDs]
  // StandbyTasks are assigned standby tasks. Null if unchanged since last
  // heartbeat.
  StandbyTasks: nullable[TaskIDs]
  // WarmupTasks are assigned warm-up tasks. Null if unchanged since last
  // heartbeat.
  WarmupTasks: nullable[TaskIDs]
  // EndpointInformationEpoch is the endpoint epoch set in the response.
  EndpointInformationEpoch: int32
  // PartitionsByUserEndpoint is global assignment information used for
  // Interactive Queries. Null if unchanged since last heartbeat.
  PartitionsByUserEndpoint: nullable[=>]
    // UserEndpoint is the user-defined endpoint to connect to the node.
    UserEndpoint: Endpoint
    // ActivePartitions are all topic partitions materialized by active tasks
    // on the node.
    ActivePartitions: [=>]
      // Topic is the topic name.
      Topic: string
      // Partitions are the partitions.
      Partitions: [int32]
    // StandbyPartitions are all topic partitions materialized by standby
    // tasks on the node.
    StandbyPartitions: [=>]
      // Topic is the topic name.
      Topic: string
      // Partitions are the partitions.
      Partitions: [int32]
