@@ -1301,14 +1301,15 @@ class JobStringParameterDefinitionUserInterface(OpenJDModel_v2023_09):
13011301 """User interface attributes for a job string parameter.
13021302
13031303 Attributes:
1304- control (StringUserInterfaceControl): The user interface control to use when editing this parameter.
1304+ control (Optional[StringUserInterfaceControl]): The user interface control to use when editing this parameter.
1305+ Default is LINE_EDIT when allowedValues is not provided, DROPDOWN_LIST when it is.
13051306 label (Optional[UserInterfaceLabelStringValue]): The label to display for the user interface control. Defaults
13061307 to the `name` of the parameter.
13071308 groupLabel (Optional[UserInterfaceLabelStringValue]): The label of the group box to place the user interface
13081309 control in.
13091310 """
13101311
1311- control : StringUserInterfaceControl
1312+ control : Optional [ StringUserInterfaceControl ] = None
13121313 label : Optional [UserInterfaceLabelStringValue ] = None
13131314 groupLabel : Optional [UserInterfaceLabelStringValue ] = None
13141315
@@ -1447,6 +1448,8 @@ def _validate_user_interface_compatibility(self) -> Self:
14471448 # validate that the user interface control is compatible with the value constraints
14481449 if self .userInterface :
14491450 user_interface_control = self .userInterface .control
1451+ if user_interface_control is None :
1452+ return self
14501453 if self .allowedValues and user_interface_control in (
14511454 StringUserInterfaceControl .LINE_EDIT ,
14521455 StringUserInterfaceControl .MULTILINE_EDIT ,
@@ -1530,7 +1533,8 @@ class JobPathParameterDefinitionUserInterface(OpenJDModel_v2023_09):
15301533 """User interface attributes for a job path parameter.
15311534
15321535 Attributes:
1533- control (PathUserInterfaceControl): The user interface control to use when editing this parameter.
1536+ control (Optional[PathUserInterfaceControl]): The user interface control to use when editing this parameter.
1537+ Default depends on objectType, dataFlow, and allowedValues.
15341538 label (Optional[UserInterfaceLabelStringValue]): The label to display for the user interface control. Defaults
15351539 to the `name` of the parameter.
15361540 groupLabel (Optional[UserInterfaceLabelStringValue]): The label of the group box to place the user interface
@@ -1542,7 +1546,7 @@ class JobPathParameterDefinitionUserInterface(OpenJDModel_v2023_09):
15421546 “CHOOSE_OUTPUT_FILE”. The default file filter that’s shown in the file choice dialog.
15431547 """
15441548
1545- control : PathUserInterfaceControl
1549+ control : Optional [ PathUserInterfaceControl ] = None
15461550 label : Optional [UserInterfaceLabelStringValue ] = None
15471551 groupLabel : Optional [UserInterfaceLabelStringValue ] = None
15481552 fileFilters : Optional [JobPathParameterDefinitionFileFilterList ] = None
@@ -1691,6 +1695,8 @@ def _validate_user_interface_compatibility(self) -> Self:
16911695 # validate that the user interface control is compatible with the value constraints
16921696 if self .userInterface :
16931697 user_interface_control = self .userInterface .control
1698+ if user_interface_control is None :
1699+ return self
16941700 if self .allowedValues and user_interface_control in (
16951701 PathUserInterfaceControl .CHOOSE_INPUT_FILE ,
16961702 PathUserInterfaceControl .CHOOSE_OUTPUT_FILE ,
@@ -1765,7 +1771,8 @@ class JobIntParameterDefinitionUserInterface(OpenJDModel_v2023_09):
17651771 """User interface attributes for a job int parameter.
17661772
17671773 Attributes:
1768- control (IntUserInterfaceControl): The user interface control to use when editing this parameter.
1774+ control (Optional[IntUserInterfaceControl]): The user interface control to use when editing this parameter.
1775+ Default is SPIN_BOX when allowedValues is not provided, DROPDOWN_LIST when it is.
17691776 label (Optional[UserInterfaceLabelStringValue]): The label to display for the user interface control. Defaults
17701777 to the `name` of the parameter.
17711778 groupLabel (Optional[UserInterfaceLabelStringValue]): The label of the group box to place the user interface
@@ -1774,7 +1781,7 @@ class JobIntParameterDefinitionUserInterface(OpenJDModel_v2023_09):
17741781 as selecting an up or down arrow in the user interface control.
17751782 """
17761783
1777- control : IntUserInterfaceControl
1784+ control : Optional [ IntUserInterfaceControl ] = None
17781785 label : Optional [UserInterfaceLabelStringValue ] = None
17791786 groupLabel : Optional [UserInterfaceLabelStringValue ] = None
17801787 singleStepDelta : Optional [PositiveInt ] = None
@@ -1958,6 +1965,8 @@ def _validate_user_interface_compatibility(self) -> Self:
19581965 # validate that the user interface control is compatible with the value constraints
19591966 if self .userInterface :
19601967 user_interface_control = self .userInterface .control
1968+ if user_interface_control is None :
1969+ return self
19611970 if self .allowedValues and user_interface_control == IntUserInterfaceControl .SPIN_BOX :
19621971 raise ValueError (
19631972 f"User interface control { user_interface_control .name } cannot be used when 'allowedValues' is provided"
@@ -2016,7 +2025,8 @@ class JobFloatParameterDefinitionUserInterface(OpenJDModel_v2023_09):
20162025 """User interface attributes for a job float parameter.
20172026
20182027 Attributes:
2019- control (FloatUserInterfaceControl): The user interface control to use when editing this parameter.
2028+ control (Optional[FloatUserInterfaceControl]): The user interface control to use when editing this parameter.
2029+ Default is SPIN_BOX when allowedValues is not provided, DROPDOWN_LIST when it is.
20202030 label (Optional[UserInterfaceLabelStringValue]): The label to display for the user interface control. Defaults
20212031 to the `name` of the parameter.
20222032 groupLabel (Optional[UserInterfaceLabelStringValue]): The label of the group box to place the user interface
@@ -2028,7 +2038,7 @@ class JobFloatParameterDefinitionUserInterface(OpenJDModel_v2023_09):
20282038 absolute value, otherwise it is the fraction of the current value to use as an adaptive step.
20292039 """
20302040
2031- control : FloatUserInterfaceControl
2041+ control : Optional [ FloatUserInterfaceControl ] = None
20322042 label : Optional [UserInterfaceLabelStringValue ] = None
20332043 groupLabel : Optional [UserInterfaceLabelStringValue ] = None
20342044 decimals : Optional [PositiveInt ] = None
@@ -2158,6 +2168,8 @@ def _validate_user_interface_compatibility(self) -> Self:
21582168 # validate that the user interface control is compatible with the value constraints
21592169 if self .userInterface :
21602170 user_interface_control = self .userInterface .control
2171+ if user_interface_control is None :
2172+ return self
21612173 if self .allowedValues and user_interface_control == FloatUserInterfaceControl .SPIN_BOX :
21622174 raise ValueError (
21632175 f"User interface control { user_interface_control .name } cannot be used when 'allowedValues' is provided"
0 commit comments