|
| 1 | +from typing import Any, ClassVar |
| 2 | + |
1 | 3 | from mpt_api_client.http import AsyncService, Service |
2 | 4 | from mpt_api_client.http.mixins import ( |
3 | 5 | AsyncCollectionMixin, |
|
11 | 13 | class Parameter(Model): |
12 | 14 | """Parameter resource.""" |
13 | 15 |
|
| 16 | + _attribute_mapping: ClassVar[dict[str, str]] = {"externalId": "external_id"} |
| 17 | + |
| 18 | + @property |
| 19 | + def scope(self) -> str: |
| 20 | + """Returns the parameter scope.""" |
| 21 | + return str(self._box.get("scope", "")) # type: ignore[no-untyped-call] |
| 22 | + |
| 23 | + @scope.setter |
| 24 | + def scope(self, value: str) -> None: |
| 25 | + """Sets the parameter scope.""" |
| 26 | + self._box.scope = value |
| 27 | + |
| 28 | + @property |
| 29 | + def phase(self) -> str: |
| 30 | + """Returns the parameter phase.""" |
| 31 | + return str(self._box.get("phase", "")) # type: ignore[no-untyped-call] |
| 32 | + |
| 33 | + @phase.setter |
| 34 | + def phase(self, value: str) -> None: |
| 35 | + """Sets the parameter phase.""" |
| 36 | + self._box.phase = value |
| 37 | + |
| 38 | + @property |
| 39 | + def context(self) -> str: |
| 40 | + """Returns the parameter context.""" |
| 41 | + return str(self._box.get("context", "")) # type: ignore[no-untyped-call] |
| 42 | + |
| 43 | + @context.setter |
| 44 | + def context(self, value: str) -> None: |
| 45 | + """Sets the parameter context.""" |
| 46 | + self._box.context = value |
| 47 | + |
| 48 | + @property |
| 49 | + def options(self) -> dict[str, Any]: |
| 50 | + """Returns the parameter options.""" |
| 51 | + return self._box.get("options", {}) # type: ignore[no-any-return, no-untyped-call] |
| 52 | + |
| 53 | + @options.setter |
| 54 | + def options(self, value: dict[str, Any]) -> None: |
| 55 | + """Sets the parameter options.""" |
| 56 | + self._box.options = value |
| 57 | + |
| 58 | + @property |
| 59 | + def multiple(self) -> bool: |
| 60 | + """Returns whether the parameter allows multiple values.""" |
| 61 | + return bool(self._box.get("multiple", False)) # type: ignore[no-untyped-call] |
| 62 | + |
| 63 | + @multiple.setter |
| 64 | + def multiple(self, value: bool) -> None: |
| 65 | + """Sets whether the parameter allows multiple values.""" |
| 66 | + self._box.multiple = value |
| 67 | + |
| 68 | + @property |
| 69 | + def constraints(self) -> dict[str, Any]: |
| 70 | + """Returns the parameter constraints.""" |
| 71 | + return self._box.get("constraints", {}) # type: ignore[no-any-return, no-untyped-call] |
| 72 | + |
| 73 | + @constraints.setter |
| 74 | + def constraints(self, value: dict[str, Any]) -> None: |
| 75 | + """Sets the parameter constraints.""" |
| 76 | + self._box.constraints = value |
| 77 | + |
| 78 | + @property |
| 79 | + def group(self) -> dict[str, Any]: |
| 80 | + """Returns the parameter group.""" |
| 81 | + return self._box.get("group", {}) # type: ignore[no-any-return,no-untyped-call] |
| 82 | + |
| 83 | + @group.setter |
| 84 | + def group(self, value: dict[str, Any]) -> None: |
| 85 | + """Sets the parameter group.""" |
| 86 | + self._box.group = value |
| 87 | + |
| 88 | + @property |
| 89 | + def external_id(self) -> str: |
| 90 | + """Returns the parameter external ID.""" |
| 91 | + return str(self._box.get("external_id", "")) # type: ignore[no-untyped-call] |
| 92 | + |
| 93 | + @external_id.setter |
| 94 | + def external_id(self, value: str) -> None: |
| 95 | + """Sets the parameter external ID.""" |
| 96 | + self._box.external_id = value |
| 97 | + |
| 98 | + @property |
| 99 | + def status(self) -> str: |
| 100 | + """Returns the parameter status.""" |
| 101 | + return str(self._box.get("status", "")) # type: ignore[no-untyped-call] |
| 102 | + |
| 103 | + @status.setter |
| 104 | + def status(self, value: str) -> None: |
| 105 | + """Sets the parameter status.""" |
| 106 | + self._box.status = value |
| 107 | + |
14 | 108 |
|
15 | 109 | class ParametersServiceConfig: |
16 | 110 | """Parameters service configuration.""" |
|
0 commit comments