revengai 2.74.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 (314) hide show
  1. revengai/__init__.py +647 -0
  2. revengai/api/__init__.py +22 -0
  3. revengai/api/analyses_comments_api.py +1198 -0
  4. revengai/api/analyses_core_api.py +3870 -0
  5. revengai/api/analyses_dynamic_execution_api.py +1884 -0
  6. revengai/api/analyses_results_metadata_api.py +2240 -0
  7. revengai/api/analyses_security_checks_api.py +862 -0
  8. revengai/api/authentication_users_api.py +1323 -0
  9. revengai/api/binaries_api.py +1610 -0
  10. revengai/api/collections_api.py +2167 -0
  11. revengai/api/external_sources_api.py +827 -0
  12. revengai/api/firmware_api.py +592 -0
  13. revengai/api/functions_ai_decompilation_api.py +2592 -0
  14. revengai/api/functions_block_comments_api.py +849 -0
  15. revengai/api/functions_core_api.py +3430 -0
  16. revengai/api/functions_data_types_api.py +1746 -0
  17. revengai/api/functions_decompilation_api.py +1198 -0
  18. revengai/api/functions_renaming_history_api.py +1151 -0
  19. revengai/api/models_api.py +284 -0
  20. revengai/api/search_api.py +1454 -0
  21. revengai/api_client.py +803 -0
  22. revengai/api_response.py +21 -0
  23. revengai/configuration.py +605 -0
  24. revengai/exceptions.py +215 -0
  25. revengai/models/__init__.py +298 -0
  26. revengai/models/addr.py +143 -0
  27. revengai/models/ai_decompilation_rating.py +37 -0
  28. revengai/models/ai_unstrip_request.py +86 -0
  29. revengai/models/analysis_access_info.py +88 -0
  30. revengai/models/analysis_config.py +106 -0
  31. revengai/models/analysis_create_request.py +131 -0
  32. revengai/models/analysis_create_response.py +88 -0
  33. revengai/models/analysis_detail_response.py +121 -0
  34. revengai/models/analysis_function_mapping.py +90 -0
  35. revengai/models/analysis_function_matching_request.py +110 -0
  36. revengai/models/analysis_functions.py +94 -0
  37. revengai/models/analysis_functions_list.py +94 -0
  38. revengai/models/analysis_record.py +128 -0
  39. revengai/models/analysis_scope.py +36 -0
  40. revengai/models/analysis_strings_response.py +96 -0
  41. revengai/models/analysis_tags.py +94 -0
  42. revengai/models/analysis_update_request.py +108 -0
  43. revengai/models/analysis_update_tags_request.py +86 -0
  44. revengai/models/analysis_update_tags_response.py +94 -0
  45. revengai/models/app_api_rest_v2_analyses_enums_dynamic_execution_status.py +38 -0
  46. revengai/models/app_api_rest_v2_analyses_enums_order_by.py +37 -0
  47. revengai/models/app_api_rest_v2_collections_enums_order_by.py +40 -0
  48. revengai/models/app_api_rest_v2_functions_responses_function.py +93 -0
  49. revengai/models/app_api_rest_v2_functions_types_function.py +110 -0
  50. revengai/models/app_services_dynamic_execution_schemas_dynamic_execution_status.py +86 -0
  51. revengai/models/argument.py +99 -0
  52. revengai/models/auto_unstrip_request.py +99 -0
  53. revengai/models/auto_unstrip_response.py +129 -0
  54. revengai/models/base_response.py +124 -0
  55. revengai/models/base_response_analysis_create_response.py +125 -0
  56. revengai/models/base_response_analysis_detail_response.py +125 -0
  57. revengai/models/base_response_analysis_function_mapping.py +125 -0
  58. revengai/models/base_response_analysis_functions.py +125 -0
  59. revengai/models/base_response_analysis_functions_list.py +125 -0
  60. revengai/models/base_response_analysis_strings_response.py +125 -0
  61. revengai/models/base_response_analysis_tags.py +125 -0
  62. revengai/models/base_response_analysis_update_tags_response.py +125 -0
  63. revengai/models/base_response_basic.py +125 -0
  64. revengai/models/base_response_binary_additional_response.py +125 -0
  65. revengai/models/base_response_binary_details_response.py +125 -0
  66. revengai/models/base_response_binary_externals_response.py +125 -0
  67. revengai/models/base_response_binary_search_response.py +125 -0
  68. revengai/models/base_response_block_comments_generation_for_function_response.py +125 -0
  69. revengai/models/base_response_block_comments_overview_generation_response.py +116 -0
  70. revengai/models/base_response_bool.py +121 -0
  71. revengai/models/base_response_callees_caller_functions_response.py +125 -0
  72. revengai/models/base_response_capabilities.py +125 -0
  73. revengai/models/base_response_check_security_checks_task_response.py +125 -0
  74. revengai/models/base_response_child_binaries_response.py +125 -0
  75. revengai/models/base_response_collection_binaries_update_response.py +125 -0
  76. revengai/models/base_response_collection_response.py +125 -0
  77. revengai/models/base_response_collection_search_response.py +125 -0
  78. revengai/models/base_response_collection_tags_update_response.py +125 -0
  79. revengai/models/base_response_comment_response.py +125 -0
  80. revengai/models/base_response_communities.py +125 -0
  81. revengai/models/base_response_created.py +125 -0
  82. revengai/models/base_response_dict.py +121 -0
  83. revengai/models/base_response_dynamic_execution_status.py +125 -0
  84. revengai/models/base_response_external_response.py +125 -0
  85. revengai/models/base_response_function_blocks_response.py +125 -0
  86. revengai/models/base_response_function_capability_response.py +125 -0
  87. revengai/models/base_response_function_data_types.py +125 -0
  88. revengai/models/base_response_function_data_types_list.py +125 -0
  89. revengai/models/base_response_function_search_response.py +125 -0
  90. revengai/models/base_response_function_strings_response.py +125 -0
  91. revengai/models/base_response_function_task_response.py +125 -0
  92. revengai/models/base_response_functions_detail_response.py +125 -0
  93. revengai/models/base_response_generate_function_data_types.py +125 -0
  94. revengai/models/base_response_generation_status_list.py +125 -0
  95. revengai/models/base_response_get_ai_decompilation_rating_response.py +125 -0
  96. revengai/models/base_response_get_ai_decompilation_task.py +125 -0
  97. revengai/models/base_response_get_me_response.py +125 -0
  98. revengai/models/base_response_get_public_user_response.py +125 -0
  99. revengai/models/base_response_list_collection_results.py +125 -0
  100. revengai/models/base_response_list_comment_response.py +129 -0
  101. revengai/models/base_response_list_die_match.py +129 -0
  102. revengai/models/base_response_list_function_name_history.py +129 -0
  103. revengai/models/base_response_list_sbom.py +129 -0
  104. revengai/models/base_response_list_user_activity_response.py +129 -0
  105. revengai/models/base_response_login_response.py +125 -0
  106. revengai/models/base_response_logs.py +125 -0
  107. revengai/models/base_response_models_response.py +125 -0
  108. revengai/models/base_response_network_overview_response.py +125 -0
  109. revengai/models/base_response_params.py +125 -0
  110. revengai/models/base_response_process_dumps.py +125 -0
  111. revengai/models/base_response_process_registry.py +125 -0
  112. revengai/models/base_response_process_tree.py +125 -0
  113. revengai/models/base_response_queued_security_checks_task_response.py +125 -0
  114. revengai/models/base_response_recent.py +125 -0
  115. revengai/models/base_response_security_checks_response.py +125 -0
  116. revengai/models/base_response_status.py +125 -0
  117. revengai/models/base_response_str.py +121 -0
  118. revengai/models/base_response_tag_search_response.py +125 -0
  119. revengai/models/base_response_task_response.py +125 -0
  120. revengai/models/base_response_ttps.py +125 -0
  121. revengai/models/base_response_upload_response.py +125 -0
  122. revengai/models/base_response_vulnerabilities.py +125 -0
  123. revengai/models/basic.py +116 -0
  124. revengai/models/binary_additional_details_data_response.py +112 -0
  125. revengai/models/binary_additional_response.py +105 -0
  126. revengai/models/binary_config.py +108 -0
  127. revengai/models/binary_details_response.py +125 -0
  128. revengai/models/binary_externals_response.py +95 -0
  129. revengai/models/binary_search_response.py +94 -0
  130. revengai/models/binary_search_result.py +108 -0
  131. revengai/models/binary_task_status.py +39 -0
  132. revengai/models/block.py +86 -0
  133. revengai/models/block_comments_generation_for_function_response.py +86 -0
  134. revengai/models/callee_function_info.py +106 -0
  135. revengai/models/callees_caller_functions_response.py +106 -0
  136. revengai/models/caller_function_info.py +106 -0
  137. revengai/models/capabilities.py +94 -0
  138. revengai/models/capability.py +90 -0
  139. revengai/models/check_security_checks_task_response.py +87 -0
  140. revengai/models/child_binaries_response.py +104 -0
  141. revengai/models/code_signature_model.py +98 -0
  142. revengai/models/collection_binaries_update_request.py +86 -0
  143. revengai/models/collection_binaries_update_response.py +94 -0
  144. revengai/models/collection_binary_response.py +97 -0
  145. revengai/models/collection_create_request.py +107 -0
  146. revengai/models/collection_list_item.py +112 -0
  147. revengai/models/collection_response.py +131 -0
  148. revengai/models/collection_response_binaries_inner.py +135 -0
  149. revengai/models/collection_scope.py +38 -0
  150. revengai/models/collection_search_response.py +94 -0
  151. revengai/models/collection_search_result.py +124 -0
  152. revengai/models/collection_tags_update_request.py +86 -0
  153. revengai/models/collection_tags_update_response.py +86 -0
  154. revengai/models/collection_update_request.py +106 -0
  155. revengai/models/comment_base.py +86 -0
  156. revengai/models/comment_response.py +110 -0
  157. revengai/models/comment_update_request.py +86 -0
  158. revengai/models/communities.py +100 -0
  159. revengai/models/community_match_percentages.py +92 -0
  160. revengai/models/confidence_type.py +39 -0
  161. revengai/models/context.py +141 -0
  162. revengai/models/created.py +90 -0
  163. revengai/models/decompilation_comment_context.py +98 -0
  164. revengai/models/die_match.py +92 -0
  165. revengai/models/dynamic_execution_status_input.py +38 -0
  166. revengai/models/elf_dynamic_entry.py +88 -0
  167. revengai/models/elf_import_model.py +88 -0
  168. revengai/models/elf_model.py +179 -0
  169. revengai/models/elf_relocation.py +98 -0
  170. revengai/models/elf_section.py +104 -0
  171. revengai/models/elf_security.py +94 -0
  172. revengai/models/elf_segment.py +102 -0
  173. revengai/models/elf_symbol.py +98 -0
  174. revengai/models/entrypoint_model.py +88 -0
  175. revengai/models/enumeration.py +97 -0
  176. revengai/models/error_model.py +88 -0
  177. revengai/models/export_model.py +88 -0
  178. revengai/models/external_response.py +91 -0
  179. revengai/models/file_format.py +37 -0
  180. revengai/models/file_hashes.py +140 -0
  181. revengai/models/file_metadata.py +96 -0
  182. revengai/models/filters.py +39 -0
  183. revengai/models/function_block_destination_response.py +95 -0
  184. revengai/models/function_block_response.py +109 -0
  185. revengai/models/function_blocks_response.py +121 -0
  186. revengai/models/function_boundary.py +90 -0
  187. revengai/models/function_capability_response.py +86 -0
  188. revengai/models/function_comment_create_request.py +92 -0
  189. revengai/models/function_data_types.py +106 -0
  190. revengai/models/function_data_types_list.py +98 -0
  191. revengai/models/function_data_types_list_item.py +108 -0
  192. revengai/models/function_data_types_params.py +86 -0
  193. revengai/models/function_data_types_status.py +90 -0
  194. revengai/models/function_header.py +112 -0
  195. revengai/models/function_info_input.py +105 -0
  196. revengai/models/function_info_input_func_deps_inner.py +163 -0
  197. revengai/models/function_info_output.py +105 -0
  198. revengai/models/function_list_item.py +96 -0
  199. revengai/models/function_local_variable_response.py +94 -0
  200. revengai/models/function_mapping.py +90 -0
  201. revengai/models/function_mapping_full.py +275 -0
  202. revengai/models/function_match.py +111 -0
  203. revengai/models/function_matching_filters.py +103 -0
  204. revengai/models/function_matching_request.py +114 -0
  205. revengai/models/function_matching_response.py +157 -0
  206. revengai/models/function_name_history.py +99 -0
  207. revengai/models/function_param_response.py +94 -0
  208. revengai/models/function_rename.py +88 -0
  209. revengai/models/function_rename_map.py +90 -0
  210. revengai/models/function_search_response.py +94 -0
  211. revengai/models/function_search_result.py +99 -0
  212. revengai/models/function_source_type.py +39 -0
  213. revengai/models/function_string.py +88 -0
  214. revengai/models/function_strings_response.py +96 -0
  215. revengai/models/function_task_response.py +94 -0
  216. revengai/models/function_task_status.py +39 -0
  217. revengai/models/function_type_input.py +127 -0
  218. revengai/models/function_type_output.py +127 -0
  219. revengai/models/functions_detail_response.py +125 -0
  220. revengai/models/functions_list_rename.py +94 -0
  221. revengai/models/generate_function_data_types.py +94 -0
  222. revengai/models/generation_status_list.py +98 -0
  223. revengai/models/get_ai_decompilation_rating_response.py +94 -0
  224. revengai/models/get_ai_decompilation_task.py +159 -0
  225. revengai/models/get_me_response.py +108 -0
  226. revengai/models/get_public_user_response.py +88 -0
  227. revengai/models/global_variable.py +101 -0
  228. revengai/models/icon_model.py +91 -0
  229. revengai/models/import_model.py +88 -0
  230. revengai/models/inverse_function_map_item.py +99 -0
  231. revengai/models/inverse_string_map_item.py +93 -0
  232. revengai/models/inverse_value.py +86 -0
  233. revengai/models/isa.py +37 -0
  234. revengai/models/list_collection_results.py +94 -0
  235. revengai/models/login_request.py +89 -0
  236. revengai/models/login_response.py +86 -0
  237. revengai/models/logs.py +86 -0
  238. revengai/models/matched_function.py +116 -0
  239. revengai/models/matched_function_suggestion.py +97 -0
  240. revengai/models/meta_model.py +95 -0
  241. revengai/models/model_name.py +40 -0
  242. revengai/models/models_response.py +86 -0
  243. revengai/models/name_confidence.py +89 -0
  244. revengai/models/network_overview_dns.py +98 -0
  245. revengai/models/network_overview_dns_answer.py +88 -0
  246. revengai/models/network_overview_metadata.py +99 -0
  247. revengai/models/network_overview_response.py +104 -0
  248. revengai/models/order.py +36 -0
  249. revengai/models/pagination_model.py +90 -0
  250. revengai/models/params.py +103 -0
  251. revengai/models/pdb_debug_model.py +94 -0
  252. revengai/models/pe_model.py +215 -0
  253. revengai/models/platform.py +36 -0
  254. revengai/models/process.py +103 -0
  255. revengai/models/process_dump.py +96 -0
  256. revengai/models/process_dump_metadata.py +90 -0
  257. revengai/models/process_dumps.py +92 -0
  258. revengai/models/process_dumps_data.py +96 -0
  259. revengai/models/process_registry.py +105 -0
  260. revengai/models/process_tree.py +96 -0
  261. revengai/models/queued_security_checks_task_response.py +86 -0
  262. revengai/models/re_analysis_form.py +101 -0
  263. revengai/models/recent.py +94 -0
  264. revengai/models/registry.py +102 -0
  265. revengai/models/relative_binary_response.py +90 -0
  266. revengai/models/sandbox_options.py +88 -0
  267. revengai/models/sbom.py +96 -0
  268. revengai/models/sbom_package.py +88 -0
  269. revengai/models/scrape_third_party_config.py +86 -0
  270. revengai/models/section_model.py +96 -0
  271. revengai/models/security_checks_response.py +98 -0
  272. revengai/models/security_checks_result.py +103 -0
  273. revengai/models/security_model.py +106 -0
  274. revengai/models/severity_type.py +40 -0
  275. revengai/models/single_code_certificate_model.py +96 -0
  276. revengai/models/single_code_signature_model.py +96 -0
  277. revengai/models/single_pdb_entry_model.py +90 -0
  278. revengai/models/single_section_model.py +98 -0
  279. revengai/models/stack_variable.py +101 -0
  280. revengai/models/status_input.py +40 -0
  281. revengai/models/status_output.py +88 -0
  282. revengai/models/string_functions.py +96 -0
  283. revengai/models/structure.py +117 -0
  284. revengai/models/structure_member.py +99 -0
  285. revengai/models/symbols.py +96 -0
  286. revengai/models/tag.py +86 -0
  287. revengai/models/tag_item.py +95 -0
  288. revengai/models/tag_response.py +88 -0
  289. revengai/models/tag_search_response.py +94 -0
  290. revengai/models/tag_search_result.py +88 -0
  291. revengai/models/task_response.py +94 -0
  292. revengai/models/task_status.py +39 -0
  293. revengai/models/timestamp_model.py +90 -0
  294. revengai/models/ttps.py +92 -0
  295. revengai/models/ttps_attack.py +88 -0
  296. revengai/models/ttps_data.py +96 -0
  297. revengai/models/ttps_element.py +108 -0
  298. revengai/models/ttps_occurance.py +88 -0
  299. revengai/models/type_definition.py +97 -0
  300. revengai/models/update_function_data_types.py +92 -0
  301. revengai/models/upload_file_type.py +38 -0
  302. revengai/models/upload_response.py +91 -0
  303. revengai/models/upsert_ai_decomplation_rating_request.py +94 -0
  304. revengai/models/user_activity_response.py +97 -0
  305. revengai/models/vulnerabilities.py +94 -0
  306. revengai/models/vulnerability.py +113 -0
  307. revengai/models/vulnerability_type.py +40 -0
  308. revengai/models/workspace.py +37 -0
  309. revengai/py.typed +0 -0
  310. revengai/rest.py +257 -0
  311. revengai-2.74.0.dist-info/METADATA +447 -0
  312. revengai-2.74.0.dist-info/RECORD +314 -0
  313. revengai-2.74.0.dist-info/WHEEL +4 -0
  314. revengai-2.74.0.dist-info/licenses/LICENSE.md +19 -0
