+ @validator("image_pull_policy")
+ def validate_image_pull_policy(cls, v):
+ values = {
+ "always": "Always",
+ "ifnotpresent": "IfNotPresent",
+ "never": "Never",
+ }
+ v = v.lower()
+ if v not in values.keys():
+ raise ValueError("value must be always, ifnotpresent or never")
+ return values[v]
+
+ @validator("kafka_endpoint")
+ def validate_kafka_endpoint(cls, v):
+ if v and len(v.split(":")) != 2:
+ raise ValueError("value must be in the format <host>:<port>")
+ return v
+
+
+class KafkaEndpoint:
+ def __init__(self, host: str, port: str) -> None:
+ self.host = host
+ self.port = port
+