Skip to content

Commit ba41532

Browse files
authored
Merge pull request #159 from samson0v/master
Updated client to 3.7.0
2 parents 24fcd2a + a8a3de2 commit ba41532

File tree

1,042 files changed

+38686
-32447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,042 files changed

+38686
-32447
lines changed

examples/example_application.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def main():
4949
# Also, you can use default Device Profile:
5050
# default_device_profile_id = rest_client.get_default_device_profile_info().id
5151
device_profile = DeviceProfile(name="Thermometer",
52+
type="DEFAULT",
53+
transport_type="DEFAULT",
5254
profile_data=DeviceProfileData(configuration={"type": "DEFAULT"},
5355
transport_configuration={"type": "DEFAULT"}))
5456
device_profile = rest_client.save_device_profile(device_profile)

examples/example_application_2.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,16 @@ def main():
102102
email=user_email,
103103
additional_info=additional_info)
104104
user = rest_client.save_user(user, send_activation_mail=False)
105-
rest_client.activate_user(body=ActivateUserRequest(user.id, user_password), send_activation_mail=False)
105+
activation_link = rest_client.get_activation_link(user.id.id)
106+
activate_token = activation_link.split('=')[-1][:-1]
107+
rest_client.activate_user(body=ActivateUserRequest(activate_token, user_password),
108+
send_activation_mail=False)
106109

107110
rest_client.add_entities_to_entity_group(customer1_administrators.id, [user.id.id])
108111
logging.info('User created:\n%r\n', user)
109112
except ApiException as e:
110113
logging.exception(e)
111114

115+
112116
if __name__ == '__main__':
113-
main()
117+
main()

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
certifi >= 2017.4.17
1+
certifi >= 2023.7.22
22
six >= 1.10
33
python_dateutil >= 2.5.3
44
setuptools >= 21.0.0
5-
urllib3 >= 1.23
6-
requests>=2.29.0
5+
urllib3 >= 2.0.7
6+
requests>=2.31.0
77
pyjwt==2.6.0

setup.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,13 @@
3636
long_description=long_description,
3737
download_url='https://github.com/thingsboard/thingsboard-python-rest-client/archive/refs/tags/%s.tar.gz' % VERSION,
3838
python_requires=">=3.7",
39+
install_requires=[
40+
'certifi >= 2023.7.22',
41+
'six >= 1.10',
42+
'python_dateutil >= 2.5.3',
43+
'setuptools >= 21.0.0',
44+
'urllib3 >= 2.0.7',
45+
'requests>=2.31.0',
46+
'pyjwt==2.6.0',
47+
]
3948
)

tb_rest_client/api/api_ce/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@
4343
from .usage_info_controller_api import UsageInfoControllerApi
4444
from .two_factor_auth_config_controller_api import TwoFactorAuthConfigControllerApi
4545
from .image_controller_api import ImageControllerApi
46+
from .mobile_application_controller_api import MobileApplicationControllerApi
47+
from .queue_stats_controller_api import QueueStatsControllerApi

tb_rest_client/api/api_ce/admin_controller_api.py

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
ThingsBoard open-source IoT platform REST API documentation. # noqa: E501
77
8-
OpenAPI spec version: 3.6.3
8+
OpenAPI spec version: 3.7.0
99
Contact: info@thingsboard.io
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
@@ -186,6 +186,10 @@ def check_repository_access_using_post_with_http_info(self, **kwargs): # noqa:
186186
)
187187
params[key] = val
188188
del params['kwargs']
189+
# verify the required parameter 'body' is set
190+
if ('body' not in params or
191+
params['body'] is None):
192+
raise ValueError("Missing the required parameter `body` when calling `check_repository_access`") # noqa: E501
189193

190194
collection_formats = {}
191195

