tbapi.api.parameter

 1from __future__ import annotations
 2from typing import TYPE_CHECKING
 3from tbapi.common.decorators import tb_class, tb_interface
 4from tbapi.common.converters import to_python_datetime, to_net_datetime
 5from datetime import datetime
 6from Tickblaze.Scripts.Api import Parameter as _Parameter
 7from typing import Any, overload
 8from abc import ABC, abstractmethod
 9
10@tb_class(_Parameter)
11class Parameter():
12    """Represents a parameter with associated attributes, value, and an optional numeric range and property reference."""
13
14    @overload
15    @staticmethod
16    def new() -> "Parameter":
17        """Constructor overload with arguments: """
18        ...
19    @overload
20    @staticmethod
21    def new(obj: Any, property: PropertyInfo, attributes: ParameterAttribute) -> "Parameter":
22        """Constructor overload with arguments: obj, property, attributes"""
23        ...
24    @staticmethod
25    def new(*args, **kwargs):
26        """Generic factory method for Parameter. Use overloads for IDE type hints."""
27        return Parameter(*args, **kwargs)
28
29    @property
30    def attributes(self) -> ParameterAttribute:
31        """The attributes associated with the parameter."""
32        val = self._value.Attributes
33        return val
34    @property
35    def numeric_range(self) -> NumericRangeAttribute:
36        """The optional numeric range attribute for the parameter."""
37        val = self._value.NumericRange
38        return val
39    @property
40    def __property__(self) -> PropertyInfo:
41        """The property information of the parameter if available."""
42        val = self._value.Property
43        return val
44    @property
45    def is_enabled(self) -> bool:
46        """Gets or sets a value indicating whether this element is enabled in the user interface (UI)."""
47        val = self._value.IsEnabled
48        return val
49    @is_enabled.setter
50    def is_enabled(self, val: bool):
51        tmp = self._value
52        tmp.IsEnabled = val
53        self._value = tmp
54    @property
55    def is_visible(self) -> bool:
56        """Gets or sets a value indicating whether this element is visible in the user interface (UI)."""
57        val = self._value.IsVisible
58        return val
59    @is_visible.setter
60    def is_visible(self, val: bool):
61        tmp = self._value
62        tmp.IsVisible = val
63        self._value = tmp
64    @property
65    def is_optimizable(self) -> bool:
66        """Gets or sets a value indicating whether this element is optimizable."""
67        val = self._value.IsOptimizable
68        return val
69    @is_optimizable.setter
70    def is_optimizable(self, val: bool):
71        tmp = self._value
72        tmp.IsOptimizable = val
73        self._value = tmp
74    @property
75    def value(self) -> Any:
76        """The value of the parameter."""
77        val = self._value.Value
78        return val
79    @value.setter
80    def value(self, val: Any):
81        tmp = self._value
82        tmp.Value = val
83        self._value = tmp
@tb_class(_Parameter)
class Parameter:
18@tb_class(_Parameter)
19class Parameter():
20    """Represents a parameter with associated attributes, value, and an optional numeric range and property reference."""
21
22    @overload
23    @staticmethod
24    def new() -> "Parameter":
25        """Constructor overload with arguments: """
26        ...
27    @overload
28    @staticmethod
29    def new(obj: Any, property: PropertyInfo, attributes: ParameterAttribute) -> "Parameter":
30        """Constructor overload with arguments: obj, property, attributes"""
31        ...
32    @staticmethod
33    def new(*args, **kwargs):
34        """Generic factory method for Parameter. Use overloads for IDE type hints."""
35        return Parameter(*args, **kwargs)
36
37    @property
38    def attributes(self) -> ParameterAttribute:
39        """The attributes associated with the parameter."""
40        val = self._value.Attributes
41        return val
42    @property
43    def numeric_range(self) -> NumericRangeAttribute:
44        """The optional numeric range attribute for the parameter."""
45        val = self._value.NumericRange
46        return val
47    @property
48    def __property__(self) -> PropertyInfo:
49        """The property information of the parameter if available."""
50        val = self._value.Property
51        return val
52    @property
53    def is_enabled(self) -> bool:
54        """Gets or sets a value indicating whether this element is enabled in the user interface (UI)."""
55        val = self._value.IsEnabled
56        return val
57    @is_enabled.setter
58    def is_enabled(self, val: bool):
59        tmp = self._value
60        tmp.IsEnabled = val
61        self._value = tmp
62    @property
63    def is_visible(self) -> bool:
64        """Gets or sets a value indicating whether this element is visible in the user interface (UI)."""
65        val = self._value.IsVisible
66        return val
67    @is_visible.setter
68    def is_visible(self, val: bool):
69        tmp = self._value
70        tmp.IsVisible = val
71        self._value = tmp
72    @property
73    def is_optimizable(self) -> bool:
74        """Gets or sets a value indicating whether this element is optimizable."""
75        val = self._value.IsOptimizable
76        return val
77    @is_optimizable.setter
78    def is_optimizable(self, val: bool):
79        tmp = self._value
80        tmp.IsOptimizable = val
81        self._value = tmp
82    @property
83    def value(self) -> Any:
84        """The value of the parameter."""
85        val = self._value.Value
86        return val
87    @value.setter
88    def value(self, val: Any):
89        tmp = self._value
90        tmp.Value = val
91        self._value = tmp

Represents a parameter with associated attributes, value, and an optional numeric range and property reference.

Parameter(*args, **kwargs)
162        def __init__(self, *args, **kwargs):
163            pass
@staticmethod
def new(*args, **kwargs):
32    @staticmethod
33    def new(*args, **kwargs):
34        """Generic factory method for Parameter. Use overloads for IDE type hints."""
35        return Parameter(*args, **kwargs)

Generic factory method for Parameter. Use overloads for IDE type hints.

attributes: 'ParameterAttribute'
37    @property
38    def attributes(self) -> ParameterAttribute:
39        """The attributes associated with the parameter."""
40        val = self._value.Attributes
41        return val

The attributes associated with the parameter.

numeric_range: 'NumericRangeAttribute'
42    @property
43    def numeric_range(self) -> NumericRangeAttribute:
44        """The optional numeric range attribute for the parameter."""
45        val = self._value.NumericRange
46        return val

The optional numeric range attribute for the parameter.

is_enabled: bool
52    @property
53    def is_enabled(self) -> bool:
54        """Gets or sets a value indicating whether this element is enabled in the user interface (UI)."""
55        val = self._value.IsEnabled
56        return val

Gets or sets a value indicating whether this element is enabled in the user interface (UI).

is_visible: bool
62    @property
63    def is_visible(self) -> bool:
64        """Gets or sets a value indicating whether this element is visible in the user interface (UI)."""
65        val = self._value.IsVisible
66        return val

Gets or sets a value indicating whether this element is visible in the user interface (UI).

is_optimizable: bool
72    @property
73    def is_optimizable(self) -> bool:
74        """Gets or sets a value indicating whether this element is optimizable."""
75        val = self._value.IsOptimizable
76        return val

Gets or sets a value indicating whether this element is optimizable.

value: Any
82    @property
83    def value(self) -> Any:
84        """The value of the parameter."""
85        val = self._value.Value
86        return val

The value of the parameter.