diff --git a/src/openjd/model/v2023_09/_model.py b/src/openjd/model/v2023_09/_model.py index e3dbea4..ad099d6 100644 --- a/src/openjd/model/v2023_09/_model.py +++ b/src/openjd/model/v2023_09/_model.py @@ -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, @@ -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" @@ -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. @@ -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): @@ -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. @@ -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] @@ -2011,6 +2030,9 @@ 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.""" @@ -2018,10 +2040,16 @@ class AttributeCapabilityName(FormatString): _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)