@@ -955,7 +959,7 @@ def get_jwt_settings_using_get(self, **kwargs): # noqa: E501
955959
>>> result = thread.get()
956960
957961
:param async_req bool
958-
:return: JWTSettings
962+
:return: JwtSettings
959963
If the method is called asynchronously,
960964
returns the request thread.
961965
"""
@@ -976,7 +980,7 @@ def get_jwt_settings_using_get_with_http_info(self, **kwargs): # noqa: E501
976980
>>> result = thread.get()
977981
978982
:param async_req bool
979-
:return: JWTSettings
983+
:return: JwtSettings
980984
If the method is called asynchronously,
981985
returns the request thread.
982986
"""
@@ -1017,14 +1021,14 @@ def get_jwt_settings_using_get_with_http_info(self, **kwargs): # noqa: E501
10171021
auth_settings = ['X-Authorization'] # noqa: E501
10181022

10191023
return self.api_client.call_api(
1020-
'/api/admin/jwtSettings', 'GET',
1024+
'/api/admin/JwtSettings', 'GET',
10211025
path_params,
10221026
query_params,
10231027
header_params,
10241028
body=body_params,
10251029
post_params=form_params,
10261030
files=local_var_files,
1027-
response_type='JWTSettings', # noqa: E501
1031+
response_type='JwtSettings', # noqa: E501
10281032
auth_settings=auth_settings,
10291033
async_req=params.get('async_req'),
10301034
_return_http_data_only=params.get('_return_http_data_only'),
@@ -1605,6 +1609,10 @@ def save_admin_settings_using_post_with_http_info(self, **kwargs): # noqa: E501
16051609
)
16061610
params[key] = val
16071611
del params['kwargs']
1612+
# verify the required parameter 'body' is set
1613+
if ('body' not in params or
1614+
params['body'] is None):
1615+
raise ValueError("Missing the required parameter `body` when calling `save_admin_settings`") # noqa: E501
16081616

16091617
collection_formats = {}
16101618

@@ -1700,6 +1708,10 @@ def save_auto_commit_settings_using_post_with_http_info(self, **kwargs): # noqa
17001708
)
17011709
params[key] = val
17021710
del params['kwargs']
1711+
# verify the required parameter 'body' is set
1712+
if ('body' not in params or
1713+
params['body'] is None):
1714+
raise ValueError("Missing the required parameter `body` when calling `save_auto_commit_settings`") # noqa: E501
17031715

17041716
collection_formats = {}
17051717

@@ -1734,7 +1746,7 @@ def save_auto_commit_settings_using_post_with_http_info(self, **kwargs): # noqa
17341746
body=body_params,
17351747
post_params=form_params,
17361748
files=local_var_files,
1737-
response_type='dict(str, AutoVersionCreateConfig)', # noqa: E501
1749+
response_type='AutoCommitSettings', # noqa: E501
17381750
auth_settings=auth_settings,
17391751
async_req=params.get('async_req'),
17401752
_return_http_data_only=params.get('_return_http_data_only'),
@@ -1752,8 +1764,8 @@ def save_jwt_settings_using_post(self, **kwargs): # noqa: E501
17521764
>>> result = thread.get()
17531765
17541766
:param async_req bool
1755-
:param JWTSettings body:
1756-
:return: JWTPair
1767+
:param JwtSettings body:
1768+
:return: JwtPair
17571769
If the method is called asynchronously,
17581770
returns the request thread.
17591771
"""
@@ -1774,8 +1786,8 @@ def save_jwt_settings_using_post_with_http_info(self, **kwargs): # noqa: E501
17741786
>>> result = thread.get()
17751787
17761788
:param async_req bool
1777-
:param JWTSettings body:
1778-
:return: JWTPair
1789+
:param JwtSettings body:
1790+
:return: JwtPair
17791791
If the method is called asynchronously,
17801792
returns the request thread.
17811793
"""
@@ -1795,6 +1807,10 @@ def save_jwt_settings_using_post_with_http_info(self, **kwargs): # noqa: E501
17951807
)
17961808
params[key] = val
17971809
del params['kwargs']
1810+
# verify the required parameter 'body' is set
1811+
if ('body' not in params or
1812+
params['body'] is None):
1813+
raise ValueError("Missing the required parameter `body` when calling `save_jwt_settings`") # noqa: E501
17981814

17991815
collection_formats = {}
18001816

