Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion src/openjd/model/v2023_09/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ class ValueReferenceConstants(Enum):
class JobTemplateName(FormatString):
_min_length = 1

def __new__(cls, value: str, *, context: ModelParsingContextInterface = ModelParsingContext()):
return super().__new__(cls, value, context=context)


JobName = Annotated[
str,
Expand Down Expand Up @@ -225,12 +228,18 @@ class CommandString(FormatString):
# All unicode except the [Cc] (control characters) category
_regex = f"(?-m:^[^{_Cc_characters}]+\\Z)"

def __new__(cls, value: str, *, context: ModelParsingContextInterface = ModelParsingContext()):
return super().__new__(cls, value, context=context)


class ArgString(FormatString):
# All unicode except the [Cc] (control characters) category
# Allow CR, LF, and TAB.
_regex = f"(?-m:^[^{_Cc_characters}]*\\Z)"

def __new__(cls, value: str, *, context: ModelParsingContextInterface = ModelParsingContext()):
return super().__new__(cls, value, context=context)


class CancelationMode(str, Enum):
NOTIFY_THEN_TERMINATE = "NOTIFY_THEN_TERMINATE"
Expand Down Expand Up @@ -363,6 +372,9 @@ class EmbeddedFileTypes(str, Enum):
class DataString(FormatString):
_min_length = 1

def __new__(cls, value: str, *, context: ModelParsingContextInterface = ModelParsingContext()):
return super().__new__(cls, value, context=context)


class EmbeddedFileText(OpenJDModel_v2023_09):
"""A plain text file embedded directly into the Job Template.
Expand Down Expand Up @@ -485,7 +497,8 @@ class TaskParameterStringValue(FormatString):
# as a TaskParameterStringValueAsJob type after the template
# has been instantiated in to a Job, and this format string
# has been evaluated.
pass
def __new__(cls, value: str, *, context: ModelParsingContextInterface = ModelParsingContext()):
return super().__new__(cls, value, context=context)


class TaskParameterType(str, Enum):
Expand All @@ -499,6 +512,9 @@ class TaskParameterType(str, Enum):
class RangeString(FormatString):
_min_length = 1

def __new__(cls, value: str, *, context: ModelParsingContextInterface = ModelParsingContext()):
return super().__new__(cls, value, context=context)


# Note: Ordering within the Unions is important. Pydantic will try to match in
# the order given.
Expand Down Expand Up @@ -994,6 +1010,9 @@ def _validate_combination(self) -> Self:
class EnvironmentVariableValueString(FormatString):
_max_length = 2048

def __new__(cls, value: str, *, context: ModelParsingContextInterface = ModelParsingContext()):
return super().__new__(cls, value, context=context)


EnvironmentVariableObject = dict[EnvironmentVariableNameString, EnvironmentVariableValueString]

Expand Down Expand Up @@ -2011,17 +2030,26 @@ class AmountCapabilityName(FormatString):
_min_length = 1
_max_length = 100

def __new__(cls, value: str, *, context: ModelParsingContextInterface = ModelParsingContext()):
return super().__new__(cls, value, context=context)


class AttributeCapabilityName(FormatString):
"""The name of an attrubute capability."""

_min_length = 1
_max_length = 100

def __new__(cls, value: str, *, context: ModelParsingContextInterface = ModelParsingContext()):
return super().__new__(cls, value, context=context)


class AttributeCapabilityValue(FormatString):
_min_length = 1

def __new__(cls, value: str, *, context: ModelParsingContextInterface = ModelParsingContext()):
return super().__new__(cls, value, context=context)


AttributeCapabilityList = Annotated[
list[AttributeCapabilityValue], Field(min_length=1, max_length=50)
Expand Down