-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathmodels.py
More file actions
54 lines (36 loc) · 1.5 KB
/
models.py
File metadata and controls
54 lines (36 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"""Models for the build command."""
from __future__ import annotations
from enum import Enum
from typing import Any, Dict, Optional
from pydantic import BaseModel, Field
class ConnectorLanguage(str, Enum):
"""Connector implementation language."""
PYTHON = "python"
JAVA = "java"
LOW_CODE = "low-code"
MANIFEST_ONLY = "manifest-only"
UNKNOWN = "unknown"
class ConnectorBuildOptions(BaseModel):
"""Connector build options from metadata.yaml."""
model_config = {"extra": "allow"}
baseImage: Optional[str] = Field(
None, description="Base image to use for building the connector"
)
path: Optional[str] = Field(
None, description="Path to the connector code within the repository"
)
class ConnectorMetadata(BaseModel):
"""Connector metadata from metadata.yaml."""
model_config = {"extra": "allow"}
dockerRepository: str = Field(..., description="Docker repository for the connector image")
dockerImageTag: str = Field(..., description="Docker image tag for the connector")
language: Optional[ConnectorLanguage] = Field(
None, description="Language of the connector implementation"
)
connectorBuildOptions: Optional[ConnectorBuildOptions] = Field(
None, description="Options for building the connector"
)
class MetadataFile(BaseModel):
"""Represents the structure of a metadata.yaml file."""
model_config = {"extra": "allow"}
data: ConnectorMetadata = Field(..., description="Connector metadata")