@@ -1822,14 +1838,14 @@ def save_jwt_settings_using_post_with_http_info(self, **kwargs): # noqa: E501
18221838
auth_settings = ['X-Authorization'] # noqa: E501
18231839

18241840
return self.api_client.call_api(
1825-
'/api/admin/jwtSettings', 'POST',
1841+
'/api/admin/JwtSettings', 'POST',
18261842
path_params,
18271843
query_params,
18281844
header_params,
18291845
body=body_params,
18301846
post_params=form_params,
18311847
files=local_var_files,
1832-
response_type='JWTPair', # noqa: E501
1848+
response_type='JwtPair', # noqa: E501
18331849
auth_settings=auth_settings,
18341850
async_req=params.get('async_req'),
18351851
_return_http_data_only=params.get('_return_http_data_only'),
@@ -1890,6 +1906,10 @@ def save_repository_settings_using_post_with_http_info(self, **kwargs): # noqa:
18901906
)
18911907
params[key] = val
18921908
del params['kwargs']
1909+
# verify the required parameter 'body' is set
1910+
if ('body' not in params or
1911+
params['body'] is None):
1912+
raise ValueError("Missing the required parameter `body` when calling `save_repository_settings`") # noqa: E501
18931913

18941914
collection_formats = {}
18951915

@@ -1985,6 +2005,10 @@ def save_security_settings_using_post_with_http_info(self, **kwargs): # noqa: E
19852005
)
19862006
params[key] = val
19872007
del params['kwargs']
2008+
# verify the required parameter 'body' is set
2009+
if ('body' not in params or
2010+
params['body'] is None):
2011+
raise ValueError("Missing the required parameter `body` when calling `save_security_settings`") # noqa: E501
19882012

19892013
collection_formats = {}
19902014

@@ -2080,6 +2104,10 @@ def send_test_mail_using_post_with_http_info(self, **kwargs): # noqa: E501
20802104
)
20812105
params[key] = val
20822106
del params['kwargs']
2107+
# verify the required parameter 'body' is set
2108+
if ('body' not in params or
2109+
params['body'] is None):
2110+
raise ValueError("Missing the required parameter `body` when calling `send_test_mail`") # noqa: E501
20832111

20842112
collection_formats = {}
20852113

@@ -2175,6 +2203,10 @@ def send_test_sms_using_post_with_http_info(self, **kwargs): # noqa: E501
21752203
)
21762204
params[key] = val
21772205
del params['kwargs']
2206+
# verify the required parameter 'body' is set
2207+
if ('body' not in params or
2208+
params['body'] is None):
2209+
raise ValueError("Missing the required parameter `body` when calling `send_test_sms`") # noqa: E501
21782210

21792211
collection_formats = {}
21802212

tb_rest_client/api/api_ce/alarm_comment_controller_api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
ThingsBoard open-source IoT platform REST API documentation. # noqa: E501
77
8-
OpenAPI spec version: 3.6.3
8+
OpenAPI spec version: 3.7.0
99
Contact: info@thingsboard.io
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
@@ -323,6 +323,10 @@ def save_alarm_comment_using_post_with_http_info(self, alarm_id, **kwargs): # n
323323
)
324324
params[key] = val
325325
del params['kwargs']
326+
# verify the required parameter 'body' is set
327+
if ('body' not in params or
328+
params['body'] is None):
329+
raise ValueError("Missing the required parameter `body` when calling `save_alarm_comment`") # noqa: E501
326330
# verify the required parameter 'alarm_id' is set
327331
if ('alarm_id' not in params or
328332
params['alarm_id'] is None):