@@ -0,0 +1,592 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ RevEng.AI API
5
+
6
+ RevEng.AI is Similarity Search Engine for executable binaries
7
+
8
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+
10
+ Do not edit the class manually.
11
+ """ # noqa: E501
12
+
13
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from pydantic import StrictBytes, StrictStr
19
+ from typing import Any, Optional, Tuple, Union
20
+
21
+ from revengai.api_client import ApiClient, RequestSerialized
22
+ from revengai.api_response import ApiResponse
23
+ from revengai.rest import RESTResponseType
24
+
25
+
26
+ class FirmwareApi:
27
+ """NOTE: This class is auto generated by OpenAPI Generator
28
+ Ref: https://openapi-generator.tech
29
+
30
+ Do not edit the class manually.
31
+ """
32
+
33
+ def __init__(self, api_client=None) -> None:
34
+ if api_client is None:
35
+ api_client = ApiClient.get_default()
36
+ self.api_client = api_client
37
+
38
+
39
+ @validate_call
40
+ def get_binaries_for_firmware_task(
41
+ self,
42
+ task_id: StrictStr,
43
+ _request_timeout: Union[
44
+ None,
45
+ Annotated[StrictFloat, Field(gt=0)],
46
+ Tuple[
47
+ Annotated[StrictFloat, Field(gt=0)],
48
+ Annotated[StrictFloat, Field(gt=0)]
49
+ ]
50
+ ] = None,
51
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
52
+ _content_type: Optional[StrictStr] = None,
53
+ _headers: Optional[Dict[StrictStr, Any]] = None,
54
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
55
+ ) -> object:
56
+ """Upload firmware for unpacking
57
+
58
+ Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response.
59
+
60
+ :param task_id: (required)
61
+ :type task_id: str
62
+ :param _request_timeout: timeout setting for this request. If one
63
+ number provided, it will be total request
64
+ timeout. It can also be a pair (tuple) of
65
+ (connection, read) timeouts.
66
+ :type _request_timeout: int, tuple(int, int), optional
67
+ :param _request_auth: set to override the auth_settings for an a single
68
+ request; this effectively ignores the
69
+ authentication in the spec for a single request.
70
+ :type _request_auth: dict, optional
71
+ :param _content_type: force content-type for the request.
72
+ :type _content_type: str, Optional
73
+ :param _headers: set to override the headers for a single
74
+ request; this effectively ignores the headers
75
+ in the spec for a single request.
76
+ :type _headers: dict, optional
77
+ :param _host_index: set to override the host_index for a single
78
+ request; this effectively ignores the host_index
79
+ in the spec for a single request.
80
+ :type _host_index: int, optional
81
+ :return: Returns the result object.
82
+ """ # noqa: E501
83
+
84
+ _param = self._get_binaries_for_firmware_task_serialize(
85
+ task_id=task_id,
86
+ _request_auth=_request_auth,
87
+ _content_type=_content_type,
88
+ _headers=_headers,
89
+ _host_index=_host_index
90
+ )
91
+
92
+ _response_types_map: Dict[str, Optional[str]] = {
93
+ '200': "object",
94
+ '422': "BaseResponse",
95
+ }
96
+ response_data = self.api_client.call_api(
97
+ *_param,
98
+ _request_timeout=_request_timeout
99
+ )
100
+ response_data.read()
101
+ return self.api_client.response_deserialize(
102
+ response_data=response_data,
103
+ response_types_map=_response_types_map,
104
+ ).data
105
+
106
+
107
+ @validate_call
108
+ def get_binaries_for_firmware_task_with_http_info(
109
+ self,
110
+ task_id: StrictStr,
111
+ _request_timeout: Union[
112
+ None,
113
+ Annotated[StrictFloat, Field(gt=0)],
114
+ Tuple[
115
+ Annotated[StrictFloat, Field(gt=0)],
116
+ Annotated[StrictFloat, Field(gt=0)]
117
+ ]
118
+ ] = None,
119
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
120
+ _content_type: Optional[StrictStr] = None,
121
+ _headers: Optional[Dict[StrictStr, Any]] = None,
122
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
123
+ ) -> ApiResponse[object]:
124
+ """Upload firmware for unpacking
125
+
126
+ Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response.
127
+
128
+ :param task_id: (required)
129
+ :type task_id: str
130
+ :param _request_timeout: timeout setting for this request. If one
131
+ number provided, it will be total request
132
+ timeout. It can also be a pair (tuple) of
133
+ (connection, read) timeouts.
134
+ :type _request_timeout: int, tuple(int, int), optional
135
+ :param _request_auth: set to override the auth_settings for an a single
136
+ request; this effectively ignores the
137
+ authentication in the spec for a single request.
138
+ :type _request_auth: dict, optional
139
+ :param _content_type: force content-type for the request.
140
+ :type _content_type: str, Optional
141
+ :param _headers: set to override the headers for a single
142
+ request; this effectively ignores the headers
143
+ in the spec for a single request.
144
+ :type _headers: dict, optional
145
+ :param _host_index: set to override the host_index for a single
146
+ request; this effectively ignores the host_index
147
+ in the spec for a single request.
148
+ :type _host_index: int, optional
149
+ :return: Returns the result object.
150
+ """ # noqa: E501
151
+
152
+ _param = self._get_binaries_for_firmware_task_serialize(
153
+ task_id=task_id,
154
+ _request_auth=_request_auth,
155
+ _content_type=_content_type,
156
+ _headers=_headers,
157
+ _host_index=_host_index
158
+ )
159
+
160
+ _response_types_map: Dict[str, Optional[str]] = {
161
+ '200': "object",
162
+ '422': "BaseResponse",
163
+ }
164
+ response_data = self.api_client.call_api(
165
+ *_param,
166
+ _request_timeout=_request_timeout
167
+ )
168
+ response_data.read()
169
+ return self.api_client.response_deserialize(
170
+ response_data=response_data,
171
+ response_types_map=_response_types_map,
172
+ )
173
+
174
+
175
+ @validate_call
176
+ def get_binaries_for_firmware_task_without_preload_content(
177
+ self,
178
+ task_id: StrictStr,
179
+ _request_timeout: Union[
180
+ None,
181
+ Annotated[StrictFloat, Field(gt=0)],
182
+ Tuple[
183
+ Annotated[StrictFloat, Field(gt=0)],
184
+ Annotated[StrictFloat, Field(gt=0)]
185
+ ]
186
+ ] = None,
187
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
188
+ _content_type: Optional[StrictStr] = None,
189
+ _headers: Optional[Dict[StrictStr, Any]] = None,
190
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
191
+ ) -> RESTResponseType:
192
+ """Upload firmware for unpacking
193
+
194
+ Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response.
195
+
196
+ :param task_id: (required)
197
+ :type task_id: str
198
+ :param _request_timeout: timeout setting for this request. If one
199
+ number provided, it will be total request
200
+ timeout. It can also be a pair (tuple) of
201
+ (connection, read) timeouts.
202
+ :type _request_timeout: int, tuple(int, int), optional
203
+ :param _request_auth: set to override the auth_settings for an a single
204
+ request; this effectively ignores the
205
+ authentication in the spec for a single request.
206
+ :type _request_auth: dict, optional
207
+ :param _content_type: force content-type for the request.
208
+ :type _content_type: str, Optional
209
+ :param _headers: set to override the headers for a single
210
+ request; this effectively ignores the headers
211
+ in the spec for a single request.
212
+ :type _headers: dict, optional
213
+ :param _host_index: set to override the host_index for a single
214
+ request; this effectively ignores the host_index
215
+ in the spec for a single request.
216
+ :type _host_index: int, optional
217
+ :return: Returns the result object.
218
+ """ # noqa: E501
219
+
220
+ _param = self._get_binaries_for_firmware_task_serialize(
221
+ task_id=task_id,
222
+ _request_auth=_request_auth,
223
+ _content_type=_content_type,
224
+ _headers=_headers,
225
+ _host_index=_host_index
226
+ )
227
+
228
+ _response_types_map: Dict[str, Optional[str]] = {
229
+ '200': "object",
230
+ '422': "BaseResponse",
231
+ }
232
+ response_data = self.api_client.call_api(
233
+ *_param,
234
+ _request_timeout=_request_timeout
235
+ )
236
+ return response_data.response
237
+
238
+
239
+ def _get_binaries_for_firmware_task_serialize(
240
+ self,
241
+ task_id,
242
+ _request_auth,
243
+ _content_type,
244
+ _headers,
245
+ _host_index,
246
+ ) -> RequestSerialized:
247
+
248
+ _host = None
249
+
250
+ _collection_formats: Dict[str, str] = {
251
+ }
252
+
253
+ _path_params: Dict[str, str] = {}
254
+ _query_params: List[Tuple[str, str]] = []
255
+ _header_params: Dict[str, Optional[str]] = _headers or {}
256
+ _form_params: List[Tuple[str, str]] = []
257
+ _files: Dict[
258
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
259
+ ] = {}
260
+ _body_params: Optional[bytes] = None
261
+
262
+ # process the path parameters
263
+ if task_id is not None:
264
+ _path_params['task_id'] = task_id
265
+ # process the query parameters
266
+ # process the header parameters
267
+ # process the form parameters
268
+ # process the body parameter
269
+
270
+
271
+ # set the HTTP header `Accept`
272
+ if 'Accept' not in _header_params:
273
+ _header_params['Accept'] = self.api_client.select_header_accept(
274
+ [
275
+ 'application/json'
276
+ ]
277
+ )
278
+
279
+
280
+ # authentication setting
281
+ _auth_settings: List[str] = [
282
+ 'APIKey'
283
+ ]
284
+
285
+ return self.api_client.param_serialize(
286
+ method='GET',
287
+ resource_path='/v2/firmware/get-binaries/{task_id}',
288
+ path_params=_path_params,
289
+ query_params=_query_params,
290
+ header_params=_header_params,
291
+ body=_body_params,
292
+ post_params=_form_params,
293
+ files=_files,
294
+ auth_settings=_auth_settings,
295
+ collection_formats=_collection_formats,
296
+ _host=_host,
297
+ _request_auth=_request_auth
298
+ )
299
+
300
+
301
+
302
+
303
+ @validate_call
304
+ def upload_firmware(
305
+ self,
306
+ file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
307
+ password: Optional[StrictStr] = None,
308
+ _request_timeout: Union[
309
+ None,
310
+ Annotated[StrictFloat, Field(gt=0)],
311
+ Tuple[
312
+ Annotated[StrictFloat, Field(gt=0)],
313
+ Annotated[StrictFloat, Field(gt=0)]
314
+ ]
315
+ ] = None,
316
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
317
+ _content_type: Optional[StrictStr] = None,
318
+ _headers: Optional[Dict[StrictStr, Any]] = None,
319
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
320
+ ) -> object:
321
+ """Upload firmware for unpacking
322
+
323
+ Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response.
324
+
325
+ :param file: (required)
326
+ :type file: bytearray
327
+ :param password:
328
+ :type password: str
329
+ :param _request_timeout: timeout setting for this request. If one
330
+ number provided, it will be total request
331
+ timeout. It can also be a pair (tuple) of
332
+ (connection, read) timeouts.
333
+ :type _request_timeout: int, tuple(int, int), optional
334
+ :param _request_auth: set to override the auth_settings for an a single
335
+ request; this effectively ignores the
336
+ authentication in the spec for a single request.
337
+ :type _request_auth: dict, optional
338
+ :param _content_type: force content-type for the request.
339
+ :type _content_type: str, Optional
340
+ :param _headers: set to override the headers for a single
341
+ request; this effectively ignores the headers
342
+ in the spec for a single request.
343
+ :type _headers: dict, optional
344
+ :param _host_index: set to override the host_index for a single
345
+ request; this effectively ignores the host_index
346
+ in the spec for a single request.
347
+ :type _host_index: int, optional
348
+ :return: Returns the result object.
349
+ """ # noqa: E501
350
+
351
+ _param = self._upload_firmware_serialize(
352
+ file=file,
353
+ password=password,
354
+ _request_auth=_request_auth,
355
+ _content_type=_content_type,
356
+ _headers=_headers,
357
+ _host_index=_host_index
358
+ )
359
+
360
+ _response_types_map: Dict[str, Optional[str]] = {
361
+ '201': "object",
362
+ '422': "BaseResponse",
363
+ }
364
+ response_data = self.api_client.call_api(
365
+ *_param,
366
+ _request_timeout=_request_timeout
367
+ )
368
+ response_data.read()
369
+ return self.api_client.response_deserialize(
370
+ response_data=response_data,
371
+ response_types_map=_response_types_map,
372
+ ).data
373
+
374
+
375
+ @validate_call
376
+ def upload_firmware_with_http_info(
377
+ self,
378
+ file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
379
+ password: Optional[StrictStr] = None,
380
+ _request_timeout: Union[
381
+ None,
382
+ Annotated[StrictFloat, Field(gt=0)],
383
+ Tuple[
384
+ Annotated[StrictFloat, Field(gt=0)],
385
+ Annotated[StrictFloat, Field(gt=0)]
386
+ ]
387
+ ] = None,
388
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
389
+ _content_type: Optional[StrictStr] = None,
390
+ _headers: Optional[Dict[StrictStr, Any]] = None,
391
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
392
+ ) -> ApiResponse[object]:
393
+ """Upload firmware for unpacking
394
+
395
+ Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response.
396
+
397
+ :param file: (required)
398
+ :type file: bytearray
399
+ :param password:
400
+ :type password: str
401
+ :param _request_timeout: timeout setting for this request. If one
402
+ number provided, it will be total request
403
+ timeout. It can also be a pair (tuple) of
404
+ (connection, read) timeouts.
405
+ :type _request_timeout: int, tuple(int, int), optional
406
+ :param _request_auth: set to override the auth_settings for an a single
407
+ request; this effectively ignores the
408
+ authentication in the spec for a single request.
409
+ :type _request_auth: dict, optional
410
+ :param _content_type: force content-type for the request.
411
+ :type _content_type: str, Optional
412
+ :param _headers: set to override the headers for a single
413
+ request; this effectively ignores the headers
414
+ in the spec for a single request.
415
+ :type _headers: dict, optional
416
+ :param _host_index: set to override the host_index for a single
417
+ request; this effectively ignores the host_index
418
+ in the spec for a single request.
419
+ :type _host_index: int, optional
420
+ :return: Returns the result object.
421
+ """ # noqa: E501
422
+
423
+ _param = self._upload_firmware_serialize(
424
+ file=file,
425
+ password=password,
426
+ _request_auth=_request_auth,
427
+ _content_type=_content_type,
428
+ _headers=_headers,
429
+ _host_index=_host_index
430
+ )
431
+
432
+ _response_types_map: Dict[str, Optional[str]] = {
433
+ '201': "object",
434
+ '422': "BaseResponse",
435
+ }
436
+ response_data = self.api_client.call_api(
437
+ *_param,
438
+ _request_timeout=_request_timeout
439
+ )
440
+ response_data.read()
441
+ return self.api_client.response_deserialize(
442
+ response_data=response_data,
443
+ response_types_map=_response_types_map,
444
+ )
445
+
446
+
447
+ @validate_call
448
+ def upload_firmware_without_preload_content(
449
+ self,
450
+ file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
451
+ password: Optional[StrictStr] = None,
452
+ _request_timeout: Union[
453
+ None,
454
+ Annotated[StrictFloat, Field(gt=0)],
455
+ Tuple[
456
+ Annotated[StrictFloat, Field(gt=0)],
457
+ Annotated[StrictFloat, Field(gt=0)]
458
+ ]
459
+ ] = None,
460
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
461
+ _content_type: Optional[StrictStr] = None,
462
+ _headers: Optional[Dict[StrictStr, Any]] = None,
463
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
464
+ ) -> RESTResponseType:
465
+ """Upload firmware for unpacking
466
+
467
+ Uploads a firmware file and begins a 'Firmware Unpacker' task. Returns a result identifier, which can be used to poll for the response.
468
+
469
+ :param file: (required)
470
+ :type file: bytearray
471
+ :param password:
472
+ :type password: str
473
+ :param _request_timeout: timeout setting for this request. If one
474
+ number provided, it will be total request
475
+ timeout. It can also be a pair (tuple) of
476
+ (connection, read) timeouts.
477
+ :type _request_timeout: int, tuple(int, int), optional
478
+ :param _request_auth: set to override the auth_settings for an a single
479
+ request; this effectively ignores the
480
+ authentication in the spec for a single request.
481
+ :type _request_auth: dict, optional
482
+ :param _content_type: force content-type for the request.
483
+ :type _content_type: str, Optional
484
+ :param _headers: set to override the headers for a single
485
+ request; this effectively ignores the headers
486
+ in the spec for a single request.
487
+ :type _headers: dict, optional
488
+ :param _host_index: set to override the host_index for a single
489
+ request; this effectively ignores the host_index
490
+ in the spec for a single request.
491
+ :type _host_index: int, optional
492
+ :return: Returns the result object.
493
+ """ # noqa: E501
494
+
495
+ _param = self._upload_firmware_serialize(
496
+ file=file,
497
+ password=password,
498
+ _request_auth=_request_auth,
499
+ _content_type=_content_type,
500
+ _headers=_headers,
501
+ _host_index=_host_index
502
+ )
503
+
504
+ _response_types_map: Dict[str, Optional[str]] = {
505
+ '201': "object",
506
+ '422': "BaseResponse",
507
+ }
508
+ response_data = self.api_client.call_api(
509
+ *_param,
510
+ _request_timeout=_request_timeout
511
+ )
512
+ return response_data.response
513
+
514
+
515
+ def _upload_firmware_serialize(
516
+ self,
517
+ file,
518
+ password,
519
+ _request_auth,
520
+ _content_type,
521
+ _headers,
522
+ _host_index,
523
+ ) -> RequestSerialized:
524
+
525
+ _host = None
526
+
527
+ _collection_formats: Dict[str, str] = {
528
+ }
529
+
530
+ _path_params: Dict[str, str] = {}
531
+ _query_params: List[Tuple[str, str]] = []
532
+ _header_params: Dict[str, Optional[str]] = _headers or {}
533
+ _form_params: List[Tuple[str, str]] = []
534
+ _files: Dict[
535
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
536
+ ] = {}
537
+ _body_params: Optional[bytes] = None
538
+
539
+ # process the path parameters
540
+ # process the query parameters
541
+ # process the header parameters
542
+ # process the form parameters
543
+ if file is not None:
544
+ _files['file'] = file
545
+ if password is not None:
546
+ _form_params.append(('password', password))
547
+ # process the body parameter
548
+
549
+
550
+ # set the HTTP header `Accept`
551
+ if 'Accept' not in _header_params:
552
+ _header_params['Accept'] = self.api_client.select_header_accept(
553
+ [
554
+ 'application/json'
555
+ ]
556
+ )
557
+
558
+ # set the HTTP header `Content-Type`
559
+ if _content_type:
560
+ _header_params['Content-Type'] = _content_type
561
+ else:
562
+ _default_content_type = (
563
+ self.api_client.select_header_content_type(
564
+ [
565
+ 'multipart/form-data'
566
+ ]
567
+ )
568
+ )
569
+ if _default_content_type is not None:
570
+ _header_params['Content-Type'] = _default_content_type
571
+
572
+ # authentication setting
573
+ _auth_settings: List[str] = [
574
+ 'APIKey'
575
+ ]
576
+
577
+ return self.api_client.param_serialize(
578
+ method='POST',
579
+ resource_path='/v2/firmware',
580
+ path_params=_path_params,
581
+ query_params=_query_params,
582
+ header_params=_header_params,
583
+ body=_body_params,
584
+ post_params=_form_params,
585
+ files=_files,
586
+ auth_settings=_auth_settings,
587
+ collection_formats=_collection_formats,
588
+ _host=_host,
589
+ _request_auth=_request_auth
590
+ )
591
+
592
+