nextmv 0.35.0__py3-none-any.whl → 0.35.0.dev0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nextmv/__about__.py +1 -1
- nextmv/__init__.py +0 -1
- nextmv/_serialization.py +3 -3
- nextmv/base_model.py +2 -2
- nextmv/cloud/acceptance_test.py +5 -4
- nextmv/cloud/application.py +109 -116
- nextmv/cloud/batch_experiment.py +17 -17
- nextmv/cloud/client.py +13 -13
- nextmv/cloud/ensemble.py +3 -2
- nextmv/cloud/input_set.py +8 -7
- nextmv/cloud/instance.py +4 -3
- nextmv/cloud/package.py +12 -18
- nextmv/cloud/scenario.py +10 -6
- nextmv/input.py +44 -38
- nextmv/local/application.py +39 -39
- nextmv/local/executor.py +17 -47
- nextmv/local/runner.py +10 -10
- nextmv/manifest.py +79 -69
- nextmv/model.py +6 -6
- nextmv/options.py +12 -12
- nextmv/output.py +61 -46
- nextmv/polling.py +2 -2
- nextmv/run.py +58 -58
- {nextmv-0.35.0.dist-info → nextmv-0.35.0.dev0.dist-info}/METADATA +4 -3
- nextmv-0.35.0.dev0.dist-info/RECORD +50 -0
- nextmv-0.35.0.dist-info/RECORD +0 -50
- {nextmv-0.35.0.dist-info → nextmv-0.35.0.dev0.dist-info}/WHEEL +0 -0
- {nextmv-0.35.0.dist-info → nextmv-0.35.0.dev0.dist-info}/licenses/LICENSE +0 -0
nextmv/manifest.py
CHANGED
|
@@ -53,7 +53,7 @@ MANIFEST_FILE_NAME
|
|
|
53
53
|
|
|
54
54
|
import os
|
|
55
55
|
from enum import Enum
|
|
56
|
-
from typing import Any
|
|
56
|
+
from typing import Any, Optional, Union
|
|
57
57
|
|
|
58
58
|
import yaml
|
|
59
59
|
from pydantic import AliasChoices, Field, field_validator
|
|
@@ -244,14 +244,14 @@ class ManifestBuild(BaseModel):
|
|
|
244
244
|
'make build'
|
|
245
245
|
"""
|
|
246
246
|
|
|
247
|
-
command: str
|
|
247
|
+
command: Optional[str] = None
|
|
248
248
|
"""The command to run to build the app.
|
|
249
249
|
|
|
250
250
|
This command will be executed without a shell, i.e., directly. The command
|
|
251
251
|
must exit with a status of 0 to continue the push process of the app to
|
|
252
252
|
Nextmv Cloud. This command is executed prior to the pre-push command.
|
|
253
253
|
"""
|
|
254
|
-
environment: dict[str, Any]
|
|
254
|
+
environment: Optional[dict[str, Any]] = None
|
|
255
255
|
"""Environment variables to set when running the build command.
|
|
256
256
|
|
|
257
257
|
Given as key-value pairs.
|
|
@@ -317,7 +317,7 @@ class ManifestPythonModel(BaseModel):
|
|
|
317
317
|
|
|
318
318
|
name: str
|
|
319
319
|
"""The name of the decision model."""
|
|
320
|
-
options: list[dict[str, Any]]
|
|
320
|
+
options: Optional[list[dict[str, Any]]] = None
|
|
321
321
|
"""
|
|
322
322
|
Options for the decision model. This is a data representation of the
|
|
323
323
|
`nextmv.Options` class. It consists of a list of dicts. Each dict
|
|
@@ -359,7 +359,7 @@ class ManifestPython(BaseModel):
|
|
|
359
359
|
'requirements.txt'
|
|
360
360
|
"""
|
|
361
361
|
|
|
362
|
-
pip_requirements: str
|
|
362
|
+
pip_requirements: Optional[Union[str, list[str]]] = Field(
|
|
363
363
|
serialization_alias="pip-requirements",
|
|
364
364
|
validation_alias=AliasChoices("pip-requirements", "pip_requirements"),
|
|
365
365
|
default=None,
|
|
@@ -371,16 +371,16 @@ class ManifestPython(BaseModel):
|
|
|
371
371
|
app. Can be either a string path to a requirements.txt file or a list
|
|
372
372
|
of package specifications.
|
|
373
373
|
"""
|
|
374
|
-
arch: ManifestPythonArch
|
|
374
|
+
arch: Optional[ManifestPythonArch] = None
|
|
375
375
|
"""
|
|
376
376
|
The architecture this model is meant to run on. One of "arm64" or "amd64". Uses
|
|
377
377
|
"arm64" if not specified.
|
|
378
378
|
"""
|
|
379
|
-
version: str
|
|
379
|
+
version: Optional[Union[str, float]] = None
|
|
380
380
|
"""
|
|
381
381
|
The Python version this model is meant to run with. Uses "3.11" if not specified.
|
|
382
382
|
"""
|
|
383
|
-
model: ManifestPythonModel
|
|
383
|
+
model: Optional[ManifestPythonModel] = None
|
|
384
384
|
"""
|
|
385
385
|
Information about an encoded decision model.
|
|
386
386
|
|
|
@@ -390,7 +390,7 @@ class ManifestPython(BaseModel):
|
|
|
390
390
|
|
|
391
391
|
@field_validator("version", mode="before")
|
|
392
392
|
@classmethod
|
|
393
|
-
def validate_version(cls, v: str
|
|
393
|
+
def validate_version(cls, v: Optional[Union[str, float]]) -> Optional[str]:
|
|
394
394
|
"""
|
|
395
395
|
Validate and convert the Python version field to a string.
|
|
396
396
|
|
|
@@ -461,11 +461,11 @@ class ManifestOptionUI(BaseModel):
|
|
|
461
461
|
'input'
|
|
462
462
|
"""
|
|
463
463
|
|
|
464
|
-
control_type: str
|
|
464
|
+
control_type: Optional[str] = None
|
|
465
465
|
"""The type of control to use for the option in the Nextmv Cloud UI."""
|
|
466
|
-
hidden_from: list[str]
|
|
466
|
+
hidden_from: Optional[list[str]] = None
|
|
467
467
|
"""A list of team roles for which this option will be hidden in the UI."""
|
|
468
|
-
display_name: str
|
|
468
|
+
display_name: Optional[str] = None
|
|
469
469
|
"""An optional display name for the option. This is useful for making
|
|
470
470
|
the option more user-friendly in the UI.
|
|
471
471
|
"""
|
|
@@ -529,15 +529,15 @@ class ManifestOption(BaseModel):
|
|
|
529
529
|
)
|
|
530
530
|
"""The type of the option (e.g., "string", "int", "bool", "float)."""
|
|
531
531
|
|
|
532
|
-
default: Any
|
|
532
|
+
default: Optional[Any] = None
|
|
533
533
|
"""The default value of the option"""
|
|
534
|
-
description: str
|
|
534
|
+
description: Optional[str] = ""
|
|
535
535
|
"""The description of the option"""
|
|
536
536
|
required: bool = False
|
|
537
537
|
"""Whether the option is required or not"""
|
|
538
|
-
additional_attributes: dict[str, Any]
|
|
538
|
+
additional_attributes: Optional[dict[str, Any]] = None
|
|
539
539
|
"""Optional additional attributes for the option."""
|
|
540
|
-
ui: ManifestOptionUI
|
|
540
|
+
ui: Optional[ManifestOptionUI] = None
|
|
541
541
|
"""Optional UI attributes for the option."""
|
|
542
542
|
|
|
543
543
|
@classmethod
|
|
@@ -727,16 +727,16 @@ class ManifestOptions(BaseModel):
|
|
|
727
727
|
2
|
|
728
728
|
"""
|
|
729
729
|
|
|
730
|
-
strict: bool
|
|
730
|
+
strict: Optional[bool] = False
|
|
731
731
|
"""If strict is set to `True`, only the listed options will be allowed."""
|
|
732
|
-
validation: ManifestValidation
|
|
732
|
+
validation: Optional[ManifestValidation] = None
|
|
733
733
|
"""Optional validation rules for all options."""
|
|
734
|
-
items: list[ManifestOption]
|
|
734
|
+
items: Optional[list[ManifestOption]] = None
|
|
735
735
|
"""The actual list of options for the decision model.
|
|
736
736
|
|
|
737
737
|
An option is a parameter that configures the decision model.
|
|
738
738
|
"""
|
|
739
|
-
format: list[str]
|
|
739
|
+
format: Optional[list[str]] = None
|
|
740
740
|
"""A list of strings that define how options are transformed into command line arguments.
|
|
741
741
|
|
|
742
742
|
Use `{{name}}` to refer to the option name and `{{value}}` to refer to the option value.
|
|
@@ -749,7 +749,7 @@ class ManifestOptions(BaseModel):
|
|
|
749
749
|
cls,
|
|
750
750
|
options: Options,
|
|
751
751
|
validation: OptionsEnforcement = None,
|
|
752
|
-
format: list[str]
|
|
752
|
+
format: Optional[list[str]] = None,
|
|
753
753
|
) -> "ManifestOptions":
|
|
754
754
|
"""
|
|
755
755
|
Create a `ManifestOptions` from a `nextmv.Options`.
|
|
@@ -853,11 +853,11 @@ class ManifestContentMultiFileOutput(BaseModel):
|
|
|
853
853
|
'my-outputs/statistics.json'
|
|
854
854
|
"""
|
|
855
855
|
|
|
856
|
-
statistics: str
|
|
856
|
+
statistics: Optional[str] = ""
|
|
857
857
|
"""The path to the statistics file."""
|
|
858
|
-
assets: str
|
|
858
|
+
assets: Optional[str] = ""
|
|
859
859
|
"""The path to the assets file."""
|
|
860
|
-
solutions: str
|
|
860
|
+
solutions: Optional[str] = ""
|
|
861
861
|
"""The path to the solutions directory."""
|
|
862
862
|
|
|
863
863
|
|
|
@@ -942,7 +942,7 @@ class ManifestContent(BaseModel):
|
|
|
942
942
|
The format of the content. Can only be `InputFormat.JSON`,
|
|
943
943
|
`InputFormat.MULTI_FILE`, or `InputFormat.CSV_ARCHIVE`.
|
|
944
944
|
"""
|
|
945
|
-
multi_file: ManifestContentMultiFile
|
|
945
|
+
multi_file: Optional[ManifestContentMultiFile] = Field(
|
|
946
946
|
serialization_alias="multi-file",
|
|
947
947
|
validation_alias=AliasChoices("multi-file", "multi_file"),
|
|
948
948
|
default=None,
|
|
@@ -1001,46 +1001,12 @@ class ManifestConfiguration(BaseModel):
|
|
|
1001
1001
|
'debug_mode'
|
|
1002
1002
|
"""
|
|
1003
1003
|
|
|
1004
|
-
options: ManifestOptions
|
|
1004
|
+
options: Optional[ManifestOptions] = None
|
|
1005
1005
|
"""Options for the decision model."""
|
|
1006
|
-
content: ManifestContent
|
|
1006
|
+
content: Optional[ManifestContent] = None
|
|
1007
1007
|
"""Content configuration for specifying how the app input/output is handled."""
|
|
1008
1008
|
|
|
1009
1009
|
|
|
1010
|
-
class ManifestExecution(BaseModel):
|
|
1011
|
-
"""
|
|
1012
|
-
Execution configuration for the decision model.
|
|
1013
|
-
|
|
1014
|
-
You can import the `ManifestExecution` class directly from `nextmv`:
|
|
1015
|
-
|
|
1016
|
-
```python
|
|
1017
|
-
from nextmv import ManifestExecution
|
|
1018
|
-
```
|
|
1019
|
-
|
|
1020
|
-
Parameters
|
|
1021
|
-
----------
|
|
1022
|
-
entrypoint : Optional[str], default=None
|
|
1023
|
-
The entrypoint for the decision model, e.g.: `./app.py`.
|
|
1024
|
-
cwd : Optional[str], default=None
|
|
1025
|
-
The working directory to set when running the app, e.g.: `./src/`.
|
|
1026
|
-
|
|
1027
|
-
Examples
|
|
1028
|
-
--------
|
|
1029
|
-
>>> from nextmv import ManifestExecution
|
|
1030
|
-
>>> exec_config = ManifestExecution(
|
|
1031
|
-
... entrypoint="./app.py",
|
|
1032
|
-
... cwd="./src/"
|
|
1033
|
-
... )
|
|
1034
|
-
>>> exec_config.entrypoint
|
|
1035
|
-
'./app.py'
|
|
1036
|
-
"""
|
|
1037
|
-
|
|
1038
|
-
entrypoint: str | None = None
|
|
1039
|
-
"""The entrypoint for the decision model, e.g.: `./app.py`."""
|
|
1040
|
-
cwd: str | None = None
|
|
1041
|
-
"""The working directory to set when running the app, e.g.: `./src/`."""
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
1010
|
class Manifest(BaseModel):
|
|
1045
1011
|
"""
|
|
1046
1012
|
Represents an app manifest (`app.yaml`) for Nextmv Cloud.
|
|
@@ -1118,7 +1084,7 @@ class Manifest(BaseModel):
|
|
|
1118
1084
|
The runtime to use for the app. It provides the environment in which the
|
|
1119
1085
|
app runs. This is mandatory.
|
|
1120
1086
|
"""
|
|
1121
|
-
python: ManifestPython
|
|
1087
|
+
python: Optional[ManifestPython] = None
|
|
1122
1088
|
"""
|
|
1123
1089
|
Python-specific attributes. Only for Python apps. Contains further
|
|
1124
1090
|
Python-specific attributes.
|
|
@@ -1127,12 +1093,12 @@ class Manifest(BaseModel):
|
|
|
1127
1093
|
default_factory=list,
|
|
1128
1094
|
)
|
|
1129
1095
|
"""The files to include (or exclude) in the app. This is mandatory."""
|
|
1130
|
-
configuration: ManifestConfiguration
|
|
1096
|
+
configuration: Optional[ManifestConfiguration] = None
|
|
1131
1097
|
"""
|
|
1132
1098
|
Configuration for the decision model. A list of options for the decision
|
|
1133
1099
|
model. An option is a parameter that configures the decision model.
|
|
1134
1100
|
"""
|
|
1135
|
-
build: ManifestBuild
|
|
1101
|
+
build: Optional[ManifestBuild] = None
|
|
1136
1102
|
"""
|
|
1137
1103
|
Build-specific attributes.
|
|
1138
1104
|
|
|
@@ -1143,7 +1109,7 @@ class Manifest(BaseModel):
|
|
|
1143
1109
|
set environment variables when running the build command given as key-value
|
|
1144
1110
|
pairs.
|
|
1145
1111
|
"""
|
|
1146
|
-
pre_push: str
|
|
1112
|
+
pre_push: Optional[str] = Field(
|
|
1147
1113
|
serialization_alias="pre-push",
|
|
1148
1114
|
validation_alias=AliasChoices("pre-push", "pre_push"),
|
|
1149
1115
|
default=None,
|
|
@@ -1158,12 +1124,55 @@ class Manifest(BaseModel):
|
|
|
1158
1124
|
process. This command is executed just before the app gets bundled and
|
|
1159
1125
|
pushed (after the build command).
|
|
1160
1126
|
"""
|
|
1161
|
-
|
|
1127
|
+
entrypoint: Optional[str] = None
|
|
1162
1128
|
"""
|
|
1163
|
-
Optional
|
|
1164
|
-
|
|
1129
|
+
Optional entrypoint for the decision model. When not specified, the
|
|
1130
|
+
following default entrypoints are used, according to the `.runtime`:
|
|
1131
|
+
|
|
1132
|
+
- `ManifestRuntime.PYTHON`, `ManifestRuntime.HEXALY`, `ManifestRuntime.PYOMO`: `./main.py`
|
|
1133
|
+
- `ManifestRuntime.DEFAULT`: `./main`
|
|
1134
|
+
- Java: `./main.jar`
|
|
1165
1135
|
"""
|
|
1166
1136
|
|
|
1137
|
+
def model_post_init(self, __context) -> None:
|
|
1138
|
+
"""
|
|
1139
|
+
Post-initialization to set default entrypoint based on runtime if not specified.
|
|
1140
|
+
|
|
1141
|
+
This method is automatically called by Pydantic after the model is initialized.
|
|
1142
|
+
If no entrypoint is provided, it sets a default entrypoint based on the runtime:
|
|
1143
|
+
- Python runtimes (PYTHON, HEXALY, PYOMO, CUOPT): "./main.py"
|
|
1144
|
+
- DEFAULT runtime: "./main"
|
|
1145
|
+
- JAVA runtime: "./main.jar"
|
|
1146
|
+
|
|
1147
|
+
Parameters
|
|
1148
|
+
----------
|
|
1149
|
+
__context : Any
|
|
1150
|
+
Pydantic context (unused in this implementation).
|
|
1151
|
+
|
|
1152
|
+
Raises
|
|
1153
|
+
------
|
|
1154
|
+
ValueError
|
|
1155
|
+
If no entrypoint is provided and the runtime cannot be resolved to
|
|
1156
|
+
establish a default entrypoint.
|
|
1157
|
+
"""
|
|
1158
|
+
if self.entrypoint is None:
|
|
1159
|
+
if self.runtime in (
|
|
1160
|
+
ManifestRuntime.PYTHON,
|
|
1161
|
+
ManifestRuntime.HEXALY,
|
|
1162
|
+
ManifestRuntime.PYOMO,
|
|
1163
|
+
ManifestRuntime.CUOPT,
|
|
1164
|
+
):
|
|
1165
|
+
self.entrypoint = "./main.py"
|
|
1166
|
+
elif self.runtime == ManifestRuntime.DEFAULT:
|
|
1167
|
+
self.entrypoint = "./main"
|
|
1168
|
+
elif self.runtime == ManifestRuntime.JAVA:
|
|
1169
|
+
self.entrypoint = "./main.jar"
|
|
1170
|
+
else:
|
|
1171
|
+
raise ValueError(
|
|
1172
|
+
f'entrypoint is not provided but the runtime "{self.runtime}" could not '
|
|
1173
|
+
"be resolved to establish a default entrypoint"
|
|
1174
|
+
)
|
|
1175
|
+
|
|
1167
1176
|
@classmethod
|
|
1168
1177
|
def from_yaml(cls, dirpath: str) -> "Manifest":
|
|
1169
1178
|
"""
|
|
@@ -1247,7 +1256,7 @@ class Manifest(BaseModel):
|
|
|
1247
1256
|
width=120,
|
|
1248
1257
|
)
|
|
1249
1258
|
|
|
1250
|
-
def extract_options(self, should_parse: bool = True) -> Options
|
|
1259
|
+
def extract_options(self, should_parse: bool = True) -> Optional[Options]:
|
|
1251
1260
|
"""
|
|
1252
1261
|
Convert the manifest options to a `nextmv.Options` object.
|
|
1253
1262
|
|
|
@@ -1468,5 +1477,6 @@ def default_python_manifest() -> Manifest:
|
|
|
1468
1477
|
type=ManifestType.PYTHON,
|
|
1469
1478
|
python=ManifestPython(pip_requirements="requirements.txt"),
|
|
1470
1479
|
)
|
|
1480
|
+
m.entrypoint = None # TODO: change this when we are ready for the entrypoint.
|
|
1471
1481
|
|
|
1472
1482
|
return m
|
nextmv/model.py
CHANGED
|
@@ -20,7 +20,7 @@ import os
|
|
|
20
20
|
import shutil
|
|
21
21
|
import warnings
|
|
22
22
|
from dataclasses import dataclass
|
|
23
|
-
from typing import Any
|
|
23
|
+
from typing import Any, Optional
|
|
24
24
|
|
|
25
25
|
from nextmv.input import Input
|
|
26
26
|
from nextmv.logger import log
|
|
@@ -152,11 +152,11 @@ class ModelConfiguration:
|
|
|
152
152
|
|
|
153
153
|
name: str
|
|
154
154
|
"""The name of the decision model."""
|
|
155
|
-
requirements: list[str]
|
|
155
|
+
requirements: Optional[list[str]] = None
|
|
156
156
|
"""A list of Python dependencies that the decision model requires."""
|
|
157
|
-
options: Options
|
|
157
|
+
options: Optional[Options] = None
|
|
158
158
|
"""Options that the decision model requires."""
|
|
159
|
-
options_enforcement: OptionsEnforcement
|
|
159
|
+
options_enforcement: Optional[OptionsEnforcement] = None
|
|
160
160
|
"""Enforcement of options for the model."""
|
|
161
161
|
|
|
162
162
|
|
|
@@ -308,7 +308,7 @@ class Model:
|
|
|
308
308
|
self,
|
|
309
309
|
context,
|
|
310
310
|
model_input,
|
|
311
|
-
params: dict[str, Any]
|
|
311
|
+
params: Optional[dict[str, Any]] = None,
|
|
312
312
|
) -> Any:
|
|
313
313
|
"""
|
|
314
314
|
MLflow-compliant prediction method that calls the Nextmv model's solve method.
|
|
@@ -376,7 +376,7 @@ class Model:
|
|
|
376
376
|
|
|
377
377
|
def _cleanup_python_model(
|
|
378
378
|
model_dir: str,
|
|
379
|
-
model_configuration: ModelConfiguration
|
|
379
|
+
model_configuration: Optional[ModelConfiguration] = None,
|
|
380
380
|
verbose: bool = False,
|
|
381
381
|
) -> None:
|
|
382
382
|
"""
|
nextmv/options.py
CHANGED
|
@@ -21,7 +21,7 @@ import copy
|
|
|
21
21
|
import json
|
|
22
22
|
import os
|
|
23
23
|
from dataclasses import dataclass
|
|
24
|
-
from typing import Any
|
|
24
|
+
from typing import Any, Optional, Union
|
|
25
25
|
|
|
26
26
|
from nextmv.base_model import BaseModel
|
|
27
27
|
from nextmv.deprecated import deprecated
|
|
@@ -74,17 +74,17 @@ class Parameter:
|
|
|
74
74
|
param_type: type
|
|
75
75
|
"""The type of the parameter."""
|
|
76
76
|
|
|
77
|
-
default: Any
|
|
77
|
+
default: Optional[Any] = None
|
|
78
78
|
"""The default value of the parameter. Even though this is optional, it is
|
|
79
79
|
recommended to provide a default value for all parameters."""
|
|
80
|
-
description: str
|
|
80
|
+
description: Optional[str] = None
|
|
81
81
|
"""An optional description of the parameter. This is useful for generating
|
|
82
82
|
help messages for the configuration."""
|
|
83
83
|
required: bool = False
|
|
84
84
|
"""Whether the parameter is required. If a parameter is required, it will
|
|
85
85
|
be an error to not provide a value for it, either trough a command-line
|
|
86
86
|
argument, an environment variable or a default value."""
|
|
87
|
-
choices: list[Any
|
|
87
|
+
choices: list[Optional[Any]] = None
|
|
88
88
|
"""Limits values to a specific set of choices."""
|
|
89
89
|
|
|
90
90
|
def __post_init__(self):
|
|
@@ -246,12 +246,12 @@ class Option:
|
|
|
246
246
|
option_type: type
|
|
247
247
|
"""The type of the option."""
|
|
248
248
|
|
|
249
|
-
default: Any
|
|
249
|
+
default: Optional[Any] = None
|
|
250
250
|
"""
|
|
251
251
|
The default value of the option. Even though this is optional, it is
|
|
252
252
|
recommended to provide a default value for all options.
|
|
253
253
|
"""
|
|
254
|
-
description: str
|
|
254
|
+
description: Optional[str] = None
|
|
255
255
|
"""
|
|
256
256
|
An optional description of the option. This is useful for generating help
|
|
257
257
|
messages for the `Options`.
|
|
@@ -262,16 +262,16 @@ class Option:
|
|
|
262
262
|
error to not provide a value for it, either trough a command-line argument,
|
|
263
263
|
an environment variable or a default value.
|
|
264
264
|
"""
|
|
265
|
-
choices: list[Any]
|
|
265
|
+
choices: Optional[list[Any]] = None
|
|
266
266
|
"""Limits values to a specific set of choices."""
|
|
267
|
-
additional_attributes: dict[str, Any]
|
|
267
|
+
additional_attributes: Optional[dict[str, Any]] = None
|
|
268
268
|
"""
|
|
269
269
|
Optional additional attributes for the option. The Nextmv Cloud may
|
|
270
270
|
perform validation on these attributes. For example, the maximum length of
|
|
271
271
|
a string or the maximum value of an integer. These additional attributes
|
|
272
272
|
will be shown in the help message of the `Options`.
|
|
273
273
|
"""
|
|
274
|
-
control_type: str
|
|
274
|
+
control_type: Optional[str] = None
|
|
275
275
|
"""
|
|
276
276
|
The type of control to use for the option in the Nextmv Cloud UI. This is
|
|
277
277
|
useful for defining how the option should be presented in the Nextmv
|
|
@@ -281,13 +281,13 @@ class Option:
|
|
|
281
281
|
the option. This will be validated by the Nextmv Cloud, and availability
|
|
282
282
|
is based on options_type.
|
|
283
283
|
"""
|
|
284
|
-
hidden_from: list[str]
|
|
284
|
+
hidden_from: Optional[list[str]] = None
|
|
285
285
|
"""
|
|
286
286
|
A list of team roles for which this option will be hidden in the UI. For
|
|
287
287
|
example, if you want to hide an option from the "operator" role, you can
|
|
288
288
|
pass `hidden_from=["operator"]`.
|
|
289
289
|
"""
|
|
290
|
-
display_name: str
|
|
290
|
+
display_name: Optional[str] = None
|
|
291
291
|
"""
|
|
292
292
|
An optional display name for the option. This is useful for making
|
|
293
293
|
the option more user-friendly in the UI.
|
|
@@ -1032,7 +1032,7 @@ class Options:
|
|
|
1032
1032
|
return False
|
|
1033
1033
|
|
|
1034
1034
|
@staticmethod
|
|
1035
|
-
def _option_type(option: Option
|
|
1035
|
+
def _option_type(option: Union[Option, Parameter]) -> type:
|
|
1036
1036
|
"""
|
|
1037
1037
|
Get the type of an option.
|
|
1038
1038
|
|