tb_rest_client/api/api_ce/alarm_controller_api.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
ThingsBoard open-source IoT platform REST API documentation. # noqa: E501
77
8-
OpenAPI spec version: 3.6.3
8+
OpenAPI spec version: 3.7.0
99
Contact: info@thingsboard.io
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
@@ -995,10 +995,13 @@ def get_alarms_v2_using_get_with_http_info(self, entity_type, entity_id, page_si
995995
query_params = []
996996
if 'status_list' in params:
997997
query_params.append(('statusList', params['status_list'])) # noqa: E501
998+
collection_formats['statusList'] = 'multi' # noqa: E501
998999
if 'severity_list' in params:
9991000
query_params.append(('severityList', params['severity_list'])) # noqa: E501
1001+
collection_formats['severityList'] = 'multi' # noqa: E501
10001002
if 'type_list' in params:
10011003
query_params.append(('typeList', params['type_list'])) # noqa: E501
1004+
collection_formats['typeList'] = 'multi' # noqa: E501
10021005
if 'assignee_id' in params:
10031006
query_params.append(('assigneeId', params['assignee_id'])) # noqa: E501
10041007
if 'page_size' in params:
@@ -1273,10 +1276,13 @@ def get_all_alarms_v2_using_get_with_http_info(self, page_size, page, **kwargs):
12731276
query_params = []
12741277
if 'status_list' in params:
12751278
query_params.append(('statusList', params['status_list'])) # noqa: E501
1279+
collection_formats['statusList'] = 'multi' # noqa: E501
12761280
if 'severity_list' in params:
12771281
query_params.append(('severityList', params['severity_list'])) # noqa: E501
1282+
collection_formats['severityList'] = 'multi' # noqa: E501
12781283
if 'type_list' in params:
12791284
query_params.append(('typeList', params['type_list'])) # noqa: E501
1285+
collection_formats['typeList'] = 'multi' # noqa: E501
12801286
if 'assignee_id' in params:
12811287
query_params.append(('assigneeId', params['assignee_id'])) # noqa: E501
12821288
if 'page_size' in params:
@@ -1491,6 +1497,10 @@ def save_alarm_using_post_with_http_info(self, **kwargs): # noqa: E501
14911497
)
14921498
params[key] = val
14931499
del params['kwargs']
1500+
# verify the required parameter 'body' is set
1501+
if ('body' not in params or
1502+
params['body'] is None):
1503+
raise ValueError("Missing the required parameter `body` when calling `save_alarm`") # noqa: E501
14941504

14951505
collection_formats = {}
14961506

tb_rest_client/api/api_ce/asset_controller_api.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
ThingsBoard open-source IoT platform REST API documentation. # noqa: E501
77
8-
OpenAPI spec version: 3.6.3
8+
OpenAPI spec version: 3.7.0
99
Contact: info@thingsboard.io
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
@@ -495,6 +495,10 @@ def find_by_query_using_post_with_http_info(self, **kwargs): # noqa: E501
495495
)
496496
params[key] = val
497497
del params['kwargs']
498+
# verify the required parameter 'body' is set
499+
if ('body' not in params or
500+
params['body'] is None):
501+
raise ValueError("Missing the required parameter `body` when calling `find_by_query4`") # noqa: E501
498502

499503
collection_formats = {}
500504

@@ -1692,6 +1696,10 @@ def process_assets_bulk_import_using_post_with_http_info(self, **kwargs): # noq
16921696
)
16931697
params[key] = val
16941698
del params['kwargs']
1699+
# verify the required parameter 'body' is set
1700+
if ('body' not in params or
1701+
params['body'] is None):
1702+
raise ValueError("Missing the required parameter `body` when calling `process_assets_bulk_import`") # noqa: E501
16951703

16961704
collection_formats = {}
16971705

@@ -1787,6 +1795,10 @@ def save_asset_using_post_with_http_info(self, **kwargs): # noqa: E501
17871795
)
17881796
params[key] = val
17891797
del params['kwargs']
1798+
# verify the required parameter 'body' is set
1799+
if ('body' not in params or
1800+
params['body'] is None):
1801+
raise ValueError("Missing the required parameter `body` when calling `save_asset`") # noqa: E501
17901802

17911803
collection_formats = {}
17921804

tb_rest_client/api/api_ce/asset_profile_controller_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
ThingsBoard open-source IoT platform REST API documentation. # noqa: E501
77
8-
OpenAPI spec version: 3.6.3
8+
OpenAPI spec version: 3.7.0
99
Contact: info@thingsboard.io
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

0 commit comments

Comments
 (0)