tbctl 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (829) hide show
  1. tb_client/__init__.py +1 -0
  2. tb_client/api/__init__.py +1 -0
  3. tb_client/api/admin_controller_api.py +7410 -0
  4. tb_client/api/ai_model_controller_api.py +1524 -0
  5. tb_client/api/alarm_comment_controller_api.py +982 -0
  6. tb_client/api/alarm_controller_api.py +4821 -0
  7. tb_client/api/api_key_controller_api.py +1568 -0
  8. tb_client/api/asset_controller_api.py +4920 -0
  9. tb_client/api/asset_profile_controller_api.py +2973 -0
  10. tb_client/api/audit_log_controller_api.py +1691 -0
  11. tb_client/api/auth_controller_api.py +2554 -0
  12. tb_client/api/blob_entity_controller_api.py +1550 -0
  13. tb_client/api/calculated_field_controller_api.py +3493 -0
  14. tb_client/api/component_descriptor_controller_api.py +907 -0
  15. tb_client/api/converter_controller_api.py +2809 -0
  16. tb_client/api/converter_library_controller_api.py +2490 -0
  17. tb_client/api/custom_menu_controller_api.py +3101 -0
  18. tb_client/api/custom_translation_controller_api.py +2076 -0
  19. tb_client/api/customer_controller_api.py +4162 -0
  20. tb_client/api/dashboard_controller_api.py +6553 -0
  21. tb_client/api/dashboard_report_controller_api.py +657 -0
  22. tb_client/api/device_api_controller_api.py +3441 -0
  23. tb_client/api/device_connectivity_controller_api.py +869 -0
  24. tb_client/api/device_controller_api.py +7390 -0
  25. tb_client/api/device_group_ota_package_controller_api.py +887 -0
  26. tb_client/api/device_profile_controller_api.py +3548 -0
  27. tb_client/api/domain_controller_api.py +1557 -0
  28. tb_client/api/edge_controller_api.py +7752 -0
  29. tb_client/api/edge_event_controller_api.py +435 -0
  30. tb_client/api/entities_version_control_controller_api.py +3800 -0
  31. tb_client/api/entity_group_controller_api.py +11279 -0
  32. tb_client/api/entity_query_controller_api.py +2094 -0
  33. tb_client/api/entity_relation_controller_api.py +4501 -0
  34. tb_client/api/entity_view_controller_api.py +4608 -0
  35. tb_client/api/event_controller_api.py +1721 -0
  36. tb_client/api/group_permission_controller_api.py +2023 -0
  37. tb_client/api/image_controller_api.py +4427 -0
  38. tb_client/api/integration_controller_api.py +4603 -0
  39. tb_client/api/job_controller_api.py +1581 -0
  40. tb_client/api/login_endpoint_api.py +611 -0
  41. tb_client/api/lwm2m_controller_api.py +621 -0
  42. tb_client/api/mail_config_template_controller_api.py +298 -0
  43. tb_client/api/mobile_app_bundle_controller_api.py +1557 -0
  44. tb_client/api/mobile_app_controller_api.py +1838 -0
  45. tb_client/api/notification_controller_api.py +5522 -0
  46. tb_client/api/notification_rule_controller_api.py +1233 -0
  47. tb_client/api/notification_target_controller_api.py +2201 -0
  48. tb_client/api/notification_template_controller_api.py +1547 -0
  49. tb_client/api/o_auth2_config_template_controller_api.py +868 -0
  50. tb_client/api/o_auth2_controller_api.py +2070 -0
  51. tb_client/api/ota_package_controller_api.py +2880 -0
  52. tb_client/api/owner_controller_api.py +710 -0
  53. tb_client/api/qr_code_settings_controller_api.py +1664 -0
  54. tb_client/api/queue_controller_api.py +1542 -0
  55. tb_client/api/queue_stats_controller_api.py +944 -0
  56. tb_client/api/report_controller_api.py +2754 -0
  57. tb_client/api/report_template_controller_api.py +1842 -0
  58. tb_client/api/role_controller_api.py +1528 -0
  59. tb_client/api/rpc_v1_controller_api.py +647 -0
  60. tb_client/api/rpc_v2_controller_api.py +1594 -0
  61. tb_client/api/rule_chain_controller_api.py +6709 -0
  62. tb_client/api/rule_engine_controller_api.py +1332 -0
  63. tb_client/api/scheduler_event_controller_api.py +4366 -0
  64. tb_client/api/secret_controller_api.py +2385 -0
  65. tb_client/api/self_registration_controller_api.py +1734 -0
  66. tb_client/api/sign_up_controller_api.py +2603 -0
  67. tb_client/api/solution_controller_api.py +1412 -0
  68. tb_client/api/tb_resource_controller_api.py +5886 -0
  69. tb_client/api/telemetry_controller_api.py +5517 -0
  70. tb_client/api/tenant_controller_api.py +2134 -0
  71. tb_client/api/tenant_profile_controller_api.py +2673 -0
  72. tb_client/api/translation_controller_api.py +1991 -0
  73. tb_client/api/trendz_api_controller_api.py +1190 -0
  74. tb_client/api/trendz_controller_api.py +1638 -0
  75. tb_client/api/two_factor_auth_config_controller_api.py +2580 -0
  76. tb_client/api/two_factor_auth_controller_api.py +1138 -0
  77. tb_client/api/ui_settings_controller_api.py +298 -0
  78. tb_client/api/usage_info_controller_api.py +295 -0
  79. tb_client/api/user_controller_api.py +9796 -0
  80. tb_client/api/user_permissions_controller_api.py +607 -0
  81. tb_client/api/white_labeling_controller_api.py +3675 -0
  82. tb_client/api/widget_type_controller_api.py +4392 -0
  83. tb_client/api/widgets_bundle_controller_api.py +2453 -0
  84. tb_client/api_client.py +805 -0
  85. tb_client/api_response.py +21 -0
  86. tb_client/configuration.py +627 -0
  87. tb_client/exceptions.py +219 -0
  88. tb_client/models/__init__.py +16 -0
  89. tb_client/models/account_two_fa_settings.py +102 -0
  90. tb_client/models/activate_user_request.py +91 -0
  91. tb_client/models/admin_settings.py +114 -0
  92. tb_client/models/admin_settings_id.py +99 -0
  93. tb_client/models/affected_tenant_administrators_filter.py +89 -0
  94. tb_client/models/affected_user_filter.py +89 -0
  95. tb_client/models/aggregation_configuration.py +101 -0
  96. tb_client/models/aggregation_params.py +115 -0
  97. tb_client/models/ai_chat_model_config_object.py +107 -0
  98. tb_client/models/ai_chat_model_config_object_provider_config.py +236 -0
  99. tb_client/models/ai_model.py +118 -0
  100. tb_client/models/ai_model_config.py +138 -0
  101. tb_client/models/ai_model_id.py +99 -0
  102. tb_client/models/alarm.py +182 -0
  103. tb_client/models/alarm_assignee.py +99 -0
  104. tb_client/models/alarm_assignment_notification_rule_trigger_config.py +128 -0
  105. tb_client/models/alarm_comment.py +140 -0
  106. tb_client/models/alarm_comment_id.py +90 -0
  107. tb_client/models/alarm_comment_info.py +146 -0
  108. tb_client/models/alarm_comment_notification_rule_trigger_config.py +121 -0
  109. tb_client/models/alarm_condition.py +103 -0
  110. tb_client/models/alarm_condition_filter.py +118 -0
  111. tb_client/models/alarm_condition_filter_key.py +101 -0
  112. tb_client/models/alarm_condition_spec.py +115 -0
  113. tb_client/models/alarm_count_query.py +145 -0
  114. tb_client/models/alarm_data.py +222 -0
  115. tb_client/models/alarm_data_page_link.py +143 -0
  116. tb_client/models/alarm_data_query.py +137 -0
  117. tb_client/models/alarm_filter_config.py +123 -0
  118. tb_client/models/alarm_id.py +99 -0
  119. tb_client/models/alarm_info.py +194 -0
  120. tb_client/models/alarm_notification_rule_trigger_config.py +121 -0
  121. tb_client/models/alarm_rule.py +107 -0
  122. tb_client/models/alarm_schedule.py +130 -0
  123. tb_client/models/alarm_table_component.py +135 -0
  124. tb_client/models/alias_entity_id.py +111 -0
  125. tb_client/models/all_users_filter.py +89 -0
  126. tb_client/models/allow_create_new_devices_device_profile_provision_configuration.py +90 -0
  127. tb_client/models/allowed_permissions_info.py +164 -0
  128. tb_client/models/amazon_bedrock_chat_model_config.py +122 -0
  129. tb_client/models/amazon_bedrock_provider_config.py +93 -0
  130. tb_client/models/anthropic_chat_model_config.py +124 -0
  131. tb_client/models/anthropic_provider_config.py +89 -0
  132. tb_client/models/any_time_schedule.py +94 -0
  133. tb_client/models/api_auth_token_post_request.py +94 -0
  134. tb_client/models/api_key.py +124 -0
  135. tb_client/models/api_key_id.py +99 -0
  136. tb_client/models/api_key_info.py +122 -0
  137. tb_client/models/api_usage_limit_notification_rule_trigger_config.py +115 -0
  138. tb_client/models/api_usage_state_filter.py +95 -0
  139. tb_client/models/argument.py +111 -0
  140. tb_client/models/asset.py +142 -0
  141. tb_client/models/asset_id.py +99 -0
  142. tb_client/models/asset_info.py +158 -0
  143. tb_client/models/asset_profile.py +134 -0
  144. tb_client/models/asset_profile_id.py +99 -0
  145. tb_client/models/asset_profile_info.py +109 -0
  146. tb_client/models/asset_search_query.py +97 -0
  147. tb_client/models/asset_search_query_filter.py +122 -0
  148. tb_client/models/asset_type_filter.py +95 -0
  149. tb_client/models/attribute_export_data.py +101 -0
  150. tb_client/models/attributes_entity_view.py +93 -0
  151. tb_client/models/attributes_immediate_output_strategy.py +99 -0
  152. tb_client/models/attributes_output.py +98 -0
  153. tb_client/models/attributes_output_strategy.py +112 -0
  154. tb_client/models/attributes_rule_chain_output_strategy.py +89 -0
  155. tb_client/models/audit_log.py +178 -0
  156. tb_client/models/audit_log_id.py +90 -0
  157. tb_client/models/auto_version_create_config.py +101 -0
  158. tb_client/models/available_entity_keys.py +102 -0
  159. tb_client/models/aws_sns_sms_provider_configuration.py +95 -0
  160. tb_client/models/azure_open_ai_chat_model_config.py +126 -0
  161. tb_client/models/azure_open_ai_provider_config.py +93 -0
  162. tb_client/models/backup_code_two_fa_account_config.py +95 -0
  163. tb_client/models/backup_code_two_fa_provider_config.py +92 -0
  164. tb_client/models/bar_series_settings.py +127 -0
  165. tb_client/models/base_read_ts_kv_query.py +119 -0
  166. tb_client/models/basic.py +93 -0
  167. tb_client/models/blob_entity_id.py +99 -0
  168. tb_client/models/blob_entity_info.py +150 -0
  169. tb_client/models/blob_entity_with_customer_info.py +156 -0
  170. tb_client/models/boolean_filter_predicate.py +107 -0
  171. tb_client/models/branch_info.py +91 -0
  172. tb_client/models/bulk_import_request.py +103 -0
  173. tb_client/models/bulk_import_result_asset.py +105 -0
  174. tb_client/models/bulk_import_result_asset_created.py +99 -0
  175. tb_client/models/bulk_import_result_device.py +105 -0
  176. tb_client/models/bulk_import_result_edge.py +105 -0
  177. tb_client/models/button.py +112 -0
  178. tb_client/models/calculated_field.py +141 -0
  179. tb_client/models/calculated_field_debug_event_filter.py +120 -0
  180. tb_client/models/calculated_field_id.py +99 -0
  181. tb_client/models/calculated_field_info.py +143 -0
  182. tb_client/models/captcha_params.py +115 -0
  183. tb_client/models/cell_settings.py +121 -0
  184. tb_client/models/cf_argument_dynamic_source_configuration.py +112 -0
  185. tb_client/models/cf_reprocessing_job_configuration.py +111 -0
  186. tb_client/models/cf_reprocessing_job_result.py +106 -0
  187. tb_client/models/cf_reprocessing_task_failure.py +95 -0
  188. tb_client/models/cf_reprocessing_task_result.py +99 -0
  189. tb_client/models/cf_reprocessing_validation_result.py +103 -0
  190. tb_client/models/change_password_request.py +91 -0
  191. tb_client/models/chart_fill_settings.py +107 -0
  192. tb_client/models/chart_fill_settings_gradient.py +91 -0
  193. tb_client/models/check_pre_provisioned_devices_device_profile_provision_configuration.py +90 -0
  194. tb_client/models/claim_request.py +89 -0
  195. tb_client/models/clear_rule.py +100 -0
  196. tb_client/models/client_attributes_querying_snmp_communication_config.py +101 -0
  197. tb_client/models/coap_device_profile_transport_configuration.py +101 -0
  198. tb_client/models/coap_device_transport_configuration.py +107 -0
  199. tb_client/models/coap_device_type_configuration.py +112 -0
  200. tb_client/models/color_range.py +93 -0
  201. tb_client/models/column_mapping.py +101 -0
  202. tb_client/models/column_settings.py +112 -0
  203. tb_client/models/comparison_ts_value.py +98 -0
  204. tb_client/models/complex_filter_predicate.py +110 -0
  205. tb_client/models/complex_version_create_request.py +118 -0
  206. tb_client/models/component_descriptor.py +170 -0
  207. tb_client/models/component_descriptor_id.py +90 -0
  208. tb_client/models/contact_based_object.py +123 -0
  209. tb_client/models/converter.py +156 -0
  210. tb_client/models/converter_id.py +99 -0
  211. tb_client/models/converters_info.py +93 -0
  212. tb_client/models/create_report_request.py +91 -0
  213. tb_client/models/csv_report_template_config.py +118 -0
  214. tb_client/models/current_owner_dynamic_source_configuration.py +89 -0
  215. tb_client/models/custom_menu.py +141 -0
  216. tb_client/models/custom_menu_config.py +97 -0
  217. tb_client/models/custom_menu_delete_result.py +111 -0
  218. tb_client/models/custom_menu_id.py +90 -0
  219. tb_client/models/custom_menu_info.py +135 -0
  220. tb_client/models/custom_menu_item.py +135 -0
  221. tb_client/models/custom_mobile_page.py +97 -0
  222. tb_client/models/custom_time_schedule.py +106 -0
  223. tb_client/models/custom_time_schedule_item.py +95 -0
  224. tb_client/models/customer.py +160 -0
  225. tb_client/models/customer_id.py +99 -0
  226. tb_client/models/customer_info.py +176 -0
  227. tb_client/models/customer_users_filter.py +92 -0
  228. tb_client/models/dashboard.py +168 -0
  229. tb_client/models/dashboard_component.py +151 -0
  230. tb_client/models/dashboard_id.py +99 -0
  231. tb_client/models/dashboard_info.py +184 -0
  232. tb_client/models/dashboard_page.py +97 -0
  233. tb_client/models/dashboard_report_config.py +112 -0
  234. tb_client/models/data_key.py +127 -0
  235. tb_client/models/data_key_comparison_settings.py +93 -0
  236. tb_client/models/data_key_settings.py +152 -0
  237. tb_client/models/data_source.py +130 -0
  238. tb_client/models/debug_converter_event_filter.py +106 -0
  239. tb_client/models/debug_integration_event_filter.py +104 -0
  240. tb_client/models/debug_settings.py +93 -0
  241. tb_client/models/default_coap_device_type_configuration.py +95 -0
  242. tb_client/models/default_dashboard_params.py +91 -0
  243. tb_client/models/default_data_key_settings.py +89 -0
  244. tb_client/models/default_device_configuration.py +89 -0
  245. tb_client/models/default_device_profile_configuration.py +89 -0
  246. tb_client/models/default_device_profile_transport_configuration.py +89 -0
  247. tb_client/models/default_device_transport_configuration.py +89 -0
  248. tb_client/models/default_menu_item.py +110 -0
  249. tb_client/models/default_mobile_page.py +107 -0
  250. tb_client/models/default_rule_chain_create_request.py +89 -0
  251. tb_client/models/default_tenant_profile_configuration.py +263 -0
  252. tb_client/models/delivery_method_notification_template.py +127 -0
  253. tb_client/models/device.py +159 -0
  254. tb_client/models/device_activity_notification_rule_trigger_config.py +105 -0
  255. tb_client/models/device_configuration.py +109 -0
  256. tb_client/models/device_credentials.py +121 -0
  257. tb_client/models/device_credentials_id.py +90 -0
  258. tb_client/models/device_data.py +99 -0
  259. tb_client/models/device_export_data.py +134 -0
  260. tb_client/models/device_group_ota_package.py +116 -0
  261. tb_client/models/device_id.py +99 -0
  262. tb_client/models/device_info.py +179 -0
  263. tb_client/models/device_profile.py +189 -0
  264. tb_client/models/device_profile_alarm.py +121 -0
  265. tb_client/models/device_profile_configuration.py +109 -0
  266. tb_client/models/device_profile_data.py +115 -0
  267. tb_client/models/device_profile_id.py +99 -0
  268. tb_client/models/device_profile_info.py +133 -0
  269. tb_client/models/device_profile_provision_configuration.py +119 -0
  270. tb_client/models/device_profile_transport_configuration.py +121 -0
  271. tb_client/models/device_search_query.py +97 -0
  272. tb_client/models/device_search_query_filter.py +122 -0
  273. tb_client/models/device_transport_configuration.py +121 -0
  274. tb_client/models/device_type_filter.py +95 -0
  275. tb_client/models/disabled_device_profile_provision_configuration.py +90 -0
  276. tb_client/models/divider_component.py +137 -0
  277. tb_client/models/domain.py +124 -0
  278. tb_client/models/domain_id.py +99 -0
  279. tb_client/models/domain_info.py +134 -0
  280. tb_client/models/dummy_job_configuration.py +117 -0
  281. tb_client/models/dummy_job_result.py +106 -0
  282. tb_client/models/dummy_task_failure.py +93 -0
  283. tb_client/models/dummy_task_result.py +99 -0
  284. tb_client/models/duration_alarm_condition_spec.py +107 -0
  285. tb_client/models/dynamic_value_boolean.py +105 -0
  286. tb_client/models/dynamic_value_double.py +105 -0
  287. tb_client/models/dynamic_value_integer.py +105 -0
  288. tb_client/models/dynamic_value_long.py +105 -0
  289. tb_client/models/dynamic_value_string.py +105 -0
  290. tb_client/models/edge.py +152 -0
  291. tb_client/models/edge_communication_failure_notification_rule_trigger_config.py +92 -0
  292. tb_client/models/edge_connection_notification_rule_trigger_config.py +105 -0
  293. tb_client/models/edge_event.py +149 -0
  294. tb_client/models/edge_event_id.py +90 -0
  295. tb_client/models/edge_id.py +99 -0
  296. tb_client/models/edge_info.py +168 -0
  297. tb_client/models/edge_instructions.py +89 -0
  298. tb_client/models/edge_search_query.py +97 -0
  299. tb_client/models/edge_search_query_filter.py +122 -0
  300. tb_client/models/edge_type_filter.py +95 -0
  301. tb_client/models/edqs_state.py +113 -0
  302. tb_client/models/edqs_sync_request.py +100 -0
  303. tb_client/models/efento_coap_device_type_configuration.py +89 -0
  304. tb_client/models/email_delivery_method_notification_template.py +94 -0
  305. tb_client/models/email_two_fa_account_config.py +93 -0
  306. tb_client/models/email_two_fa_provider_config.py +92 -0
  307. tb_client/models/enterprise_captcha_params.py +101 -0
  308. tb_client/models/entities_by_group_name_filter.py +113 -0
  309. tb_client/models/entities_limit_notification_rule_trigger_config.py +105 -0
  310. tb_client/models/entity.py +93 -0
  311. tb_client/models/entity_action_notification_rule_trigger_config.py +108 -0
  312. tb_client/models/entity_alias.py +97 -0
  313. tb_client/models/entity_count_query.py +103 -0
  314. tb_client/models/entity_data.py +151 -0
  315. tb_client/models/entity_data_diff.py +98 -0
  316. tb_client/models/entity_data_diff_current_version.py +239 -0
  317. tb_client/models/entity_data_info.py +99 -0
  318. tb_client/models/entity_data_page_link.py +101 -0
  319. tb_client/models/entity_data_query.py +128 -0
  320. tb_client/models/entity_data_sort_order.py +105 -0
  321. tb_client/models/entity_export_data_object.py +175 -0
  322. tb_client/models/entity_filter.py +169 -0
  323. tb_client/models/entity_group.py +142 -0
  324. tb_client/models/entity_group_export_data.py +150 -0
  325. tb_client/models/entity_group_filter.py +119 -0
  326. tb_client/models/entity_group_id.py +99 -0
  327. tb_client/models/entity_group_info.py +151 -0
  328. tb_client/models/entity_group_list_filter.py +103 -0
  329. tb_client/models/entity_group_name_filter.py +103 -0
  330. tb_client/models/entity_id.py +99 -0
  331. tb_client/models/entity_info.py +95 -0
  332. tb_client/models/entity_key.py +101 -0
  333. tb_client/models/entity_list_filter.py +103 -0
  334. tb_client/models/entity_load_error.py +102 -0
  335. tb_client/models/entity_name_filter.py +103 -0
  336. tb_client/models/entity_relation.py +119 -0
  337. tb_client/models/entity_relation_info.py +127 -0
  338. tb_client/models/entity_relations_query.py +103 -0
  339. tb_client/models/entity_subtype.py +107 -0
  340. tb_client/models/entity_table_component.py +133 -0
  341. tb_client/models/entity_type_filter.py +101 -0
  342. tb_client/models/entity_type_load_result.py +111 -0
  343. tb_client/models/entity_type_version_create_config.py +116 -0
  344. tb_client/models/entity_type_version_load_config.py +105 -0
  345. tb_client/models/entity_type_version_load_request.py +107 -0
  346. tb_client/models/entity_version.py +95 -0
  347. tb_client/models/entity_view.py +149 -0
  348. tb_client/models/entity_view_id.py +99 -0
  349. tb_client/models/entity_view_info.py +165 -0
  350. tb_client/models/entity_view_search_query.py +97 -0
  351. tb_client/models/entity_view_search_query_filter.py +122 -0
  352. tb_client/models/entity_view_type_filter.py +95 -0
  353. tb_client/models/error_component.py +98 -0
  354. tb_client/models/error_component_all_of_exception.py +116 -0
  355. tb_client/models/error_component_all_of_exception_cause.py +101 -0
  356. tb_client/models/error_component_all_of_exception_cause_stack_trace.py +103 -0
  357. tb_client/models/error_event_filter.py +96 -0
  358. tb_client/models/escalated_notification_rule_recipients_config.py +92 -0
  359. tb_client/models/event_filter.py +141 -0
  360. tb_client/models/event_id.py +90 -0
  361. tb_client/models/event_info.py +124 -0
  362. tb_client/models/exportable_entity_entity_id.py +95 -0
  363. tb_client/models/failure.py +92 -0
  364. tb_client/models/favicon.py +89 -0
  365. tb_client/models/features_info.py +99 -0
  366. tb_client/models/filter.py +101 -0
  367. tb_client/models/filter_predicate_value_boolean.py +97 -0
  368. tb_client/models/filter_predicate_value_double.py +97 -0
  369. tb_client/models/filter_predicate_value_integer.py +97 -0
  370. tb_client/models/filter_predicate_value_long.py +97 -0
  371. tb_client/models/filter_predicate_value_string.py +97 -0
  372. tb_client/models/fixed_time_window.py +91 -0
  373. tb_client/models/font.py +115 -0
  374. tb_client/models/git_hub_models_chat_model_config.py +126 -0
  375. tb_client/models/git_hub_models_provider_config.py +89 -0
  376. tb_client/models/google_ai_gemini_chat_model_config.py +128 -0
  377. tb_client/models/google_ai_gemini_provider_config.py +89 -0
  378. tb_client/models/google_vertex_ai_gemini_chat_model_config.py +128 -0
  379. tb_client/models/google_vertex_ai_gemini_provider_config.py +95 -0
  380. tb_client/models/group_entity_export_data.py +128 -0
  381. tb_client/models/group_permission.py +142 -0
  382. tb_client/models/group_permission_id.py +99 -0
  383. tb_client/models/group_permission_info.py +167 -0
  384. tb_client/models/has_id_object.py +94 -0
  385. tb_client/models/header_footer.py +106 -0
  386. tb_client/models/heading.py +123 -0
  387. tb_client/models/heading_component.py +155 -0
  388. tb_client/models/history.py +115 -0
  389. tb_client/models/home_dashboard_info.py +95 -0
  390. tb_client/models/home_dashboard_params.py +91 -0
  391. tb_client/models/home_menu_item.py +125 -0
  392. tb_client/models/image_component.py +159 -0
  393. tb_client/models/insets.py +95 -0
  394. tb_client/models/integration.py +163 -0
  395. tb_client/models/integration_converters_info.py +98 -0
  396. tb_client/models/integration_id.py +99 -0
  397. tb_client/models/integration_info.py +143 -0
  398. tb_client/models/integration_lifecycle_event_notification_rule_trigger_config.py +120 -0
  399. tb_client/models/interval.py +101 -0
  400. tb_client/models/job.py +144 -0
  401. tb_client/models/job_configuration.py +126 -0
  402. tb_client/models/job_id.py +99 -0
  403. tb_client/models/job_result.py +132 -0
  404. tb_client/models/json_transport_payload_configuration.py +89 -0
  405. tb_client/models/jwt_pair.py +103 -0
  406. tb_client/models/jwt_settings.py +95 -0
  407. tb_client/models/key_filter.py +111 -0
  408. tb_client/models/key_filter_predicate.py +118 -0
  409. tb_client/models/last_visited_dashboard_info.py +98 -0
  410. tb_client/models/latest_chart_component.py +153 -0
  411. tb_client/models/latest_chart_component_all_of_latest_chart_settings.py +166 -0
  412. tb_client/models/legend_config.py +111 -0
  413. tb_client/models/license_usage_info.py +109 -0
  414. tb_client/models/life_cycle_event_filter.py +108 -0
  415. tb_client/models/line_series_settings.py +167 -0
  416. tb_client/models/login_mobile_info.py +115 -0
  417. tb_client/models/login_request.py +91 -0
  418. tb_client/models/login_response.py +91 -0
  419. tb_client/models/login_white_labeling_params.py +145 -0
  420. tb_client/models/lw_m2_m_bootstrap_server_credential.py +118 -0
  421. tb_client/models/lw_m2_m_server_security_config_default.py +143 -0
  422. tb_client/models/lw_m2m_instance.py +99 -0
  423. tb_client/models/lw_m2m_object.py +107 -0
  424. tb_client/models/lw_m2m_resource_observe.py +99 -0
  425. tb_client/models/lw_m2m_version.py +89 -0
  426. tb_client/models/lwm2m_device_profile_transport_configuration.py +113 -0
  427. tb_client/models/lwm2m_device_transport_configuration.py +107 -0
  428. tb_client/models/mapping.py +103 -0
  429. tb_client/models/menu_item.py +126 -0
  430. tb_client/models/merged_group_permission_info.py +112 -0
  431. tb_client/models/merged_group_type_permission_info.py +99 -0
  432. tb_client/models/merged_user_permissions.py +172 -0
  433. tb_client/models/microsoft_teams_delivery_method_notification_template.py +101 -0
  434. tb_client/models/microsoft_teams_notification_target_config.py +112 -0
  435. tb_client/models/mistral_ai_chat_model_config.py +126 -0
  436. tb_client/models/mistral_ai_provider_config.py +89 -0
  437. tb_client/models/mobile_app.py +144 -0
  438. tb_client/models/mobile_app_bundle.py +137 -0
  439. tb_client/models/mobile_app_bundle_id.py +99 -0
  440. tb_client/models/mobile_app_bundle_info.py +153 -0
  441. tb_client/models/mobile_app_delivery_method_notification_template.py +101 -0
  442. tb_client/models/mobile_app_id.py +99 -0
  443. tb_client/models/mobile_app_notification_delivery_method_config.py +95 -0
  444. tb_client/models/mobile_app_version_info.py +95 -0
  445. tb_client/models/mobile_layout_config.py +97 -0
  446. tb_client/models/mobile_page.py +129 -0
  447. tb_client/models/mobile_redirect_params.py +91 -0
  448. tb_client/models/mobile_self_registration_params.py +165 -0
  449. tb_client/models/mobile_session_info.py +89 -0
  450. tb_client/models/model.py +98 -0
  451. tb_client/models/model_none.py +89 -0
  452. tb_client/models/mqtt_device_profile_transport_configuration.py +107 -0
  453. tb_client/models/mqtt_device_transport_configuration.py +89 -0
  454. tb_client/models/multi_value_map_string_string.py +102 -0
  455. tb_client/models/new_platform_version_notification_rule_trigger_config.py +89 -0
  456. tb_client/models/no_sec_lw_m2_m_bootstrap_server_credential.py +137 -0
  457. tb_client/models/node_connection_info.py +93 -0
  458. tb_client/models/notification.py +162 -0
  459. tb_client/models/notification_delivery_method_config.py +112 -0
  460. tb_client/models/notification_id.py +99 -0
  461. tb_client/models/notification_info.py +101 -0
  462. tb_client/models/notification_pref.py +91 -0
  463. tb_client/models/notification_request.py +161 -0
  464. tb_client/models/notification_request_config.py +100 -0
  465. tb_client/models/notification_request_id.py +99 -0
  466. tb_client/models/notification_request_info.py +176 -0
  467. tb_client/models/notification_request_preview.py +108 -0
  468. tb_client/models/notification_request_stats.py +113 -0
  469. tb_client/models/notification_rule.py +141 -0
  470. tb_client/models/notification_rule_config.py +89 -0
  471. tb_client/models/notification_rule_id.py +99 -0
  472. tb_client/models/notification_rule_info.py +156 -0
  473. tb_client/models/notification_rule_recipients_config.py +116 -0
  474. tb_client/models/notification_rule_trigger_config.py +161 -0
  475. tb_client/models/notification_settings.py +102 -0
  476. tb_client/models/notification_target.py +112 -0
  477. tb_client/models/notification_target_config.py +116 -0
  478. tb_client/models/notification_target_id.py +99 -0
  479. tb_client/models/notification_template.py +121 -0
  480. tb_client/models/notification_template_config.py +118 -0
  481. tb_client/models/notification_template_id.py +99 -0
  482. tb_client/models/numeric_filter_predicate.py +107 -0
  483. tb_client/models/o_auth2_basic_mapper_config.py +114 -0
  484. tb_client/models/o_auth2_client.py +172 -0
  485. tb_client/models/o_auth2_client_id.py +99 -0
  486. tb_client/models/o_auth2_client_info.py +118 -0
  487. tb_client/models/o_auth2_client_login_info.py +93 -0
  488. tb_client/models/o_auth2_client_registration_template.py +136 -0
  489. tb_client/models/o_auth2_client_registration_template_id.py +90 -0
  490. tb_client/models/o_auth2_custom_mapper_config.py +95 -0
  491. tb_client/models/o_auth2_mapper_config.py +112 -0
  492. tb_client/models/object_attributes.py +120 -0
  493. tb_client/models/ollama_auth.py +115 -0
  494. tb_client/models/ollama_chat_model_config.py +126 -0
  495. tb_client/models/ollama_provider_config.py +95 -0
  496. tb_client/models/open_ai_chat_model_config.py +126 -0
  497. tb_client/models/open_ai_provider_config.py +91 -0
  498. tb_client/models/originator_entity_owner_users_filter.py +89 -0
  499. tb_client/models/ota_package.py +194 -0
  500. tb_client/models/ota_package_data.py +103 -0
  501. tb_client/models/ota_package_export_data.py +128 -0
  502. tb_client/models/ota_package_id.py +99 -0
  503. tb_client/models/ota_package_info.py +188 -0
  504. tb_client/models/other_configuration.py +119 -0
  505. tb_client/models/output.py +131 -0
  506. tb_client/models/page_break_component.py +90 -0
  507. tb_client/models/page_data_ai_model.py +111 -0
  508. tb_client/models/page_data_alarm_comment_info.py +111 -0
  509. tb_client/models/page_data_alarm_data.py +111 -0
  510. tb_client/models/page_data_alarm_info.py +111 -0
  511. tb_client/models/page_data_api_key_info.py +111 -0
  512. tb_client/models/page_data_asset.py +111 -0
  513. tb_client/models/page_data_asset_info.py +111 -0
  514. tb_client/models/page_data_asset_profile.py +111 -0
  515. tb_client/models/page_data_asset_profile_info.py +111 -0
  516. tb_client/models/page_data_audit_log.py +111 -0
  517. tb_client/models/page_data_blob_entity_with_customer_info.py +111 -0
  518. tb_client/models/page_data_calculated_field.py +111 -0
  519. tb_client/models/page_data_calculated_field_info.py +111 -0
  520. tb_client/models/page_data_contact_based_object.py +111 -0
  521. tb_client/models/page_data_converter.py +111 -0
  522. tb_client/models/page_data_custom_menu_info.py +111 -0
  523. tb_client/models/page_data_customer.py +111 -0
  524. tb_client/models/page_data_customer_info.py +111 -0
  525. tb_client/models/page_data_dashboard_info.py +111 -0
  526. tb_client/models/page_data_device.py +111 -0
  527. tb_client/models/page_data_device_info.py +111 -0
  528. tb_client/models/page_data_device_profile.py +111 -0
  529. tb_client/models/page_data_device_profile_info.py +111 -0
  530. tb_client/models/page_data_domain_info.py +111 -0
  531. tb_client/models/page_data_edge.py +111 -0
  532. tb_client/models/page_data_edge_event.py +111 -0
  533. tb_client/models/page_data_edge_info.py +111 -0
  534. tb_client/models/page_data_entity_data.py +111 -0
  535. tb_client/models/page_data_entity_group_info.py +111 -0
  536. tb_client/models/page_data_entity_info.py +111 -0
  537. tb_client/models/page_data_entity_subtype.py +111 -0
  538. tb_client/models/page_data_entity_version.py +111 -0
  539. tb_client/models/page_data_entity_view.py +111 -0
  540. tb_client/models/page_data_entity_view_info.py +111 -0
  541. tb_client/models/page_data_event_info.py +111 -0
  542. tb_client/models/page_data_integration.py +111 -0
  543. tb_client/models/page_data_integration_info.py +111 -0
  544. tb_client/models/page_data_job.py +111 -0
  545. tb_client/models/page_data_mobile_app.py +111 -0
  546. tb_client/models/page_data_mobile_app_bundle_info.py +111 -0
  547. tb_client/models/page_data_notification.py +111 -0
  548. tb_client/models/page_data_notification_request_info.py +111 -0
  549. tb_client/models/page_data_notification_rule_info.py +111 -0
  550. tb_client/models/page_data_notification_target.py +111 -0
  551. tb_client/models/page_data_notification_template.py +111 -0
  552. tb_client/models/page_data_o_auth2_client_info.py +111 -0
  553. tb_client/models/page_data_ota_package_info.py +111 -0
  554. tb_client/models/page_data_queue.py +111 -0
  555. tb_client/models/page_data_queue_stats.py +111 -0
  556. tb_client/models/page_data_report.py +111 -0
  557. tb_client/models/page_data_report_info.py +111 -0
  558. tb_client/models/page_data_report_template_info.py +111 -0
  559. tb_client/models/page_data_role.py +111 -0
  560. tb_client/models/page_data_rule_chain.py +111 -0
  561. tb_client/models/page_data_scheduled_report_info.py +111 -0
  562. tb_client/models/page_data_scheduler_event_info.py +111 -0
  563. tb_client/models/page_data_scheduler_event_with_customer_info.py +111 -0
  564. tb_client/models/page_data_secret_info.py +111 -0
  565. tb_client/models/page_data_short_entity_view.py +111 -0
  566. tb_client/models/page_data_string.py +103 -0
  567. tb_client/models/page_data_tb_resource_info.py +111 -0
  568. tb_client/models/page_data_tenant.py +111 -0
  569. tb_client/models/page_data_tenant_info.py +111 -0
  570. tb_client/models/page_data_tenant_profile.py +111 -0
  571. tb_client/models/page_data_trendz_view_config_lite.py +111 -0
  572. tb_client/models/page_data_user.py +111 -0
  573. tb_client/models/page_data_user_email_info.py +111 -0
  574. tb_client/models/page_data_user_info.py +111 -0
  575. tb_client/models/page_data_widget_type_info.py +111 -0
  576. tb_client/models/page_data_widgets_bundle.py +111 -0
  577. tb_client/models/palette.py +93 -0
  578. tb_client/models/palette_settings.py +98 -0
  579. tb_client/models/pdf_report_template_config.py +161 -0
  580. tb_client/models/platform_two_fa_settings.py +130 -0
  581. tb_client/models/platform_users_notification_target_config.py +96 -0
  582. tb_client/models/power_saving_configuration.py +105 -0
  583. tb_client/models/processing_strategy.py +107 -0
  584. tb_client/models/proto_transport_payload_configuration.py +101 -0
  585. tb_client/models/psklw_m2_m_bootstrap_server_credential.py +137 -0
  586. tb_client/models/qr_code_config.py +107 -0
  587. tb_client/models/qr_code_settings.py +133 -0
  588. tb_client/models/qr_code_settings_id.py +90 -0
  589. tb_client/models/queue.py +134 -0
  590. tb_client/models/queue_id.py +99 -0
  591. tb_client/models/queue_stats.py +107 -0
  592. tb_client/models/queue_stats_id.py +99 -0
  593. tb_client/models/rate_limits_notification_rule_trigger_config.py +102 -0
  594. tb_client/models/raw_data_event_filter.py +98 -0
  595. tb_client/models/referenced_entity_key.py +113 -0
  596. tb_client/models/relation_entity_type_filter.py +104 -0
  597. tb_client/models/relation_path_level.py +99 -0
  598. tb_client/models/relation_path_query_dynamic_source_configuration.py +99 -0
  599. tb_client/models/relations_query_filter.py +146 -0
  600. tb_client/models/relations_search_parameters.py +130 -0
  601. tb_client/models/repeating_alarm_condition_spec.py +95 -0
  602. tb_client/models/report.py +141 -0
  603. tb_client/models/report_bar_chart_settings.py +168 -0
  604. tb_client/models/report_bar_chart_with_labels_settings.py +256 -0
  605. tb_client/models/report_component.py +169 -0
  606. tb_client/models/report_doughnut_chart_settings.py +172 -0
  607. tb_client/models/report_id.py +99 -0
  608. tb_client/models/report_info.py +151 -0
  609. tb_client/models/report_job_configuration.py +154 -0
  610. tb_client/models/report_job_result.py +112 -0
  611. tb_client/models/report_latest_chart_settings.py +151 -0
  612. tb_client/models/report_pie_chart_settings.py +180 -0
  613. tb_client/models/report_range_chart_settings.py +255 -0
  614. tb_client/models/report_request.py +118 -0
  615. tb_client/models/report_task_result.py +101 -0
  616. tb_client/models/report_template.py +151 -0
  617. tb_client/models/report_template_config.py +151 -0
  618. tb_client/models/report_template_id.py +99 -0
  619. tb_client/models/report_template_info.py +149 -0
  620. tb_client/models/report_time_series_chart_settings.py +222 -0
  621. tb_client/models/repository_settings.py +119 -0
  622. tb_client/models/repository_settings_info.py +91 -0
  623. tb_client/models/reset_password_email_request.py +89 -0
  624. tb_client/models/reset_password_request.py +91 -0
  625. tb_client/models/resource_export_data.py +129 -0
  626. tb_client/models/resources_shortage_notification_rule_trigger_config.py +96 -0
  627. tb_client/models/rich_text_component.py +121 -0
  628. tb_client/models/role.py +148 -0
  629. tb_client/models/role_id.py +99 -0
  630. tb_client/models/rpc.py +158 -0
  631. tb_client/models/rpc_id.py +99 -0
  632. tb_client/models/rpklw_m2_m_bootstrap_server_credential.py +137 -0
  633. tb_client/models/rule_chain.py +145 -0
  634. tb_client/models/rule_chain_connection_info.py +104 -0
  635. tb_client/models/rule_chain_data.py +111 -0
  636. tb_client/models/rule_chain_debug_event_filter.py +100 -0
  637. tb_client/models/rule_chain_export_data.py +134 -0
  638. tb_client/models/rule_chain_id.py +99 -0
  639. tb_client/models/rule_chain_import_result.py +99 -0
  640. tb_client/models/rule_chain_meta_data.py +129 -0
  641. tb_client/models/rule_chain_output_labels_usage.py +115 -0
  642. tb_client/models/rule_engine_component_lifecycle_event_notification_rule_trigger_config.py +124 -0
  643. tb_client/models/rule_node.py +142 -0
  644. tb_client/models/rule_node_debug_event_filter.py +134 -0
  645. tb_client/models/rule_node_id.py +99 -0
  646. tb_client/models/save_device_with_credentials_request.py +99 -0
  647. tb_client/models/save_ota_package_info_request.py +192 -0
  648. tb_client/models/scheduled_report_info.py +166 -0
  649. tb_client/models/scheduler_event.py +157 -0
  650. tb_client/models/scheduler_event_export_data.py +128 -0
  651. tb_client/models/scheduler_event_filter.py +104 -0
  652. tb_client/models/scheduler_event_id.py +99 -0
  653. tb_client/models/scheduler_event_info.py +150 -0
  654. tb_client/models/scheduler_event_with_customer_info.py +158 -0
  655. tb_client/models/secret.py +123 -0
  656. tb_client/models/secret_id.py +99 -0
  657. tb_client/models/secret_info.py +119 -0
  658. tb_client/models/security_settings.py +104 -0
  659. tb_client/models/self_registration_params.py +175 -0
  660. tb_client/models/share_group_request.py +113 -0
  661. tb_client/models/shared_attributes_setting_snmp_communication_config.py +99 -0
  662. tb_client/models/short_customer_info.py +99 -0
  663. tb_client/models/short_entity_view.py +99 -0
  664. tb_client/models/sign_up_field.py +100 -0
  665. tb_client/models/sign_up_request.py +107 -0
  666. tb_client/models/sign_up_self_registration_params.py +109 -0
  667. tb_client/models/simple_alarm_condition_spec.py +89 -0
  668. tb_client/models/simple_calculated_field_configuration.py +112 -0
  669. tb_client/models/simple_entity.py +91 -0
  670. tb_client/models/single_entity_filter.py +95 -0
  671. tb_client/models/single_entity_version_create_request.py +103 -0
  672. tb_client/models/single_entity_version_load_request.py +107 -0
  673. tb_client/models/slack_conversation.py +107 -0
  674. tb_client/models/slack_delivery_method_notification_template.py +91 -0
  675. tb_client/models/slack_notification_delivery_method_config.py +92 -0
  676. tb_client/models/slack_notification_target_config.py +108 -0
  677. tb_client/models/smpp_sms_provider_configuration.py +146 -0
  678. tb_client/models/sms_delivery_method_notification_template.py +91 -0
  679. tb_client/models/sms_provider_configuration.py +115 -0
  680. tb_client/models/sms_two_fa_account_config.py +103 -0
  681. tb_client/models/sms_two_fa_provider_config.py +104 -0
  682. tb_client/models/snmp_communication_config.py +131 -0
  683. tb_client/models/snmp_device_profile_transport_configuration.py +103 -0
  684. tb_client/models/snmp_device_transport_configuration.py +143 -0
  685. tb_client/models/snmp_mapping.py +103 -0
  686. tb_client/models/solution_install_response.py +111 -0
  687. tb_client/models/specific_time_schedule.py +102 -0
  688. tb_client/models/split_view_component.py +147 -0
  689. tb_client/models/starred_dashboard_info.py +96 -0
  690. tb_client/models/state_entity_filter.py +95 -0
  691. tb_client/models/state_entity_owner_filter.py +100 -0
  692. tb_client/models/statistics_event_filter.py +100 -0
  693. tb_client/models/store_info.py +93 -0
  694. tb_client/models/string_filter_predicate.py +109 -0
  695. tb_client/models/sub_report_component.py +108 -0
  696. tb_client/models/submit_strategy.py +101 -0
  697. tb_client/models/subscription_info.py +139 -0
  698. tb_client/models/success.py +92 -0
  699. tb_client/models/system_administrators_filter.py +89 -0
  700. tb_client/models/system_info.py +99 -0
  701. tb_client/models/system_info_data.py +103 -0
  702. tb_client/models/table_sort_order.py +101 -0
  703. tb_client/models/task_processing_failure_notification_rule_trigger_config.py +89 -0
  704. tb_client/models/task_result.py +119 -0
  705. tb_client/models/tb_chat_request.py +101 -0
  706. tb_client/models/tb_chat_response.py +112 -0
  707. tb_client/models/tb_content.py +109 -0
  708. tb_client/models/tb_image_delete_result.py +116 -0
  709. tb_client/models/tb_resource.py +182 -0
  710. tb_client/models/tb_resource_delete_result.py +106 -0
  711. tb_client/models/tb_resource_id.py +99 -0
  712. tb_client/models/tb_resource_info.py +178 -0
  713. tb_client/models/tb_secret_delete_result.py +106 -0
  714. tb_client/models/tb_text_content.py +92 -0
  715. tb_client/models/tb_user_message.py +98 -0
  716. tb_client/models/telemetry_entity_view.py +95 -0
  717. tb_client/models/telemetry_mapping_configuration.py +124 -0
  718. tb_client/models/telemetry_querying_snmp_communication_config.py +101 -0
  719. tb_client/models/tenant.py +136 -0
  720. tb_client/models/tenant_administrators_filter.py +94 -0
  721. tb_client/models/tenant_id.py +99 -0
  722. tb_client/models/tenant_info.py +138 -0
  723. tb_client/models/tenant_profile.py +111 -0
  724. tb_client/models/tenant_profile_configuration.py +109 -0
  725. tb_client/models/tenant_profile_data.py +103 -0
  726. tb_client/models/tenant_profile_id.py +99 -0
  727. tb_client/models/tenant_profile_queue_configuration.py +118 -0
  728. tb_client/models/tenant_solution_template_details.py +117 -0
  729. tb_client/models/tenant_solution_template_info.py +119 -0
  730. tb_client/models/tenant_solution_template_instructions.py +109 -0
  731. tb_client/models/test_sms_request.py +97 -0
  732. tb_client/models/thingsboard_credentials_expired_response.py +138 -0
  733. tb_client/models/thingsboard_error_response.py +134 -0
  734. tb_client/models/time_series_chart_bar_width.py +93 -0
  735. tb_client/models/time_series_chart_bar_width_settings.py +91 -0
  736. tb_client/models/time_series_chart_grid_settings.py +95 -0
  737. tb_client/models/time_series_chart_key_settings.py +123 -0
  738. tb_client/models/time_series_chart_no_aggregation_bar_width_settings.py +110 -0
  739. tb_client/models/time_series_chart_state_settings.py +114 -0
  740. tb_client/models/time_series_chart_threshold.py +187 -0
  741. tb_client/models/time_series_chart_x_axis_settings.py +134 -0
  742. tb_client/models/time_series_chart_y_axis_settings.py +148 -0
  743. tb_client/models/time_series_immediate_output_strategy.py +99 -0
  744. tb_client/models/time_series_output.py +98 -0
  745. tb_client/models/time_series_output_strategy.py +112 -0
  746. tb_client/models/time_series_rule_chain_output_strategy.py +89 -0
  747. tb_client/models/time_window_configuration.py +101 -0
  748. tb_client/models/timeseries_chart_component.py +159 -0
  749. tb_client/models/timeseries_chart_component_all_of_time_series_chart_settings.py +152 -0
  750. tb_client/models/timeseries_table_component.py +151 -0
  751. tb_client/models/to_core_edqs_request.py +95 -0
  752. tb_client/models/to_device_rpc_request_snmp_communication_config.py +99 -0
  753. tb_client/models/to_server_rpc_request_snmp_communication_config.py +99 -0
  754. tb_client/models/token.py +91 -0
  755. tb_client/models/totp_two_fa_account_config.py +103 -0
  756. tb_client/models/totp_two_fa_provider_config.py +92 -0
  757. tb_client/models/translation_info.py +97 -0
  758. tb_client/models/transport_payload_type_configuration.py +112 -0
  759. tb_client/models/trendz_configuration.py +91 -0
  760. tb_client/models/trendz_healthcheck_result.py +115 -0
  761. tb_client/models/trendz_summary.py +99 -0
  762. tb_client/models/trendz_synchronization_result.py +115 -0
  763. tb_client/models/trendz_usage.py +121 -0
  764. tb_client/models/trendz_view_config.py +94 -0
  765. tb_client/models/trendz_view_config_lite.py +92 -0
  766. tb_client/models/ts_value.py +93 -0
  767. tb_client/models/twilio_sms_provider_configuration.py +95 -0
  768. tb_client/models/two_fa_account_config.py +119 -0
  769. tb_client/models/two_fa_account_config_update_request.py +89 -0
  770. tb_client/models/two_fa_provider_config.py +118 -0
  771. tb_client/models/two_fa_provider_info.py +107 -0
  772. tb_client/models/update_message.py +99 -0
  773. tb_client/models/usage_info.py +141 -0
  774. tb_client/models/user.py +157 -0
  775. tb_client/models/user_activation_link.py +91 -0
  776. tb_client/models/user_dashboards_info.py +111 -0
  777. tb_client/models/user_email_info.py +99 -0
  778. tb_client/models/user_group_list_filter.py +93 -0
  779. tb_client/models/user_id.py +99 -0
  780. tb_client/models/user_info.py +173 -0
  781. tb_client/models/user_list_filter.py +93 -0
  782. tb_client/models/user_mobile_info.py +118 -0
  783. tb_client/models/user_notification_settings.py +102 -0
  784. tb_client/models/user_password_policy.py +107 -0
  785. tb_client/models/user_role_filter.py +93 -0
  786. tb_client/models/users_filter.py +136 -0
  787. tb_client/models/v2_captcha_params.py +95 -0
  788. tb_client/models/v3_captcha_params.py +95 -0
  789. tb_client/models/vendor.py +91 -0
  790. tb_client/models/version_create_config.py +99 -0
  791. tb_client/models/version_create_request.py +124 -0
  792. tb_client/models/version_creation_result.py +103 -0
  793. tb_client/models/version_load_config.py +101 -0
  794. tb_client/models/version_load_request.py +123 -0
  795. tb_client/models/version_load_result.py +105 -0
  796. tb_client/models/versioned_entity_info.py +95 -0
  797. tb_client/models/web_delivery_method_notification_template.py +101 -0
  798. tb_client/models/web_self_registration_params.py +165 -0
  799. tb_client/models/web_view_page.py +97 -0
  800. tb_client/models/white_labeling.py +124 -0
  801. tb_client/models/white_labeling_params.py +127 -0
  802. tb_client/models/widget_bundle_info.py +95 -0
  803. tb_client/models/widget_type.py +128 -0
  804. tb_client/models/widget_type_details.py +144 -0
  805. tb_client/models/widget_type_export_data.py +128 -0
  806. tb_client/models/widget_type_id.py +99 -0
  807. tb_client/models/widget_type_info.py +147 -0
  808. tb_client/models/widgets_bundle.py +135 -0
  809. tb_client/models/widgets_bundle_export_data.py +132 -0
  810. tb_client/models/widgets_bundle_id.py +99 -0
  811. tb_client/models/x509_certificate_chain_provision_configuration.py +94 -0
  812. tb_client/models/x509_lw_m2_m_bootstrap_server_credential.py +137 -0
  813. tb_client/py.typed +0 -0
  814. tb_client/rest.py +264 -0
  815. tbctl/__init__.py +0 -0
  816. tbctl/cli.py +36 -0
  817. tbctl/commands/__init__.py +0 -0
  818. tbctl/commands/_client.py +252 -0
  819. tbctl/commands/attributes.py +70 -0
  820. tbctl/commands/config_cmd.py +73 -0
  821. tbctl/commands/device.py +223 -0
  822. tbctl/commands/ota.py +562 -0
  823. tbctl/commands/telemetry.py +273 -0
  824. tbctl/config.py +31 -0
  825. tbctl-0.2.0.dist-info/METADATA +201 -0
  826. tbctl-0.2.0.dist-info/RECORD +829 -0
  827. tbctl-0.2.0.dist-info/WHEEL +4 -0
  828. tbctl-0.2.0.dist-info/entry_points.txt +2 -0
  829. tbctl-0.2.0.dist-info/licenses/LICENSE +202 -0
