tbapi.api.models.stroke

 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.Models import Stroke as _Stroke
 7from typing import Any, overload
 8from abc import ABC, abstractmethod
 9from tbapi.core.enums.line_style import LineStyle
10from tbapi.api.models.stroke_editable_fields import StrokeEditableFields
11from Tickblaze.Core.Enums import LineStyle as _LineStyle
12from Tickblaze.Scripts.Api.Models import StrokeEditableFields as _StrokeEditableFields
13if TYPE_CHECKING:
14    from tbapi.api.models.color import Color
15
16@tb_class(_Stroke)
17class Stroke():
18    """Represents a line style with color, dash style, and thickness."""
19
20    @overload
21    @staticmethod
22    def new() -> "Stroke":
23        """Constructor overload with arguments: """
24        ...
25    @staticmethod
26    def new(*args, **kwargs):
27        """Generic factory method for Stroke. Use overloads for IDE type hints."""
28        return Stroke(*args, **kwargs)
29
30    @property
31    def color(self) -> Color:
32        """The color of the stroke."""
33        from tbapi.api.models.color import Color
34        val = self._value.Color
35        return Color(_existing=val)
36    @color.setter
37    def color(self, val: Color):
38        tmp = self._value
39        tmp.Color = val._value
40        self._value = tmp
41    @property
42    def line_style(self) -> LineStyle:
43        """The line style for the stroke."""
44        val = int(self._value.LineStyle)
45        return LineStyle(val)
46    @line_style.setter
47    def line_style(self, val: LineStyle):
48        tmp = self._value
49        tmp.LineStyle = _LineStyle(val.value if hasattr(val, "value") else int(val))
50        self._value = tmp
51    @property
52    def thickness(self) -> int:
53        """The thickness of the stroke."""
54        val = self._value.Thickness
55        return val
56    @thickness.setter
57    def thickness(self, val: int):
58        tmp = self._value
59        tmp.Thickness = val
60        self._value = tmp
61    @property
62    def is_visible(self) -> bool:
63        """Indicates whether the stroke is visible"""
64        val = self._value.IsVisible
65        return val
66    @is_visible.setter
67    def is_visible(self, val: bool):
68        tmp = self._value
69        tmp.IsVisible = val
70        self._value = tmp
71    @property
72    def editable_fields(self) -> StrokeEditableFields:
73        val = int(self._value.EditableFields)
74        return StrokeEditableFields(val)
75    @editable_fields.setter
76    def editable_fields(self, val: StrokeEditableFields):
77        tmp = self._value
78        tmp.EditableFields = _StrokeEditableFields(val.value if hasattr(val, "value") else int(val))
79        self._value = tmp
@tb_class(_Stroke)
class Stroke:
24@tb_class(_Stroke)
25class Stroke():
26    """Represents a line style with color, dash style, and thickness."""
27
28    @overload
29    @staticmethod
30    def new() -> "Stroke":
31        """Constructor overload with arguments: """
32        ...
33    @staticmethod
34    def new(*args, **kwargs):
35        """Generic factory method for Stroke. Use overloads for IDE type hints."""
36        return Stroke(*args, **kwargs)
37
38    @property
39    def color(self) -> Color:
40        """The color of the stroke."""
41        from tbapi.api.models.color import Color
42        val = self._value.Color
43        return Color(_existing=val)
44    @color.setter
45    def color(self, val: Color):
46        tmp = self._value
47        tmp.Color = val._value
48        self._value = tmp
49    @property
50    def line_style(self) -> LineStyle:
51        """The line style for the stroke."""
52        val = int(self._value.LineStyle)
53        return LineStyle(val)
54    @line_style.setter
55    def line_style(self, val: LineStyle):
56        tmp = self._value
57        tmp.LineStyle = _LineStyle(val.value if hasattr(val, "value") else int(val))
58        self._value = tmp
59    @property
60    def thickness(self) -> int:
61        """The thickness of the stroke."""
62        val = self._value.Thickness
63        return val
64    @thickness.setter
65    def thickness(self, val: int):
66        tmp = self._value
67        tmp.Thickness = val
68        self._value = tmp
69    @property
70    def is_visible(self) -> bool:
71        """Indicates whether the stroke is visible"""
72        val = self._value.IsVisible
73        return val
74    @is_visible.setter
75    def is_visible(self, val: bool):
76        tmp = self._value
77        tmp.IsVisible = val
78        self._value = tmp
79    @property
80    def editable_fields(self) -> StrokeEditableFields:
81        val = int(self._value.EditableFields)
82        return StrokeEditableFields(val)
83    @editable_fields.setter
84    def editable_fields(self, val: StrokeEditableFields):
85        tmp = self._value
86        tmp.EditableFields = _StrokeEditableFields(val.value if hasattr(val, "value") else int(val))
87        self._value = tmp

Represents a line style with color, dash style, and thickness.

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

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

color: tbapi.api.models.color.Color
38    @property
39    def color(self) -> Color:
40        """The color of the stroke."""
41        from tbapi.api.models.color import Color
42        val = self._value.Color
43        return Color(_existing=val)

The color of the stroke.

line_style: tbapi.core.enums.line_style.LineStyle
49    @property
50    def line_style(self) -> LineStyle:
51        """The line style for the stroke."""
52        val = int(self._value.LineStyle)
53        return LineStyle(val)

The line style for the stroke.

thickness: int
59    @property
60    def thickness(self) -> int:
61        """The thickness of the stroke."""
62        val = self._value.Thickness
63        return val

The thickness of the stroke.

is_visible: bool
69    @property
70    def is_visible(self) -> bool:
71        """Indicates whether the stroke is visible"""
72        val = self._value.IsVisible
73        return val

Indicates whether the stroke is visible

79    @property
80    def editable_fields(self) -> StrokeEditableFields:
81        val = int(self._value.EditableFields)
82        return StrokeEditableFields(val)