Skip to content

Commit 0066e0f

Browse files
authored
Merge pull request #105 from samson0v/issue/101
Added Alarm Comments API
2 parents 5d4fe74 + 521c694 commit 0066e0f

File tree

7 files changed

+1136
-0
lines changed

7 files changed

+1136
-0
lines changed

tb_rest_client/api/api_ce/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@
3434
from .device_api_controller_api import DeviceApiControllerApi
3535
from .two_fa_config_controller_api import TwoFaConfigControllerApi
3636
from .two_factor_auth_controller_api import TwoFactorAuthControllerApi
37+
from .alarm_comment_controller_api import AlarmCommentControllerApi

tb_rest_client/api/api_ce/alarm_comment_controller_api.py

+358
Large diffs are not rendered by default.

tb_rest_client/models/models_ce/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -299,3 +299,6 @@
299299
from .entity_load_error import EntityLoadError
300300
from .jwt_settings import JWTSettings
301301
from .jwt_pair import JWTPair
302+
from .alarm_comment import AlarmComment
303+
from .alarm_comment_id import AlarmCommentId
304+
from .alarm_comment_info import AlarmCommentInfo
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
# coding: utf-8
2+
3+
"""
4+
ThingsBoard REST API
5+
6+
ThingsBoard open-source IoT platform REST API documentation. # noqa: E501
7+
8+
OpenAPI spec version: 3.5.0-SNAPSHOT
9+
10+
Generated by: https://github.com./swagger-api/swagger-codegen.git
11+
"""
12+
13+
import pprint
14+
import re # noqa: F401
15+
16+
import six
17+
18+
class AlarmComment(object):
19+
"""NOTE: This class is auto generated by the swagger code generator program.
20+
21+
Do not edit the class manually.
22+
"""
23+
"""
24+
Attributes:
25+
swagger_types (dict): The key is attribute name
26+
and the value is attribute type.
27+
attribute_map (dict): The key is attribute name
28+
and the value is json key in definition.
29+
"""
30+
swagger_types = {
31+
'id': 'AlarmCommentId',
32+
'created_time': 'int',
33+
'alarm_id': 'EntityId',
34+
'user_id': 'UserId',
35+
'name': 'str',
36+
'type': 'str',
37+
'comment': 'JsonNode'
38+
}
39+
40+
attribute_map = {
41+
'id': 'id',
42+
'created_time': 'createdTime',
43+
'alarm_id': 'alarmId',
44+
'user_id': 'userId',
45+
'name': 'name',
46+
'type': 'type',
47+
'comment': 'comment'
48+
}
49+
50+
def __init__(self, id=None, created_time=None, alarm_id=None, user_id=None, name=None, type=None, comment=None): # noqa: E501
51+
"""AlarmComment - a model defined in Swagger""" # noqa: E501
52+
self._id = None
53+
self._created_time = None
54+
self._alarm_id = None
55+
self._user_id = None
56+
self._name = None
57+
self._type = None
58+
self._comment = None
59+
self.discriminator = None
60+
if id is not None:
61+
self.id = id
62+
if created_time is not None:
63+
self.created_time = created_time
64+
if alarm_id is not None:
65+
self.alarm_id = alarm_id
66+
if user_id is not None:
67+
self.user_id = user_id
68+
self.name = name
69+
if type is not None:
70+
self.type = type
71+
if comment is not None:
72+
self.comment = comment
73+
74+
@property
75+
def id(self):
76+
"""Gets the id of this AlarmComment. # noqa: E501
77+
78+
79+
:return: The id of this AlarmComment. # noqa: E501
80+
:rtype: AlarmCommentId
81+
"""
82+
return self._id
83+
84+
@id.setter
85+
def id(self, id):
86+
"""Sets the id of this AlarmComment.
87+
88+
89+
:param id: The id of this AlarmComment. # noqa: E501
90+
:type: AlarmCommentId
91+
"""
92+
93+
self._id = id
94+
95+
@property
96+
def created_time(self):
97+
"""Gets the created_time of this AlarmComment. # noqa: E501
98+
99+
Timestamp of the alarm comment creation, in milliseconds # noqa: E501
100+
101+
:return: The created_time of this AlarmComment. # noqa: E501
102+
:rtype: int
103+
"""
104+
return self._created_time
105+
106+
@created_time.setter
107+
def created_time(self, created_time):
108+
"""Sets the created_time of this AlarmComment.
109+
110+
Timestamp of the alarm comment creation, in milliseconds # noqa: E501
111+
112+
:param created_time: The created_time of this AlarmComment. # noqa: E501
113+
:type: int
114+
"""
115+
116+
self._created_time = created_time
117+
118+
@property
119+
def alarm_id(self):
120+
"""Gets the alarm_id of this AlarmComment. # noqa: E501
121+
122+
123+
:return: The alarm_id of this AlarmComment. # noqa: E501
124+
:rtype: EntityId
125+
"""
126+
return self._alarm_id
127+
128+
@alarm_id.setter
129+
def alarm_id(self, alarm_id):
130+
"""Sets the alarm_id of this AlarmComment.
131+
132+
133+
:param alarm_id: The alarm_id of this AlarmComment. # noqa: E501
134+
:type: EntityId
135+
"""
136+
137+
self._alarm_id = alarm_id
138+
139+
@property
140+
def user_id(self):
141+
"""Gets the user_id of this AlarmComment. # noqa: E501
142+
143+
144+
:return: The user_id of this AlarmComment. # noqa: E501
145+
:rtype: UserId
146+
"""
147+
return self._user_id
148+
149+
@user_id.setter
150+
def user_id(self, user_id):
151+
"""Sets the user_id of this AlarmComment.
152+
153+
154+
:param user_id: The user_id of this AlarmComment. # noqa: E501
155+
:type: UserId
156+
"""
157+
158+
self._user_id = user_id
159+
160+
@property
161+
def name(self):
162+
"""Gets the name of this AlarmComment. # noqa: E501
163+
164+
representing comment text # noqa: E501
165+
166+
:return: The name of this AlarmComment. # noqa: E501
167+
:rtype: str
168+
"""
169+
return self._name
170+
171+
@name.setter
172+
def name(self, name):
173+
"""Sets the name of this AlarmComment.
174+
175+
representing comment text # noqa: E501
176+
177+
:param name: The name of this AlarmComment. # noqa: E501
178+
:type: str
179+
"""
180+
if name is None:
181+
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
182+
183+
self._name = name
184+
185+
@property
186+
def type(self):
187+
"""Gets the type of this AlarmComment. # noqa: E501
188+
189+
Defines origination of comment. System type means comment was created by TB. OTHER type means comment was created by user. # noqa: E501
190+
191+
:return: The type of this AlarmComment. # noqa: E501
192+
:rtype: str
193+
"""
194+
return self._type
195+
196+
@type.setter
197+
def type(self, type):
198+
"""Sets the type of this AlarmComment.
199+
200+
Defines origination of comment. System type means comment was created by TB. OTHER type means comment was created by user. # noqa: E501
201+
202+
:param type: The type of this AlarmComment. # noqa: E501
203+
:type: str
204+
"""
205+
allowed_values = ["OTHER", "SYSTEM"] # noqa: E501
206+
if type not in allowed_values:
207+
raise ValueError(
208+
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
209+
.format(type, allowed_values)
210+
)
211+
212+
self._type = type
213+
214+
@property
215+
def comment(self):
216+
"""Gets the comment of this AlarmComment. # noqa: E501
217+
218+
219+
:return: The comment of this AlarmComment. # noqa: E501
220+
:rtype: JsonNode
221+
"""
222+
return self._comment
223+
224+
@comment.setter
225+
def comment(self, comment):
226+
"""Sets the comment of this AlarmComment.
227+
228+
229+
:param comment: The comment of this AlarmComment. # noqa: E501
230+
:type: JsonNode
231+
"""
232+
233+
self._comment = comment
234+
235+
def to_dict(self):
236+
"""Returns the model properties as a dict"""
237+
result = {}
238+
239+
for attr, _ in six.iteritems(self.swagger_types):
240+
value = getattr(self, attr)
241+
if isinstance(value, list):
242+
result[attr] = list(map(
243+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
244+
value
245+
))
246+
elif hasattr(value, "to_dict"):
247+
result[attr] = value.to_dict()
248+
elif isinstance(value, dict):
249+
result[attr] = dict(map(
250+
lambda item: (item[0], item[1].to_dict())
251+
if hasattr(item[1], "to_dict") else item,
252+
value.items()
253+
))
254+
else:
255+
result[attr] = value
256+
if issubclass(AlarmComment, dict):
257+
for key, value in self.items():
258+
result[key] = value
259+
260+
return result
261+
262+
def to_str(self):
263+
"""Returns the string representation of the model"""
264+
return pprint.pformat(self.to_dict())
265+
266+
def __repr__(self):
267+
"""For `print` and `pprint`"""
268+
return self.to_str()
269+
270+
def __eq__(self, other):
271+
"""Returns true if both objects are equal"""
272+
if not isinstance(other, AlarmComment):
273+
return False
274+
275+
return self.__dict__ == other.__dict__
276+
277+
def __ne__(self, other):
278+
"""Returns true if both objects are not equal"""
279+
return not self == other

0 commit comments

Comments
 (0)