Skip to content

Commit

Permalink
Merge pull request #159 from samson0v/master
Browse files Browse the repository at this point in the history
Updated client to 3.7.0
  • Loading branch information
imbeacon authored Jul 1, 2024
2 parents 24fcd2a + a8a3de2 commit ba41532
Show file tree
Hide file tree
Showing 1,042 changed files with 38,686 additions and 32,447 deletions.
2 changes: 2 additions & 0 deletions examples/example_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def main():
# Also, you can use default Device Profile:
# default_device_profile_id = rest_client.get_default_device_profile_info().id
device_profile = DeviceProfile(name="Thermometer",
type="DEFAULT",
transport_type="DEFAULT",
profile_data=DeviceProfileData(configuration={"type": "DEFAULT"},
transport_configuration={"type": "DEFAULT"}))
device_profile = rest_client.save_device_profile(device_profile)
Expand Down
8 changes: 6 additions & 2 deletions examples/example_application_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,16 @@ def main():
email=user_email,
additional_info=additional_info)
user = rest_client.save_user(user, send_activation_mail=False)
rest_client.activate_user(body=ActivateUserRequest(user.id, user_password), send_activation_mail=False)
activation_link = rest_client.get_activation_link(user.id.id)
activate_token = activation_link.split('=')[-1][:-1]
rest_client.activate_user(body=ActivateUserRequest(activate_token, user_password),
send_activation_mail=False)

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


if __name__ == '__main__':
main()
main()
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
certifi >= 2017.4.17
certifi >= 2023.7.22
six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.23
requests>=2.29.0
urllib3 >= 2.0.7
requests>=2.31.0
pyjwt==2.6.0
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,13 @@
long_description=long_description,
download_url='https://github.com/thingsboard/thingsboard-python-rest-client/archive/refs/tags/%s.tar.gz' % VERSION,
python_requires=">=3.7",
install_requires=[
'certifi >= 2023.7.22',
'six >= 1.10',
'python_dateutil >= 2.5.3',
'setuptools >= 21.0.0',
'urllib3 >= 2.0.7',
'requests>=2.31.0',
'pyjwt==2.6.0',
]
)
2 changes: 2 additions & 0 deletions tb_rest_client/api/api_ce/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@
from .usage_info_controller_api import UsageInfoControllerApi
from .two_factor_auth_config_controller_api import TwoFactorAuthConfigControllerApi
from .image_controller_api import ImageControllerApi
from .mobile_application_controller_api import MobileApplicationControllerApi
from .queue_stats_controller_api import QueueStatsControllerApi
56 changes: 44 additions & 12 deletions tb_rest_client/api/api_ce/admin_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ThingsBoard open-source IoT platform REST API documentation. # noqa: E501
OpenAPI spec version: 3.6.3
OpenAPI spec version: 3.7.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down Expand Up @@ -186,6 +186,10 @@ def check_repository_access_using_post_with_http_info(self, **kwargs): # noqa:
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `check_repository_access`") # noqa: E501

collection_formats = {}

Expand Down Expand Up @@ -955,7 +959,7 @@ def get_jwt_settings_using_get(self, **kwargs): # noqa: E501
>>> result = thread.get()
:param async_req bool
:return: JWTSettings
:return: JwtSettings
If the method is called asynchronously,
returns the request thread.
"""
Expand All @@ -976,7 +980,7 @@ def get_jwt_settings_using_get_with_http_info(self, **kwargs): # noqa: E501
>>> result = thread.get()
:param async_req bool
:return: JWTSettings
:return: JwtSettings
If the method is called asynchronously,
returns the request thread.
"""
Expand Down Expand Up @@ -1017,14 +1021,14 @@ def get_jwt_settings_using_get_with_http_info(self, **kwargs): # noqa: E501
auth_settings = ['X-Authorization'] # noqa: E501

