# generated by datamodel-codegen:
#   filename:  schema/entity/services/connections/messaging/kafkaConnection.json
#   timestamp: 2022-04-20T15:52:56+00:00

from __future__ import annotations

from enum import Enum
from typing import Optional

from pydantic import AnyUrl, BaseModel, Extra, Field

from .. import connectionBasicType


class KafkaType(Enum):
    Kafka = 'Kafka'


class KafkaConnection(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Optional[KafkaType] = Field('Kafka', description='Service Type')
    bootstrapServers: Optional[str] = Field(
        'localhost:9092',
        description='Kafka bootstrap servers. add them in comma separated values ex: host1:9092,host2:9092',
    )
    schemaRegistryURL: Optional[AnyUrl] = Field(
        'http://localhost:8081', description='Confluent Kafka Schema Registry URL.'
    )
    supportsMetadataExtraction: Optional[
        connectionBasicType.SupportsMetadataExtraction
    ] = None