@@ -0,0 +1,4501 @@
1
+ """
2
+ ThingsBoard REST API
3
+
4
+ ThingsBoard Professional Edition IoT platform REST API documentation.
5
+
6
+ The version of the OpenAPI document: 4.3.0.1PE
7
+ Contact: info@thingsboard.io
8
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+
10
+ Do not edit the class manually.
11
+ """ # noqa: E501
12
+
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictStr
20
+ from typing import List, Optional
21
+ from typing_extensions import Annotated
22
+ from tb_client.models.entity_relation import EntityRelation
23
+ from tb_client.models.entity_relation_info import EntityRelationInfo
24
+ from tb_client.models.entity_relations_query import EntityRelationsQuery
25
+
26
+ from tb_client.api_client import ApiClient, RequestSerialized
27
+ from tb_client.api_response import ApiResponse
28
+ from tb_client.rest import RESTResponseType
29
+
30
+
31
+ class EntityRelationControllerApi:
32
+ """NOTE: This class is auto generated by OpenAPI Generator
33
+ Ref: https://openapi-generator.tech
34
+
35
+ Do not edit the class manually.
36
+ """
37
+
38
+ def __init__(self, api_client=None) -> None:
39
+ if api_client is None:
40
+ api_client = ApiClient.get_default()
41
+ self.api_client = api_client
42
+
43
+
44
+ @validate_call
45
+ def delete_relation(
46
+ self,
47
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
48
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
49
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
50
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
51
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
52
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
53
+ _request_timeout: Union[
54
+ None,
55
+ Annotated[StrictFloat, Field(gt=0)],
56
+ Tuple[
57
+ Annotated[StrictFloat, Field(gt=0)],
58
+ Annotated[StrictFloat, Field(gt=0)]
59
+ ]
60
+ ] = None,
61
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
62
+ _content_type: Optional[StrictStr] = None,
63
+ _headers: Optional[Dict[StrictStr, Any]] = None,
64
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
65
+ ) -> None:
66
+ """Delete Relation (deleteRelation)
67
+
68
+ Deletes a relation between two entities in the platform. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
69
+
70
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
71
+ :type from_id: str
72
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
73
+ :type from_type: str
74
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
75
+ :type relation_type: str
76
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
77
+ :type to_id: str
78
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
79
+ :type to_type: str
80
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
81
+ :type relation_type_group: str
82
+ :param _request_timeout: timeout setting for this request. If one
83
+ number provided, it will be total request
84
+ timeout. It can also be a pair (tuple) of
85
+ (connection, read) timeouts.
86
+ :type _request_timeout: int, tuple(int, int), optional
87
+ :param _request_auth: set to override the auth_settings for an a single
88
+ request; this effectively ignores the
89
+ authentication in the spec for a single request.
90
+ :type _request_auth: dict, optional
91
+ :param _content_type: force content-type for the request.
92
+ :type _content_type: str, Optional
93
+ :param _headers: set to override the headers for a single
94
+ request; this effectively ignores the headers
95
+ in the spec for a single request.
96
+ :type _headers: dict, optional
97
+ :param _host_index: set to override the host_index for a single
98
+ request; this effectively ignores the host_index
99
+ in the spec for a single request.
100
+ :type _host_index: int, optional
101
+ :return: Returns the result object.
102
+ """ # noqa: E501
103
+
104
+ _param = self._delete_relation_serialize(
105
+ from_id=from_id,
106
+ from_type=from_type,
107
+ relation_type=relation_type,
108
+ to_id=to_id,
109
+ to_type=to_type,
110
+ relation_type_group=relation_type_group,
111
+ _request_auth=_request_auth,
112
+ _content_type=_content_type,
113
+ _headers=_headers,
114
+ _host_index=_host_index
115
+ )
116
+
117
+ _response_types_map: Dict[str, Optional[str]] = {
118
+ '200': None,
119
+ '400': "ThingsboardErrorResponse",
120
+ '401': "ThingsboardErrorResponse",
121
+ '403': "ThingsboardErrorResponse",
122
+ '404': "ThingsboardErrorResponse",
123
+ '429': "ThingsboardErrorResponse",
124
+ }
125
+ response_data = self.api_client.call_api(
126
+ *_param,
127
+ _request_timeout=_request_timeout
128
+ )
129
+ response_data.read()
130
+ return self.api_client.response_deserialize(
131
+ response_data=response_data,
132
+ response_types_map=_response_types_map,
133
+ ).data
134
+
135
+
136
+ @validate_call
137
+ def delete_relation_with_http_info(
138
+ self,
139
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
140
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
141
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
142
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
143
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
144
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
145
+ _request_timeout: Union[
146
+ None,
147
+ Annotated[StrictFloat, Field(gt=0)],
148
+ Tuple[
149
+ Annotated[StrictFloat, Field(gt=0)],
150
+ Annotated[StrictFloat, Field(gt=0)]
151
+ ]
152
+ ] = None,
153
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
154
+ _content_type: Optional[StrictStr] = None,
155
+ _headers: Optional[Dict[StrictStr, Any]] = None,
156
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
157
+ ) -> ApiResponse[None]:
158
+ """Delete Relation (deleteRelation)
159
+
160
+ Deletes a relation between two entities in the platform. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
161
+
162
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
163
+ :type from_id: str
164
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
165
+ :type from_type: str
166
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
167
+ :type relation_type: str
168
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
169
+ :type to_id: str
170
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
171
+ :type to_type: str
172
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
173
+ :type relation_type_group: str
174
+ :param _request_timeout: timeout setting for this request. If one
175
+ number provided, it will be total request
176
+ timeout. It can also be a pair (tuple) of
177
+ (connection, read) timeouts.
178
+ :type _request_timeout: int, tuple(int, int), optional
179
+ :param _request_auth: set to override the auth_settings for an a single
180
+ request; this effectively ignores the
181
+ authentication in the spec for a single request.
182
+ :type _request_auth: dict, optional
183
+ :param _content_type: force content-type for the request.
184
+ :type _content_type: str, Optional
185
+ :param _headers: set to override the headers for a single
186
+ request; this effectively ignores the headers
187
+ in the spec for a single request.
188
+ :type _headers: dict, optional
189
+ :param _host_index: set to override the host_index for a single
190
+ request; this effectively ignores the host_index
191
+ in the spec for a single request.
192
+ :type _host_index: int, optional
193
+ :return: Returns the result object.
194
+ """ # noqa: E501
195
+
196
+ _param = self._delete_relation_serialize(
197
+ from_id=from_id,
198
+ from_type=from_type,
199
+ relation_type=relation_type,
200
+ to_id=to_id,
201
+ to_type=to_type,
202
+ relation_type_group=relation_type_group,
203
+ _request_auth=_request_auth,
204
+ _content_type=_content_type,
205
+ _headers=_headers,
206
+ _host_index=_host_index
207
+ )
208
+
209
+ _response_types_map: Dict[str, Optional[str]] = {
210
+ '200': None,
211
+ '400': "ThingsboardErrorResponse",
212
+ '401': "ThingsboardErrorResponse",
213
+ '403': "ThingsboardErrorResponse",
214
+ '404': "ThingsboardErrorResponse",
215
+ '429': "ThingsboardErrorResponse",
216
+ }
217
+ response_data = self.api_client.call_api(
218
+ *_param,
219
+ _request_timeout=_request_timeout
220
+ )
221
+ response_data.read()
222
+ return self.api_client.response_deserialize(
223
+ response_data=response_data,
224
+ response_types_map=_response_types_map,
225
+ )
226
+
227
+
228
+ @validate_call
229
+ def delete_relation_without_preload_content(
230
+ self,
231
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
232
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
233
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
234
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
235
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
236
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
237
+ _request_timeout: Union[
238
+ None,
239
+ Annotated[StrictFloat, Field(gt=0)],
240
+ Tuple[
241
+ Annotated[StrictFloat, Field(gt=0)],
242
+ Annotated[StrictFloat, Field(gt=0)]
243
+ ]
244
+ ] = None,
245
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
246
+ _content_type: Optional[StrictStr] = None,
247
+ _headers: Optional[Dict[StrictStr, Any]] = None,
248
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
249
+ ) -> RESTResponseType:
250
+ """Delete Relation (deleteRelation)
251
+
252
+ Deletes a relation between two entities in the platform. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
253
+
254
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
255
+ :type from_id: str
256
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
257
+ :type from_type: str
258
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
259
+ :type relation_type: str
260
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
261
+ :type to_id: str
262
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
263
+ :type to_type: str
264
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
265
+ :type relation_type_group: str
266
+ :param _request_timeout: timeout setting for this request. If one
267
+ number provided, it will be total request
268
+ timeout. It can also be a pair (tuple) of
269
+ (connection, read) timeouts.
270
+ :type _request_timeout: int, tuple(int, int), optional
271
+ :param _request_auth: set to override the auth_settings for an a single
272
+ request; this effectively ignores the
273
+ authentication in the spec for a single request.
274
+ :type _request_auth: dict, optional
275
+ :param _content_type: force content-type for the request.
276
+ :type _content_type: str, Optional
277
+ :param _headers: set to override the headers for a single
278
+ request; this effectively ignores the headers
279
+ in the spec for a single request.
280
+ :type _headers: dict, optional
281
+ :param _host_index: set to override the host_index for a single
282
+ request; this effectively ignores the host_index
283
+ in the spec for a single request.
284
+ :type _host_index: int, optional
285
+ :return: Returns the result object.
286
+ """ # noqa: E501
287
+
288
+ _param = self._delete_relation_serialize(
289
+ from_id=from_id,
290
+ from_type=from_type,
291
+ relation_type=relation_type,
292
+ to_id=to_id,
293
+ to_type=to_type,
294
+ relation_type_group=relation_type_group,
295
+ _request_auth=_request_auth,
296
+ _content_type=_content_type,
297
+ _headers=_headers,
298
+ _host_index=_host_index
299
+ )
300
+
301
+ _response_types_map: Dict[str, Optional[str]] = {
302
+ '200': None,
303
+ '400': "ThingsboardErrorResponse",
304
+ '401': "ThingsboardErrorResponse",
305
+ '403': "ThingsboardErrorResponse",
306
+ '404': "ThingsboardErrorResponse",
307
+ '429': "ThingsboardErrorResponse",
308
+ }
309
+ response_data = self.api_client.call_api(
310
+ *_param,
311
+ _request_timeout=_request_timeout
312
+ )
313
+ return response_data.response
314
+
315
+
316
+ def _delete_relation_serialize(
317
+ self,
318
+ from_id,
319
+ from_type,
320
+ relation_type,
321
+ to_id,
322
+ to_type,
323
+ relation_type_group,
324
+ _request_auth,
325
+ _content_type,
326
+ _headers,
327
+ _host_index,
328
+ ) -> RequestSerialized:
329
+
330
+ _host = None
331
+
332
+ _collection_formats: Dict[str, str] = {
333
+ }
334
+
335
+ _path_params: Dict[str, str] = {}
336
+ _query_params: List[Tuple[str, str]] = []
337
+ _header_params: Dict[str, Optional[str]] = _headers or {}
338
+ _form_params: List[Tuple[str, str]] = []
339
+ _files: Dict[
340
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
341
+ ] = {}
342
+ _body_params: Optional[bytes] = None
343
+
344
+ # process the path parameters
345
+ # process the query parameters
346
+ if from_id is not None:
347
+
348
+ _query_params.append(('fromId', from_id))
349
+
350
+ if from_type is not None:
351
+
352
+ _query_params.append(('fromType', from_type))
353
+
354
+ if relation_type is not None:
355
+
356
+ _query_params.append(('relationType', relation_type))
357
+
358
+ if relation_type_group is not None:
359
+
360
+ _query_params.append(('relationTypeGroup', relation_type_group))
361
+
362
+ if to_id is not None:
363
+
364
+ _query_params.append(('toId', to_id))
365
+
366
+ if to_type is not None:
367
+
368
+ _query_params.append(('toType', to_type))
369
+
370
+ # process the header parameters
371
+ # process the form parameters
372
+ # process the body parameter
373
+
374
+
375
+ # set the HTTP header `Accept`
376
+ if 'Accept' not in _header_params:
377
+ _header_params['Accept'] = self.api_client.select_header_accept(
378
+ [
379
+ 'application/json'
380
+ ]
381
+ )
382
+
383
+
384
+ # authentication setting
385
+ _auth_settings: List[str] = [
386
+ 'HTTP login form',
387
+ 'API key form'
388
+ ]
389
+
390
+ return self.api_client.param_serialize(
391
+ method='DELETE',
392
+ resource_path='/api/relation{?fromId,fromType,relationType,relationTypeGroup,toId,toType}',
393
+ path_params=_path_params,
394
+ query_params=_query_params,
395
+ header_params=_header_params,
396
+ body=_body_params,
397
+ post_params=_form_params,
398
+ files=_files,
399
+ auth_settings=_auth_settings,
400
+ collection_formats=_collection_formats,
401
+ _host=_host,
402
+ _request_auth=_request_auth
403
+ )
404
+
405
+
406
+
407
+
408
+ @validate_call
409
+ def delete_relation_v2(
410
+ self,
411
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
412
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
413
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
414
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
415
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
416
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
417
+ _request_timeout: Union[
418
+ None,
419
+ Annotated[StrictFloat, Field(gt=0)],
420
+ Tuple[
421
+ Annotated[StrictFloat, Field(gt=0)],
422
+ Annotated[StrictFloat, Field(gt=0)]
423
+ ]
424
+ ] = None,
425
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
426
+ _content_type: Optional[StrictStr] = None,
427
+ _headers: Optional[Dict[StrictStr, Any]] = None,
428
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
429
+ ) -> EntityRelation:
430
+ """Delete Relation (deleteRelationV2)
431
+
432
+ Deletes a relation between two entities in the platform. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
433
+
434
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
435
+ :type from_id: str
436
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
437
+ :type from_type: str
438
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
439
+ :type relation_type: str
440
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
441
+ :type to_id: str
442
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
443
+ :type to_type: str
444
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
445
+ :type relation_type_group: str
446
+ :param _request_timeout: timeout setting for this request. If one
447
+ number provided, it will be total request
448
+ timeout. It can also be a pair (tuple) of
449
+ (connection, read) timeouts.
450
+ :type _request_timeout: int, tuple(int, int), optional
451
+ :param _request_auth: set to override the auth_settings for an a single
452
+ request; this effectively ignores the
453
+ authentication in the spec for a single request.
454
+ :type _request_auth: dict, optional
455
+ :param _content_type: force content-type for the request.
456
+ :type _content_type: str, Optional
457
+ :param _headers: set to override the headers for a single
458
+ request; this effectively ignores the headers
459
+ in the spec for a single request.
460
+ :type _headers: dict, optional
461
+ :param _host_index: set to override the host_index for a single
462
+ request; this effectively ignores the host_index
463
+ in the spec for a single request.
464
+ :type _host_index: int, optional
465
+ :return: Returns the result object.
466
+ """ # noqa: E501
467
+
468
+ _param = self._delete_relation_v2_serialize(
469
+ from_id=from_id,
470
+ from_type=from_type,
471
+ relation_type=relation_type,
472
+ to_id=to_id,
473
+ to_type=to_type,
474
+ relation_type_group=relation_type_group,
475
+ _request_auth=_request_auth,
476
+ _content_type=_content_type,
477
+ _headers=_headers,
478
+ _host_index=_host_index
479
+ )
480
+
481
+ _response_types_map: Dict[str, Optional[str]] = {
482
+ '200': "EntityRelation",
483
+ '400': "ThingsboardErrorResponse",
484
+ '401': "ThingsboardErrorResponse",
485
+ '403': "ThingsboardErrorResponse",
486
+ '404': "ThingsboardErrorResponse",
487
+ '429': "ThingsboardErrorResponse",
488
+ }
489
+ response_data = self.api_client.call_api(
490
+ *_param,
491
+ _request_timeout=_request_timeout
492
+ )
493
+ response_data.read()
494
+ return self.api_client.response_deserialize(
495
+ response_data=response_data,
496
+ response_types_map=_response_types_map,
497
+ ).data
498
+
499
+
500
+ @validate_call
501
+ def delete_relation_v2_with_http_info(
502
+ self,
503
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
504
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
505
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
506
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
507
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
508
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
509
+ _request_timeout: Union[
510
+ None,
511
+ Annotated[StrictFloat, Field(gt=0)],
512
+ Tuple[
513
+ Annotated[StrictFloat, Field(gt=0)],
514
+ Annotated[StrictFloat, Field(gt=0)]
515
+ ]
516
+ ] = None,
517
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
518
+ _content_type: Optional[StrictStr] = None,
519
+ _headers: Optional[Dict[StrictStr, Any]] = None,
520
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
521
+ ) -> ApiResponse[EntityRelation]:
522
+ """Delete Relation (deleteRelationV2)
523
+
524
+ Deletes a relation between two entities in the platform. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
525
+
526
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
527
+ :type from_id: str
528
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
529
+ :type from_type: str
530
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
531
+ :type relation_type: str
532
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
533
+ :type to_id: str
534
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
535
+ :type to_type: str
536
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
537
+ :type relation_type_group: str
538
+ :param _request_timeout: timeout setting for this request. If one
539
+ number provided, it will be total request
540
+ timeout. It can also be a pair (tuple) of
541
+ (connection, read) timeouts.
542
+ :type _request_timeout: int, tuple(int, int), optional
543
+ :param _request_auth: set to override the auth_settings for an a single
544
+ request; this effectively ignores the
545
+ authentication in the spec for a single request.
546
+ :type _request_auth: dict, optional
547
+ :param _content_type: force content-type for the request.
548
+ :type _content_type: str, Optional
549
+ :param _headers: set to override the headers for a single
550
+ request; this effectively ignores the headers
551
+ in the spec for a single request.
552
+ :type _headers: dict, optional
553
+ :param _host_index: set to override the host_index for a single
554
+ request; this effectively ignores the host_index
555
+ in the spec for a single request.
556
+ :type _host_index: int, optional
557
+ :return: Returns the result object.
558
+ """ # noqa: E501
559
+
560
+ _param = self._delete_relation_v2_serialize(
561
+ from_id=from_id,
562
+ from_type=from_type,
563
+ relation_type=relation_type,
564
+ to_id=to_id,
565
+ to_type=to_type,
566
+ relation_type_group=relation_type_group,
567
+ _request_auth=_request_auth,
568
+ _content_type=_content_type,
569
+ _headers=_headers,
570
+ _host_index=_host_index
571
+ )
572
+
573
+ _response_types_map: Dict[str, Optional[str]] = {
574
+ '200': "EntityRelation",
575
+ '400': "ThingsboardErrorResponse",
576
+ '401': "ThingsboardErrorResponse",
577
+ '403': "ThingsboardErrorResponse",
578
+ '404': "ThingsboardErrorResponse",
579
+ '429': "ThingsboardErrorResponse",
580
+ }
581
+ response_data = self.api_client.call_api(
582
+ *_param,
583
+ _request_timeout=_request_timeout
584
+ )
585
+ response_data.read()
586
+ return self.api_client.response_deserialize(
587
+ response_data=response_data,
588
+ response_types_map=_response_types_map,
589
+ )
590
+
591
+
592
+ @validate_call
593
+ def delete_relation_v2_without_preload_content(
594
+ self,
595
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
596
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
597
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
598
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
599
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
600
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
601
+ _request_timeout: Union[
602
+ None,
603
+ Annotated[StrictFloat, Field(gt=0)],
604
+ Tuple[
605
+ Annotated[StrictFloat, Field(gt=0)],
606
+ Annotated[StrictFloat, Field(gt=0)]
607
+ ]
608
+ ] = None,
609
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
610
+ _content_type: Optional[StrictStr] = None,
611
+ _headers: Optional[Dict[StrictStr, Any]] = None,
612
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
613
+ ) -> RESTResponseType:
614
+ """Delete Relation (deleteRelationV2)
615
+
616
+ Deletes a relation between two entities in the platform. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
617
+
618
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
619
+ :type from_id: str
620
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
621
+ :type from_type: str
622
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
623
+ :type relation_type: str
624
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
625
+ :type to_id: str
626
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
627
+ :type to_type: str
628
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
629
+ :type relation_type_group: str
630
+ :param _request_timeout: timeout setting for this request. If one
631
+ number provided, it will be total request
632
+ timeout. It can also be a pair (tuple) of
633
+ (connection, read) timeouts.
634
+ :type _request_timeout: int, tuple(int, int), optional
635
+ :param _request_auth: set to override the auth_settings for an a single
636
+ request; this effectively ignores the
637
+ authentication in the spec for a single request.
638
+ :type _request_auth: dict, optional
639
+ :param _content_type: force content-type for the request.
640
+ :type _content_type: str, Optional
641
+ :param _headers: set to override the headers for a single
642
+ request; this effectively ignores the headers
643
+ in the spec for a single request.
644
+ :type _headers: dict, optional
645
+ :param _host_index: set to override the host_index for a single
646
+ request; this effectively ignores the host_index
647
+ in the spec for a single request.
648
+ :type _host_index: int, optional
649
+ :return: Returns the result object.
650
+ """ # noqa: E501
651
+
652
+ _param = self._delete_relation_v2_serialize(
653
+ from_id=from_id,
654
+ from_type=from_type,
655
+ relation_type=relation_type,
656
+ to_id=to_id,
657
+ to_type=to_type,
658
+ relation_type_group=relation_type_group,
659
+ _request_auth=_request_auth,
660
+ _content_type=_content_type,
661
+ _headers=_headers,
662
+ _host_index=_host_index
663
+ )
664
+
665
+ _response_types_map: Dict[str, Optional[str]] = {
666
+ '200': "EntityRelation",
667
+ '400': "ThingsboardErrorResponse",
668
+ '401': "ThingsboardErrorResponse",
669
+ '403': "ThingsboardErrorResponse",
670
+ '404': "ThingsboardErrorResponse",
671
+ '429': "ThingsboardErrorResponse",
672
+ }
673
+ response_data = self.api_client.call_api(
674
+ *_param,
675
+ _request_timeout=_request_timeout
676
+ )
677
+ return response_data.response
678
+
679
+
680
+ def _delete_relation_v2_serialize(
681
+ self,
682
+ from_id,
683
+ from_type,
684
+ relation_type,
685
+ to_id,
686
+ to_type,
687
+ relation_type_group,
688
+ _request_auth,
689
+ _content_type,
690
+ _headers,
691
+ _host_index,
692
+ ) -> RequestSerialized:
693
+
694
+ _host = None
695
+
696
+ _collection_formats: Dict[str, str] = {
697
+ }
698
+
699
+ _path_params: Dict[str, str] = {}
700
+ _query_params: List[Tuple[str, str]] = []
701
+ _header_params: Dict[str, Optional[str]] = _headers or {}
702
+ _form_params: List[Tuple[str, str]] = []
703
+ _files: Dict[
704
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
705
+ ] = {}
706
+ _body_params: Optional[bytes] = None
707
+
708
+ # process the path parameters
709
+ # process the query parameters
710
+ if from_id is not None:
711
+
712
+ _query_params.append(('fromId', from_id))
713
+
714
+ if from_type is not None:
715
+
716
+ _query_params.append(('fromType', from_type))
717
+
718
+ if relation_type is not None:
719
+
720
+ _query_params.append(('relationType', relation_type))
721
+
722
+ if relation_type_group is not None:
723
+
724
+ _query_params.append(('relationTypeGroup', relation_type_group))
725
+
726
+ if to_id is not None:
727
+
728
+ _query_params.append(('toId', to_id))
729
+
730
+ if to_type is not None:
731
+
732
+ _query_params.append(('toType', to_type))
733
+
734
+ # process the header parameters
735
+ # process the form parameters
736
+ # process the body parameter
737
+
738
+
739
+ # set the HTTP header `Accept`
740
+ if 'Accept' not in _header_params:
741
+ _header_params['Accept'] = self.api_client.select_header_accept(
742
+ [
743
+ 'application/json'
744
+ ]
745
+ )
746
+
747
+
748
+ # authentication setting
749
+ _auth_settings: List[str] = [
750
+ 'HTTP login form',
751
+ 'API key form'
752
+ ]
753
+
754
+ return self.api_client.param_serialize(
755
+ method='DELETE',
756
+ resource_path='/api/v2/relation{?fromId,fromType,relationType,relationTypeGroup,toId,toType}',
757
+ path_params=_path_params,
758
+ query_params=_query_params,
759
+ header_params=_header_params,
760
+ body=_body_params,
761
+ post_params=_form_params,
762
+ files=_files,
763
+ auth_settings=_auth_settings,
764
+ collection_formats=_collection_formats,
765
+ _host=_host,
766
+ _request_auth=_request_auth
767
+ )
768
+
769
+
770
+
771
+
772
+ @validate_call
773
+ def delete_relations(
774
+ self,
775
+ entity_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
776
+ entity_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
777
+ _request_timeout: Union[
778
+ None,
779
+ Annotated[StrictFloat, Field(gt=0)],
780
+ Tuple[
781
+ Annotated[StrictFloat, Field(gt=0)],
782
+ Annotated[StrictFloat, Field(gt=0)]
783
+ ]
784
+ ] = None,
785
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
786
+ _content_type: Optional[StrictStr] = None,
787
+ _headers: Optional[Dict[StrictStr, Any]] = None,
788
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
789
+ ) -> None:
790
+ """Delete common relations (deleteCommonRelations)
791
+
792
+ Deletes all the relations ('from' and 'to' direction) for the specified entity and relation type group: 'COMMON'. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
793
+
794
+ :param entity_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
795
+ :type entity_id: str
796
+ :param entity_type: A string value representing the entity type. For example, 'DEVICE' (required)
797
+ :type entity_type: str
798
+ :param _request_timeout: timeout setting for this request. If one
799
+ number provided, it will be total request
800
+ timeout. It can also be a pair (tuple) of
801
+ (connection, read) timeouts.
802
+ :type _request_timeout: int, tuple(int, int), optional
803
+ :param _request_auth: set to override the auth_settings for an a single
804
+ request; this effectively ignores the
805
+ authentication in the spec for a single request.
806
+ :type _request_auth: dict, optional
807
+ :param _content_type: force content-type for the request.
808
+ :type _content_type: str, Optional
809
+ :param _headers: set to override the headers for a single
810
+ request; this effectively ignores the headers
811
+ in the spec for a single request.
812
+ :type _headers: dict, optional
813
+ :param _host_index: set to override the host_index for a single
814
+ request; this effectively ignores the host_index
815
+ in the spec for a single request.
816
+ :type _host_index: int, optional
817
+ :return: Returns the result object.
818
+ """ # noqa: E501
819
+
820
+ _param = self._delete_relations_serialize(
821
+ entity_id=entity_id,
822
+ entity_type=entity_type,
823
+ _request_auth=_request_auth,
824
+ _content_type=_content_type,
825
+ _headers=_headers,
826
+ _host_index=_host_index
827
+ )
828
+
829
+ _response_types_map: Dict[str, Optional[str]] = {
830
+ '200': None,
831
+ '400': "ThingsboardErrorResponse",
832
+ '401': "ThingsboardErrorResponse",
833
+ '403': "ThingsboardErrorResponse",
834
+ '404': "ThingsboardErrorResponse",
835
+ '429': "ThingsboardErrorResponse",
836
+ }
837
+ response_data = self.api_client.call_api(
838
+ *_param,
839
+ _request_timeout=_request_timeout
840
+ )
841
+ response_data.read()
842
+ return self.api_client.response_deserialize(
843
+ response_data=response_data,
844
+ response_types_map=_response_types_map,
845
+ ).data
846
+
847
+
848
+ @validate_call
849
+ def delete_relations_with_http_info(
850
+ self,
851
+ entity_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
852
+ entity_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
853
+ _request_timeout: Union[
854
+ None,
855
+ Annotated[StrictFloat, Field(gt=0)],
856
+ Tuple[
857
+ Annotated[StrictFloat, Field(gt=0)],
858
+ Annotated[StrictFloat, Field(gt=0)]
859
+ ]
860
+ ] = None,
861
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
862
+ _content_type: Optional[StrictStr] = None,
863
+ _headers: Optional[Dict[StrictStr, Any]] = None,
864
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
865
+ ) -> ApiResponse[None]:
866
+ """Delete common relations (deleteCommonRelations)
867
+
868
+ Deletes all the relations ('from' and 'to' direction) for the specified entity and relation type group: 'COMMON'. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
869
+
870
+ :param entity_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
871
+ :type entity_id: str
872
+ :param entity_type: A string value representing the entity type. For example, 'DEVICE' (required)
873
+ :type entity_type: str
874
+ :param _request_timeout: timeout setting for this request. If one
875
+ number provided, it will be total request
876
+ timeout. It can also be a pair (tuple) of
877
+ (connection, read) timeouts.
878
+ :type _request_timeout: int, tuple(int, int), optional
879
+ :param _request_auth: set to override the auth_settings for an a single
880
+ request; this effectively ignores the
881
+ authentication in the spec for a single request.
882
+ :type _request_auth: dict, optional
883
+ :param _content_type: force content-type for the request.
884
+ :type _content_type: str, Optional
885
+ :param _headers: set to override the headers for a single
886
+ request; this effectively ignores the headers
887
+ in the spec for a single request.
888
+ :type _headers: dict, optional
889
+ :param _host_index: set to override the host_index for a single
890
+ request; this effectively ignores the host_index
891
+ in the spec for a single request.
892
+ :type _host_index: int, optional
893
+ :return: Returns the result object.
894
+ """ # noqa: E501
895
+
896
+ _param = self._delete_relations_serialize(
897
+ entity_id=entity_id,
898
+ entity_type=entity_type,
899
+ _request_auth=_request_auth,
900
+ _content_type=_content_type,
901
+ _headers=_headers,
902
+ _host_index=_host_index
903
+ )
904
+
905
+ _response_types_map: Dict[str, Optional[str]] = {
906
+ '200': None,
907
+ '400': "ThingsboardErrorResponse",
908
+ '401': "ThingsboardErrorResponse",
909
+ '403': "ThingsboardErrorResponse",
910
+ '404': "ThingsboardErrorResponse",
911
+ '429': "ThingsboardErrorResponse",
912
+ }
913
+ response_data = self.api_client.call_api(
914
+ *_param,
915
+ _request_timeout=_request_timeout
916
+ )
917
+ response_data.read()
918
+ return self.api_client.response_deserialize(
919
+ response_data=response_data,
920
+ response_types_map=_response_types_map,
921
+ )
922
+
923
+
924
+ @validate_call
925
+ def delete_relations_without_preload_content(
926
+ self,
927
+ entity_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
928
+ entity_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
929
+ _request_timeout: Union[
930
+ None,
931
+ Annotated[StrictFloat, Field(gt=0)],
932
+ Tuple[
933
+ Annotated[StrictFloat, Field(gt=0)],
934
+ Annotated[StrictFloat, Field(gt=0)]
935
+ ]
936
+ ] = None,
937
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
938
+ _content_type: Optional[StrictStr] = None,
939
+ _headers: Optional[Dict[StrictStr, Any]] = None,
940
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
941
+ ) -> RESTResponseType:
942
+ """Delete common relations (deleteCommonRelations)
943
+
944
+ Deletes all the relations ('from' and 'to' direction) for the specified entity and relation type group: 'COMMON'. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
945
+
946
+ :param entity_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
947
+ :type entity_id: str
948
+ :param entity_type: A string value representing the entity type. For example, 'DEVICE' (required)
949
+ :type entity_type: str
950
+ :param _request_timeout: timeout setting for this request. If one
951
+ number provided, it will be total request
952
+ timeout. It can also be a pair (tuple) of
953
+ (connection, read) timeouts.
954
+ :type _request_timeout: int, tuple(int, int), optional
955
+ :param _request_auth: set to override the auth_settings for an a single
956
+ request; this effectively ignores the
957
+ authentication in the spec for a single request.
958
+ :type _request_auth: dict, optional
959
+ :param _content_type: force content-type for the request.
960
+ :type _content_type: str, Optional
961
+ :param _headers: set to override the headers for a single
962
+ request; this effectively ignores the headers
963
+ in the spec for a single request.
964
+ :type _headers: dict, optional
965
+ :param _host_index: set to override the host_index for a single
966
+ request; this effectively ignores the host_index
967
+ in the spec for a single request.
968
+ :type _host_index: int, optional
969
+ :return: Returns the result object.
970
+ """ # noqa: E501
971
+
972
+ _param = self._delete_relations_serialize(
973
+ entity_id=entity_id,
974
+ entity_type=entity_type,
975
+ _request_auth=_request_auth,
976
+ _content_type=_content_type,
977
+ _headers=_headers,
978
+ _host_index=_host_index
979
+ )
980
+
981
+ _response_types_map: Dict[str, Optional[str]] = {
982
+ '200': None,
983
+ '400': "ThingsboardErrorResponse",
984
+ '401': "ThingsboardErrorResponse",
985
+ '403': "ThingsboardErrorResponse",
986
+ '404': "ThingsboardErrorResponse",
987
+ '429': "ThingsboardErrorResponse",
988
+ }
989
+ response_data = self.api_client.call_api(
990
+ *_param,
991
+ _request_timeout=_request_timeout
992
+ )
993
+ return response_data.response
994
+
995
+
996
+ def _delete_relations_serialize(
997
+ self,
998
+ entity_id,
999
+ entity_type,
1000
+ _request_auth,
1001
+ _content_type,
1002
+ _headers,
1003
+ _host_index,
1004
+ ) -> RequestSerialized:
1005
+
1006
+ _host = None
1007
+
1008
+ _collection_formats: Dict[str, str] = {
1009
+ }
1010
+
1011
+ _path_params: Dict[str, str] = {}
1012
+ _query_params: List[Tuple[str, str]] = []
1013
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1014
+ _form_params: List[Tuple[str, str]] = []
1015
+ _files: Dict[
1016
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1017
+ ] = {}
1018
+ _body_params: Optional[bytes] = None
1019
+
1020
+ # process the path parameters
1021
+ # process the query parameters
1022
+ if entity_id is not None:
1023
+
1024
+ _query_params.append(('entityId', entity_id))
1025
+
1026
+ if entity_type is not None:
1027
+
1028
+ _query_params.append(('entityType', entity_type))
1029
+
1030
+ # process the header parameters
1031
+ # process the form parameters
1032
+ # process the body parameter
1033
+
1034
+
1035
+ # set the HTTP header `Accept`
1036
+ if 'Accept' not in _header_params:
1037
+ _header_params['Accept'] = self.api_client.select_header_accept(
1038
+ [
1039
+ 'application/json'
1040
+ ]
1041
+ )
1042
+
1043
+
1044
+ # authentication setting
1045
+ _auth_settings: List[str] = [
1046
+ 'HTTP login form',
1047
+ 'API key form'
1048
+ ]
1049
+
1050
+ return self.api_client.param_serialize(
1051
+ method='DELETE',
1052
+ resource_path='/api/relations{?entityId,entityType}',
1053
+ path_params=_path_params,
1054
+ query_params=_query_params,
1055
+ header_params=_header_params,
1056
+ body=_body_params,
1057
+ post_params=_form_params,
1058
+ files=_files,
1059
+ auth_settings=_auth_settings,
1060
+ collection_formats=_collection_formats,
1061
+ _host=_host,
1062
+ _request_auth=_request_auth
1063
+ )
1064
+
1065
+
1066
+
1067
+
1068
+ @validate_call
1069
+ def find_by_from(
1070
+ self,
1071
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
1072
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
1073
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
1074
+ _request_timeout: Union[
1075
+ None,
1076
+ Annotated[StrictFloat, Field(gt=0)],
1077
+ Tuple[
1078
+ Annotated[StrictFloat, Field(gt=0)],
1079
+ Annotated[StrictFloat, Field(gt=0)]
1080
+ ]
1081
+ ] = None,
1082
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1083
+ _content_type: Optional[StrictStr] = None,
1084
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1085
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1086
+ ) -> List[EntityRelation]:
1087
+ """Get List of Relations (findByFrom)
1088
+
1089
+ Returns list of relation objects for the specified entity by the 'from' direction. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
1090
+
1091
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
1092
+ :type from_id: str
1093
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
1094
+ :type from_type: str
1095
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
1096
+ :type relation_type_group: str
1097
+ :param _request_timeout: timeout setting for this request. If one
1098
+ number provided, it will be total request
1099
+ timeout. It can also be a pair (tuple) of
1100
+ (connection, read) timeouts.
1101
+ :type _request_timeout: int, tuple(int, int), optional
1102
+ :param _request_auth: set to override the auth_settings for an a single
1103
+ request; this effectively ignores the
1104
+ authentication in the spec for a single request.
1105
+ :type _request_auth: dict, optional
1106
+ :param _content_type: force content-type for the request.
1107
+ :type _content_type: str, Optional
1108
+ :param _headers: set to override the headers for a single
1109
+ request; this effectively ignores the headers
1110
+ in the spec for a single request.
1111
+ :type _headers: dict, optional
1112
+ :param _host_index: set to override the host_index for a single
1113
+ request; this effectively ignores the host_index
1114
+ in the spec for a single request.
1115
+ :type _host_index: int, optional
1116
+ :return: Returns the result object.
1117
+ """ # noqa: E501
1118
+
1119
+ _param = self._find_by_from_serialize(
1120
+ from_id=from_id,
1121
+ from_type=from_type,
1122
+ relation_type_group=relation_type_group,
1123
+ _request_auth=_request_auth,
1124
+ _content_type=_content_type,
1125
+ _headers=_headers,
1126
+ _host_index=_host_index
1127
+ )
1128
+
1129
+ _response_types_map: Dict[str, Optional[str]] = {
1130
+ '200': "List[EntityRelation]",
1131
+ '400': "ThingsboardErrorResponse",
1132
+ '401': "ThingsboardErrorResponse",
1133
+ '403': "ThingsboardErrorResponse",
1134
+ '404': "ThingsboardErrorResponse",
1135
+ '429': "ThingsboardErrorResponse",
1136
+ }
1137
+ response_data = self.api_client.call_api(
1138
+ *_param,
1139
+ _request_timeout=_request_timeout
1140
+ )
1141
+ response_data.read()
1142
+ return self.api_client.response_deserialize(
1143
+ response_data=response_data,
1144
+ response_types_map=_response_types_map,
1145
+ ).data
1146
+
1147
+
1148
+ @validate_call
1149
+ def find_by_from_with_http_info(
1150
+ self,
1151
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
1152
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
1153
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
1154
+ _request_timeout: Union[
1155
+ None,
1156
+ Annotated[StrictFloat, Field(gt=0)],
1157
+ Tuple[
1158
+ Annotated[StrictFloat, Field(gt=0)],
1159
+ Annotated[StrictFloat, Field(gt=0)]
1160
+ ]
1161
+ ] = None,
1162
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1163
+ _content_type: Optional[StrictStr] = None,
1164
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1165
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1166
+ ) -> ApiResponse[List[EntityRelation]]:
1167
+ """Get List of Relations (findByFrom)
1168
+
1169
+ Returns list of relation objects for the specified entity by the 'from' direction. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
1170
+
1171
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
1172
+ :type from_id: str
1173
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
1174
+ :type from_type: str
1175
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
1176
+ :type relation_type_group: str
1177
+ :param _request_timeout: timeout setting for this request. If one
1178
+ number provided, it will be total request
1179
+ timeout. It can also be a pair (tuple) of
1180
+ (connection, read) timeouts.
1181
+ :type _request_timeout: int, tuple(int, int), optional
1182
+ :param _request_auth: set to override the auth_settings for an a single
1183
+ request; this effectively ignores the
1184
+ authentication in the spec for a single request.
1185
+ :type _request_auth: dict, optional
1186
+ :param _content_type: force content-type for the request.
1187
+ :type _content_type: str, Optional
1188
+ :param _headers: set to override the headers for a single
1189
+ request; this effectively ignores the headers
1190
+ in the spec for a single request.
1191
+ :type _headers: dict, optional
1192
+ :param _host_index: set to override the host_index for a single
1193
+ request; this effectively ignores the host_index
1194
+ in the spec for a single request.
1195
+ :type _host_index: int, optional
1196
+ :return: Returns the result object.
1197
+ """ # noqa: E501
1198
+
1199
+ _param = self._find_by_from_serialize(
1200
+ from_id=from_id,
1201
+ from_type=from_type,
1202
+ relation_type_group=relation_type_group,
1203
+ _request_auth=_request_auth,
1204
+ _content_type=_content_type,
1205
+ _headers=_headers,
1206
+ _host_index=_host_index
1207
+ )
1208
+
1209
+ _response_types_map: Dict[str, Optional[str]] = {
1210
+ '200': "List[EntityRelation]",
1211
+ '400': "ThingsboardErrorResponse",
1212
+ '401': "ThingsboardErrorResponse",
1213
+ '403': "ThingsboardErrorResponse",
1214
+ '404': "ThingsboardErrorResponse",
1215
+ '429': "ThingsboardErrorResponse",
1216
+ }
1217
+ response_data = self.api_client.call_api(
1218
+ *_param,
1219
+ _request_timeout=_request_timeout
1220
+ )
1221
+ response_data.read()
1222
+ return self.api_client.response_deserialize(
1223
+ response_data=response_data,
1224
+ response_types_map=_response_types_map,
1225
+ )
1226
+
1227
+
1228
+ @validate_call
1229
+ def find_by_from_without_preload_content(
1230
+ self,
1231
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
1232
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
1233
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
1234
+ _request_timeout: Union[
1235
+ None,
1236
+ Annotated[StrictFloat, Field(gt=0)],
1237
+ Tuple[
1238
+ Annotated[StrictFloat, Field(gt=0)],
1239
+ Annotated[StrictFloat, Field(gt=0)]
1240
+ ]
1241
+ ] = None,
1242
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1243
+ _content_type: Optional[StrictStr] = None,
1244
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1245
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1246
+ ) -> RESTResponseType:
1247
+ """Get List of Relations (findByFrom)
1248
+
1249
+ Returns list of relation objects for the specified entity by the 'from' direction. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
1250
+
1251
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
1252
+ :type from_id: str
1253
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
1254
+ :type from_type: str
1255
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
1256
+ :type relation_type_group: str
1257
+ :param _request_timeout: timeout setting for this request. If one
1258
+ number provided, it will be total request
1259
+ timeout. It can also be a pair (tuple) of
1260
+ (connection, read) timeouts.
1261
+ :type _request_timeout: int, tuple(int, int), optional
1262
+ :param _request_auth: set to override the auth_settings for an a single
1263
+ request; this effectively ignores the
1264
+ authentication in the spec for a single request.
1265
+ :type _request_auth: dict, optional
1266
+ :param _content_type: force content-type for the request.
1267
+ :type _content_type: str, Optional
1268
+ :param _headers: set to override the headers for a single
1269
+ request; this effectively ignores the headers
1270
+ in the spec for a single request.
1271
+ :type _headers: dict, optional
1272
+ :param _host_index: set to override the host_index for a single
1273
+ request; this effectively ignores the host_index
1274
+ in the spec for a single request.
1275
+ :type _host_index: int, optional
1276
+ :return: Returns the result object.
1277
+ """ # noqa: E501
1278
+
1279
+ _param = self._find_by_from_serialize(
1280
+ from_id=from_id,
1281
+ from_type=from_type,
1282
+ relation_type_group=relation_type_group,
1283
+ _request_auth=_request_auth,
1284
+ _content_type=_content_type,
1285
+ _headers=_headers,
1286
+ _host_index=_host_index
1287
+ )
1288
+
1289
+ _response_types_map: Dict[str, Optional[str]] = {
1290
+ '200': "List[EntityRelation]",
1291
+ '400': "ThingsboardErrorResponse",
1292
+ '401': "ThingsboardErrorResponse",
1293
+ '403': "ThingsboardErrorResponse",
1294
+ '404': "ThingsboardErrorResponse",
1295
+ '429': "ThingsboardErrorResponse",
1296
+ }
1297
+ response_data = self.api_client.call_api(
1298
+ *_param,
1299
+ _request_timeout=_request_timeout
1300
+ )
1301
+ return response_data.response
1302
+
1303
+
1304
+ def _find_by_from_serialize(
1305
+ self,
1306
+ from_id,
1307
+ from_type,
1308
+ relation_type_group,
1309
+ _request_auth,
1310
+ _content_type,
1311
+ _headers,
1312
+ _host_index,
1313
+ ) -> RequestSerialized:
1314
+
1315
+ _host = None
1316
+
1317
+ _collection_formats: Dict[str, str] = {
1318
+ }
1319
+
1320
+ _path_params: Dict[str, str] = {}
1321
+ _query_params: List[Tuple[str, str]] = []
1322
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1323
+ _form_params: List[Tuple[str, str]] = []
1324
+ _files: Dict[
1325
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1326
+ ] = {}
1327
+ _body_params: Optional[bytes] = None
1328
+
1329
+ # process the path parameters
1330
+ # process the query parameters
1331
+ if from_id is not None:
1332
+
1333
+ _query_params.append(('fromId', from_id))
1334
+
1335
+ if from_type is not None:
1336
+
1337
+ _query_params.append(('fromType', from_type))
1338
+
1339
+ if relation_type_group is not None:
1340
+
1341
+ _query_params.append(('relationTypeGroup', relation_type_group))
1342
+
1343
+ # process the header parameters
1344
+ # process the form parameters
1345
+ # process the body parameter
1346
+
1347
+
1348
+ # set the HTTP header `Accept`
1349
+ if 'Accept' not in _header_params:
1350
+ _header_params['Accept'] = self.api_client.select_header_accept(
1351
+ [
1352
+ 'application/json'
1353
+ ]
1354
+ )
1355
+
1356
+
1357
+ # authentication setting
1358
+ _auth_settings: List[str] = [
1359
+ 'HTTP login form',
1360
+ 'API key form'
1361
+ ]
1362
+
1363
+ return self.api_client.param_serialize(
1364
+ method='GET',
1365
+ resource_path='/api/relations{?fromId,fromType,relationTypeGroup}',
1366
+ path_params=_path_params,
1367
+ query_params=_query_params,
1368
+ header_params=_header_params,
1369
+ body=_body_params,
1370
+ post_params=_form_params,
1371
+ files=_files,
1372
+ auth_settings=_auth_settings,
1373
+ collection_formats=_collection_formats,
1374
+ _host=_host,
1375
+ _request_auth=_request_auth
1376
+ )
1377
+
1378
+
1379
+
1380
+
1381
+ @validate_call
1382
+ def find_by_from1(
1383
+ self,
1384
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
1385
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
1386
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
1387
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
1388
+ _request_timeout: Union[
1389
+ None,
1390
+ Annotated[StrictFloat, Field(gt=0)],
1391
+ Tuple[
1392
+ Annotated[StrictFloat, Field(gt=0)],
1393
+ Annotated[StrictFloat, Field(gt=0)]
1394
+ ]
1395
+ ] = None,
1396
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1397
+ _content_type: Optional[StrictStr] = None,
1398
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1399
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1400
+ ) -> List[EntityRelation]:
1401
+ """Get List of Relations (findByFrom)
1402
+
1403
+ Returns list of relation objects for the specified entity by the 'from' direction and relation type. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
1404
+
1405
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
1406
+ :type from_id: str
1407
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
1408
+ :type from_type: str
1409
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
1410
+ :type relation_type: str
1411
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
1412
+ :type relation_type_group: str
1413
+ :param _request_timeout: timeout setting for this request. If one
1414
+ number provided, it will be total request
1415
+ timeout. It can also be a pair (tuple) of
1416
+ (connection, read) timeouts.
1417
+ :type _request_timeout: int, tuple(int, int), optional
1418
+ :param _request_auth: set to override the auth_settings for an a single
1419
+ request; this effectively ignores the
1420
+ authentication in the spec for a single request.
1421
+ :type _request_auth: dict, optional
1422
+ :param _content_type: force content-type for the request.
1423
+ :type _content_type: str, Optional
1424
+ :param _headers: set to override the headers for a single
1425
+ request; this effectively ignores the headers
1426
+ in the spec for a single request.
1427
+ :type _headers: dict, optional
1428
+ :param _host_index: set to override the host_index for a single
1429
+ request; this effectively ignores the host_index
1430
+ in the spec for a single request.
1431
+ :type _host_index: int, optional
1432
+ :return: Returns the result object.
1433
+ """ # noqa: E501
1434
+
1435
+ _param = self._find_by_from1_serialize(
1436
+ from_id=from_id,
1437
+ from_type=from_type,
1438
+ relation_type=relation_type,
1439
+ relation_type_group=relation_type_group,
1440
+ _request_auth=_request_auth,
1441
+ _content_type=_content_type,
1442
+ _headers=_headers,
1443
+ _host_index=_host_index
1444
+ )
1445
+
1446
+ _response_types_map: Dict[str, Optional[str]] = {
1447
+ '200': "List[EntityRelation]",
1448
+ '400': "ThingsboardErrorResponse",
1449
+ '401': "ThingsboardErrorResponse",
1450
+ '403': "ThingsboardErrorResponse",
1451
+ '404': "ThingsboardErrorResponse",
1452
+ '429': "ThingsboardErrorResponse",
1453
+ }
1454
+ response_data = self.api_client.call_api(
1455
+ *_param,
1456
+ _request_timeout=_request_timeout
1457
+ )
1458
+ response_data.read()
1459
+ return self.api_client.response_deserialize(
1460
+ response_data=response_data,
1461
+ response_types_map=_response_types_map,
1462
+ ).data
1463
+
1464
+
1465
+ @validate_call
1466
+ def find_by_from1_with_http_info(
1467
+ self,
1468
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
1469
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
1470
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
1471
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
1472
+ _request_timeout: Union[
1473
+ None,
1474
+ Annotated[StrictFloat, Field(gt=0)],
1475
+ Tuple[
1476
+ Annotated[StrictFloat, Field(gt=0)],
1477
+ Annotated[StrictFloat, Field(gt=0)]
1478
+ ]
1479
+ ] = None,
1480
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1481
+ _content_type: Optional[StrictStr] = None,
1482
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1483
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1484
+ ) -> ApiResponse[List[EntityRelation]]:
1485
+ """Get List of Relations (findByFrom)
1486
+
1487
+ Returns list of relation objects for the specified entity by the 'from' direction and relation type. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
1488
+
1489
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
1490
+ :type from_id: str
1491
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
1492
+ :type from_type: str
1493
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
1494
+ :type relation_type: str
1495
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
1496
+ :type relation_type_group: str
1497
+ :param _request_timeout: timeout setting for this request. If one
1498
+ number provided, it will be total request
1499
+ timeout. It can also be a pair (tuple) of
1500
+ (connection, read) timeouts.
1501
+ :type _request_timeout: int, tuple(int, int), optional
1502
+ :param _request_auth: set to override the auth_settings for an a single
1503
+ request; this effectively ignores the
1504
+ authentication in the spec for a single request.
1505
+ :type _request_auth: dict, optional
1506
+ :param _content_type: force content-type for the request.
1507
+ :type _content_type: str, Optional
1508
+ :param _headers: set to override the headers for a single
1509
+ request; this effectively ignores the headers
1510
+ in the spec for a single request.
1511
+ :type _headers: dict, optional
1512
+ :param _host_index: set to override the host_index for a single
1513
+ request; this effectively ignores the host_index
1514
+ in the spec for a single request.
1515
+ :type _host_index: int, optional
1516
+ :return: Returns the result object.
1517
+ """ # noqa: E501
1518
+
1519
+ _param = self._find_by_from1_serialize(
1520
+ from_id=from_id,
1521
+ from_type=from_type,
1522
+ relation_type=relation_type,
1523
+ relation_type_group=relation_type_group,
1524
+ _request_auth=_request_auth,
1525
+ _content_type=_content_type,
1526
+ _headers=_headers,
1527
+ _host_index=_host_index
1528
+ )
1529
+
1530
+ _response_types_map: Dict[str, Optional[str]] = {
1531
+ '200': "List[EntityRelation]",
1532
+ '400': "ThingsboardErrorResponse",
1533
+ '401': "ThingsboardErrorResponse",
1534
+ '403': "ThingsboardErrorResponse",
1535
+ '404': "ThingsboardErrorResponse",
1536
+ '429': "ThingsboardErrorResponse",
1537
+ }
1538
+ response_data = self.api_client.call_api(
1539
+ *_param,
1540
+ _request_timeout=_request_timeout
1541
+ )
1542
+ response_data.read()
1543
+ return self.api_client.response_deserialize(
1544
+ response_data=response_data,
1545
+ response_types_map=_response_types_map,
1546
+ )
1547
+
1548
+
1549
+ @validate_call
1550
+ def find_by_from1_without_preload_content(
1551
+ self,
1552
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
1553
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
1554
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
1555
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
1556
+ _request_timeout: Union[
1557
+ None,
1558
+ Annotated[StrictFloat, Field(gt=0)],
1559
+ Tuple[
1560
+ Annotated[StrictFloat, Field(gt=0)],
1561
+ Annotated[StrictFloat, Field(gt=0)]
1562
+ ]
1563
+ ] = None,
1564
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1565
+ _content_type: Optional[StrictStr] = None,
1566
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1567
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1568
+ ) -> RESTResponseType:
1569
+ """Get List of Relations (findByFrom)
1570
+
1571
+ Returns list of relation objects for the specified entity by the 'from' direction and relation type. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
1572
+
1573
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
1574
+ :type from_id: str
1575
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
1576
+ :type from_type: str
1577
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
1578
+ :type relation_type: str
1579
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
1580
+ :type relation_type_group: str
1581
+ :param _request_timeout: timeout setting for this request. If one
1582
+ number provided, it will be total request
1583
+ timeout. It can also be a pair (tuple) of
1584
+ (connection, read) timeouts.
1585
+ :type _request_timeout: int, tuple(int, int), optional
1586
+ :param _request_auth: set to override the auth_settings for an a single
1587
+ request; this effectively ignores the
1588
+ authentication in the spec for a single request.
1589
+ :type _request_auth: dict, optional
1590
+ :param _content_type: force content-type for the request.
1591
+ :type _content_type: str, Optional
1592
+ :param _headers: set to override the headers for a single
1593
+ request; this effectively ignores the headers
1594
+ in the spec for a single request.
1595
+ :type _headers: dict, optional
1596
+ :param _host_index: set to override the host_index for a single
1597
+ request; this effectively ignores the host_index
1598
+ in the spec for a single request.
1599
+ :type _host_index: int, optional
1600
+ :return: Returns the result object.
1601
+ """ # noqa: E501
1602
+
1603
+ _param = self._find_by_from1_serialize(
1604
+ from_id=from_id,
1605
+ from_type=from_type,
1606
+ relation_type=relation_type,
1607
+ relation_type_group=relation_type_group,
1608
+ _request_auth=_request_auth,
1609
+ _content_type=_content_type,
1610
+ _headers=_headers,
1611
+ _host_index=_host_index
1612
+ )
1613
+
1614
+ _response_types_map: Dict[str, Optional[str]] = {
1615
+ '200': "List[EntityRelation]",
1616
+ '400': "ThingsboardErrorResponse",
1617
+ '401': "ThingsboardErrorResponse",
1618
+ '403': "ThingsboardErrorResponse",
1619
+ '404': "ThingsboardErrorResponse",
1620
+ '429': "ThingsboardErrorResponse",
1621
+ }
1622
+ response_data = self.api_client.call_api(
1623
+ *_param,
1624
+ _request_timeout=_request_timeout
1625
+ )
1626
+ return response_data.response
1627
+
1628
+
1629
+ def _find_by_from1_serialize(
1630
+ self,
1631
+ from_id,
1632
+ from_type,
1633
+ relation_type,
1634
+ relation_type_group,
1635
+ _request_auth,
1636
+ _content_type,
1637
+ _headers,
1638
+ _host_index,
1639
+ ) -> RequestSerialized:
1640
+
1641
+ _host = None
1642
+
1643
+ _collection_formats: Dict[str, str] = {
1644
+ }
1645
+
1646
+ _path_params: Dict[str, str] = {}
1647
+ _query_params: List[Tuple[str, str]] = []
1648
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1649
+ _form_params: List[Tuple[str, str]] = []
1650
+ _files: Dict[
1651
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1652
+ ] = {}
1653
+ _body_params: Optional[bytes] = None
1654
+
1655
+ # process the path parameters
1656
+ # process the query parameters
1657
+ if from_id is not None:
1658
+
1659
+ _query_params.append(('fromId', from_id))
1660
+
1661
+ if from_type is not None:
1662
+
1663
+ _query_params.append(('fromType', from_type))
1664
+
1665
+ if relation_type is not None:
1666
+
1667
+ _query_params.append(('relationType', relation_type))
1668
+
1669
+ if relation_type_group is not None:
1670
+
1671
+ _query_params.append(('relationTypeGroup', relation_type_group))
1672
+
1673
+ # process the header parameters
1674
+ # process the form parameters
1675
+ # process the body parameter
1676
+
1677
+
1678
+ # set the HTTP header `Accept`
1679
+ if 'Accept' not in _header_params:
1680
+ _header_params['Accept'] = self.api_client.select_header_accept(
1681
+ [
1682
+ 'application/json'
1683
+ ]
1684
+ )
1685
+
1686
+
1687
+ # authentication setting
1688
+ _auth_settings: List[str] = [
1689
+ 'HTTP login form',
1690
+ 'API key form'
1691
+ ]
1692
+
1693
+ return self.api_client.param_serialize(
1694
+ method='GET',
1695
+ resource_path='/api/relations{?fromId,fromType,relationType,relationTypeGroup}',
1696
+ path_params=_path_params,
1697
+ query_params=_query_params,
1698
+ header_params=_header_params,
1699
+ body=_body_params,
1700
+ post_params=_form_params,
1701
+ files=_files,
1702
+ auth_settings=_auth_settings,
1703
+ collection_formats=_collection_formats,
1704
+ _host=_host,
1705
+ _request_auth=_request_auth
1706
+ )
1707
+
1708
+
1709
+
1710
+
1711
+ @validate_call
1712
+ def find_by_query(
1713
+ self,
1714
+ entity_relations_query: EntityRelationsQuery,
1715
+ _request_timeout: Union[
1716
+ None,
1717
+ Annotated[StrictFloat, Field(gt=0)],
1718
+ Tuple[
1719
+ Annotated[StrictFloat, Field(gt=0)],
1720
+ Annotated[StrictFloat, Field(gt=0)]
1721
+ ]
1722
+ ] = None,
1723
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1724
+ _content_type: Optional[StrictStr] = None,
1725
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1726
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1727
+ ) -> List[EntityRelation]:
1728
+ """Find related entities (findByQuery)
1729
+
1730
+ Returns all entities that are related to the specific entity. The entity id, relation type, entity types, depth of the search, and other query parameters defined using complex 'EntityRelationsQuery' object. See 'Model' tab of the Parameters for more info.
1731
+
1732
+ :param entity_relations_query: (required)
1733
+ :type entity_relations_query: EntityRelationsQuery
1734
+ :param _request_timeout: timeout setting for this request. If one
1735
+ number provided, it will be total request
1736
+ timeout. It can also be a pair (tuple) of
1737
+ (connection, read) timeouts.
1738
+ :type _request_timeout: int, tuple(int, int), optional
1739
+ :param _request_auth: set to override the auth_settings for an a single
1740
+ request; this effectively ignores the
1741
+ authentication in the spec for a single request.
1742
+ :type _request_auth: dict, optional
1743
+ :param _content_type: force content-type for the request.
1744
+ :type _content_type: str, Optional
1745
+ :param _headers: set to override the headers for a single
1746
+ request; this effectively ignores the headers
1747
+ in the spec for a single request.
1748
+ :type _headers: dict, optional
1749
+ :param _host_index: set to override the host_index for a single
1750
+ request; this effectively ignores the host_index
1751
+ in the spec for a single request.
1752
+ :type _host_index: int, optional
1753
+ :return: Returns the result object.
1754
+ """ # noqa: E501
1755
+
1756
+ _param = self._find_by_query_serialize(
1757
+ entity_relations_query=entity_relations_query,
1758
+ _request_auth=_request_auth,
1759
+ _content_type=_content_type,
1760
+ _headers=_headers,
1761
+ _host_index=_host_index
1762
+ )
1763
+
1764
+ _response_types_map: Dict[str, Optional[str]] = {
1765
+ '200': "List[EntityRelation]",
1766
+ '400': "ThingsboardErrorResponse",
1767
+ '401': "ThingsboardErrorResponse",
1768
+ '403': "ThingsboardErrorResponse",
1769
+ '404': "ThingsboardErrorResponse",
1770
+ '429': "ThingsboardErrorResponse",
1771
+ }
1772
+ response_data = self.api_client.call_api(
1773
+ *_param,
1774
+ _request_timeout=_request_timeout
1775
+ )
1776
+ response_data.read()
1777
+ return self.api_client.response_deserialize(
1778
+ response_data=response_data,
1779
+ response_types_map=_response_types_map,
1780
+ ).data
1781
+
1782
+
1783
+ @validate_call
1784
+ def find_by_query_with_http_info(
1785
+ self,
1786
+ entity_relations_query: EntityRelationsQuery,
1787
+ _request_timeout: Union[
1788
+ None,
1789
+ Annotated[StrictFloat, Field(gt=0)],
1790
+ Tuple[
1791
+ Annotated[StrictFloat, Field(gt=0)],
1792
+ Annotated[StrictFloat, Field(gt=0)]
1793
+ ]
1794
+ ] = None,
1795
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1796
+ _content_type: Optional[StrictStr] = None,
1797
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1798
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1799
+ ) -> ApiResponse[List[EntityRelation]]:
1800
+ """Find related entities (findByQuery)
1801
+
1802
+ Returns all entities that are related to the specific entity. The entity id, relation type, entity types, depth of the search, and other query parameters defined using complex 'EntityRelationsQuery' object. See 'Model' tab of the Parameters for more info.
1803
+
1804
+ :param entity_relations_query: (required)
1805
+ :type entity_relations_query: EntityRelationsQuery
1806
+ :param _request_timeout: timeout setting for this request. If one
1807
+ number provided, it will be total request
1808
+ timeout. It can also be a pair (tuple) of
1809
+ (connection, read) timeouts.
1810
+ :type _request_timeout: int, tuple(int, int), optional
1811
+ :param _request_auth: set to override the auth_settings for an a single
1812
+ request; this effectively ignores the
1813
+ authentication in the spec for a single request.
1814
+ :type _request_auth: dict, optional
1815
+ :param _content_type: force content-type for the request.
1816
+ :type _content_type: str, Optional
1817
+ :param _headers: set to override the headers for a single
1818
+ request; this effectively ignores the headers
1819
+ in the spec for a single request.
1820
+ :type _headers: dict, optional
1821
+ :param _host_index: set to override the host_index for a single
1822
+ request; this effectively ignores the host_index
1823
+ in the spec for a single request.
1824
+ :type _host_index: int, optional
1825
+ :return: Returns the result object.
1826
+ """ # noqa: E501
1827
+
1828
+ _param = self._find_by_query_serialize(
1829
+ entity_relations_query=entity_relations_query,
1830
+ _request_auth=_request_auth,
1831
+ _content_type=_content_type,
1832
+ _headers=_headers,
1833
+ _host_index=_host_index
1834
+ )
1835
+
1836
+ _response_types_map: Dict[str, Optional[str]] = {
1837
+ '200': "List[EntityRelation]",
1838
+ '400': "ThingsboardErrorResponse",
1839
+ '401': "ThingsboardErrorResponse",
1840
+ '403': "ThingsboardErrorResponse",
1841
+ '404': "ThingsboardErrorResponse",
1842
+ '429': "ThingsboardErrorResponse",
1843
+ }
1844
+ response_data = self.api_client.call_api(
1845
+ *_param,
1846
+ _request_timeout=_request_timeout
1847
+ )
1848
+ response_data.read()
1849
+ return self.api_client.response_deserialize(
1850
+ response_data=response_data,
1851
+ response_types_map=_response_types_map,
1852
+ )
1853
+
1854
+
1855
+ @validate_call
1856
+ def find_by_query_without_preload_content(
1857
+ self,
1858
+ entity_relations_query: EntityRelationsQuery,
1859
+ _request_timeout: Union[
1860
+ None,
1861
+ Annotated[StrictFloat, Field(gt=0)],
1862
+ Tuple[
1863
+ Annotated[StrictFloat, Field(gt=0)],
1864
+ Annotated[StrictFloat, Field(gt=0)]
1865
+ ]
1866
+ ] = None,
1867
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1868
+ _content_type: Optional[StrictStr] = None,
1869
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1870
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1871
+ ) -> RESTResponseType:
1872
+ """Find related entities (findByQuery)
1873
+
1874
+ Returns all entities that are related to the specific entity. The entity id, relation type, entity types, depth of the search, and other query parameters defined using complex 'EntityRelationsQuery' object. See 'Model' tab of the Parameters for more info.
1875
+
1876
+ :param entity_relations_query: (required)
1877
+ :type entity_relations_query: EntityRelationsQuery
1878
+ :param _request_timeout: timeout setting for this request. If one
1879
+ number provided, it will be total request
1880
+ timeout. It can also be a pair (tuple) of
1881
+ (connection, read) timeouts.
1882
+ :type _request_timeout: int, tuple(int, int), optional
1883
+ :param _request_auth: set to override the auth_settings for an a single
1884
+ request; this effectively ignores the
1885
+ authentication in the spec for a single request.
1886
+ :type _request_auth: dict, optional
1887
+ :param _content_type: force content-type for the request.
1888
+ :type _content_type: str, Optional
1889
+ :param _headers: set to override the headers for a single
1890
+ request; this effectively ignores the headers
1891
+ in the spec for a single request.
1892
+ :type _headers: dict, optional
1893
+ :param _host_index: set to override the host_index for a single
1894
+ request; this effectively ignores the host_index
1895
+ in the spec for a single request.
1896
+ :type _host_index: int, optional
1897
+ :return: Returns the result object.
1898
+ """ # noqa: E501
1899
+
1900
+ _param = self._find_by_query_serialize(
1901
+ entity_relations_query=entity_relations_query,
1902
+ _request_auth=_request_auth,
1903
+ _content_type=_content_type,
1904
+ _headers=_headers,
1905
+ _host_index=_host_index
1906
+ )
1907
+
1908
+ _response_types_map: Dict[str, Optional[str]] = {
1909
+ '200': "List[EntityRelation]",
1910
+ '400': "ThingsboardErrorResponse",
1911
+ '401': "ThingsboardErrorResponse",
1912
+ '403': "ThingsboardErrorResponse",
1913
+ '404': "ThingsboardErrorResponse",
1914
+ '429': "ThingsboardErrorResponse",
1915
+ }
1916
+ response_data = self.api_client.call_api(
1917
+ *_param,
1918
+ _request_timeout=_request_timeout
1919
+ )
1920
+ return response_data.response
1921
+
1922
+
1923
+ def _find_by_query_serialize(
1924
+ self,
1925
+ entity_relations_query,
1926
+ _request_auth,
1927
+ _content_type,
1928
+ _headers,
1929
+ _host_index,
1930
+ ) -> RequestSerialized:
1931
+
1932
+ _host = None
1933
+
1934
+ _collection_formats: Dict[str, str] = {
1935
+ }
1936
+
1937
+ _path_params: Dict[str, str] = {}
1938
+ _query_params: List[Tuple[str, str]] = []
1939
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1940
+ _form_params: List[Tuple[str, str]] = []
1941
+ _files: Dict[
1942
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1943
+ ] = {}
1944
+ _body_params: Optional[bytes] = None
1945
+
1946
+ # process the path parameters
1947
+ # process the query parameters
1948
+ # process the header parameters
1949
+ # process the form parameters
1950
+ # process the body parameter
1951
+ if entity_relations_query is not None:
1952
+ _body_params = entity_relations_query
1953
+
1954
+
1955
+ # set the HTTP header `Accept`
1956
+ if 'Accept' not in _header_params:
1957
+ _header_params['Accept'] = self.api_client.select_header_accept(
1958
+ [
1959
+ 'application/json'
1960
+ ]
1961
+ )
1962
+
1963
+ # set the HTTP header `Content-Type`
1964
+ if _content_type:
1965
+ _header_params['Content-Type'] = _content_type
1966
+ else:
1967
+ _default_content_type = (
1968
+ self.api_client.select_header_content_type(
1969
+ [
1970
+ 'application/json'
1971
+ ]
1972
+ )
1973
+ )
1974
+ if _default_content_type is not None:
1975
+ _header_params['Content-Type'] = _default_content_type
1976
+
1977
+ # authentication setting
1978
+ _auth_settings: List[str] = [
1979
+ 'HTTP login form',
1980
+ 'API key form'
1981
+ ]
1982
+
1983
+ return self.api_client.param_serialize(
1984
+ method='POST',
1985
+ resource_path='/api/relations',
1986
+ path_params=_path_params,
1987
+ query_params=_query_params,
1988
+ header_params=_header_params,
1989
+ body=_body_params,
1990
+ post_params=_form_params,
1991
+ files=_files,
1992
+ auth_settings=_auth_settings,
1993
+ collection_formats=_collection_formats,
1994
+ _host=_host,
1995
+ _request_auth=_request_auth
1996
+ )
1997
+
1998
+
1999
+
2000
+
2001
+ @validate_call
2002
+ def find_by_to(
2003
+ self,
2004
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
2005
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
2006
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
2007
+ _request_timeout: Union[
2008
+ None,
2009
+ Annotated[StrictFloat, Field(gt=0)],
2010
+ Tuple[
2011
+ Annotated[StrictFloat, Field(gt=0)],
2012
+ Annotated[StrictFloat, Field(gt=0)]
2013
+ ]
2014
+ ] = None,
2015
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2016
+ _content_type: Optional[StrictStr] = None,
2017
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2018
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2019
+ ) -> List[EntityRelation]:
2020
+ """Get List of Relations (findByTo)
2021
+
2022
+ Returns list of relation objects for the specified entity by the 'to' direction. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
2023
+
2024
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
2025
+ :type to_id: str
2026
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
2027
+ :type to_type: str
2028
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
2029
+ :type relation_type_group: str
2030
+ :param _request_timeout: timeout setting for this request. If one
2031
+ number provided, it will be total request
2032
+ timeout. It can also be a pair (tuple) of
2033
+ (connection, read) timeouts.
2034
+ :type _request_timeout: int, tuple(int, int), optional
2035
+ :param _request_auth: set to override the auth_settings for an a single
2036
+ request; this effectively ignores the
2037
+ authentication in the spec for a single request.
2038
+ :type _request_auth: dict, optional
2039
+ :param _content_type: force content-type for the request.
2040
+ :type _content_type: str, Optional
2041
+ :param _headers: set to override the headers for a single
2042
+ request; this effectively ignores the headers
2043
+ in the spec for a single request.
2044
+ :type _headers: dict, optional
2045
+ :param _host_index: set to override the host_index for a single
2046
+ request; this effectively ignores the host_index
2047
+ in the spec for a single request.
2048
+ :type _host_index: int, optional
2049
+ :return: Returns the result object.
2050
+ """ # noqa: E501
2051
+
2052
+ _param = self._find_by_to_serialize(
2053
+ to_id=to_id,
2054
+ to_type=to_type,
2055
+ relation_type_group=relation_type_group,
2056
+ _request_auth=_request_auth,
2057
+ _content_type=_content_type,
2058
+ _headers=_headers,
2059
+ _host_index=_host_index
2060
+ )
2061
+
2062
+ _response_types_map: Dict[str, Optional[str]] = {
2063
+ '200': "List[EntityRelation]",
2064
+ '400': "ThingsboardErrorResponse",
2065
+ '401': "ThingsboardErrorResponse",
2066
+ '403': "ThingsboardErrorResponse",
2067
+ '404': "ThingsboardErrorResponse",
2068
+ '429': "ThingsboardErrorResponse",
2069
+ }
2070
+ response_data = self.api_client.call_api(
2071
+ *_param,
2072
+ _request_timeout=_request_timeout
2073
+ )
2074
+ response_data.read()
2075
+ return self.api_client.response_deserialize(
2076
+ response_data=response_data,
2077
+ response_types_map=_response_types_map,
2078
+ ).data
2079
+
2080
+
2081
+ @validate_call
2082
+ def find_by_to_with_http_info(
2083
+ self,
2084
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
2085
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
2086
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
2087
+ _request_timeout: Union[
2088
+ None,
2089
+ Annotated[StrictFloat, Field(gt=0)],
2090
+ Tuple[
2091
+ Annotated[StrictFloat, Field(gt=0)],
2092
+ Annotated[StrictFloat, Field(gt=0)]
2093
+ ]
2094
+ ] = None,
2095
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2096
+ _content_type: Optional[StrictStr] = None,
2097
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2098
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2099
+ ) -> ApiResponse[List[EntityRelation]]:
2100
+ """Get List of Relations (findByTo)
2101
+
2102
+ Returns list of relation objects for the specified entity by the 'to' direction. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
2103
+
2104
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
2105
+ :type to_id: str
2106
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
2107
+ :type to_type: str
2108
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
2109
+ :type relation_type_group: str
2110
+ :param _request_timeout: timeout setting for this request. If one
2111
+ number provided, it will be total request
2112
+ timeout. It can also be a pair (tuple) of
2113
+ (connection, read) timeouts.
2114
+ :type _request_timeout: int, tuple(int, int), optional
2115
+ :param _request_auth: set to override the auth_settings for an a single
2116
+ request; this effectively ignores the
2117
+ authentication in the spec for a single request.
2118
+ :type _request_auth: dict, optional
2119
+ :param _content_type: force content-type for the request.
2120
+ :type _content_type: str, Optional
2121
+ :param _headers: set to override the headers for a single
2122
+ request; this effectively ignores the headers
2123
+ in the spec for a single request.
2124
+ :type _headers: dict, optional
2125
+ :param _host_index: set to override the host_index for a single
2126
+ request; this effectively ignores the host_index
2127
+ in the spec for a single request.
2128
+ :type _host_index: int, optional
2129
+ :return: Returns the result object.
2130
+ """ # noqa: E501
2131
+
2132
+ _param = self._find_by_to_serialize(
2133
+ to_id=to_id,
2134
+ to_type=to_type,
2135
+ relation_type_group=relation_type_group,
2136
+ _request_auth=_request_auth,
2137
+ _content_type=_content_type,
2138
+ _headers=_headers,
2139
+ _host_index=_host_index
2140
+ )
2141
+
2142
+ _response_types_map: Dict[str, Optional[str]] = {
2143
+ '200': "List[EntityRelation]",
2144
+ '400': "ThingsboardErrorResponse",
2145
+ '401': "ThingsboardErrorResponse",
2146
+ '403': "ThingsboardErrorResponse",
2147
+ '404': "ThingsboardErrorResponse",
2148
+ '429': "ThingsboardErrorResponse",
2149
+ }
2150
+ response_data = self.api_client.call_api(
2151
+ *_param,
2152
+ _request_timeout=_request_timeout
2153
+ )
2154
+ response_data.read()
2155
+ return self.api_client.response_deserialize(
2156
+ response_data=response_data,
2157
+ response_types_map=_response_types_map,
2158
+ )
2159
+
2160
+
2161
+ @validate_call
2162
+ def find_by_to_without_preload_content(
2163
+ self,
2164
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
2165
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
2166
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
2167
+ _request_timeout: Union[
2168
+ None,
2169
+ Annotated[StrictFloat, Field(gt=0)],
2170
+ Tuple[
2171
+ Annotated[StrictFloat, Field(gt=0)],
2172
+ Annotated[StrictFloat, Field(gt=0)]
2173
+ ]
2174
+ ] = None,
2175
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2176
+ _content_type: Optional[StrictStr] = None,
2177
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2178
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2179
+ ) -> RESTResponseType:
2180
+ """Get List of Relations (findByTo)
2181
+
2182
+ Returns list of relation objects for the specified entity by the 'to' direction. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
2183
+
2184
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
2185
+ :type to_id: str
2186
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
2187
+ :type to_type: str
2188
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
2189
+ :type relation_type_group: str
2190
+ :param _request_timeout: timeout setting for this request. If one
2191
+ number provided, it will be total request
2192
+ timeout. It can also be a pair (tuple) of
2193
+ (connection, read) timeouts.
2194
+ :type _request_timeout: int, tuple(int, int), optional
2195
+ :param _request_auth: set to override the auth_settings for an a single
2196
+ request; this effectively ignores the
2197
+ authentication in the spec for a single request.
2198
+ :type _request_auth: dict, optional
2199
+ :param _content_type: force content-type for the request.
2200
+ :type _content_type: str, Optional
2201
+ :param _headers: set to override the headers for a single
2202
+ request; this effectively ignores the headers
2203
+ in the spec for a single request.
2204
+ :type _headers: dict, optional
2205
+ :param _host_index: set to override the host_index for a single
2206
+ request; this effectively ignores the host_index
2207
+ in the spec for a single request.
2208
+ :type _host_index: int, optional
2209
+ :return: Returns the result object.
2210
+ """ # noqa: E501
2211
+
2212
+ _param = self._find_by_to_serialize(
2213
+ to_id=to_id,
2214
+ to_type=to_type,
2215
+ relation_type_group=relation_type_group,
2216
+ _request_auth=_request_auth,
2217
+ _content_type=_content_type,
2218
+ _headers=_headers,
2219
+ _host_index=_host_index
2220
+ )
2221
+
2222
+ _response_types_map: Dict[str, Optional[str]] = {
2223
+ '200': "List[EntityRelation]",
2224
+ '400': "ThingsboardErrorResponse",
2225
+ '401': "ThingsboardErrorResponse",
2226
+ '403': "ThingsboardErrorResponse",
2227
+ '404': "ThingsboardErrorResponse",
2228
+ '429': "ThingsboardErrorResponse",
2229
+ }
2230
+ response_data = self.api_client.call_api(
2231
+ *_param,
2232
+ _request_timeout=_request_timeout
2233
+ )
2234
+ return response_data.response
2235
+
2236
+
2237
+ def _find_by_to_serialize(
2238
+ self,
2239
+ to_id,
2240
+ to_type,
2241
+ relation_type_group,
2242
+ _request_auth,
2243
+ _content_type,
2244
+ _headers,
2245
+ _host_index,
2246
+ ) -> RequestSerialized:
2247
+
2248
+ _host = None
2249
+
2250
+ _collection_formats: Dict[str, str] = {
2251
+ }
2252
+
2253
+ _path_params: Dict[str, str] = {}
2254
+ _query_params: List[Tuple[str, str]] = []
2255
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2256
+ _form_params: List[Tuple[str, str]] = []
2257
+ _files: Dict[
2258
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2259
+ ] = {}
2260
+ _body_params: Optional[bytes] = None
2261
+
2262
+ # process the path parameters
2263
+ # process the query parameters
2264
+ if to_id is not None:
2265
+
2266
+ _query_params.append(('toId', to_id))
2267
+
2268
+ if to_type is not None:
2269
+
2270
+ _query_params.append(('toType', to_type))
2271
+
2272
+ if relation_type_group is not None:
2273
+
2274
+ _query_params.append(('relationTypeGroup', relation_type_group))
2275
+
2276
+ # process the header parameters
2277
+ # process the form parameters
2278
+ # process the body parameter
2279
+
2280
+
2281
+ # set the HTTP header `Accept`
2282
+ if 'Accept' not in _header_params:
2283
+ _header_params['Accept'] = self.api_client.select_header_accept(
2284
+ [
2285
+ 'application/json'
2286
+ ]
2287
+ )
2288
+
2289
+
2290
+ # authentication setting
2291
+ _auth_settings: List[str] = [
2292
+ 'HTTP login form',
2293
+ 'API key form'
2294
+ ]
2295
+
2296
+ return self.api_client.param_serialize(
2297
+ method='GET',
2298
+ resource_path='/api/relations{?toId,toType,relationTypeGroup}',
2299
+ path_params=_path_params,
2300
+ query_params=_query_params,
2301
+ header_params=_header_params,
2302
+ body=_body_params,
2303
+ post_params=_form_params,
2304
+ files=_files,
2305
+ auth_settings=_auth_settings,
2306
+ collection_formats=_collection_formats,
2307
+ _host=_host,
2308
+ _request_auth=_request_auth
2309
+ )
2310
+
2311
+
2312
+
2313
+
2314
+ @validate_call
2315
+ def find_by_to1(
2316
+ self,
2317
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
2318
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
2319
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
2320
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
2321
+ _request_timeout: Union[
2322
+ None,
2323
+ Annotated[StrictFloat, Field(gt=0)],
2324
+ Tuple[
2325
+ Annotated[StrictFloat, Field(gt=0)],
2326
+ Annotated[StrictFloat, Field(gt=0)]
2327
+ ]
2328
+ ] = None,
2329
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2330
+ _content_type: Optional[StrictStr] = None,
2331
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2332
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2333
+ ) -> List[EntityRelation]:
2334
+ """Get List of Relations (findByTo)
2335
+
2336
+ Returns list of relation objects for the specified entity by the 'to' direction and relation type. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
2337
+
2338
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
2339
+ :type to_id: str
2340
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
2341
+ :type to_type: str
2342
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
2343
+ :type relation_type: str
2344
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
2345
+ :type relation_type_group: str
2346
+ :param _request_timeout: timeout setting for this request. If one
2347
+ number provided, it will be total request
2348
+ timeout. It can also be a pair (tuple) of
2349
+ (connection, read) timeouts.
2350
+ :type _request_timeout: int, tuple(int, int), optional
2351
+ :param _request_auth: set to override the auth_settings for an a single
2352
+ request; this effectively ignores the
2353
+ authentication in the spec for a single request.
2354
+ :type _request_auth: dict, optional
2355
+ :param _content_type: force content-type for the request.
2356
+ :type _content_type: str, Optional
2357
+ :param _headers: set to override the headers for a single
2358
+ request; this effectively ignores the headers
2359
+ in the spec for a single request.
2360
+ :type _headers: dict, optional
2361
+ :param _host_index: set to override the host_index for a single
2362
+ request; this effectively ignores the host_index
2363
+ in the spec for a single request.
2364
+ :type _host_index: int, optional
2365
+ :return: Returns the result object.
2366
+ """ # noqa: E501
2367
+
2368
+ _param = self._find_by_to1_serialize(
2369
+ to_id=to_id,
2370
+ to_type=to_type,
2371
+ relation_type=relation_type,
2372
+ relation_type_group=relation_type_group,
2373
+ _request_auth=_request_auth,
2374
+ _content_type=_content_type,
2375
+ _headers=_headers,
2376
+ _host_index=_host_index
2377
+ )
2378
+
2379
+ _response_types_map: Dict[str, Optional[str]] = {
2380
+ '200': "List[EntityRelation]",
2381
+ '400': "ThingsboardErrorResponse",
2382
+ '401': "ThingsboardErrorResponse",
2383
+ '403': "ThingsboardErrorResponse",
2384
+ '404': "ThingsboardErrorResponse",
2385
+ '429': "ThingsboardErrorResponse",
2386
+ }
2387
+ response_data = self.api_client.call_api(
2388
+ *_param,
2389
+ _request_timeout=_request_timeout
2390
+ )
2391
+ response_data.read()
2392
+ return self.api_client.response_deserialize(
2393
+ response_data=response_data,
2394
+ response_types_map=_response_types_map,
2395
+ ).data
2396
+
2397
+
2398
+ @validate_call
2399
+ def find_by_to1_with_http_info(
2400
+ self,
2401
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
2402
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
2403
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
2404
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
2405
+ _request_timeout: Union[
2406
+ None,
2407
+ Annotated[StrictFloat, Field(gt=0)],
2408
+ Tuple[
2409
+ Annotated[StrictFloat, Field(gt=0)],
2410
+ Annotated[StrictFloat, Field(gt=0)]
2411
+ ]
2412
+ ] = None,
2413
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2414
+ _content_type: Optional[StrictStr] = None,
2415
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2416
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2417
+ ) -> ApiResponse[List[EntityRelation]]:
2418
+ """Get List of Relations (findByTo)
2419
+
2420
+ Returns list of relation objects for the specified entity by the 'to' direction and relation type. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
2421
+
2422
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
2423
+ :type to_id: str
2424
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
2425
+ :type to_type: str
2426
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
2427
+ :type relation_type: str
2428
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
2429
+ :type relation_type_group: str
2430
+ :param _request_timeout: timeout setting for this request. If one
2431
+ number provided, it will be total request
2432
+ timeout. It can also be a pair (tuple) of
2433
+ (connection, read) timeouts.
2434
+ :type _request_timeout: int, tuple(int, int), optional
2435
+ :param _request_auth: set to override the auth_settings for an a single
2436
+ request; this effectively ignores the
2437
+ authentication in the spec for a single request.
2438
+ :type _request_auth: dict, optional
2439
+ :param _content_type: force content-type for the request.
2440
+ :type _content_type: str, Optional
2441
+ :param _headers: set to override the headers for a single
2442
+ request; this effectively ignores the headers
2443
+ in the spec for a single request.
2444
+ :type _headers: dict, optional
2445
+ :param _host_index: set to override the host_index for a single
2446
+ request; this effectively ignores the host_index
2447
+ in the spec for a single request.
2448
+ :type _host_index: int, optional
2449
+ :return: Returns the result object.
2450
+ """ # noqa: E501
2451
+
2452
+ _param = self._find_by_to1_serialize(
2453
+ to_id=to_id,
2454
+ to_type=to_type,
2455
+ relation_type=relation_type,
2456
+ relation_type_group=relation_type_group,
2457
+ _request_auth=_request_auth,
2458
+ _content_type=_content_type,
2459
+ _headers=_headers,
2460
+ _host_index=_host_index
2461
+ )
2462
+
2463
+ _response_types_map: Dict[str, Optional[str]] = {
2464
+ '200': "List[EntityRelation]",
2465
+ '400': "ThingsboardErrorResponse",
2466
+ '401': "ThingsboardErrorResponse",
2467
+ '403': "ThingsboardErrorResponse",
2468
+ '404': "ThingsboardErrorResponse",
2469
+ '429': "ThingsboardErrorResponse",
2470
+ }
2471
+ response_data = self.api_client.call_api(
2472
+ *_param,
2473
+ _request_timeout=_request_timeout
2474
+ )
2475
+ response_data.read()
2476
+ return self.api_client.response_deserialize(
2477
+ response_data=response_data,
2478
+ response_types_map=_response_types_map,
2479
+ )
2480
+
2481
+
2482
+ @validate_call
2483
+ def find_by_to1_without_preload_content(
2484
+ self,
2485
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
2486
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
2487
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
2488
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
2489
+ _request_timeout: Union[
2490
+ None,
2491
+ Annotated[StrictFloat, Field(gt=0)],
2492
+ Tuple[
2493
+ Annotated[StrictFloat, Field(gt=0)],
2494
+ Annotated[StrictFloat, Field(gt=0)]
2495
+ ]
2496
+ ] = None,
2497
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2498
+ _content_type: Optional[StrictStr] = None,
2499
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2500
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2501
+ ) -> RESTResponseType:
2502
+ """Get List of Relations (findByTo)
2503
+
2504
+ Returns list of relation objects for the specified entity by the 'to' direction and relation type. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.
2505
+
2506
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
2507
+ :type to_id: str
2508
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
2509
+ :type to_type: str
2510
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
2511
+ :type relation_type: str
2512
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
2513
+ :type relation_type_group: str
2514
+ :param _request_timeout: timeout setting for this request. If one
2515
+ number provided, it will be total request
2516
+ timeout. It can also be a pair (tuple) of
2517
+ (connection, read) timeouts.
2518
+ :type _request_timeout: int, tuple(int, int), optional
2519
+ :param _request_auth: set to override the auth_settings for an a single
2520
+ request; this effectively ignores the
2521
+ authentication in the spec for a single request.
2522
+ :type _request_auth: dict, optional
2523
+ :param _content_type: force content-type for the request.
2524
+ :type _content_type: str, Optional
2525
+ :param _headers: set to override the headers for a single
2526
+ request; this effectively ignores the headers
2527
+ in the spec for a single request.
2528
+ :type _headers: dict, optional
2529
+ :param _host_index: set to override the host_index for a single
2530
+ request; this effectively ignores the host_index
2531
+ in the spec for a single request.
2532
+ :type _host_index: int, optional
2533
+ :return: Returns the result object.
2534
+ """ # noqa: E501
2535
+
2536
+ _param = self._find_by_to1_serialize(
2537
+ to_id=to_id,
2538
+ to_type=to_type,
2539
+ relation_type=relation_type,
2540
+ relation_type_group=relation_type_group,
2541
+ _request_auth=_request_auth,
2542
+ _content_type=_content_type,
2543
+ _headers=_headers,
2544
+ _host_index=_host_index
2545
+ )
2546
+
2547
+ _response_types_map: Dict[str, Optional[str]] = {
2548
+ '200': "List[EntityRelation]",
2549
+ '400': "ThingsboardErrorResponse",
2550
+ '401': "ThingsboardErrorResponse",
2551
+ '403': "ThingsboardErrorResponse",
2552
+ '404': "ThingsboardErrorResponse",
2553
+ '429': "ThingsboardErrorResponse",
2554
+ }
2555
+ response_data = self.api_client.call_api(
2556
+ *_param,
2557
+ _request_timeout=_request_timeout
2558
+ )
2559
+ return response_data.response
2560
+
2561
+
2562
+ def _find_by_to1_serialize(
2563
+ self,
2564
+ to_id,
2565
+ to_type,
2566
+ relation_type,
2567
+ relation_type_group,
2568
+ _request_auth,
2569
+ _content_type,
2570
+ _headers,
2571
+ _host_index,
2572
+ ) -> RequestSerialized:
2573
+
2574
+ _host = None
2575
+
2576
+ _collection_formats: Dict[str, str] = {
2577
+ }
2578
+
2579
+ _path_params: Dict[str, str] = {}
2580
+ _query_params: List[Tuple[str, str]] = []
2581
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2582
+ _form_params: List[Tuple[str, str]] = []
2583
+ _files: Dict[
2584
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2585
+ ] = {}
2586
+ _body_params: Optional[bytes] = None
2587
+
2588
+ # process the path parameters
2589
+ # process the query parameters
2590
+ if to_id is not None:
2591
+
2592
+ _query_params.append(('toId', to_id))
2593
+
2594
+ if to_type is not None:
2595
+
2596
+ _query_params.append(('toType', to_type))
2597
+
2598
+ if relation_type is not None:
2599
+
2600
+ _query_params.append(('relationType', relation_type))
2601
+
2602
+ if relation_type_group is not None:
2603
+
2604
+ _query_params.append(('relationTypeGroup', relation_type_group))
2605
+
2606
+ # process the header parameters
2607
+ # process the form parameters
2608
+ # process the body parameter
2609
+
2610
+
2611
+ # set the HTTP header `Accept`
2612
+ if 'Accept' not in _header_params:
2613
+ _header_params['Accept'] = self.api_client.select_header_accept(
2614
+ [
2615
+ 'application/json'
2616
+ ]
2617
+ )
2618
+
2619
+
2620
+ # authentication setting
2621
+ _auth_settings: List[str] = [
2622
+ 'HTTP login form',
2623
+ 'API key form'
2624
+ ]
2625
+
2626
+ return self.api_client.param_serialize(
2627
+ method='GET',
2628
+ resource_path='/api/relations{?toId,toType,relationType,relationTypeGroup}',
2629
+ path_params=_path_params,
2630
+ query_params=_query_params,
2631
+ header_params=_header_params,
2632
+ body=_body_params,
2633
+ post_params=_form_params,
2634
+ files=_files,
2635
+ auth_settings=_auth_settings,
2636
+ collection_formats=_collection_formats,
2637
+ _host=_host,
2638
+ _request_auth=_request_auth
2639
+ )
2640
+
2641
+
2642
+
2643
+
2644
+ @validate_call
2645
+ def find_info_by_from(
2646
+ self,
2647
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
2648
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
2649
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
2650
+ _request_timeout: Union[
2651
+ None,
2652
+ Annotated[StrictFloat, Field(gt=0)],
2653
+ Tuple[
2654
+ Annotated[StrictFloat, Field(gt=0)],
2655
+ Annotated[StrictFloat, Field(gt=0)]
2656
+ ]
2657
+ ] = None,
2658
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2659
+ _content_type: Optional[StrictStr] = None,
2660
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2661
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2662
+ ) -> List[EntityRelationInfo]:
2663
+ """Get List of Relation Infos (findInfoByFrom)
2664
+
2665
+ Returns list of relation info objects for the specified entity by the 'from' direction. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names.
2666
+
2667
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
2668
+ :type from_id: str
2669
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
2670
+ :type from_type: str
2671
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
2672
+ :type relation_type_group: str
2673
+ :param _request_timeout: timeout setting for this request. If one
2674
+ number provided, it will be total request
2675
+ timeout. It can also be a pair (tuple) of
2676
+ (connection, read) timeouts.
2677
+ :type _request_timeout: int, tuple(int, int), optional
2678
+ :param _request_auth: set to override the auth_settings for an a single
2679
+ request; this effectively ignores the
2680
+ authentication in the spec for a single request.
2681
+ :type _request_auth: dict, optional
2682
+ :param _content_type: force content-type for the request.
2683
+ :type _content_type: str, Optional
2684
+ :param _headers: set to override the headers for a single
2685
+ request; this effectively ignores the headers
2686
+ in the spec for a single request.
2687
+ :type _headers: dict, optional
2688
+ :param _host_index: set to override the host_index for a single
2689
+ request; this effectively ignores the host_index
2690
+ in the spec for a single request.
2691
+ :type _host_index: int, optional
2692
+ :return: Returns the result object.
2693
+ """ # noqa: E501
2694
+
2695
+ _param = self._find_info_by_from_serialize(
2696
+ from_id=from_id,
2697
+ from_type=from_type,
2698
+ relation_type_group=relation_type_group,
2699
+ _request_auth=_request_auth,
2700
+ _content_type=_content_type,
2701
+ _headers=_headers,
2702
+ _host_index=_host_index
2703
+ )
2704
+
2705
+ _response_types_map: Dict[str, Optional[str]] = {
2706
+ '200': "List[EntityRelationInfo]",
2707
+ '400': "ThingsboardErrorResponse",
2708
+ '401': "ThingsboardErrorResponse",
2709
+ '403': "ThingsboardErrorResponse",
2710
+ '404': "ThingsboardErrorResponse",
2711
+ '429': "ThingsboardErrorResponse",
2712
+ }
2713
+ response_data = self.api_client.call_api(
2714
+ *_param,
2715
+ _request_timeout=_request_timeout
2716
+ )
2717
+ response_data.read()
2718
+ return self.api_client.response_deserialize(
2719
+ response_data=response_data,
2720
+ response_types_map=_response_types_map,
2721
+ ).data
2722
+
2723
+
2724
+ @validate_call
2725
+ def find_info_by_from_with_http_info(
2726
+ self,
2727
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
2728
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
2729
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
2730
+ _request_timeout: Union[
2731
+ None,
2732
+ Annotated[StrictFloat, Field(gt=0)],
2733
+ Tuple[
2734
+ Annotated[StrictFloat, Field(gt=0)],
2735
+ Annotated[StrictFloat, Field(gt=0)]
2736
+ ]
2737
+ ] = None,
2738
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2739
+ _content_type: Optional[StrictStr] = None,
2740
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2741
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2742
+ ) -> ApiResponse[List[EntityRelationInfo]]:
2743
+ """Get List of Relation Infos (findInfoByFrom)
2744
+
2745
+ Returns list of relation info objects for the specified entity by the 'from' direction. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names.
2746
+
2747
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
2748
+ :type from_id: str
2749
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
2750
+ :type from_type: str
2751
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
2752
+ :type relation_type_group: str
2753
+ :param _request_timeout: timeout setting for this request. If one
2754
+ number provided, it will be total request
2755
+ timeout. It can also be a pair (tuple) of
2756
+ (connection, read) timeouts.
2757
+ :type _request_timeout: int, tuple(int, int), optional
2758
+ :param _request_auth: set to override the auth_settings for an a single
2759
+ request; this effectively ignores the
2760
+ authentication in the spec for a single request.
2761
+ :type _request_auth: dict, optional
2762
+ :param _content_type: force content-type for the request.
2763
+ :type _content_type: str, Optional
2764
+ :param _headers: set to override the headers for a single
2765
+ request; this effectively ignores the headers
2766
+ in the spec for a single request.
2767
+ :type _headers: dict, optional
2768
+ :param _host_index: set to override the host_index for a single
2769
+ request; this effectively ignores the host_index
2770
+ in the spec for a single request.
2771
+ :type _host_index: int, optional
2772
+ :return: Returns the result object.
2773
+ """ # noqa: E501
2774
+
2775
+ _param = self._find_info_by_from_serialize(
2776
+ from_id=from_id,
2777
+ from_type=from_type,
2778
+ relation_type_group=relation_type_group,
2779
+ _request_auth=_request_auth,
2780
+ _content_type=_content_type,
2781
+ _headers=_headers,
2782
+ _host_index=_host_index
2783
+ )
2784
+
2785
+ _response_types_map: Dict[str, Optional[str]] = {
2786
+ '200': "List[EntityRelationInfo]",
2787
+ '400': "ThingsboardErrorResponse",
2788
+ '401': "ThingsboardErrorResponse",
2789
+ '403': "ThingsboardErrorResponse",
2790
+ '404': "ThingsboardErrorResponse",
2791
+ '429': "ThingsboardErrorResponse",
2792
+ }
2793
+ response_data = self.api_client.call_api(
2794
+ *_param,
2795
+ _request_timeout=_request_timeout
2796
+ )
2797
+ response_data.read()
2798
+ return self.api_client.response_deserialize(
2799
+ response_data=response_data,
2800
+ response_types_map=_response_types_map,
2801
+ )
2802
+
2803
+
2804
+ @validate_call
2805
+ def find_info_by_from_without_preload_content(
2806
+ self,
2807
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
2808
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
2809
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
2810
+ _request_timeout: Union[
2811
+ None,
2812
+ Annotated[StrictFloat, Field(gt=0)],
2813
+ Tuple[
2814
+ Annotated[StrictFloat, Field(gt=0)],
2815
+ Annotated[StrictFloat, Field(gt=0)]
2816
+ ]
2817
+ ] = None,
2818
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2819
+ _content_type: Optional[StrictStr] = None,
2820
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2821
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2822
+ ) -> RESTResponseType:
2823
+ """Get List of Relation Infos (findInfoByFrom)
2824
+
2825
+ Returns list of relation info objects for the specified entity by the 'from' direction. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names.
2826
+
2827
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
2828
+ :type from_id: str
2829
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
2830
+ :type from_type: str
2831
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
2832
+ :type relation_type_group: str
2833
+ :param _request_timeout: timeout setting for this request. If one
2834
+ number provided, it will be total request
2835
+ timeout. It can also be a pair (tuple) of
2836
+ (connection, read) timeouts.
2837
+ :type _request_timeout: int, tuple(int, int), optional
2838
+ :param _request_auth: set to override the auth_settings for an a single
2839
+ request; this effectively ignores the
2840
+ authentication in the spec for a single request.
2841
+ :type _request_auth: dict, optional
2842
+ :param _content_type: force content-type for the request.
2843
+ :type _content_type: str, Optional
2844
+ :param _headers: set to override the headers for a single
2845
+ request; this effectively ignores the headers
2846
+ in the spec for a single request.
2847
+ :type _headers: dict, optional
2848
+ :param _host_index: set to override the host_index for a single
2849
+ request; this effectively ignores the host_index
2850
+ in the spec for a single request.
2851
+ :type _host_index: int, optional
2852
+ :return: Returns the result object.
2853
+ """ # noqa: E501
2854
+
2855
+ _param = self._find_info_by_from_serialize(
2856
+ from_id=from_id,
2857
+ from_type=from_type,
2858
+ relation_type_group=relation_type_group,
2859
+ _request_auth=_request_auth,
2860
+ _content_type=_content_type,
2861
+ _headers=_headers,
2862
+ _host_index=_host_index
2863
+ )
2864
+
2865
+ _response_types_map: Dict[str, Optional[str]] = {
2866
+ '200': "List[EntityRelationInfo]",
2867
+ '400': "ThingsboardErrorResponse",
2868
+ '401': "ThingsboardErrorResponse",
2869
+ '403': "ThingsboardErrorResponse",
2870
+ '404': "ThingsboardErrorResponse",
2871
+ '429': "ThingsboardErrorResponse",
2872
+ }
2873
+ response_data = self.api_client.call_api(
2874
+ *_param,
2875
+ _request_timeout=_request_timeout
2876
+ )
2877
+ return response_data.response
2878
+
2879
+
2880
+ def _find_info_by_from_serialize(
2881
+ self,
2882
+ from_id,
2883
+ from_type,
2884
+ relation_type_group,
2885
+ _request_auth,
2886
+ _content_type,
2887
+ _headers,
2888
+ _host_index,
2889
+ ) -> RequestSerialized:
2890
+
2891
+ _host = None
2892
+
2893
+ _collection_formats: Dict[str, str] = {
2894
+ }
2895
+
2896
+ _path_params: Dict[str, str] = {}
2897
+ _query_params: List[Tuple[str, str]] = []
2898
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2899
+ _form_params: List[Tuple[str, str]] = []
2900
+ _files: Dict[
2901
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2902
+ ] = {}
2903
+ _body_params: Optional[bytes] = None
2904
+
2905
+ # process the path parameters
2906
+ # process the query parameters
2907
+ if from_id is not None:
2908
+
2909
+ _query_params.append(('fromId', from_id))
2910
+
2911
+ if from_type is not None:
2912
+
2913
+ _query_params.append(('fromType', from_type))
2914
+
2915
+ if relation_type_group is not None:
2916
+
2917
+ _query_params.append(('relationTypeGroup', relation_type_group))
2918
+
2919
+ # process the header parameters
2920
+ # process the form parameters
2921
+ # process the body parameter
2922
+
2923
+
2924
+ # set the HTTP header `Accept`
2925
+ if 'Accept' not in _header_params:
2926
+ _header_params['Accept'] = self.api_client.select_header_accept(
2927
+ [
2928
+ 'application/json'
2929
+ ]
2930
+ )
2931
+
2932
+
2933
+ # authentication setting
2934
+ _auth_settings: List[str] = [
2935
+ 'HTTP login form',
2936
+ 'API key form'
2937
+ ]
2938
+
2939
+ return self.api_client.param_serialize(
2940
+ method='GET',
2941
+ resource_path='/api/relations/info{?fromId,fromType,relationTypeGroup}',
2942
+ path_params=_path_params,
2943
+ query_params=_query_params,
2944
+ header_params=_header_params,
2945
+ body=_body_params,
2946
+ post_params=_form_params,
2947
+ files=_files,
2948
+ auth_settings=_auth_settings,
2949
+ collection_formats=_collection_formats,
2950
+ _host=_host,
2951
+ _request_auth=_request_auth
2952
+ )
2953
+
2954
+
2955
+
2956
+
2957
+ @validate_call
2958
+ def find_info_by_query(
2959
+ self,
2960
+ entity_relations_query: EntityRelationsQuery,
2961
+ _request_timeout: Union[
2962
+ None,
2963
+ Annotated[StrictFloat, Field(gt=0)],
2964
+ Tuple[
2965
+ Annotated[StrictFloat, Field(gt=0)],
2966
+ Annotated[StrictFloat, Field(gt=0)]
2967
+ ]
2968
+ ] = None,
2969
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2970
+ _content_type: Optional[StrictStr] = None,
2971
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2972
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2973
+ ) -> List[EntityRelationInfo]:
2974
+ """Find related entity infos (findInfoByQuery)
2975
+
2976
+ Returns all entity infos that are related to the specific entity. The entity id, relation type, entity types, depth of the search, and other query parameters defined using complex 'EntityRelationsQuery' object. See 'Model' tab of the Parameters for more info. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names.
2977
+
2978
+ :param entity_relations_query: (required)
2979
+ :type entity_relations_query: EntityRelationsQuery
2980
+ :param _request_timeout: timeout setting for this request. If one
2981
+ number provided, it will be total request
2982
+ timeout. It can also be a pair (tuple) of
2983
+ (connection, read) timeouts.
2984
+ :type _request_timeout: int, tuple(int, int), optional
2985
+ :param _request_auth: set to override the auth_settings for an a single
2986
+ request; this effectively ignores the
2987
+ authentication in the spec for a single request.
2988
+ :type _request_auth: dict, optional
2989
+ :param _content_type: force content-type for the request.
2990
+ :type _content_type: str, Optional
2991
+ :param _headers: set to override the headers for a single
2992
+ request; this effectively ignores the headers
2993
+ in the spec for a single request.
2994
+ :type _headers: dict, optional
2995
+ :param _host_index: set to override the host_index for a single
2996
+ request; this effectively ignores the host_index
2997
+ in the spec for a single request.
2998
+ :type _host_index: int, optional
2999
+ :return: Returns the result object.
3000
+ """ # noqa: E501
3001
+
3002
+ _param = self._find_info_by_query_serialize(
3003
+ entity_relations_query=entity_relations_query,
3004
+ _request_auth=_request_auth,
3005
+ _content_type=_content_type,
3006
+ _headers=_headers,
3007
+ _host_index=_host_index
3008
+ )
3009
+
3010
+ _response_types_map: Dict[str, Optional[str]] = {
3011
+ '200': "List[EntityRelationInfo]",
3012
+ '400': "ThingsboardErrorResponse",
3013
+ '401': "ThingsboardErrorResponse",
3014
+ '403': "ThingsboardErrorResponse",
3015
+ '404': "ThingsboardErrorResponse",
3016
+ '429': "ThingsboardErrorResponse",
3017
+ }
3018
+ response_data = self.api_client.call_api(
3019
+ *_param,
3020
+ _request_timeout=_request_timeout
3021
+ )
3022
+ response_data.read()
3023
+ return self.api_client.response_deserialize(
3024
+ response_data=response_data,
3025
+ response_types_map=_response_types_map,
3026
+ ).data
3027
+
3028
+
3029
+ @validate_call
3030
+ def find_info_by_query_with_http_info(
3031
+ self,
3032
+ entity_relations_query: EntityRelationsQuery,
3033
+ _request_timeout: Union[
3034
+ None,
3035
+ Annotated[StrictFloat, Field(gt=0)],
3036
+ Tuple[
3037
+ Annotated[StrictFloat, Field(gt=0)],
3038
+ Annotated[StrictFloat, Field(gt=0)]
3039
+ ]
3040
+ ] = None,
3041
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3042
+ _content_type: Optional[StrictStr] = None,
3043
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3044
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3045
+ ) -> ApiResponse[List[EntityRelationInfo]]:
3046
+ """Find related entity infos (findInfoByQuery)
3047
+
3048
+ Returns all entity infos that are related to the specific entity. The entity id, relation type, entity types, depth of the search, and other query parameters defined using complex 'EntityRelationsQuery' object. See 'Model' tab of the Parameters for more info. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names.
3049
+
3050
+ :param entity_relations_query: (required)
3051
+ :type entity_relations_query: EntityRelationsQuery
3052
+ :param _request_timeout: timeout setting for this request. If one
3053
+ number provided, it will be total request
3054
+ timeout. It can also be a pair (tuple) of
3055
+ (connection, read) timeouts.
3056
+ :type _request_timeout: int, tuple(int, int), optional
3057
+ :param _request_auth: set to override the auth_settings for an a single
3058
+ request; this effectively ignores the
3059
+ authentication in the spec for a single request.
3060
+ :type _request_auth: dict, optional
3061
+ :param _content_type: force content-type for the request.
3062
+ :type _content_type: str, Optional
3063
+ :param _headers: set to override the headers for a single
3064
+ request; this effectively ignores the headers
3065
+ in the spec for a single request.
3066
+ :type _headers: dict, optional
3067
+ :param _host_index: set to override the host_index for a single
3068
+ request; this effectively ignores the host_index
3069
+ in the spec for a single request.
3070
+ :type _host_index: int, optional
3071
+ :return: Returns the result object.
3072
+ """ # noqa: E501
3073
+
3074
+ _param = self._find_info_by_query_serialize(
3075
+ entity_relations_query=entity_relations_query,
3076
+ _request_auth=_request_auth,
3077
+ _content_type=_content_type,
3078
+ _headers=_headers,
3079
+ _host_index=_host_index
3080
+ )
3081
+
3082
+ _response_types_map: Dict[str, Optional[str]] = {
3083
+ '200': "List[EntityRelationInfo]",
3084
+ '400': "ThingsboardErrorResponse",
3085
+ '401': "ThingsboardErrorResponse",
3086
+ '403': "ThingsboardErrorResponse",
3087
+ '404': "ThingsboardErrorResponse",
3088
+ '429': "ThingsboardErrorResponse",
3089
+ }
3090
+ response_data = self.api_client.call_api(
3091
+ *_param,
3092
+ _request_timeout=_request_timeout
3093
+ )
3094
+ response_data.read()
3095
+ return self.api_client.response_deserialize(
3096
+ response_data=response_data,
3097
+ response_types_map=_response_types_map,
3098
+ )
3099
+
3100
+
3101
+ @validate_call
3102
+ def find_info_by_query_without_preload_content(
3103
+ self,
3104
+ entity_relations_query: EntityRelationsQuery,
3105
+ _request_timeout: Union[
3106
+ None,
3107
+ Annotated[StrictFloat, Field(gt=0)],
3108
+ Tuple[
3109
+ Annotated[StrictFloat, Field(gt=0)],
3110
+ Annotated[StrictFloat, Field(gt=0)]
3111
+ ]
3112
+ ] = None,
3113
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3114
+ _content_type: Optional[StrictStr] = None,
3115
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3116
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3117
+ ) -> RESTResponseType:
3118
+ """Find related entity infos (findInfoByQuery)
3119
+
3120
+ Returns all entity infos that are related to the specific entity. The entity id, relation type, entity types, depth of the search, and other query parameters defined using complex 'EntityRelationsQuery' object. See 'Model' tab of the Parameters for more info. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names.
3121
+
3122
+ :param entity_relations_query: (required)
3123
+ :type entity_relations_query: EntityRelationsQuery
3124
+ :param _request_timeout: timeout setting for this request. If one
3125
+ number provided, it will be total request
3126
+ timeout. It can also be a pair (tuple) of
3127
+ (connection, read) timeouts.
3128
+ :type _request_timeout: int, tuple(int, int), optional
3129
+ :param _request_auth: set to override the auth_settings for an a single
3130
+ request; this effectively ignores the
3131
+ authentication in the spec for a single request.
3132
+ :type _request_auth: dict, optional
3133
+ :param _content_type: force content-type for the request.
3134
+ :type _content_type: str, Optional
3135
+ :param _headers: set to override the headers for a single
3136
+ request; this effectively ignores the headers
3137
+ in the spec for a single request.
3138
+ :type _headers: dict, optional
3139
+ :param _host_index: set to override the host_index for a single
3140
+ request; this effectively ignores the host_index
3141
+ in the spec for a single request.
3142
+ :type _host_index: int, optional
3143
+ :return: Returns the result object.
3144
+ """ # noqa: E501
3145
+
3146
+ _param = self._find_info_by_query_serialize(
3147
+ entity_relations_query=entity_relations_query,
3148
+ _request_auth=_request_auth,
3149
+ _content_type=_content_type,
3150
+ _headers=_headers,
3151
+ _host_index=_host_index
3152
+ )
3153
+
3154
+ _response_types_map: Dict[str, Optional[str]] = {
3155
+ '200': "List[EntityRelationInfo]",
3156
+ '400': "ThingsboardErrorResponse",
3157
+ '401': "ThingsboardErrorResponse",
3158
+ '403': "ThingsboardErrorResponse",
3159
+ '404': "ThingsboardErrorResponse",
3160
+ '429': "ThingsboardErrorResponse",
3161
+ }
3162
+ response_data = self.api_client.call_api(
3163
+ *_param,
3164
+ _request_timeout=_request_timeout
3165
+ )
3166
+ return response_data.response
3167
+
3168
+
3169
+ def _find_info_by_query_serialize(
3170
+ self,
3171
+ entity_relations_query,
3172
+ _request_auth,
3173
+ _content_type,
3174
+ _headers,
3175
+ _host_index,
3176
+ ) -> RequestSerialized:
3177
+
3178
+ _host = None
3179
+
3180
+ _collection_formats: Dict[str, str] = {
3181
+ }
3182
+
3183
+ _path_params: Dict[str, str] = {}
3184
+ _query_params: List[Tuple[str, str]] = []
3185
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3186
+ _form_params: List[Tuple[str, str]] = []
3187
+ _files: Dict[
3188
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3189
+ ] = {}
3190
+ _body_params: Optional[bytes] = None
3191
+
3192
+ # process the path parameters
3193
+ # process the query parameters
3194
+ # process the header parameters
3195
+ # process the form parameters
3196
+ # process the body parameter
3197
+ if entity_relations_query is not None:
3198
+ _body_params = entity_relations_query
3199
+
3200
+
3201
+ # set the HTTP header `Accept`
3202
+ if 'Accept' not in _header_params:
3203
+ _header_params['Accept'] = self.api_client.select_header_accept(
3204
+ [
3205
+ 'application/json'
3206
+ ]
3207
+ )
3208
+
3209
+ # set the HTTP header `Content-Type`
3210
+ if _content_type:
3211
+ _header_params['Content-Type'] = _content_type
3212
+ else:
3213
+ _default_content_type = (
3214
+ self.api_client.select_header_content_type(
3215
+ [
3216
+ 'application/json'
3217
+ ]
3218
+ )
3219
+ )
3220
+ if _default_content_type is not None:
3221
+ _header_params['Content-Type'] = _default_content_type
3222
+
3223
+ # authentication setting
3224
+ _auth_settings: List[str] = [
3225
+ 'HTTP login form',
3226
+ 'API key form'
3227
+ ]
3228
+
3229
+ return self.api_client.param_serialize(
3230
+ method='POST',
3231
+ resource_path='/api/relations/info',
3232
+ path_params=_path_params,
3233
+ query_params=_query_params,
3234
+ header_params=_header_params,
3235
+ body=_body_params,
3236
+ post_params=_form_params,
3237
+ files=_files,
3238
+ auth_settings=_auth_settings,
3239
+ collection_formats=_collection_formats,
3240
+ _host=_host,
3241
+ _request_auth=_request_auth
3242
+ )
3243
+
3244
+
3245
+
3246
+
3247
+ @validate_call
3248
+ def find_info_by_to(
3249
+ self,
3250
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
3251
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
3252
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
3253
+ _request_timeout: Union[
3254
+ None,
3255
+ Annotated[StrictFloat, Field(gt=0)],
3256
+ Tuple[
3257
+ Annotated[StrictFloat, Field(gt=0)],
3258
+ Annotated[StrictFloat, Field(gt=0)]
3259
+ ]
3260
+ ] = None,
3261
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3262
+ _content_type: Optional[StrictStr] = None,
3263
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3264
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3265
+ ) -> List[EntityRelationInfo]:
3266
+ """Get List of Relation Infos (findInfoByTo)
3267
+
3268
+ Returns list of relation info objects for the specified entity by the 'to' direction. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names.
3269
+
3270
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
3271
+ :type to_id: str
3272
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
3273
+ :type to_type: str
3274
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
3275
+ :type relation_type_group: str
3276
+ :param _request_timeout: timeout setting for this request. If one
3277
+ number provided, it will be total request
3278
+ timeout. It can also be a pair (tuple) of
3279
+ (connection, read) timeouts.
3280
+ :type _request_timeout: int, tuple(int, int), optional
3281
+ :param _request_auth: set to override the auth_settings for an a single
3282
+ request; this effectively ignores the
3283
+ authentication in the spec for a single request.
3284
+ :type _request_auth: dict, optional
3285
+ :param _content_type: force content-type for the request.
3286
+ :type _content_type: str, Optional
3287
+ :param _headers: set to override the headers for a single
3288
+ request; this effectively ignores the headers
3289
+ in the spec for a single request.
3290
+ :type _headers: dict, optional
3291
+ :param _host_index: set to override the host_index for a single
3292
+ request; this effectively ignores the host_index
3293
+ in the spec for a single request.
3294
+ :type _host_index: int, optional
3295
+ :return: Returns the result object.
3296
+ """ # noqa: E501
3297
+
3298
+ _param = self._find_info_by_to_serialize(
3299
+ to_id=to_id,
3300
+ to_type=to_type,
3301
+ relation_type_group=relation_type_group,
3302
+ _request_auth=_request_auth,
3303
+ _content_type=_content_type,
3304
+ _headers=_headers,
3305
+ _host_index=_host_index
3306
+ )
3307
+
3308
+ _response_types_map: Dict[str, Optional[str]] = {
3309
+ '200': "List[EntityRelationInfo]",
3310
+ '400': "ThingsboardErrorResponse",
3311
+ '401': "ThingsboardErrorResponse",
3312
+ '403': "ThingsboardErrorResponse",
3313
+ '404': "ThingsboardErrorResponse",
3314
+ '429': "ThingsboardErrorResponse",
3315
+ }
3316
+ response_data = self.api_client.call_api(
3317
+ *_param,
3318
+ _request_timeout=_request_timeout
3319
+ )
3320
+ response_data.read()
3321
+ return self.api_client.response_deserialize(
3322
+ response_data=response_data,
3323
+ response_types_map=_response_types_map,
3324
+ ).data
3325
+
3326
+
3327
+ @validate_call
3328
+ def find_info_by_to_with_http_info(
3329
+ self,
3330
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
3331
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
3332
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
3333
+ _request_timeout: Union[
3334
+ None,
3335
+ Annotated[StrictFloat, Field(gt=0)],
3336
+ Tuple[
3337
+ Annotated[StrictFloat, Field(gt=0)],
3338
+ Annotated[StrictFloat, Field(gt=0)]
3339
+ ]
3340
+ ] = None,
3341
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3342
+ _content_type: Optional[StrictStr] = None,
3343
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3344
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3345
+ ) -> ApiResponse[List[EntityRelationInfo]]:
3346
+ """Get List of Relation Infos (findInfoByTo)
3347
+
3348
+ Returns list of relation info objects for the specified entity by the 'to' direction. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names.
3349
+
3350
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
3351
+ :type to_id: str
3352
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
3353
+ :type to_type: str
3354
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
3355
+ :type relation_type_group: str
3356
+ :param _request_timeout: timeout setting for this request. If one
3357
+ number provided, it will be total request
3358
+ timeout. It can also be a pair (tuple) of
3359
+ (connection, read) timeouts.
3360
+ :type _request_timeout: int, tuple(int, int), optional
3361
+ :param _request_auth: set to override the auth_settings for an a single
3362
+ request; this effectively ignores the
3363
+ authentication in the spec for a single request.
3364
+ :type _request_auth: dict, optional
3365
+ :param _content_type: force content-type for the request.
3366
+ :type _content_type: str, Optional
3367
+ :param _headers: set to override the headers for a single
3368
+ request; this effectively ignores the headers
3369
+ in the spec for a single request.
3370
+ :type _headers: dict, optional
3371
+ :param _host_index: set to override the host_index for a single
3372
+ request; this effectively ignores the host_index
3373
+ in the spec for a single request.
3374
+ :type _host_index: int, optional
3375
+ :return: Returns the result object.
3376
+ """ # noqa: E501
3377
+
3378
+ _param = self._find_info_by_to_serialize(
3379
+ to_id=to_id,
3380
+ to_type=to_type,
3381
+ relation_type_group=relation_type_group,
3382
+ _request_auth=_request_auth,
3383
+ _content_type=_content_type,
3384
+ _headers=_headers,
3385
+ _host_index=_host_index
3386
+ )
3387
+
3388
+ _response_types_map: Dict[str, Optional[str]] = {
3389
+ '200': "List[EntityRelationInfo]",
3390
+ '400': "ThingsboardErrorResponse",
3391
+ '401': "ThingsboardErrorResponse",
3392
+ '403': "ThingsboardErrorResponse",
3393
+ '404': "ThingsboardErrorResponse",
3394
+ '429': "ThingsboardErrorResponse",
3395
+ }
3396
+ response_data = self.api_client.call_api(
3397
+ *_param,
3398
+ _request_timeout=_request_timeout
3399
+ )
3400
+ response_data.read()
3401
+ return self.api_client.response_deserialize(
3402
+ response_data=response_data,
3403
+ response_types_map=_response_types_map,
3404
+ )
3405
+
3406
+
3407
+ @validate_call
3408
+ def find_info_by_to_without_preload_content(
3409
+ self,
3410
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
3411
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
3412
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
3413
+ _request_timeout: Union[
3414
+ None,
3415
+ Annotated[StrictFloat, Field(gt=0)],
3416
+ Tuple[
3417
+ Annotated[StrictFloat, Field(gt=0)],
3418
+ Annotated[StrictFloat, Field(gt=0)]
3419
+ ]
3420
+ ] = None,
3421
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3422
+ _content_type: Optional[StrictStr] = None,
3423
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3424
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3425
+ ) -> RESTResponseType:
3426
+ """Get List of Relation Infos (findInfoByTo)
3427
+
3428
+ Returns list of relation info objects for the specified entity by the 'to' direction. If the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names.
3429
+
3430
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
3431
+ :type to_id: str
3432
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
3433
+ :type to_type: str
3434
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
3435
+ :type relation_type_group: str
3436
+ :param _request_timeout: timeout setting for this request. If one
3437
+ number provided, it will be total request
3438
+ timeout. It can also be a pair (tuple) of
3439
+ (connection, read) timeouts.
3440
+ :type _request_timeout: int, tuple(int, int), optional
3441
+ :param _request_auth: set to override the auth_settings for an a single
3442
+ request; this effectively ignores the
3443
+ authentication in the spec for a single request.
3444
+ :type _request_auth: dict, optional
3445
+ :param _content_type: force content-type for the request.
3446
+ :type _content_type: str, Optional
3447
+ :param _headers: set to override the headers for a single
3448
+ request; this effectively ignores the headers
3449
+ in the spec for a single request.
3450
+ :type _headers: dict, optional
3451
+ :param _host_index: set to override the host_index for a single
3452
+ request; this effectively ignores the host_index
3453
+ in the spec for a single request.
3454
+ :type _host_index: int, optional
3455
+ :return: Returns the result object.
3456
+ """ # noqa: E501
3457
+
3458
+ _param = self._find_info_by_to_serialize(
3459
+ to_id=to_id,
3460
+ to_type=to_type,
3461
+ relation_type_group=relation_type_group,
3462
+ _request_auth=_request_auth,
3463
+ _content_type=_content_type,
3464
+ _headers=_headers,
3465
+ _host_index=_host_index
3466
+ )
3467
+
3468
+ _response_types_map: Dict[str, Optional[str]] = {
3469
+ '200': "List[EntityRelationInfo]",
3470
+ '400': "ThingsboardErrorResponse",
3471
+ '401': "ThingsboardErrorResponse",
3472
+ '403': "ThingsboardErrorResponse",
3473
+ '404': "ThingsboardErrorResponse",
3474
+ '429': "ThingsboardErrorResponse",
3475
+ }
3476
+ response_data = self.api_client.call_api(
3477
+ *_param,
3478
+ _request_timeout=_request_timeout
3479
+ )
3480
+ return response_data.response
3481
+
3482
+
3483
+ def _find_info_by_to_serialize(
3484
+ self,
3485
+ to_id,
3486
+ to_type,
3487
+ relation_type_group,
3488
+ _request_auth,
3489
+ _content_type,
3490
+ _headers,
3491
+ _host_index,
3492
+ ) -> RequestSerialized:
3493
+
3494
+ _host = None
3495
+
3496
+ _collection_formats: Dict[str, str] = {
3497
+ }
3498
+
3499
+ _path_params: Dict[str, str] = {}
3500
+ _query_params: List[Tuple[str, str]] = []
3501
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3502
+ _form_params: List[Tuple[str, str]] = []
3503
+ _files: Dict[
3504
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3505
+ ] = {}
3506
+ _body_params: Optional[bytes] = None
3507
+
3508
+ # process the path parameters
3509
+ # process the query parameters
3510
+ if to_id is not None:
3511
+
3512
+ _query_params.append(('toId', to_id))
3513
+
3514
+ if to_type is not None:
3515
+
3516
+ _query_params.append(('toType', to_type))
3517
+
3518
+ if relation_type_group is not None:
3519
+
3520
+ _query_params.append(('relationTypeGroup', relation_type_group))
3521
+
3522
+ # process the header parameters
3523
+ # process the form parameters
3524
+ # process the body parameter
3525
+
3526
+
3527
+ # set the HTTP header `Accept`
3528
+ if 'Accept' not in _header_params:
3529
+ _header_params['Accept'] = self.api_client.select_header_accept(
3530
+ [
3531
+ 'application/json'
3532
+ ]
3533
+ )
3534
+
3535
+
3536
+ # authentication setting
3537
+ _auth_settings: List[str] = [
3538
+ 'HTTP login form',
3539
+ 'API key form'
3540
+ ]
3541
+
3542
+ return self.api_client.param_serialize(
3543
+ method='GET',
3544
+ resource_path='/api/relations/info{?toId,toType,relationTypeGroup}',
3545
+ path_params=_path_params,
3546
+ query_params=_query_params,
3547
+ header_params=_header_params,
3548
+ body=_body_params,
3549
+ post_params=_form_params,
3550
+ files=_files,
3551
+ auth_settings=_auth_settings,
3552
+ collection_formats=_collection_formats,
3553
+ _host=_host,
3554
+ _request_auth=_request_auth
3555
+ )
3556
+
3557
+
3558
+
3559
+
3560
+ @validate_call
3561
+ def get_relation(
3562
+ self,
3563
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
3564
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
3565
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
3566
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
3567
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
3568
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
3569
+ _request_timeout: Union[
3570
+ None,
3571
+ Annotated[StrictFloat, Field(gt=0)],
3572
+ Tuple[
3573
+ Annotated[StrictFloat, Field(gt=0)],
3574
+ Annotated[StrictFloat, Field(gt=0)]
3575
+ ]
3576
+ ] = None,
3577
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3578
+ _content_type: Optional[StrictStr] = None,
3579
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3580
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3581
+ ) -> EntityRelation:
3582
+ """Get Relation (getRelation)
3583
+
3584
+ Returns relation object between two specified entities if present. Otherwise throws exception. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
3585
+
3586
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
3587
+ :type from_id: str
3588
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
3589
+ :type from_type: str
3590
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
3591
+ :type relation_type: str
3592
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
3593
+ :type to_id: str
3594
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
3595
+ :type to_type: str
3596
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
3597
+ :type relation_type_group: str
3598
+ :param _request_timeout: timeout setting for this request. If one
3599
+ number provided, it will be total request
3600
+ timeout. It can also be a pair (tuple) of
3601
+ (connection, read) timeouts.
3602
+ :type _request_timeout: int, tuple(int, int), optional
3603
+ :param _request_auth: set to override the auth_settings for an a single
3604
+ request; this effectively ignores the
3605
+ authentication in the spec for a single request.
3606
+ :type _request_auth: dict, optional
3607
+ :param _content_type: force content-type for the request.
3608
+ :type _content_type: str, Optional
3609
+ :param _headers: set to override the headers for a single
3610
+ request; this effectively ignores the headers
3611
+ in the spec for a single request.
3612
+ :type _headers: dict, optional
3613
+ :param _host_index: set to override the host_index for a single
3614
+ request; this effectively ignores the host_index
3615
+ in the spec for a single request.
3616
+ :type _host_index: int, optional
3617
+ :return: Returns the result object.
3618
+ """ # noqa: E501
3619
+
3620
+ _param = self._get_relation_serialize(
3621
+ from_id=from_id,
3622
+ from_type=from_type,
3623
+ relation_type=relation_type,
3624
+ to_id=to_id,
3625
+ to_type=to_type,
3626
+ relation_type_group=relation_type_group,
3627
+ _request_auth=_request_auth,
3628
+ _content_type=_content_type,
3629
+ _headers=_headers,
3630
+ _host_index=_host_index
3631
+ )
3632
+
3633
+ _response_types_map: Dict[str, Optional[str]] = {
3634
+ '200': "EntityRelation",
3635
+ '400': "ThingsboardErrorResponse",
3636
+ '401': "ThingsboardErrorResponse",
3637
+ '403': "ThingsboardErrorResponse",
3638
+ '404': "ThingsboardErrorResponse",
3639
+ '429': "ThingsboardErrorResponse",
3640
+ }
3641
+ response_data = self.api_client.call_api(
3642
+ *_param,
3643
+ _request_timeout=_request_timeout
3644
+ )
3645
+ response_data.read()
3646
+ return self.api_client.response_deserialize(
3647
+ response_data=response_data,
3648
+ response_types_map=_response_types_map,
3649
+ ).data
3650
+
3651
+
3652
+ @validate_call
3653
+ def get_relation_with_http_info(
3654
+ self,
3655
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
3656
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
3657
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
3658
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
3659
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
3660
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
3661
+ _request_timeout: Union[
3662
+ None,
3663
+ Annotated[StrictFloat, Field(gt=0)],
3664
+ Tuple[
3665
+ Annotated[StrictFloat, Field(gt=0)],
3666
+ Annotated[StrictFloat, Field(gt=0)]
3667
+ ]
3668
+ ] = None,
3669
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3670
+ _content_type: Optional[StrictStr] = None,
3671
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3672
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3673
+ ) -> ApiResponse[EntityRelation]:
3674
+ """Get Relation (getRelation)
3675
+
3676
+ Returns relation object between two specified entities if present. Otherwise throws exception. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
3677
+
3678
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
3679
+ :type from_id: str
3680
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
3681
+ :type from_type: str
3682
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
3683
+ :type relation_type: str
3684
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
3685
+ :type to_id: str
3686
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
3687
+ :type to_type: str
3688
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
3689
+ :type relation_type_group: str
3690
+ :param _request_timeout: timeout setting for this request. If one
3691
+ number provided, it will be total request
3692
+ timeout. It can also be a pair (tuple) of
3693
+ (connection, read) timeouts.
3694
+ :type _request_timeout: int, tuple(int, int), optional
3695
+ :param _request_auth: set to override the auth_settings for an a single
3696
+ request; this effectively ignores the
3697
+ authentication in the spec for a single request.
3698
+ :type _request_auth: dict, optional
3699
+ :param _content_type: force content-type for the request.
3700
+ :type _content_type: str, Optional
3701
+ :param _headers: set to override the headers for a single
3702
+ request; this effectively ignores the headers
3703
+ in the spec for a single request.
3704
+ :type _headers: dict, optional
3705
+ :param _host_index: set to override the host_index for a single
3706
+ request; this effectively ignores the host_index
3707
+ in the spec for a single request.
3708
+ :type _host_index: int, optional
3709
+ :return: Returns the result object.
3710
+ """ # noqa: E501
3711
+
3712
+ _param = self._get_relation_serialize(
3713
+ from_id=from_id,
3714
+ from_type=from_type,
3715
+ relation_type=relation_type,
3716
+ to_id=to_id,
3717
+ to_type=to_type,
3718
+ relation_type_group=relation_type_group,
3719
+ _request_auth=_request_auth,
3720
+ _content_type=_content_type,
3721
+ _headers=_headers,
3722
+ _host_index=_host_index
3723
+ )
3724
+
3725
+ _response_types_map: Dict[str, Optional[str]] = {
3726
+ '200': "EntityRelation",
3727
+ '400': "ThingsboardErrorResponse",
3728
+ '401': "ThingsboardErrorResponse",
3729
+ '403': "ThingsboardErrorResponse",
3730
+ '404': "ThingsboardErrorResponse",
3731
+ '429': "ThingsboardErrorResponse",
3732
+ }
3733
+ response_data = self.api_client.call_api(
3734
+ *_param,
3735
+ _request_timeout=_request_timeout
3736
+ )
3737
+ response_data.read()
3738
+ return self.api_client.response_deserialize(
3739
+ response_data=response_data,
3740
+ response_types_map=_response_types_map,
3741
+ )
3742
+
3743
+
3744
+ @validate_call
3745
+ def get_relation_without_preload_content(
3746
+ self,
3747
+ from_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
3748
+ from_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
3749
+ relation_type: Annotated[StrictStr, Field(description="A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.")],
3750
+ to_id: Annotated[StrictStr, Field(description="A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'")],
3751
+ to_type: Annotated[StrictStr, Field(description="A string value representing the entity type. For example, 'DEVICE'")],
3752
+ relation_type_group: Annotated[Optional[StrictStr], Field(description="A string value representing relation type group. For example, 'COMMON'")] = None,
3753
+ _request_timeout: Union[
3754
+ None,
3755
+ Annotated[StrictFloat, Field(gt=0)],
3756
+ Tuple[
3757
+ Annotated[StrictFloat, Field(gt=0)],
3758
+ Annotated[StrictFloat, Field(gt=0)]
3759
+ ]
3760
+ ] = None,
3761
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3762
+ _content_type: Optional[StrictStr] = None,
3763
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3764
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3765
+ ) -> RESTResponseType:
3766
+ """Get Relation (getRelation)
3767
+
3768
+ Returns relation object between two specified entities if present. Otherwise throws exception. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
3769
+
3770
+ :param from_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
3771
+ :type from_id: str
3772
+ :param from_type: A string value representing the entity type. For example, 'DEVICE' (required)
3773
+ :type from_type: str
3774
+ :param relation_type: A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value. (required)
3775
+ :type relation_type: str
3776
+ :param to_id: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
3777
+ :type to_id: str
3778
+ :param to_type: A string value representing the entity type. For example, 'DEVICE' (required)
3779
+ :type to_type: str
3780
+ :param relation_type_group: A string value representing relation type group. For example, 'COMMON'
3781
+ :type relation_type_group: str
3782
+ :param _request_timeout: timeout setting for this request. If one
3783
+ number provided, it will be total request
3784
+ timeout. It can also be a pair (tuple) of
3785
+ (connection, read) timeouts.
3786
+ :type _request_timeout: int, tuple(int, int), optional
3787
+ :param _request_auth: set to override the auth_settings for an a single
3788
+ request; this effectively ignores the
3789
+ authentication in the spec for a single request.
3790
+ :type _request_auth: dict, optional
3791
+ :param _content_type: force content-type for the request.
3792
+ :type _content_type: str, Optional
3793
+ :param _headers: set to override the headers for a single
3794
+ request; this effectively ignores the headers
3795
+ in the spec for a single request.
3796
+ :type _headers: dict, optional
3797
+ :param _host_index: set to override the host_index for a single
3798
+ request; this effectively ignores the host_index
3799
+ in the spec for a single request.
3800
+ :type _host_index: int, optional
3801
+ :return: Returns the result object.
3802
+ """ # noqa: E501
3803
+
3804
+ _param = self._get_relation_serialize(
3805
+ from_id=from_id,
3806
+ from_type=from_type,
3807
+ relation_type=relation_type,
3808
+ to_id=to_id,
3809
+ to_type=to_type,
3810
+ relation_type_group=relation_type_group,
3811
+ _request_auth=_request_auth,
3812
+ _content_type=_content_type,
3813
+ _headers=_headers,
3814
+ _host_index=_host_index
3815
+ )
3816
+
3817
+ _response_types_map: Dict[str, Optional[str]] = {
3818
+ '200': "EntityRelation",
3819
+ '400': "ThingsboardErrorResponse",
3820
+ '401': "ThingsboardErrorResponse",
3821
+ '403': "ThingsboardErrorResponse",
3822
+ '404': "ThingsboardErrorResponse",
3823
+ '429': "ThingsboardErrorResponse",
3824
+ }
3825
+ response_data = self.api_client.call_api(
3826
+ *_param,
3827
+ _request_timeout=_request_timeout
3828
+ )
3829
+ return response_data.response
3830
+
3831
+
3832
+ def _get_relation_serialize(
3833
+ self,
3834
+ from_id,
3835
+ from_type,
3836
+ relation_type,
3837
+ to_id,
3838
+ to_type,
3839
+ relation_type_group,
3840
+ _request_auth,
3841
+ _content_type,
3842
+ _headers,
3843
+ _host_index,
3844
+ ) -> RequestSerialized:
3845
+
3846
+ _host = None
3847
+
3848
+ _collection_formats: Dict[str, str] = {
3849
+ }
3850
+
3851
+ _path_params: Dict[str, str] = {}
3852
+ _query_params: List[Tuple[str, str]] = []
3853
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3854
+ _form_params: List[Tuple[str, str]] = []
3855
+ _files: Dict[
3856
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3857
+ ] = {}
3858
+ _body_params: Optional[bytes] = None
3859
+
3860
+ # process the path parameters
3861
+ # process the query parameters
3862
+ if from_id is not None:
3863
+
3864
+ _query_params.append(('fromId', from_id))
3865
+
3866
+ if from_type is not None:
3867
+
3868
+ _query_params.append(('fromType', from_type))
3869
+
3870
+ if relation_type is not None:
3871
+
3872
+ _query_params.append(('relationType', relation_type))
3873
+
3874
+ if relation_type_group is not None:
3875
+
3876
+ _query_params.append(('relationTypeGroup', relation_type_group))
3877
+
3878
+ if to_id is not None:
3879
+
3880
+ _query_params.append(('toId', to_id))
3881
+
3882
+ if to_type is not None:
3883
+
3884
+ _query_params.append(('toType', to_type))
3885
+
3886
+ # process the header parameters
3887
+ # process the form parameters
3888
+ # process the body parameter
3889
+
3890
+
3891
+ # set the HTTP header `Accept`
3892
+ if 'Accept' not in _header_params:
3893
+ _header_params['Accept'] = self.api_client.select_header_accept(
3894
+ [
3895
+ 'application/json'
3896
+ ]
3897
+ )
3898
+
3899
+
3900
+ # authentication setting
3901
+ _auth_settings: List[str] = [
3902
+ 'HTTP login form',
3903
+ 'API key form'
3904
+ ]
3905
+
3906
+ return self.api_client.param_serialize(
3907
+ method='GET',
3908
+ resource_path='/api/relation{?fromId,fromType,relationType,relationTypeGroup,toId,toType}',
3909
+ path_params=_path_params,
3910
+ query_params=_query_params,
3911
+ header_params=_header_params,
3912
+ body=_body_params,
3913
+ post_params=_form_params,
3914
+ files=_files,
3915
+ auth_settings=_auth_settings,
3916
+ collection_formats=_collection_formats,
3917
+ _host=_host,
3918
+ _request_auth=_request_auth
3919
+ )
3920
+
3921
+
3922
+
3923
+
3924
+ @validate_call
3925
+ def save_relation(
3926
+ self,
3927
+ entity_relation: EntityRelation,
3928
+ _request_timeout: Union[
3929
+ None,
3930
+ Annotated[StrictFloat, Field(gt=0)],
3931
+ Tuple[
3932
+ Annotated[StrictFloat, Field(gt=0)],
3933
+ Annotated[StrictFloat, Field(gt=0)]
3934
+ ]
3935
+ ] = None,
3936
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3937
+ _content_type: Optional[StrictStr] = None,
3938
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3939
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3940
+ ) -> None:
3941
+ """Create Relation (saveRelation)
3942
+
3943
+ Creates or updates a relation between two entities in the platform. Relations unique key is a combination of from/to entity id and relation type group and relation type. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
3944
+
3945
+ :param entity_relation: (required)
3946
+ :type entity_relation: EntityRelation
3947
+ :param _request_timeout: timeout setting for this request. If one
3948
+ number provided, it will be total request
3949
+ timeout. It can also be a pair (tuple) of
3950
+ (connection, read) timeouts.
3951
+ :type _request_timeout: int, tuple(int, int), optional
3952
+ :param _request_auth: set to override the auth_settings for an a single
3953
+ request; this effectively ignores the
3954
+ authentication in the spec for a single request.
3955
+ :type _request_auth: dict, optional
3956
+ :param _content_type: force content-type for the request.
3957
+ :type _content_type: str, Optional
3958
+ :param _headers: set to override the headers for a single
3959
+ request; this effectively ignores the headers
3960
+ in the spec for a single request.
3961
+ :type _headers: dict, optional
3962
+ :param _host_index: set to override the host_index for a single
3963
+ request; this effectively ignores the host_index
3964
+ in the spec for a single request.
3965
+ :type _host_index: int, optional
3966
+ :return: Returns the result object.
3967
+ """ # noqa: E501
3968
+
3969
+ _param = self._save_relation_serialize(
3970
+ entity_relation=entity_relation,
3971
+ _request_auth=_request_auth,
3972
+ _content_type=_content_type,
3973
+ _headers=_headers,
3974
+ _host_index=_host_index
3975
+ )
3976
+
3977
+ _response_types_map: Dict[str, Optional[str]] = {
3978
+ '200': None,
3979
+ '400': "ThingsboardErrorResponse",
3980
+ '401': "ThingsboardErrorResponse",
3981
+ '403': "ThingsboardErrorResponse",
3982
+ '404': "ThingsboardErrorResponse",
3983
+ '429': "ThingsboardErrorResponse",
3984
+ }
3985
+ response_data = self.api_client.call_api(
3986
+ *_param,
3987
+ _request_timeout=_request_timeout
3988
+ )
3989
+ response_data.read()
3990
+ return self.api_client.response_deserialize(
3991
+ response_data=response_data,
3992
+ response_types_map=_response_types_map,
3993
+ ).data
3994
+
3995
+
3996
+ @validate_call
3997
+ def save_relation_with_http_info(
3998
+ self,
3999
+ entity_relation: EntityRelation,
4000
+ _request_timeout: Union[
4001
+ None,
4002
+ Annotated[StrictFloat, Field(gt=0)],
4003
+ Tuple[
4004
+ Annotated[StrictFloat, Field(gt=0)],
4005
+ Annotated[StrictFloat, Field(gt=0)]
4006
+ ]
4007
+ ] = None,
4008
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4009
+ _content_type: Optional[StrictStr] = None,
4010
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4011
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4012
+ ) -> ApiResponse[None]:
4013
+ """Create Relation (saveRelation)
4014
+
4015
+ Creates or updates a relation between two entities in the platform. Relations unique key is a combination of from/to entity id and relation type group and relation type. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
4016
+
4017
+ :param entity_relation: (required)
4018
+ :type entity_relation: EntityRelation
4019
+ :param _request_timeout: timeout setting for this request. If one
4020
+ number provided, it will be total request
4021
+ timeout. It can also be a pair (tuple) of
4022
+ (connection, read) timeouts.
4023
+ :type _request_timeout: int, tuple(int, int), optional
4024
+ :param _request_auth: set to override the auth_settings for an a single
4025
+ request; this effectively ignores the
4026
+ authentication in the spec for a single request.
4027
+ :type _request_auth: dict, optional
4028
+ :param _content_type: force content-type for the request.
4029
+ :type _content_type: str, Optional
4030
+ :param _headers: set to override the headers for a single
4031
+ request; this effectively ignores the headers
4032
+ in the spec for a single request.
4033
+ :type _headers: dict, optional
4034
+ :param _host_index: set to override the host_index for a single
4035
+ request; this effectively ignores the host_index
4036
+ in the spec for a single request.
4037
+ :type _host_index: int, optional
4038
+ :return: Returns the result object.
4039
+ """ # noqa: E501
4040
+
4041
+ _param = self._save_relation_serialize(
4042
+ entity_relation=entity_relation,
4043
+ _request_auth=_request_auth,
4044
+ _content_type=_content_type,
4045
+ _headers=_headers,
4046
+ _host_index=_host_index
4047
+ )
4048
+
4049
+ _response_types_map: Dict[str, Optional[str]] = {
4050
+ '200': None,
4051
+ '400': "ThingsboardErrorResponse",
4052
+ '401': "ThingsboardErrorResponse",
4053
+ '403': "ThingsboardErrorResponse",
4054
+ '404': "ThingsboardErrorResponse",
4055
+ '429': "ThingsboardErrorResponse",
4056
+ }
4057
+ response_data = self.api_client.call_api(
4058
+ *_param,
4059
+ _request_timeout=_request_timeout
4060
+ )
4061
+ response_data.read()
4062
+ return self.api_client.response_deserialize(
4063
+ response_data=response_data,
4064
+ response_types_map=_response_types_map,
4065
+ )
4066
+
4067
+
4068
+ @validate_call
4069
+ def save_relation_without_preload_content(
4070
+ self,
4071
+ entity_relation: EntityRelation,
4072
+ _request_timeout: Union[
4073
+ None,
4074
+ Annotated[StrictFloat, Field(gt=0)],
4075
+ Tuple[
4076
+ Annotated[StrictFloat, Field(gt=0)],
4077
+ Annotated[StrictFloat, Field(gt=0)]
4078
+ ]
4079
+ ] = None,
4080
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4081
+ _content_type: Optional[StrictStr] = None,
4082
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4083
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4084
+ ) -> RESTResponseType:
4085
+ """Create Relation (saveRelation)
4086
+
4087
+ Creates or updates a relation between two entities in the platform. Relations unique key is a combination of from/to entity id and relation type group and relation type. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
4088
+
4089
+ :param entity_relation: (required)
4090
+ :type entity_relation: EntityRelation
4091
+ :param _request_timeout: timeout setting for this request. If one
4092
+ number provided, it will be total request
4093
+ timeout. It can also be a pair (tuple) of
4094
+ (connection, read) timeouts.
4095
+ :type _request_timeout: int, tuple(int, int), optional
4096
+ :param _request_auth: set to override the auth_settings for an a single
4097
+ request; this effectively ignores the
4098
+ authentication in the spec for a single request.
4099
+ :type _request_auth: dict, optional
4100
+ :param _content_type: force content-type for the request.
4101
+ :type _content_type: str, Optional
4102
+ :param _headers: set to override the headers for a single
4103
+ request; this effectively ignores the headers
4104
+ in the spec for a single request.
4105
+ :type _headers: dict, optional
4106
+ :param _host_index: set to override the host_index for a single
4107
+ request; this effectively ignores the host_index
4108
+ in the spec for a single request.
4109
+ :type _host_index: int, optional
4110
+ :return: Returns the result object.
4111
+ """ # noqa: E501
4112
+
4113
+ _param = self._save_relation_serialize(
4114
+ entity_relation=entity_relation,
4115
+ _request_auth=_request_auth,
4116
+ _content_type=_content_type,
4117
+ _headers=_headers,
4118
+ _host_index=_host_index
4119
+ )
4120
+
4121
+ _response_types_map: Dict[str, Optional[str]] = {
4122
+ '200': None,
4123
+ '400': "ThingsboardErrorResponse",
4124
+ '401': "ThingsboardErrorResponse",
4125
+ '403': "ThingsboardErrorResponse",
4126
+ '404': "ThingsboardErrorResponse",
4127
+ '429': "ThingsboardErrorResponse",
4128
+ }
4129
+ response_data = self.api_client.call_api(
4130
+ *_param,
4131
+ _request_timeout=_request_timeout
4132
+ )
4133
+ return response_data.response
4134
+
4135
+
4136
+ def _save_relation_serialize(
4137
+ self,
4138
+ entity_relation,
4139
+ _request_auth,
4140
+ _content_type,
4141
+ _headers,
4142
+ _host_index,
4143
+ ) -> RequestSerialized:
4144
+
4145
+ _host = None
4146
+
4147
+ _collection_formats: Dict[str, str] = {
4148
+ }
4149
+
4150
+ _path_params: Dict[str, str] = {}
4151
+ _query_params: List[Tuple[str, str]] = []
4152
+ _header_params: Dict[str, Optional[str]] = _headers or {}
4153
+ _form_params: List[Tuple[str, str]] = []
4154
+ _files: Dict[
4155
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
4156
+ ] = {}
4157
+ _body_params: Optional[bytes] = None
4158
+
4159
+ # process the path parameters
4160
+ # process the query parameters
4161
+ # process the header parameters
4162
+ # process the form parameters
4163
+ # process the body parameter
4164
+ if entity_relation is not None:
4165
+ _body_params = entity_relation
4166
+
4167
+
4168
+ # set the HTTP header `Accept`
4169
+ if 'Accept' not in _header_params:
4170
+ _header_params['Accept'] = self.api_client.select_header_accept(
4171
+ [
4172
+ 'application/json'
4173
+ ]
4174
+ )
4175
+
4176
+ # set the HTTP header `Content-Type`
4177
+ if _content_type:
4178
+ _header_params['Content-Type'] = _content_type
4179
+ else:
4180
+ _default_content_type = (
4181
+ self.api_client.select_header_content_type(
4182
+ [
4183
+ 'application/json'
4184
+ ]
4185
+ )
4186
+ )
4187
+ if _default_content_type is not None:
4188
+ _header_params['Content-Type'] = _default_content_type
4189
+
4190
+ # authentication setting
4191
+ _auth_settings: List[str] = [
4192
+ 'HTTP login form',
4193
+ 'API key form'
4194
+ ]
4195
+
4196
+ return self.api_client.param_serialize(
4197
+ method='POST',
4198
+ resource_path='/api/relation',
4199
+ path_params=_path_params,
4200
+ query_params=_query_params,
4201
+ header_params=_header_params,
4202
+ body=_body_params,
4203
+ post_params=_form_params,
4204
+ files=_files,
4205
+ auth_settings=_auth_settings,
4206
+ collection_formats=_collection_formats,
4207
+ _host=_host,
4208
+ _request_auth=_request_auth
4209
+ )
4210
+
4211
+
4212
+
4213
+
4214
+ @validate_call
4215
+ def save_relation_v2(
4216
+ self,
4217
+ entity_relation: EntityRelation,
4218
+ _request_timeout: Union[
4219
+ None,
4220
+ Annotated[StrictFloat, Field(gt=0)],
4221
+ Tuple[
4222
+ Annotated[StrictFloat, Field(gt=0)],
4223
+ Annotated[StrictFloat, Field(gt=0)]
4224
+ ]
4225
+ ] = None,
4226
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4227
+ _content_type: Optional[StrictStr] = None,
4228
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4229
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4230
+ ) -> EntityRelation:
4231
+ """Create Relation (saveRelationV2)
4232
+
4233
+ Creates or updates a relation between two entities in the platform. Relations unique key is a combination of from/to entity id and relation type group and relation type. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
4234
+
4235
+ :param entity_relation: (required)
4236
+ :type entity_relation: EntityRelation
4237
+ :param _request_timeout: timeout setting for this request. If one
4238
+ number provided, it will be total request
4239
+ timeout. It can also be a pair (tuple) of
4240
+ (connection, read) timeouts.
4241
+ :type _request_timeout: int, tuple(int, int), optional
4242
+ :param _request_auth: set to override the auth_settings for an a single
4243
+ request; this effectively ignores the
4244
+ authentication in the spec for a single request.
4245
+ :type _request_auth: dict, optional
4246
+ :param _content_type: force content-type for the request.
4247
+ :type _content_type: str, Optional
4248
+ :param _headers: set to override the headers for a single
4249
+ request; this effectively ignores the headers
4250
+ in the spec for a single request.
4251
+ :type _headers: dict, optional
4252
+ :param _host_index: set to override the host_index for a single
4253
+ request; this effectively ignores the host_index
4254
+ in the spec for a single request.
4255
+ :type _host_index: int, optional
4256
+ :return: Returns the result object.
4257
+ """ # noqa: E501
4258
+
4259
+ _param = self._save_relation_v2_serialize(
4260
+ entity_relation=entity_relation,
4261
+ _request_auth=_request_auth,
4262
+ _content_type=_content_type,
4263
+ _headers=_headers,
4264
+ _host_index=_host_index
4265
+ )
4266
+
4267
+ _response_types_map: Dict[str, Optional[str]] = {
4268
+ '200': "EntityRelation",
4269
+ '400': "ThingsboardErrorResponse",
4270
+ '401': "ThingsboardErrorResponse",
4271
+ '403': "ThingsboardErrorResponse",
4272
+ '404': "ThingsboardErrorResponse",
4273
+ '429': "ThingsboardErrorResponse",
4274
+ }
4275
+ response_data = self.api_client.call_api(
4276
+ *_param,
4277
+ _request_timeout=_request_timeout
4278
+ )
4279
+ response_data.read()
4280
+ return self.api_client.response_deserialize(
4281
+ response_data=response_data,
4282
+ response_types_map=_response_types_map,
4283
+ ).data
4284
+
4285
+
4286
+ @validate_call
4287
+ def save_relation_v2_with_http_info(
4288
+ self,
4289
+ entity_relation: EntityRelation,
4290
+ _request_timeout: Union[
4291
+ None,
4292
+ Annotated[StrictFloat, Field(gt=0)],
4293
+ Tuple[
4294
+ Annotated[StrictFloat, Field(gt=0)],
4295
+ Annotated[StrictFloat, Field(gt=0)]
4296
+ ]
4297
+ ] = None,
4298
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4299
+ _content_type: Optional[StrictStr] = None,
4300
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4301
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4302
+ ) -> ApiResponse[EntityRelation]:
4303
+ """Create Relation (saveRelationV2)
4304
+
4305
+ Creates or updates a relation between two entities in the platform. Relations unique key is a combination of from/to entity id and relation type group and relation type. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
4306
+
4307
+ :param entity_relation: (required)
4308
+ :type entity_relation: EntityRelation
4309
+ :param _request_timeout: timeout setting for this request. If one
4310
+ number provided, it will be total request
4311
+ timeout. It can also be a pair (tuple) of
4312
+ (connection, read) timeouts.
4313
+ :type _request_timeout: int, tuple(int, int), optional
4314
+ :param _request_auth: set to override the auth_settings for an a single
4315
+ request; this effectively ignores the
4316
+ authentication in the spec for a single request.
4317
+ :type _request_auth: dict, optional
4318
+ :param _content_type: force content-type for the request.
4319
+ :type _content_type: str, Optional
4320
+ :param _headers: set to override the headers for a single
4321
+ request; this effectively ignores the headers
4322
+ in the spec for a single request.
4323
+ :type _headers: dict, optional
4324
+ :param _host_index: set to override the host_index for a single
4325
+ request; this effectively ignores the host_index
4326
+ in the spec for a single request.
4327
+ :type _host_index: int, optional
4328
+ :return: Returns the result object.
4329
+ """ # noqa: E501
4330
+
4331
+ _param = self._save_relation_v2_serialize(
4332
+ entity_relation=entity_relation,
4333
+ _request_auth=_request_auth,
4334
+ _content_type=_content_type,
4335
+ _headers=_headers,
4336
+ _host_index=_host_index
4337
+ )
4338
+
4339
+ _response_types_map: Dict[str, Optional[str]] = {
4340
+ '200': "EntityRelation",
4341
+ '400': "ThingsboardErrorResponse",
4342
+ '401': "ThingsboardErrorResponse",
4343
+ '403': "ThingsboardErrorResponse",
4344
+ '404': "ThingsboardErrorResponse",
4345
+ '429': "ThingsboardErrorResponse",
4346
+ }
4347
+ response_data = self.api_client.call_api(
4348
+ *_param,
4349
+ _request_timeout=_request_timeout
4350
+ )
4351
+ response_data.read()
4352
+ return self.api_client.response_deserialize(
4353
+ response_data=response_data,
4354
+ response_types_map=_response_types_map,
4355
+ )
4356
+
4357
+
4358
+ @validate_call
4359
+ def save_relation_v2_without_preload_content(
4360
+ self,
4361
+ entity_relation: EntityRelation,
4362
+ _request_timeout: Union[
4363
+ None,
4364
+ Annotated[StrictFloat, Field(gt=0)],
4365
+ Tuple[
4366
+ Annotated[StrictFloat, Field(gt=0)],
4367
+ Annotated[StrictFloat, Field(gt=0)]
4368
+ ]
4369
+ ] = None,
4370
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4371
+ _content_type: Optional[StrictStr] = None,
4372
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4373
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4374
+ ) -> RESTResponseType:
4375
+ """Create Relation (saveRelationV2)
4376
+
4377
+ Creates or updates a relation between two entities in the platform. Relations unique key is a combination of from/to entity id and relation type group and relation type. If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.
4378
+
4379
+ :param entity_relation: (required)
4380
+ :type entity_relation: EntityRelation
4381
+ :param _request_timeout: timeout setting for this request. If one
4382
+ number provided, it will be total request
4383
+ timeout. It can also be a pair (tuple) of
4384
+ (connection, read) timeouts.
4385
+ :type _request_timeout: int, tuple(int, int), optional
4386
+ :param _request_auth: set to override the auth_settings for an a single
4387
+ request; this effectively ignores the
4388
+ authentication in the spec for a single request.
4389
+ :type _request_auth: dict, optional
4390
+ :param _content_type: force content-type for the request.
4391
+ :type _content_type: str, Optional
4392
+ :param _headers: set to override the headers for a single
4393
+ request; this effectively ignores the headers
4394
+ in the spec for a single request.
4395
+ :type _headers: dict, optional
4396
+ :param _host_index: set to override the host_index for a single
4397
+ request; this effectively ignores the host_index
4398
+ in the spec for a single request.
4399
+ :type _host_index: int, optional
4400
+ :return: Returns the result object.
4401
+ """ # noqa: E501
4402
+
4403
+ _param = self._save_relation_v2_serialize(
4404
+ entity_relation=entity_relation,
4405
+ _request_auth=_request_auth,
4406
+ _content_type=_content_type,
4407
+ _headers=_headers,
4408
+ _host_index=_host_index
4409
+ )
4410
+
4411
+ _response_types_map: Dict[str, Optional[str]] = {
4412
+ '200': "EntityRelation",
4413
+ '400': "ThingsboardErrorResponse",
4414
+ '401': "ThingsboardErrorResponse",
4415
+ '403': "ThingsboardErrorResponse",
4416
+ '404': "ThingsboardErrorResponse",
4417
+ '429': "ThingsboardErrorResponse",
4418
+ }
4419
+ response_data = self.api_client.call_api(
4420
+ *_param,
4421
+ _request_timeout=_request_timeout
4422
+ )
4423
+ return response_data.response
4424
+
4425
+
4426
+ def _save_relation_v2_serialize(
4427
+ self,
4428
+ entity_relation,
4429
+ _request_auth,
4430
+ _content_type,
4431
+ _headers,
4432
+ _host_index,
4433
+ ) -> RequestSerialized:
4434
+
4435
+ _host = None
4436
+
4437
+ _collection_formats: Dict[str, str] = {
4438
+ }
4439
+
4440
+ _path_params: Dict[str, str] = {}
4441
+ _query_params: List[Tuple[str, str]] = []
4442
+ _header_params: Dict[str, Optional[str]] = _headers or {}
4443
+ _form_params: List[Tuple[str, str]] = []
4444
+ _files: Dict[
4445
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
4446
+ ] = {}
4447
+ _body_params: Optional[bytes] = None
4448
+
4449
+ # process the path parameters
4450
+ # process the query parameters
4451
+ # process the header parameters
4452
+ # process the form parameters
4453
+ # process the body parameter
4454
+ if entity_relation is not None:
4455
+ _body_params = entity_relation
4456
+
4457
+
4458
+ # set the HTTP header `Accept`
4459
+ if 'Accept' not in _header_params:
4460
+ _header_params['Accept'] = self.api_client.select_header_accept(
4461
+ [
4462
+ 'application/json'
4463
+ ]
4464
+ )
4465
+
4466
+ # set the HTTP header `Content-Type`
4467
+ if _content_type:
4468
+ _header_params['Content-Type'] = _content_type
4469
+ else:
4470
+ _default_content_type = (
4471
+ self.api_client.select_header_content_type(
4472
+ [
4473
+ 'application/json'
4474
+ ]
4475
+ )
4476
+ )
4477
+ if _default_content_type is not None:
4478
+ _header_params['Content-Type'] = _default_content_type
4479
+
4480
+ # authentication setting
4481
+ _auth_settings: List[str] = [
4482
+ 'HTTP login form',
4483
+ 'API key form'
4484
+ ]
4485
+
4486
+ return self.api_client.param_serialize(
4487
+ method='POST',
4488
+ resource_path='/api/v2/relation',
4489
+ path_params=_path_params,
4490
+ query_params=_query_params,
4491
+ header_params=_header_params,
4492
+ body=_body_params,
4493
+ post_params=_form_params,
4494
+ files=_files,
4495
+ auth_settings=_auth_settings,
4496
+ collection_formats=_collection_formats,
4497
+ _host=_host,
4498
+ _request_auth=_request_auth
4499
+ )
4500
+
4501
+