return self.api_client.call_api(
'/api/admin/jwtSettings', 'GET',
'/api/admin/JwtSettings', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='JWTSettings', # noqa: E501
response_type='JwtSettings', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -1605,6 +1609,10 @@ def save_admin_settings_using_post_with_http_info(self, **kwargs): # noqa: E501
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `save_admin_settings`") # noqa: E501

collection_formats = {}

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

collection_formats = {}

Expand Down Expand Up @@ -1734,7 +1746,7 @@ def save_auto_commit_settings_using_post_with_http_info(self, **kwargs): # noqa
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='dict(str, AutoVersionCreateConfig)', # noqa: E501
response_type='AutoCommitSettings', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand All @@ -1752,8 +1764,8 @@ def save_jwt_settings_using_post(self, **kwargs): # noqa: E501
>>> result = thread.get()
:param async_req bool
:param JWTSettings body:
:return: JWTPair
:param JwtSettings body:
:return: JwtPair
If the method is called asynchronously,
returns the request thread.
"""
Expand All @@ -1774,8 +1786,8 @@ def save_jwt_settings_using_post_with_http_info(self, **kwargs): # noqa: E501
>>> result = thread.get()
:param async_req bool
:param JWTSettings body:
:return: JWTPair
:param JwtSettings body:
:return: JwtPair
If the method is called asynchronously,
returns the request thread.
"""
Expand All @@ -1795,6 +1807,10 @@ def save_jwt_settings_using_post_with_http_info(self, **kwargs): # noqa: E501
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `save_jwt_settings`") # noqa: E501

collection_formats = {}

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

return self.api_client.call_api(
'/api/admin/jwtSettings', 'POST',
'/api/admin/JwtSettings', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='JWTPair', # noqa: E501
response_type='JwtPair', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -1890,6 +1906,10 @@ def save_repository_settings_using_post_with_http_info(self, **kwargs): # noqa:
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `save_repository_settings`") # noqa: E501

collection_formats = {}

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

collection_formats = {}

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

collection_formats = {}

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

collection_formats = {}

Expand Down
6 changes: 5 additions & 1 deletion tb_rest_client/api/api_ce/alarm_comment_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ThingsBoard open-source IoT platform REST API documentation. # noqa: E501
OpenAPI spec version: 3.6.3
OpenAPI spec version: 3.7.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down Expand Up @@ -323,6 +323,10 @@ def save_alarm_comment_using_post_with_http_info(self, alarm_id, **kwargs): # n
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `save_alarm_comment`") # noqa: E501
# verify the required parameter 'alarm_id' is set
if ('alarm_id' not in params or
params['alarm_id'] is None):
Expand Down
12 changes: 11 additions & 1 deletion tb_rest_client/api/api_ce/alarm_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ThingsBoard open-source IoT platform REST API documentation. # noqa: E501
OpenAPI spec version: 3.6.3
OpenAPI spec version: 3.7.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down Expand Up @@ -995,10 +995,13 @@ def get_alarms_v2_using_get_with_http_info(self, entity_type, entity_id, page_si
query_params = []
if 'status_list' in params:
query_params.append(('statusList', params['status_list'])) # noqa: E501
collection_formats['statusList'] = 'multi' # noqa: E501
if 'severity_list' in params:
query_params.append(('severityList', params['severity_list'])) # noqa: E501
collection_formats['severityList'] = 'multi' # noqa: E501
if 'type_list' in params:
query_params.append(('typeList', params['type_list'])) # noqa: E501
collection_formats['typeList'] = 'multi' # noqa: E501
if 'assignee_id' in params:
query_params.append(('assigneeId', params['assignee_id'])) # noqa: E501
if 'page_size' in params:
Expand Down Expand Up @@ -1273,10 +1276,13 @@ def get_all_alarms_v2_using_get_with_http_info(self, page_size, page, **kwargs):
query_params = []
if 'status_list' in params:
query_params.append(('statusList', params['status_list'])) # noqa: E501
collection_formats['statusList'] = 'multi' # noqa: E501
if 'severity_list' in params:
query_params.append(('severityList', params['severity_list'])) # noqa: E501
collection_formats['severityList'] = 'multi' # noqa: E501
if 'type_list' in params:
query_params.append(('typeList', params['type_list'])) # noqa: E501
collection_formats['typeList'] = 'multi' # noqa: E501
if 'assignee_id' in params:
query_params.append(('assigneeId', params['assignee_id'])) # noqa: E501
if 'page_size' in params:
Expand Down Expand Up @@ -1491,6 +1497,10 @@ def save_alarm_using_post_with_http_info(self, **kwargs): # noqa: E501
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `save_alarm`") # noqa: E501

collection_formats = {}

Expand Down
14 changes: 13 additions & 1 deletion tb_rest_client/api/api_ce/asset_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ThingsBoard open-source IoT platform REST API documentation. # noqa: E501
OpenAPI spec version: 3.6.3
OpenAPI spec version: 3.7.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down Expand Up @@ -495,6 +495,10 @@ def find_by_query_using_post_with_http_info(self, **kwargs): # noqa: E501
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `find_by_query4`") # noqa: E501

collection_formats = {}

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

collection_formats = {}

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

collection_formats = {}

Expand Down
2 changes: 1 addition & 1 deletion tb_rest_client/api/api_ce/asset_profile_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ThingsBoard open-source IoT platform REST API documentation. # noqa: E501
OpenAPI spec version: 3.6.3
OpenAPI spec version: 3.7.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion tb_rest_client/api/api_ce/audit_log_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ThingsBoard open-source IoT platform REST API documentation. # noqa: E501
OpenAPI spec version: 3.6.3
OpenAPI spec version: 3.7.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
Loading

0 comments on commit ba41532

Please sign in to comment.