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,2167 @@
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 Field, StrictBool, StrictInt, StrictStr
19
+ from typing import List, Optional
20
+ from typing_extensions import Annotated
21
+ from revengai.models.app_api_rest_v2_collections_enums_order_by import AppApiRestV2CollectionsEnumsOrderBy
22
+ from revengai.models.base_response_bool import BaseResponseBool
23
+ from revengai.models.base_response_collection_binaries_update_response import BaseResponseCollectionBinariesUpdateResponse
24
+ from revengai.models.base_response_collection_response import BaseResponseCollectionResponse
25
+ from revengai.models.base_response_collection_tags_update_response import BaseResponseCollectionTagsUpdateResponse
26
+ from revengai.models.base_response_list_collection_results import BaseResponseListCollectionResults
27
+ from revengai.models.collection_binaries_update_request import CollectionBinariesUpdateRequest
28
+ from revengai.models.collection_create_request import CollectionCreateRequest
29
+ from revengai.models.collection_tags_update_request import CollectionTagsUpdateRequest
30
+ from revengai.models.collection_update_request import CollectionUpdateRequest
31
+ from revengai.models.filters import Filters
32
+ from revengai.models.order import Order
33
+
34
+ from revengai.api_client import ApiClient, RequestSerialized
35
+ from revengai.api_response import ApiResponse
36
+ from revengai.rest import RESTResponseType
37
+
38
+
39
+ class CollectionsApi:
40
+ """NOTE: This class is auto generated by OpenAPI Generator
41
+ Ref: https://openapi-generator.tech
42
+
43
+ Do not edit the class manually.
44
+ """
45
+
46
+ def __init__(self, api_client=None) -> None:
47
+ if api_client is None:
48
+ api_client = ApiClient.get_default()
49
+ self.api_client = api_client
50
+
51
+
52
+ @validate_call
53
+ def create_collection(
54
+ self,
55
+ collection_create_request: CollectionCreateRequest,
56
+ _request_timeout: Union[
57
+ None,
58
+ Annotated[StrictFloat, Field(gt=0)],
59
+ Tuple[
60
+ Annotated[StrictFloat, Field(gt=0)],
61
+ Annotated[StrictFloat, Field(gt=0)]
62
+ ]
63
+ ] = None,
64
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
65
+ _content_type: Optional[StrictStr] = None,
66
+ _headers: Optional[Dict[StrictStr, Any]] = None,
67
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
68
+ ) -> BaseResponseCollectionResponse:
69
+ """Creates new collection information
70
+
71
+ A collection is a group of binaries that are related in some way. This endpoint creates a new collection and allows you to add tags and binaries to it. If you add tags or binaries to the collection, they will be returned in the response.
72
+
73
+ :param collection_create_request: (required)
74
+ :type collection_create_request: CollectionCreateRequest
75
+ :param _request_timeout: timeout setting for this request. If one
76
+ number provided, it will be total request
77
+ timeout. It can also be a pair (tuple) of
78
+ (connection, read) timeouts.
79
+ :type _request_timeout: int, tuple(int, int), optional
80
+ :param _request_auth: set to override the auth_settings for an a single
81
+ request; this effectively ignores the
82
+ authentication in the spec for a single request.
83
+ :type _request_auth: dict, optional
84
+ :param _content_type: force content-type for the request.
85
+ :type _content_type: str, Optional
86
+ :param _headers: set to override the headers for a single
87
+ request; this effectively ignores the headers
88
+ in the spec for a single request.
89
+ :type _headers: dict, optional
90
+ :param _host_index: set to override the host_index for a single
91
+ request; this effectively ignores the host_index
92
+ in the spec for a single request.
93
+ :type _host_index: int, optional
94
+ :return: Returns the result object.
95
+ """ # noqa: E501
96
+
97
+ _param = self._create_collection_serialize(
98
+ collection_create_request=collection_create_request,
99
+ _request_auth=_request_auth,
100
+ _content_type=_content_type,
101
+ _headers=_headers,
102
+ _host_index=_host_index
103
+ )
104
+
105
+ _response_types_map: Dict[str, Optional[str]] = {
106
+ '200': "BaseResponseCollectionResponse",
107
+ '422': "BaseResponse",
108
+ }
109
+ response_data = self.api_client.call_api(
110
+ *_param,
111
+ _request_timeout=_request_timeout
112
+ )
113
+ response_data.read()
114
+ return self.api_client.response_deserialize(
115
+ response_data=response_data,
116
+ response_types_map=_response_types_map,
117
+ ).data
118
+
119
+
120
+ @validate_call
121
+ def create_collection_with_http_info(
122
+ self,
123
+ collection_create_request: CollectionCreateRequest,
124
+ _request_timeout: Union[
125
+ None,
126
+ Annotated[StrictFloat, Field(gt=0)],
127
+ Tuple[
128
+ Annotated[StrictFloat, Field(gt=0)],
129
+ Annotated[StrictFloat, Field(gt=0)]
130
+ ]
131
+ ] = None,
132
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
133
+ _content_type: Optional[StrictStr] = None,
134
+ _headers: Optional[Dict[StrictStr, Any]] = None,
135
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
136
+ ) -> ApiResponse[BaseResponseCollectionResponse]:
137
+ """Creates new collection information
138
+
139
+ A collection is a group of binaries that are related in some way. This endpoint creates a new collection and allows you to add tags and binaries to it. If you add tags or binaries to the collection, they will be returned in the response.
140
+
141
+ :param collection_create_request: (required)
142
+ :type collection_create_request: CollectionCreateRequest
143
+ :param _request_timeout: timeout setting for this request. If one
144
+ number provided, it will be total request
145
+ timeout. It can also be a pair (tuple) of
146
+ (connection, read) timeouts.
147
+ :type _request_timeout: int, tuple(int, int), optional
148
+ :param _request_auth: set to override the auth_settings for an a single
149
+ request; this effectively ignores the
150
+ authentication in the spec for a single request.
151
+ :type _request_auth: dict, optional
152
+ :param _content_type: force content-type for the request.
153
+ :type _content_type: str, Optional
154
+ :param _headers: set to override the headers for a single
155
+ request; this effectively ignores the headers
156
+ in the spec for a single request.
157
+ :type _headers: dict, optional
158
+ :param _host_index: set to override the host_index for a single
159
+ request; this effectively ignores the host_index
160
+ in the spec for a single request.
161
+ :type _host_index: int, optional
162
+ :return: Returns the result object.
163
+ """ # noqa: E501
164
+
165
+ _param = self._create_collection_serialize(
166
+ collection_create_request=collection_create_request,
167
+ _request_auth=_request_auth,
168
+ _content_type=_content_type,
169
+ _headers=_headers,
170
+ _host_index=_host_index
171
+ )
172
+
173
+ _response_types_map: Dict[str, Optional[str]] = {
174
+ '200': "BaseResponseCollectionResponse",
175
+ '422': "BaseResponse",
176
+ }
177
+ response_data = self.api_client.call_api(
178
+ *_param,
179
+ _request_timeout=_request_timeout
180
+ )
181
+ response_data.read()
182
+ return self.api_client.response_deserialize(
183
+ response_data=response_data,
184
+ response_types_map=_response_types_map,
185
+ )
186
+
187
+
188
+ @validate_call
189
+ def create_collection_without_preload_content(
190
+ self,
191
+ collection_create_request: CollectionCreateRequest,
192
+ _request_timeout: Union[
193
+ None,
194
+ Annotated[StrictFloat, Field(gt=0)],
195
+ Tuple[
196
+ Annotated[StrictFloat, Field(gt=0)],
197
+ Annotated[StrictFloat, Field(gt=0)]
198
+ ]
199
+ ] = None,
200
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
201
+ _content_type: Optional[StrictStr] = None,
202
+ _headers: Optional[Dict[StrictStr, Any]] = None,
203
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
204
+ ) -> RESTResponseType:
205
+ """Creates new collection information
206
+
207
+ A collection is a group of binaries that are related in some way. This endpoint creates a new collection and allows you to add tags and binaries to it. If you add tags or binaries to the collection, they will be returned in the response.
208
+
209
+ :param collection_create_request: (required)
210
+ :type collection_create_request: CollectionCreateRequest
211
+ :param _request_timeout: timeout setting for this request. If one
212
+ number provided, it will be total request
213
+ timeout. It can also be a pair (tuple) of
214
+ (connection, read) timeouts.
215
+ :type _request_timeout: int, tuple(int, int), optional
216
+ :param _request_auth: set to override the auth_settings for an a single
217
+ request; this effectively ignores the
218
+ authentication in the spec for a single request.
219
+ :type _request_auth: dict, optional
220
+ :param _content_type: force content-type for the request.
221
+ :type _content_type: str, Optional
222
+ :param _headers: set to override the headers for a single
223
+ request; this effectively ignores the headers
224
+ in the spec for a single request.
225
+ :type _headers: dict, optional
226
+ :param _host_index: set to override the host_index for a single
227
+ request; this effectively ignores the host_index
228
+ in the spec for a single request.
229
+ :type _host_index: int, optional
230
+ :return: Returns the result object.
231
+ """ # noqa: E501
232
+
233
+ _param = self._create_collection_serialize(
234
+ collection_create_request=collection_create_request,
235
+ _request_auth=_request_auth,
236
+ _content_type=_content_type,
237
+ _headers=_headers,
238
+ _host_index=_host_index
239
+ )
240
+
241
+ _response_types_map: Dict[str, Optional[str]] = {
242
+ '200': "BaseResponseCollectionResponse",
243
+ '422': "BaseResponse",
244
+ }
245
+ response_data = self.api_client.call_api(
246
+ *_param,
247
+ _request_timeout=_request_timeout
248
+ )
249
+ return response_data.response
250
+
251
+
252
+ def _create_collection_serialize(
253
+ self,
254
+ collection_create_request,
255
+ _request_auth,
256
+ _content_type,
257
+ _headers,
258
+ _host_index,
259
+ ) -> RequestSerialized:
260
+
261
+ _host = None
262
+
263
+ _collection_formats: Dict[str, str] = {
264
+ }
265
+
266
+ _path_params: Dict[str, str] = {}
267
+ _query_params: List[Tuple[str, str]] = []
268
+ _header_params: Dict[str, Optional[str]] = _headers or {}
269
+ _form_params: List[Tuple[str, str]] = []
270
+ _files: Dict[
271
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
272
+ ] = {}
273
+ _body_params: Optional[bytes] = None
274
+
275
+ # process the path parameters
276
+ # process the query parameters
277
+ # process the header parameters
278
+ # process the form parameters
279
+ # process the body parameter
280
+ if collection_create_request is not None:
281
+ _body_params = collection_create_request
282
+
283
+
284
+ # set the HTTP header `Accept`
285
+ if 'Accept' not in _header_params:
286
+ _header_params['Accept'] = self.api_client.select_header_accept(
287
+ [
288
+ 'application/json'
289
+ ]
290
+ )
291
+
292
+ # set the HTTP header `Content-Type`
293
+ if _content_type:
294
+ _header_params['Content-Type'] = _content_type
295
+ else:
296
+ _default_content_type = (
297
+ self.api_client.select_header_content_type(
298
+ [
299
+ 'application/json'
300
+ ]
301
+ )
302
+ )
303
+ if _default_content_type is not None:
304
+ _header_params['Content-Type'] = _default_content_type
305
+
306
+ # authentication setting
307
+ _auth_settings: List[str] = [
308
+ 'APIKey'
309
+ ]
310
+
311
+ return self.api_client.param_serialize(
312
+ method='POST',
313
+ resource_path='/v2/collections',
314
+ path_params=_path_params,
315
+ query_params=_query_params,
316
+ header_params=_header_params,
317
+ body=_body_params,
318
+ post_params=_form_params,
319
+ files=_files,
320
+ auth_settings=_auth_settings,
321
+ collection_formats=_collection_formats,
322
+ _host=_host,
323
+ _request_auth=_request_auth
324
+ )
325
+
326
+
327
+
328
+
329
+ @validate_call
330
+ def delete_collection(
331
+ self,
332
+ collection_id: StrictInt,
333
+ _request_timeout: Union[
334
+ None,
335
+ Annotated[StrictFloat, Field(gt=0)],
336
+ Tuple[
337
+ Annotated[StrictFloat, Field(gt=0)],
338
+ Annotated[StrictFloat, Field(gt=0)]
339
+ ]
340
+ ] = None,
341
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
342
+ _content_type: Optional[StrictStr] = None,
343
+ _headers: Optional[Dict[StrictStr, Any]] = None,
344
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
345
+ ) -> BaseResponseBool:
346
+ """Deletes a collection
347
+
348
+ Deletes a collection
349
+
350
+ :param collection_id: (required)
351
+ :type collection_id: int
352
+ :param _request_timeout: timeout setting for this request. If one
353
+ number provided, it will be total request
354
+ timeout. It can also be a pair (tuple) of
355
+ (connection, read) timeouts.
356
+ :type _request_timeout: int, tuple(int, int), optional
357
+ :param _request_auth: set to override the auth_settings for an a single
358
+ request; this effectively ignores the
359
+ authentication in the spec for a single request.
360
+ :type _request_auth: dict, optional
361
+ :param _content_type: force content-type for the request.
362
+ :type _content_type: str, Optional
363
+ :param _headers: set to override the headers for a single
364
+ request; this effectively ignores the headers
365
+ in the spec for a single request.
366
+ :type _headers: dict, optional
367
+ :param _host_index: set to override the host_index for a single
368
+ request; this effectively ignores the host_index
369
+ in the spec for a single request.
370
+ :type _host_index: int, optional
371
+ :return: Returns the result object.
372
+ """ # noqa: E501
373
+
374
+ _param = self._delete_collection_serialize(
375
+ collection_id=collection_id,
376
+ _request_auth=_request_auth,
377
+ _content_type=_content_type,
378
+ _headers=_headers,
379
+ _host_index=_host_index
380
+ )
381
+
382
+ _response_types_map: Dict[str, Optional[str]] = {
383
+ '200': "BaseResponseBool",
384
+ '422': "BaseResponse",
385
+ }
386
+ response_data = self.api_client.call_api(
387
+ *_param,
388
+ _request_timeout=_request_timeout
389
+ )
390
+ response_data.read()
391
+ return self.api_client.response_deserialize(
392
+ response_data=response_data,
393
+ response_types_map=_response_types_map,
394
+ ).data
395
+
396
+
397
+ @validate_call
398
+ def delete_collection_with_http_info(
399
+ self,
400
+ collection_id: StrictInt,
401
+ _request_timeout: Union[
402
+ None,
403
+ Annotated[StrictFloat, Field(gt=0)],
404
+ Tuple[
405
+ Annotated[StrictFloat, Field(gt=0)],
406
+ Annotated[StrictFloat, Field(gt=0)]
407
+ ]
408
+ ] = None,
409
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
410
+ _content_type: Optional[StrictStr] = None,
411
+ _headers: Optional[Dict[StrictStr, Any]] = None,
412
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
413
+ ) -> ApiResponse[BaseResponseBool]:
414
+ """Deletes a collection
415
+
416
+ Deletes a collection
417
+
418
+ :param collection_id: (required)
419
+ :type collection_id: int
420
+ :param _request_timeout: timeout setting for this request. If one
421
+ number provided, it will be total request
422
+ timeout. It can also be a pair (tuple) of
423
+ (connection, read) timeouts.
424
+ :type _request_timeout: int, tuple(int, int), optional
425
+ :param _request_auth: set to override the auth_settings for an a single
426
+ request; this effectively ignores the
427
+ authentication in the spec for a single request.
428
+ :type _request_auth: dict, optional
429
+ :param _content_type: force content-type for the request.
430
+ :type _content_type: str, Optional
431
+ :param _headers: set to override the headers for a single
432
+ request; this effectively ignores the headers
433
+ in the spec for a single request.
434
+ :type _headers: dict, optional
435
+ :param _host_index: set to override the host_index for a single
436
+ request; this effectively ignores the host_index
437
+ in the spec for a single request.
438
+ :type _host_index: int, optional
439
+ :return: Returns the result object.
440
+ """ # noqa: E501
441
+
442
+ _param = self._delete_collection_serialize(
443
+ collection_id=collection_id,
444
+ _request_auth=_request_auth,
445
+ _content_type=_content_type,
446
+ _headers=_headers,
447
+ _host_index=_host_index
448
+ )
449
+
450
+ _response_types_map: Dict[str, Optional[str]] = {
451
+ '200': "BaseResponseBool",
452
+ '422': "BaseResponse",
453
+ }
454
+ response_data = self.api_client.call_api(
455
+ *_param,
456
+ _request_timeout=_request_timeout
457
+ )
458
+ response_data.read()
459
+ return self.api_client.response_deserialize(
460
+ response_data=response_data,
461
+ response_types_map=_response_types_map,
462
+ )
463
+
464
+
465
+ @validate_call
466
+ def delete_collection_without_preload_content(
467
+ self,
468
+ collection_id: StrictInt,
469
+ _request_timeout: Union[
470
+ None,
471
+ Annotated[StrictFloat, Field(gt=0)],
472
+ Tuple[
473
+ Annotated[StrictFloat, Field(gt=0)],
474
+ Annotated[StrictFloat, Field(gt=0)]
475
+ ]
476
+ ] = None,
477
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
478
+ _content_type: Optional[StrictStr] = None,
479
+ _headers: Optional[Dict[StrictStr, Any]] = None,
480
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
481
+ ) -> RESTResponseType:
482
+ """Deletes a collection
483
+
484
+ Deletes a collection
485
+
486
+ :param collection_id: (required)
487
+ :type collection_id: int
488
+ :param _request_timeout: timeout setting for this request. If one
489
+ number provided, it will be total request
490
+ timeout. It can also be a pair (tuple) of
491
+ (connection, read) timeouts.
492
+ :type _request_timeout: int, tuple(int, int), optional
493
+ :param _request_auth: set to override the auth_settings for an a single
494
+ request; this effectively ignores the
495
+ authentication in the spec for a single request.
496
+ :type _request_auth: dict, optional
497
+ :param _content_type: force content-type for the request.
498
+ :type _content_type: str, Optional
499
+ :param _headers: set to override the headers for a single
500
+ request; this effectively ignores the headers
501
+ in the spec for a single request.
502
+ :type _headers: dict, optional
503
+ :param _host_index: set to override the host_index for a single
504
+ request; this effectively ignores the host_index
505
+ in the spec for a single request.
506
+ :type _host_index: int, optional
507
+ :return: Returns the result object.
508
+ """ # noqa: E501
509
+
510
+ _param = self._delete_collection_serialize(
511
+ collection_id=collection_id,
512
+ _request_auth=_request_auth,
513
+ _content_type=_content_type,
514
+ _headers=_headers,
515
+ _host_index=_host_index
516
+ )
517
+
518
+ _response_types_map: Dict[str, Optional[str]] = {
519
+ '200': "BaseResponseBool",
520
+ '422': "BaseResponse",
521
+ }
522
+ response_data = self.api_client.call_api(
523
+ *_param,
524
+ _request_timeout=_request_timeout
525
+ )
526
+ return response_data.response
527
+
528
+
529
+ def _delete_collection_serialize(
530
+ self,
531
+ collection_id,
532
+ _request_auth,
533
+ _content_type,
534
+ _headers,
535
+ _host_index,
536
+ ) -> RequestSerialized:
537
+
538
+ _host = None
539
+
540
+ _collection_formats: Dict[str, str] = {
541
+ }
542
+
543
+ _path_params: Dict[str, str] = {}
544
+ _query_params: List[Tuple[str, str]] = []
545
+ _header_params: Dict[str, Optional[str]] = _headers or {}
546
+ _form_params: List[Tuple[str, str]] = []
547
+ _files: Dict[
548
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
549
+ ] = {}
550
+ _body_params: Optional[bytes] = None
551
+
552
+ # process the path parameters
553
+ if collection_id is not None:
554
+ _path_params['collection_id'] = collection_id
555
+ # process the query parameters
556
+ # process the header parameters
557
+ # process the form parameters
558
+ # process the body parameter
559
+
560
+
561
+ # set the HTTP header `Accept`
562
+ if 'Accept' not in _header_params:
563
+ _header_params['Accept'] = self.api_client.select_header_accept(
564
+ [
565
+ 'application/json'
566
+ ]
567
+ )
568
+
569
+
570
+ # authentication setting
571
+ _auth_settings: List[str] = [
572
+ 'APIKey'
573
+ ]
574
+
575
+ return self.api_client.param_serialize(
576
+ method='DELETE',
577
+ resource_path='/v2/collections/{collection_id}',
578
+ path_params=_path_params,
579
+ query_params=_query_params,
580
+ header_params=_header_params,
581
+ body=_body_params,
582
+ post_params=_form_params,
583
+ files=_files,
584
+ auth_settings=_auth_settings,
585
+ collection_formats=_collection_formats,
586
+ _host=_host,
587
+ _request_auth=_request_auth
588
+ )
589
+
590
+
591
+
592
+
593
+ @validate_call
594
+ def get_collection(
595
+ self,
596
+ collection_id: StrictInt,
597
+ include_tags: Optional[StrictBool] = None,
598
+ include_binaries: Optional[StrictBool] = None,
599
+ page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
600
+ page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None,
601
+ binary_search_str: Optional[StrictStr] = None,
602
+ _request_timeout: Union[
603
+ None,
604
+ Annotated[StrictFloat, Field(gt=0)],
605
+ Tuple[
606
+ Annotated[StrictFloat, Field(gt=0)],
607
+ Annotated[StrictFloat, Field(gt=0)]
608
+ ]
609
+ ] = None,
610
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
611
+ _content_type: Optional[StrictStr] = None,
612
+ _headers: Optional[Dict[StrictStr, Any]] = None,
613
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
614
+ ) -> BaseResponseCollectionResponse:
615
+ """Returns a collection
616
+
617
+ Gets a single collection. The collection can include binaries and tags if requested. You can specify whether to include tags and binaries in the response by using the query string parameters defined.
618
+
619
+ :param collection_id: (required)
620
+ :type collection_id: int
621
+ :param include_tags:
622
+ :type include_tags: bool
623
+ :param include_binaries:
624
+ :type include_binaries: bool
625
+ :param page_size:
626
+ :type page_size: int
627
+ :param page_number:
628
+ :type page_number: int
629
+ :param binary_search_str:
630
+ :type binary_search_str: str
631
+ :param _request_timeout: timeout setting for this request. If one
632
+ number provided, it will be total request
633
+ timeout. It can also be a pair (tuple) of
634
+ (connection, read) timeouts.
635
+ :type _request_timeout: int, tuple(int, int), optional
636
+ :param _request_auth: set to override the auth_settings for an a single
637
+ request; this effectively ignores the
638
+ authentication in the spec for a single request.
639
+ :type _request_auth: dict, optional
640
+ :param _content_type: force content-type for the request.
641
+ :type _content_type: str, Optional
642
+ :param _headers: set to override the headers for a single
643
+ request; this effectively ignores the headers
644
+ in the spec for a single request.
645
+ :type _headers: dict, optional
646
+ :param _host_index: set to override the host_index for a single
647
+ request; this effectively ignores the host_index
648
+ in the spec for a single request.
649
+ :type _host_index: int, optional
650
+ :return: Returns the result object.
651
+ """ # noqa: E501
652
+
653
+ _param = self._get_collection_serialize(
654
+ collection_id=collection_id,
655
+ include_tags=include_tags,
656
+ include_binaries=include_binaries,
657
+ page_size=page_size,
658
+ page_number=page_number,
659
+ binary_search_str=binary_search_str,
660
+ _request_auth=_request_auth,
661
+ _content_type=_content_type,
662
+ _headers=_headers,
663
+ _host_index=_host_index
664
+ )
665
+
666
+ _response_types_map: Dict[str, Optional[str]] = {
667
+ '200': "BaseResponseCollectionResponse",
668
+ '422': "BaseResponse",
669
+ }
670
+ response_data = self.api_client.call_api(
671
+ *_param,
672
+ _request_timeout=_request_timeout
673
+ )
674
+ response_data.read()
675
+ return self.api_client.response_deserialize(
676
+ response_data=response_data,
677
+ response_types_map=_response_types_map,
678
+ ).data
679
+
680
+
681
+ @validate_call
682
+ def get_collection_with_http_info(
683
+ self,
684
+ collection_id: StrictInt,
685
+ include_tags: Optional[StrictBool] = None,
686
+ include_binaries: Optional[StrictBool] = None,
687
+ page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
688
+ page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None,
689
+ binary_search_str: Optional[StrictStr] = None,
690
+ _request_timeout: Union[
691
+ None,
692
+ Annotated[StrictFloat, Field(gt=0)],
693
+ Tuple[
694
+ Annotated[StrictFloat, Field(gt=0)],
695
+ Annotated[StrictFloat, Field(gt=0)]
696
+ ]
697
+ ] = None,
698
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
699
+ _content_type: Optional[StrictStr] = None,
700
+ _headers: Optional[Dict[StrictStr, Any]] = None,
701
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
702
+ ) -> ApiResponse[BaseResponseCollectionResponse]:
703
+ """Returns a collection
704
+
705
+ Gets a single collection. The collection can include binaries and tags if requested. You can specify whether to include tags and binaries in the response by using the query string parameters defined.
706
+
707
+ :param collection_id: (required)
708
+ :type collection_id: int
709
+ :param include_tags:
710
+ :type include_tags: bool
711
+ :param include_binaries:
712
+ :type include_binaries: bool
713
+ :param page_size:
714
+ :type page_size: int
715
+ :param page_number:
716
+ :type page_number: int
717
+ :param binary_search_str:
718
+ :type binary_search_str: str
719
+ :param _request_timeout: timeout setting for this request. If one
720
+ number provided, it will be total request
721
+ timeout. It can also be a pair (tuple) of
722
+ (connection, read) timeouts.
723
+ :type _request_timeout: int, tuple(int, int), optional
724
+ :param _request_auth: set to override the auth_settings for an a single
725
+ request; this effectively ignores the
726
+ authentication in the spec for a single request.
727
+ :type _request_auth: dict, optional
728
+ :param _content_type: force content-type for the request.
729
+ :type _content_type: str, Optional
730
+ :param _headers: set to override the headers for a single
731
+ request; this effectively ignores the headers
732
+ in the spec for a single request.
733
+ :type _headers: dict, optional
734
+ :param _host_index: set to override the host_index for a single
735
+ request; this effectively ignores the host_index
736
+ in the spec for a single request.
737
+ :type _host_index: int, optional
738
+ :return: Returns the result object.
739
+ """ # noqa: E501
740
+
741
+ _param = self._get_collection_serialize(
742
+ collection_id=collection_id,
743
+ include_tags=include_tags,
744
+ include_binaries=include_binaries,
745
+ page_size=page_size,
746
+ page_number=page_number,
747
+ binary_search_str=binary_search_str,
748
+ _request_auth=_request_auth,
749
+ _content_type=_content_type,
750
+ _headers=_headers,
751
+ _host_index=_host_index
752
+ )
753
+
754
+ _response_types_map: Dict[str, Optional[str]] = {
755
+ '200': "BaseResponseCollectionResponse",
756
+ '422': "BaseResponse",
757
+ }
758
+ response_data = self.api_client.call_api(
759
+ *_param,
760
+ _request_timeout=_request_timeout
761
+ )
762
+ response_data.read()
763
+ return self.api_client.response_deserialize(
764
+ response_data=response_data,
765
+ response_types_map=_response_types_map,
766
+ )
767
+
768
+
769
+ @validate_call
770
+ def get_collection_without_preload_content(
771
+ self,
772
+ collection_id: StrictInt,
773
+ include_tags: Optional[StrictBool] = None,
774
+ include_binaries: Optional[StrictBool] = None,
775
+ page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
776
+ page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None,
777
+ binary_search_str: Optional[StrictStr] = None,
778
+ _request_timeout: Union[
779
+ None,
780
+ Annotated[StrictFloat, Field(gt=0)],
781
+ Tuple[
782
+ Annotated[StrictFloat, Field(gt=0)],
783
+ Annotated[StrictFloat, Field(gt=0)]
784
+ ]
785
+ ] = None,
786
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
787
+ _content_type: Optional[StrictStr] = None,
788
+ _headers: Optional[Dict[StrictStr, Any]] = None,
789
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
790
+ ) -> RESTResponseType:
791
+ """Returns a collection
792
+
793
+ Gets a single collection. The collection can include binaries and tags if requested. You can specify whether to include tags and binaries in the response by using the query string parameters defined.
794
+
795
+ :param collection_id: (required)
796
+ :type collection_id: int
797
+ :param include_tags:
798
+ :type include_tags: bool
799
+ :param include_binaries:
800
+ :type include_binaries: bool
801
+ :param page_size:
802
+ :type page_size: int
803
+ :param page_number:
804
+ :type page_number: int
805
+ :param binary_search_str:
806
+ :type binary_search_str: str
807
+ :param _request_timeout: timeout setting for this request. If one
808
+ number provided, it will be total request
809
+ timeout. It can also be a pair (tuple) of
810
+ (connection, read) timeouts.
811
+ :type _request_timeout: int, tuple(int, int), optional
812
+ :param _request_auth: set to override the auth_settings for an a single
813
+ request; this effectively ignores the
814
+ authentication in the spec for a single request.
815
+ :type _request_auth: dict, optional
816
+ :param _content_type: force content-type for the request.
817
+ :type _content_type: str, Optional
818
+ :param _headers: set to override the headers for a single
819
+ request; this effectively ignores the headers
820
+ in the spec for a single request.
821
+ :type _headers: dict, optional
822
+ :param _host_index: set to override the host_index for a single
823
+ request; this effectively ignores the host_index
824
+ in the spec for a single request.
825
+ :type _host_index: int, optional
826
+ :return: Returns the result object.
827
+ """ # noqa: E501
828
+
829
+ _param = self._get_collection_serialize(
830
+ collection_id=collection_id,
831
+ include_tags=include_tags,
832
+ include_binaries=include_binaries,
833
+ page_size=page_size,
834
+ page_number=page_number,
835
+ binary_search_str=binary_search_str,
836
+ _request_auth=_request_auth,
837
+ _content_type=_content_type,
838
+ _headers=_headers,
839
+ _host_index=_host_index
840
+ )
841
+
842
+ _response_types_map: Dict[str, Optional[str]] = {
843
+ '200': "BaseResponseCollectionResponse",
844
+ '422': "BaseResponse",
845
+ }
846
+ response_data = self.api_client.call_api(
847
+ *_param,
848
+ _request_timeout=_request_timeout
849
+ )
850
+ return response_data.response
851
+
852
+
853
+ def _get_collection_serialize(
854
+ self,
855
+ collection_id,
856
+ include_tags,
857
+ include_binaries,
858
+ page_size,
859
+ page_number,
860
+ binary_search_str,
861
+ _request_auth,
862
+ _content_type,
863
+ _headers,
864
+ _host_index,
865
+ ) -> RequestSerialized:
866
+
867
+ _host = None
868
+
869
+ _collection_formats: Dict[str, str] = {
870
+ }
871
+
872
+ _path_params: Dict[str, str] = {}
873
+ _query_params: List[Tuple[str, str]] = []
874
+ _header_params: Dict[str, Optional[str]] = _headers or {}
875
+ _form_params: List[Tuple[str, str]] = []
876
+ _files: Dict[
877
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
878
+ ] = {}
879
+ _body_params: Optional[bytes] = None
880
+
881
+ # process the path parameters
882
+ if collection_id is not None:
883
+ _path_params['collection_id'] = collection_id
884
+ # process the query parameters
885
+ if include_tags is not None:
886
+
887
+ _query_params.append(('include_tags', include_tags))
888
+
889
+ if include_binaries is not None:
890
+
891
+ _query_params.append(('include_binaries', include_binaries))
892
+
893
+ if page_size is not None:
894
+
895
+ _query_params.append(('page_size', page_size))
896
+
897
+ if page_number is not None:
898
+
899
+ _query_params.append(('page_number', page_number))
900
+
901
+ if binary_search_str is not None:
902
+
903
+ _query_params.append(('binary_search_str', binary_search_str))
904
+
905
+ # process the header parameters
906
+ # process the form parameters
907
+ # process the body parameter
908
+
909
+
910
+ # set the HTTP header `Accept`
911
+ if 'Accept' not in _header_params:
912
+ _header_params['Accept'] = self.api_client.select_header_accept(
913
+ [
914
+ 'application/json'
915
+ ]
916
+ )
917
+
918
+
919
+ # authentication setting
920
+ _auth_settings: List[str] = [
921
+ 'APIKey'
922
+ ]
923
+
924
+ return self.api_client.param_serialize(
925
+ method='GET',
926
+ resource_path='/v2/collections/{collection_id}',
927
+ path_params=_path_params,
928
+ query_params=_query_params,
929
+ header_params=_header_params,
930
+ body=_body_params,
931
+ post_params=_form_params,
932
+ files=_files,
933
+ auth_settings=_auth_settings,
934
+ collection_formats=_collection_formats,
935
+ _host=_host,
936
+ _request_auth=_request_auth
937
+ )
938
+
939
+
940
+
941
+
942
+ @validate_call
943
+ def list_collections(
944
+ self,
945
+ search_term: Optional[StrictStr] = None,
946
+ filters: Optional[List[Filters]] = None,
947
+ limit: Optional[Annotated[int, Field(le=50, strict=True, ge=5)]] = None,
948
+ offset: Optional[StrictInt] = None,
949
+ order_by: Optional[AppApiRestV2CollectionsEnumsOrderBy] = None,
950
+ order: Optional[Order] = None,
951
+ _request_timeout: Union[
952
+ None,
953
+ Annotated[StrictFloat, Field(gt=0)],
954
+ Tuple[
955
+ Annotated[StrictFloat, Field(gt=0)],
956
+ Annotated[StrictFloat, Field(gt=0)]
957
+ ]
958
+ ] = None,
959
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
960
+ _content_type: Optional[StrictStr] = None,
961
+ _headers: Optional[Dict[StrictStr, Any]] = None,
962
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
963
+ ) -> BaseResponseListCollectionResults:
964
+ """Gets basic collections information
965
+
966
+ Returns a list of collections
967
+
968
+ :param search_term:
969
+ :type search_term: str
970
+ :param filters:
971
+ :type filters: List[Filters]
972
+ :param limit:
973
+ :type limit: int
974
+ :param offset:
975
+ :type offset: int
976
+ :param order_by:
977
+ :type order_by: AppApiRestV2CollectionsEnumsOrderBy
978
+ :param order:
979
+ :type order: Order
980
+ :param _request_timeout: timeout setting for this request. If one
981
+ number provided, it will be total request
982
+ timeout. It can also be a pair (tuple) of
983
+ (connection, read) timeouts.
984
+ :type _request_timeout: int, tuple(int, int), optional
985
+ :param _request_auth: set to override the auth_settings for an a single
986
+ request; this effectively ignores the
987
+ authentication in the spec for a single request.
988
+ :type _request_auth: dict, optional
989
+ :param _content_type: force content-type for the request.
990
+ :type _content_type: str, Optional
991
+ :param _headers: set to override the headers for a single
992
+ request; this effectively ignores the headers
993
+ in the spec for a single request.
994
+ :type _headers: dict, optional
995
+ :param _host_index: set to override the host_index for a single
996
+ request; this effectively ignores the host_index
997
+ in the spec for a single request.
998
+ :type _host_index: int, optional
999
+ :return: Returns the result object.
1000
+ """ # noqa: E501
1001
+
1002
+ _param = self._list_collections_serialize(
1003
+ search_term=search_term,
1004
+ filters=filters,
1005
+ limit=limit,
1006
+ offset=offset,
1007
+ order_by=order_by,
1008
+ order=order,
1009
+ _request_auth=_request_auth,
1010
+ _content_type=_content_type,
1011
+ _headers=_headers,
1012
+ _host_index=_host_index
1013
+ )
1014
+
1015
+ _response_types_map: Dict[str, Optional[str]] = {
1016
+ '200': "BaseResponseListCollectionResults",
1017
+ '422': "BaseResponse",
1018
+ }
1019
+ response_data = self.api_client.call_api(
1020
+ *_param,
1021
+ _request_timeout=_request_timeout
1022
+ )
1023
+ response_data.read()
1024
+ return self.api_client.response_deserialize(
1025
+ response_data=response_data,
1026
+ response_types_map=_response_types_map,
1027
+ ).data
1028
+
1029
+
1030
+ @validate_call
1031
+ def list_collections_with_http_info(
1032
+ self,
1033
+ search_term: Optional[StrictStr] = None,
1034
+ filters: Optional[List[Filters]] = None,
1035
+ limit: Optional[Annotated[int, Field(le=50, strict=True, ge=5)]] = None,
1036
+ offset: Optional[StrictInt] = None,
1037
+ order_by: Optional[AppApiRestV2CollectionsEnumsOrderBy] = None,
1038
+ order: Optional[Order] = None,
1039
+ _request_timeout: Union[
1040
+ None,
1041
+ Annotated[StrictFloat, Field(gt=0)],
1042
+ Tuple[
1043
+ Annotated[StrictFloat, Field(gt=0)],
1044
+ Annotated[StrictFloat, Field(gt=0)]
1045
+ ]
1046
+ ] = None,
1047
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1048
+ _content_type: Optional[StrictStr] = None,
1049
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1050
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1051
+ ) -> ApiResponse[BaseResponseListCollectionResults]:
1052
+ """Gets basic collections information
1053
+
1054
+ Returns a list of collections
1055
+
1056
+ :param search_term:
1057
+ :type search_term: str
1058
+ :param filters:
1059
+ :type filters: List[Filters]
1060
+ :param limit:
1061
+ :type limit: int
1062
+ :param offset:
1063
+ :type offset: int
1064
+ :param order_by:
1065
+ :type order_by: AppApiRestV2CollectionsEnumsOrderBy
1066
+ :param order:
1067
+ :type order: Order
1068
+ :param _request_timeout: timeout setting for this request. If one
1069
+ number provided, it will be total request
1070
+ timeout. It can also be a pair (tuple) of
1071
+ (connection, read) timeouts.
1072
+ :type _request_timeout: int, tuple(int, int), optional
1073
+ :param _request_auth: set to override the auth_settings for an a single
1074
+ request; this effectively ignores the
1075
+ authentication in the spec for a single request.
1076
+ :type _request_auth: dict, optional
1077
+ :param _content_type: force content-type for the request.
1078
+ :type _content_type: str, Optional
1079
+ :param _headers: set to override the headers for a single
1080
+ request; this effectively ignores the headers
1081
+ in the spec for a single request.
1082
+ :type _headers: dict, optional
1083
+ :param _host_index: set to override the host_index for a single
1084
+ request; this effectively ignores the host_index
1085
+ in the spec for a single request.
1086
+ :type _host_index: int, optional
1087
+ :return: Returns the result object.
1088
+ """ # noqa: E501
1089
+
1090
+ _param = self._list_collections_serialize(
1091
+ search_term=search_term,
1092
+ filters=filters,
1093
+ limit=limit,
1094
+ offset=offset,
1095
+ order_by=order_by,
1096
+ order=order,
1097
+ _request_auth=_request_auth,
1098
+ _content_type=_content_type,
1099
+ _headers=_headers,
1100
+ _host_index=_host_index
1101
+ )
1102
+
1103
+ _response_types_map: Dict[str, Optional[str]] = {
1104
+ '200': "BaseResponseListCollectionResults",
1105
+ '422': "BaseResponse",
1106
+ }
1107
+ response_data = self.api_client.call_api(
1108
+ *_param,
1109
+ _request_timeout=_request_timeout
1110
+ )
1111
+ response_data.read()
1112
+ return self.api_client.response_deserialize(
1113
+ response_data=response_data,
1114
+ response_types_map=_response_types_map,
1115
+ )
1116
+
1117
+
1118
+ @validate_call
1119
+ def list_collections_without_preload_content(
1120
+ self,
1121
+ search_term: Optional[StrictStr] = None,
1122
+ filters: Optional[List[Filters]] = None,
1123
+ limit: Optional[Annotated[int, Field(le=50, strict=True, ge=5)]] = None,
1124
+ offset: Optional[StrictInt] = None,
1125
+ order_by: Optional[AppApiRestV2CollectionsEnumsOrderBy] = None,
1126
+ order: Optional[Order] = None,
1127
+ _request_timeout: Union[
1128
+ None,
1129
+ Annotated[StrictFloat, Field(gt=0)],
1130
+ Tuple[
1131
+ Annotated[StrictFloat, Field(gt=0)],
1132
+ Annotated[StrictFloat, Field(gt=0)]
1133
+ ]
1134
+ ] = None,
1135
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1136
+ _content_type: Optional[StrictStr] = None,
1137
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1138
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1139
+ ) -> RESTResponseType:
1140
+ """Gets basic collections information
1141
+
1142
+ Returns a list of collections
1143
+
1144
+ :param search_term:
1145
+ :type search_term: str
1146
+ :param filters:
1147
+ :type filters: List[Filters]
1148
+ :param limit:
1149
+ :type limit: int
1150
+ :param offset:
1151
+ :type offset: int
1152
+ :param order_by:
1153
+ :type order_by: AppApiRestV2CollectionsEnumsOrderBy
1154
+ :param order:
1155
+ :type order: Order
1156
+ :param _request_timeout: timeout setting for this request. If one
1157
+ number provided, it will be total request
1158
+ timeout. It can also be a pair (tuple) of
1159
+ (connection, read) timeouts.
1160
+ :type _request_timeout: int, tuple(int, int), optional
1161
+ :param _request_auth: set to override the auth_settings for an a single
1162
+ request; this effectively ignores the
1163
+ authentication in the spec for a single request.
1164
+ :type _request_auth: dict, optional
1165
+ :param _content_type: force content-type for the request.
1166
+ :type _content_type: str, Optional
1167
+ :param _headers: set to override the headers for a single
1168
+ request; this effectively ignores the headers
1169
+ in the spec for a single request.
1170
+ :type _headers: dict, optional
1171
+ :param _host_index: set to override the host_index for a single
1172
+ request; this effectively ignores the host_index
1173
+ in the spec for a single request.
1174
+ :type _host_index: int, optional
1175
+ :return: Returns the result object.
1176
+ """ # noqa: E501
1177
+
1178
+ _param = self._list_collections_serialize(
1179
+ search_term=search_term,
1180
+ filters=filters,
1181
+ limit=limit,
1182
+ offset=offset,
1183
+ order_by=order_by,
1184
+ order=order,
1185
+ _request_auth=_request_auth,
1186
+ _content_type=_content_type,
1187
+ _headers=_headers,
1188
+ _host_index=_host_index
1189
+ )
1190
+
1191
+ _response_types_map: Dict[str, Optional[str]] = {
1192
+ '200': "BaseResponseListCollectionResults",
1193
+ '422': "BaseResponse",
1194
+ }
1195
+ response_data = self.api_client.call_api(
1196
+ *_param,
1197
+ _request_timeout=_request_timeout
1198
+ )
1199
+ return response_data.response
1200
+
1201
+
1202
+ def _list_collections_serialize(
1203
+ self,
1204
+ search_term,
1205
+ filters,
1206
+ limit,
1207
+ offset,
1208
+ order_by,
1209
+ order,
1210
+ _request_auth,
1211
+ _content_type,
1212
+ _headers,
1213
+ _host_index,
1214
+ ) -> RequestSerialized:
1215
+
1216
+ _host = None
1217
+
1218
+ _collection_formats: Dict[str, str] = {
1219
+ 'filters': 'multi',
1220
+ }
1221
+
1222
+ _path_params: Dict[str, str] = {}
1223
+ _query_params: List[Tuple[str, str]] = []
1224
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1225
+ _form_params: List[Tuple[str, str]] = []
1226
+ _files: Dict[
1227
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1228
+ ] = {}
1229
+ _body_params: Optional[bytes] = None
1230
+
1231
+ # process the path parameters
1232
+ # process the query parameters
1233
+ if search_term is not None:
1234
+
1235
+ _query_params.append(('search_term', search_term))
1236
+
1237
+ if filters is not None:
1238
+
1239
+ _query_params.append(('filters', filters))
1240
+
1241
+ if limit is not None:
1242
+
1243
+ _query_params.append(('limit', limit))
1244
+
1245
+ if offset is not None:
1246
+
1247
+ _query_params.append(('offset', offset))
1248
+
1249
+ if order_by is not None:
1250
+
1251
+ _query_params.append(('order_by', order_by.value))
1252
+
1253
+ if order is not None:
1254
+
1255
+ _query_params.append(('order', order.value))
1256
+
1257
+ # process the header parameters
1258
+ # process the form parameters
1259
+ # process the body parameter
1260
+
1261
+
1262
+ # set the HTTP header `Accept`
1263
+ if 'Accept' not in _header_params:
1264
+ _header_params['Accept'] = self.api_client.select_header_accept(
1265
+ [
1266
+ 'application/json'
1267
+ ]
1268
+ )
1269
+
1270
+
1271
+ # authentication setting
1272
+ _auth_settings: List[str] = [
1273
+ 'APIKey'
1274
+ ]
1275
+
1276
+ return self.api_client.param_serialize(
1277
+ method='GET',
1278
+ resource_path='/v2/collections',
1279
+ path_params=_path_params,
1280
+ query_params=_query_params,
1281
+ header_params=_header_params,
1282
+ body=_body_params,
1283
+ post_params=_form_params,
1284
+ files=_files,
1285
+ auth_settings=_auth_settings,
1286
+ collection_formats=_collection_formats,
1287
+ _host=_host,
1288
+ _request_auth=_request_auth
1289
+ )
1290
+
1291
+
1292
+
1293
+
1294
+ @validate_call
1295
+ def update_collection(
1296
+ self,
1297
+ collection_id: StrictInt,
1298
+ collection_update_request: CollectionUpdateRequest,
1299
+ _request_timeout: Union[
1300
+ None,
1301
+ Annotated[StrictFloat, Field(gt=0)],
1302
+ Tuple[
1303
+ Annotated[StrictFloat, Field(gt=0)],
1304
+ Annotated[StrictFloat, Field(gt=0)]
1305
+ ]
1306
+ ] = None,
1307
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1308
+ _content_type: Optional[StrictStr] = None,
1309
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1310
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1311
+ ) -> BaseResponseCollectionResponse:
1312
+ """Updates a collection
1313
+
1314
+ Updates a collection, you can update the collection name, description, and scope
1315
+
1316
+ :param collection_id: (required)
1317
+ :type collection_id: int
1318
+ :param collection_update_request: (required)
1319
+ :type collection_update_request: CollectionUpdateRequest
1320
+ :param _request_timeout: timeout setting for this request. If one
1321
+ number provided, it will be total request
1322
+ timeout. It can also be a pair (tuple) of
1323
+ (connection, read) timeouts.
1324
+ :type _request_timeout: int, tuple(int, int), optional
1325
+ :param _request_auth: set to override the auth_settings for an a single
1326
+ request; this effectively ignores the
1327
+ authentication in the spec for a single request.
1328
+ :type _request_auth: dict, optional
1329
+ :param _content_type: force content-type for the request.
1330
+ :type _content_type: str, Optional
1331
+ :param _headers: set to override the headers for a single
1332
+ request; this effectively ignores the headers
1333
+ in the spec for a single request.
1334
+ :type _headers: dict, optional
1335
+ :param _host_index: set to override the host_index for a single
1336
+ request; this effectively ignores the host_index
1337
+ in the spec for a single request.
1338
+ :type _host_index: int, optional
1339
+ :return: Returns the result object.
1340
+ """ # noqa: E501
1341
+
1342
+ _param = self._update_collection_serialize(
1343
+ collection_id=collection_id,
1344
+ collection_update_request=collection_update_request,
1345
+ _request_auth=_request_auth,
1346
+ _content_type=_content_type,
1347
+ _headers=_headers,
1348
+ _host_index=_host_index
1349
+ )
1350
+
1351
+ _response_types_map: Dict[str, Optional[str]] = {
1352
+ '200': "BaseResponseCollectionResponse",
1353
+ '422': "BaseResponse",
1354
+ }
1355
+ response_data = self.api_client.call_api(
1356
+ *_param,
1357
+ _request_timeout=_request_timeout
1358
+ )
1359
+ response_data.read()
1360
+ return self.api_client.response_deserialize(
1361
+ response_data=response_data,
1362
+ response_types_map=_response_types_map,
1363
+ ).data
1364
+
1365
+
1366
+ @validate_call
1367
+ def update_collection_with_http_info(
1368
+ self,
1369
+ collection_id: StrictInt,
1370
+ collection_update_request: CollectionUpdateRequest,
1371
+ _request_timeout: Union[
1372
+ None,
1373
+ Annotated[StrictFloat, Field(gt=0)],
1374
+ Tuple[
1375
+ Annotated[StrictFloat, Field(gt=0)],
1376
+ Annotated[StrictFloat, Field(gt=0)]
1377
+ ]
1378
+ ] = None,
1379
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1380
+ _content_type: Optional[StrictStr] = None,
1381
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1382
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1383
+ ) -> ApiResponse[BaseResponseCollectionResponse]:
1384
+ """Updates a collection
1385
+
1386
+ Updates a collection, you can update the collection name, description, and scope
1387
+
1388
+ :param collection_id: (required)
1389
+ :type collection_id: int
1390
+ :param collection_update_request: (required)
1391
+ :type collection_update_request: CollectionUpdateRequest
1392
+ :param _request_timeout: timeout setting for this request. If one
1393
+ number provided, it will be total request
1394
+ timeout. It can also be a pair (tuple) of
1395
+ (connection, read) timeouts.
1396
+ :type _request_timeout: int, tuple(int, int), optional
1397
+ :param _request_auth: set to override the auth_settings for an a single
1398
+ request; this effectively ignores the
1399
+ authentication in the spec for a single request.
1400
+ :type _request_auth: dict, optional
1401
+ :param _content_type: force content-type for the request.
1402
+ :type _content_type: str, Optional
1403
+ :param _headers: set to override the headers for a single
1404
+ request; this effectively ignores the headers
1405
+ in the spec for a single request.
1406
+ :type _headers: dict, optional
1407
+ :param _host_index: set to override the host_index for a single
1408
+ request; this effectively ignores the host_index
1409
+ in the spec for a single request.
1410
+ :type _host_index: int, optional
1411
+ :return: Returns the result object.
1412
+ """ # noqa: E501
1413
+
1414
+ _param = self._update_collection_serialize(
1415
+ collection_id=collection_id,
1416
+ collection_update_request=collection_update_request,
1417
+ _request_auth=_request_auth,
1418
+ _content_type=_content_type,
1419
+ _headers=_headers,
1420
+ _host_index=_host_index
1421
+ )
1422
+
1423
+ _response_types_map: Dict[str, Optional[str]] = {
1424
+ '200': "BaseResponseCollectionResponse",
1425
+ '422': "BaseResponse",
1426
+ }
1427
+ response_data = self.api_client.call_api(
1428
+ *_param,
1429
+ _request_timeout=_request_timeout
1430
+ )
1431
+ response_data.read()
1432
+ return self.api_client.response_deserialize(
1433
+ response_data=response_data,
1434
+ response_types_map=_response_types_map,
1435
+ )
1436
+
1437
+
1438
+ @validate_call
1439
+ def update_collection_without_preload_content(
1440
+ self,
1441
+ collection_id: StrictInt,
1442
+ collection_update_request: CollectionUpdateRequest,
1443
+ _request_timeout: Union[
1444
+ None,
1445
+ Annotated[StrictFloat, Field(gt=0)],
1446
+ Tuple[
1447
+ Annotated[StrictFloat, Field(gt=0)],
1448
+ Annotated[StrictFloat, Field(gt=0)]
1449
+ ]
1450
+ ] = None,
1451
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1452
+ _content_type: Optional[StrictStr] = None,
1453
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1454
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1455
+ ) -> RESTResponseType:
1456
+ """Updates a collection
1457
+
1458
+ Updates a collection, you can update the collection name, description, and scope
1459
+
1460
+ :param collection_id: (required)
1461
+ :type collection_id: int
1462
+ :param collection_update_request: (required)
1463
+ :type collection_update_request: CollectionUpdateRequest
1464
+ :param _request_timeout: timeout setting for this request. If one
1465
+ number provided, it will be total request
1466
+ timeout. It can also be a pair (tuple) of
1467
+ (connection, read) timeouts.
1468
+ :type _request_timeout: int, tuple(int, int), optional
1469
+ :param _request_auth: set to override the auth_settings for an a single
1470
+ request; this effectively ignores the
1471
+ authentication in the spec for a single request.
1472
+ :type _request_auth: dict, optional
1473
+ :param _content_type: force content-type for the request.
1474
+ :type _content_type: str, Optional
1475
+ :param _headers: set to override the headers for a single
1476
+ request; this effectively ignores the headers
1477
+ in the spec for a single request.
1478
+ :type _headers: dict, optional
1479
+ :param _host_index: set to override the host_index for a single
1480
+ request; this effectively ignores the host_index
1481
+ in the spec for a single request.
1482
+ :type _host_index: int, optional
1483
+ :return: Returns the result object.
1484
+ """ # noqa: E501
1485
+
1486
+ _param = self._update_collection_serialize(
1487
+ collection_id=collection_id,
1488
+ collection_update_request=collection_update_request,
1489
+ _request_auth=_request_auth,
1490
+ _content_type=_content_type,
1491
+ _headers=_headers,
1492
+ _host_index=_host_index
1493
+ )
1494
+
1495
+ _response_types_map: Dict[str, Optional[str]] = {
1496
+ '200': "BaseResponseCollectionResponse",
1497
+ '422': "BaseResponse",
1498
+ }
1499
+ response_data = self.api_client.call_api(
1500
+ *_param,
1501
+ _request_timeout=_request_timeout
1502
+ )
1503
+ return response_data.response
1504
+
1505
+
1506
+ def _update_collection_serialize(
1507
+ self,
1508
+ collection_id,
1509
+ collection_update_request,
1510
+ _request_auth,
1511
+ _content_type,
1512
+ _headers,
1513
+ _host_index,
1514
+ ) -> RequestSerialized:
1515
+
1516
+ _host = None
1517
+
1518
+ _collection_formats: Dict[str, str] = {
1519
+ }
1520
+
1521
+ _path_params: Dict[str, str] = {}
1522
+ _query_params: List[Tuple[str, str]] = []
1523
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1524
+ _form_params: List[Tuple[str, str]] = []
1525
+ _files: Dict[
1526
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1527
+ ] = {}
1528
+ _body_params: Optional[bytes] = None
1529
+
1530
+ # process the path parameters
1531
+ if collection_id is not None:
1532
+ _path_params['collection_id'] = collection_id
1533
+ # process the query parameters
1534
+ # process the header parameters
1535
+ # process the form parameters
1536
+ # process the body parameter
1537
+ if collection_update_request is not None:
1538
+ _body_params = collection_update_request
1539
+
1540
+
1541
+ # set the HTTP header `Accept`
1542
+ if 'Accept' not in _header_params:
1543
+ _header_params['Accept'] = self.api_client.select_header_accept(
1544
+ [
1545
+ 'application/json'
1546
+ ]
1547
+ )
1548
+
1549
+ # set the HTTP header `Content-Type`
1550
+ if _content_type:
1551
+ _header_params['Content-Type'] = _content_type
1552
+ else:
1553
+ _default_content_type = (
1554
+ self.api_client.select_header_content_type(
1555
+ [
1556
+ 'application/json'
1557
+ ]
1558
+ )
1559
+ )
1560
+ if _default_content_type is not None:
1561
+ _header_params['Content-Type'] = _default_content_type
1562
+
1563
+ # authentication setting
1564
+ _auth_settings: List[str] = [
1565
+ 'APIKey'
1566
+ ]
1567
+
1568
+ return self.api_client.param_serialize(
1569
+ method='PATCH',
1570
+ resource_path='/v2/collections/{collection_id}',
1571
+ path_params=_path_params,
1572
+ query_params=_query_params,
1573
+ header_params=_header_params,
1574
+ body=_body_params,
1575
+ post_params=_form_params,
1576
+ files=_files,
1577
+ auth_settings=_auth_settings,
1578
+ collection_formats=_collection_formats,
1579
+ _host=_host,
1580
+ _request_auth=_request_auth
1581
+ )
1582
+
1583
+
1584
+
1585
+
1586
+ @validate_call
1587
+ def update_collection_binaries(
1588
+ self,
1589
+ collection_id: StrictInt,
1590
+ collection_binaries_update_request: CollectionBinariesUpdateRequest,
1591
+ _request_timeout: Union[
1592
+ None,
1593
+ Annotated[StrictFloat, Field(gt=0)],
1594
+ Tuple[
1595
+ Annotated[StrictFloat, Field(gt=0)],
1596
+ Annotated[StrictFloat, Field(gt=0)]
1597
+ ]
1598
+ ] = None,
1599
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1600
+ _content_type: Optional[StrictStr] = None,
1601
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1602
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1603
+ ) -> BaseResponseCollectionBinariesUpdateResponse:
1604
+ """Updates a collection binaries
1605
+
1606
+ Updates/changes a collection binaries to whatever is provided in the request. After this update the collection will only contain the binaries provided in the request.
1607
+
1608
+ :param collection_id: (required)
1609
+ :type collection_id: int
1610
+ :param collection_binaries_update_request: (required)
1611
+ :type collection_binaries_update_request: CollectionBinariesUpdateRequest
1612
+ :param _request_timeout: timeout setting for this request. If one
1613
+ number provided, it will be total request
1614
+ timeout. It can also be a pair (tuple) of
1615
+ (connection, read) timeouts.
1616
+ :type _request_timeout: int, tuple(int, int), optional
1617
+ :param _request_auth: set to override the auth_settings for an a single
1618
+ request; this effectively ignores the
1619
+ authentication in the spec for a single request.
1620
+ :type _request_auth: dict, optional
1621
+ :param _content_type: force content-type for the request.
1622
+ :type _content_type: str, Optional
1623
+ :param _headers: set to override the headers for a single
1624
+ request; this effectively ignores the headers
1625
+ in the spec for a single request.
1626
+ :type _headers: dict, optional
1627
+ :param _host_index: set to override the host_index for a single
1628
+ request; this effectively ignores the host_index
1629
+ in the spec for a single request.
1630
+ :type _host_index: int, optional
1631
+ :return: Returns the result object.
1632
+ """ # noqa: E501
1633
+
1634
+ _param = self._update_collection_binaries_serialize(
1635
+ collection_id=collection_id,
1636
+ collection_binaries_update_request=collection_binaries_update_request,
1637
+ _request_auth=_request_auth,
1638
+ _content_type=_content_type,
1639
+ _headers=_headers,
1640
+ _host_index=_host_index
1641
+ )
1642
+
1643
+ _response_types_map: Dict[str, Optional[str]] = {
1644
+ '200': "BaseResponseCollectionBinariesUpdateResponse",
1645
+ '422': "BaseResponse",
1646
+ }
1647
+ response_data = self.api_client.call_api(
1648
+ *_param,
1649
+ _request_timeout=_request_timeout
1650
+ )
1651
+ response_data.read()
1652
+ return self.api_client.response_deserialize(
1653
+ response_data=response_data,
1654
+ response_types_map=_response_types_map,
1655
+ ).data
1656
+
1657
+
1658
+ @validate_call
1659
+ def update_collection_binaries_with_http_info(
1660
+ self,
1661
+ collection_id: StrictInt,
1662
+ collection_binaries_update_request: CollectionBinariesUpdateRequest,
1663
+ _request_timeout: Union[
1664
+ None,
1665
+ Annotated[StrictFloat, Field(gt=0)],
1666
+ Tuple[
1667
+ Annotated[StrictFloat, Field(gt=0)],
1668
+ Annotated[StrictFloat, Field(gt=0)]
1669
+ ]
1670
+ ] = None,
1671
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1672
+ _content_type: Optional[StrictStr] = None,
1673
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1674
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1675
+ ) -> ApiResponse[BaseResponseCollectionBinariesUpdateResponse]:
1676
+ """Updates a collection binaries
1677
+
1678
+ Updates/changes a collection binaries to whatever is provided in the request. After this update the collection will only contain the binaries provided in the request.
1679
+
1680
+ :param collection_id: (required)
1681
+ :type collection_id: int
1682
+ :param collection_binaries_update_request: (required)
1683
+ :type collection_binaries_update_request: CollectionBinariesUpdateRequest
1684
+ :param _request_timeout: timeout setting for this request. If one
1685
+ number provided, it will be total request
1686
+ timeout. It can also be a pair (tuple) of
1687
+ (connection, read) timeouts.
1688
+ :type _request_timeout: int, tuple(int, int), optional
1689
+ :param _request_auth: set to override the auth_settings for an a single
1690
+ request; this effectively ignores the
1691
+ authentication in the spec for a single request.
1692
+ :type _request_auth: dict, optional
1693
+ :param _content_type: force content-type for the request.
1694
+ :type _content_type: str, Optional
1695
+ :param _headers: set to override the headers for a single
1696
+ request; this effectively ignores the headers
1697
+ in the spec for a single request.
1698
+ :type _headers: dict, optional
1699
+ :param _host_index: set to override the host_index for a single
1700
+ request; this effectively ignores the host_index
1701
+ in the spec for a single request.
1702
+ :type _host_index: int, optional
1703
+ :return: Returns the result object.
1704
+ """ # noqa: E501
1705
+
1706
+ _param = self._update_collection_binaries_serialize(
1707
+ collection_id=collection_id,
1708
+ collection_binaries_update_request=collection_binaries_update_request,
1709
+ _request_auth=_request_auth,
1710
+ _content_type=_content_type,
1711
+ _headers=_headers,
1712
+ _host_index=_host_index
1713
+ )
1714
+
1715
+ _response_types_map: Dict[str, Optional[str]] = {
1716
+ '200': "BaseResponseCollectionBinariesUpdateResponse",
1717
+ '422': "BaseResponse",
1718
+ }
1719
+ response_data = self.api_client.call_api(
1720
+ *_param,
1721
+ _request_timeout=_request_timeout
1722
+ )
1723
+ response_data.read()
1724
+ return self.api_client.response_deserialize(
1725
+ response_data=response_data,
1726
+ response_types_map=_response_types_map,
1727
+ )
1728
+
1729
+
1730
+ @validate_call
1731
+ def update_collection_binaries_without_preload_content(
1732
+ self,
1733
+ collection_id: StrictInt,
1734
+ collection_binaries_update_request: CollectionBinariesUpdateRequest,
1735
+ _request_timeout: Union[
1736
+ None,
1737
+ Annotated[StrictFloat, Field(gt=0)],
1738
+ Tuple[
1739
+ Annotated[StrictFloat, Field(gt=0)],
1740
+ Annotated[StrictFloat, Field(gt=0)]
1741
+ ]
1742
+ ] = None,
1743
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1744
+ _content_type: Optional[StrictStr] = None,
1745
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1746
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1747
+ ) -> RESTResponseType:
1748
+ """Updates a collection binaries
1749
+
1750
+ Updates/changes a collection binaries to whatever is provided in the request. After this update the collection will only contain the binaries provided in the request.
1751
+
1752
+ :param collection_id: (required)
1753
+ :type collection_id: int
1754
+ :param collection_binaries_update_request: (required)
1755
+ :type collection_binaries_update_request: CollectionBinariesUpdateRequest
1756
+ :param _request_timeout: timeout setting for this request. If one
1757
+ number provided, it will be total request
1758
+ timeout. It can also be a pair (tuple) of
1759
+ (connection, read) timeouts.
1760
+ :type _request_timeout: int, tuple(int, int), optional
1761
+ :param _request_auth: set to override the auth_settings for an a single
1762
+ request; this effectively ignores the
1763
+ authentication in the spec for a single request.
1764
+ :type _request_auth: dict, optional
1765
+ :param _content_type: force content-type for the request.
1766
+ :type _content_type: str, Optional
1767
+ :param _headers: set to override the headers for a single
1768
+ request; this effectively ignores the headers
1769
+ in the spec for a single request.
1770
+ :type _headers: dict, optional
1771
+ :param _host_index: set to override the host_index for a single
1772
+ request; this effectively ignores the host_index
1773
+ in the spec for a single request.
1774
+ :type _host_index: int, optional
1775
+ :return: Returns the result object.
1776
+ """ # noqa: E501
1777
+
1778
+ _param = self._update_collection_binaries_serialize(
1779
+ collection_id=collection_id,
1780
+ collection_binaries_update_request=collection_binaries_update_request,
1781
+ _request_auth=_request_auth,
1782
+ _content_type=_content_type,
1783
+ _headers=_headers,
1784
+ _host_index=_host_index
1785
+ )
1786
+
1787
+ _response_types_map: Dict[str, Optional[str]] = {
1788
+ '200': "BaseResponseCollectionBinariesUpdateResponse",
1789
+ '422': "BaseResponse",
1790
+ }
1791
+ response_data = self.api_client.call_api(
1792
+ *_param,
1793
+ _request_timeout=_request_timeout
1794
+ )
1795
+ return response_data.response
1796
+
1797
+
1798
+ def _update_collection_binaries_serialize(
1799
+ self,
1800
+ collection_id,
1801
+ collection_binaries_update_request,
1802
+ _request_auth,
1803
+ _content_type,
1804
+ _headers,
1805
+ _host_index,
1806
+ ) -> RequestSerialized:
1807
+
1808
+ _host = None
1809
+
1810
+ _collection_formats: Dict[str, str] = {
1811
+ }
1812
+
1813
+ _path_params: Dict[str, str] = {}
1814
+ _query_params: List[Tuple[str, str]] = []
1815
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1816
+ _form_params: List[Tuple[str, str]] = []
1817
+ _files: Dict[
1818
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1819
+ ] = {}
1820
+ _body_params: Optional[bytes] = None
1821
+
1822
+ # process the path parameters
1823
+ if collection_id is not None:
1824
+ _path_params['collection_id'] = collection_id
1825
+ # process the query parameters
1826
+ # process the header parameters
1827
+ # process the form parameters
1828
+ # process the body parameter
1829
+ if collection_binaries_update_request is not None:
1830
+ _body_params = collection_binaries_update_request
1831
+
1832
+
1833
+ # set the HTTP header `Accept`
1834
+ if 'Accept' not in _header_params:
1835
+ _header_params['Accept'] = self.api_client.select_header_accept(
1836
+ [
1837
+ 'application/json'
1838
+ ]
1839
+ )
1840
+
1841
+ # set the HTTP header `Content-Type`
1842
+ if _content_type:
1843
+ _header_params['Content-Type'] = _content_type
1844
+ else:
1845
+ _default_content_type = (
1846
+ self.api_client.select_header_content_type(
1847
+ [
1848
+ 'application/json'
1849
+ ]
1850
+ )
1851
+ )
1852
+ if _default_content_type is not None:
1853
+ _header_params['Content-Type'] = _default_content_type
1854
+
1855
+ # authentication setting
1856
+ _auth_settings: List[str] = [
1857
+ 'APIKey'
1858
+ ]
1859
+
1860
+ return self.api_client.param_serialize(
1861
+ method='PATCH',
1862
+ resource_path='/v2/collections/{collection_id}/binaries',
1863
+ path_params=_path_params,
1864
+ query_params=_query_params,
1865
+ header_params=_header_params,
1866
+ body=_body_params,
1867
+ post_params=_form_params,
1868
+ files=_files,
1869
+ auth_settings=_auth_settings,
1870
+ collection_formats=_collection_formats,
1871
+ _host=_host,
1872
+ _request_auth=_request_auth
1873
+ )
1874
+
1875
+
1876
+
1877
+
1878
+ @validate_call
1879
+ def update_collection_tags(
1880
+ self,
1881
+ collection_id: StrictInt,
1882
+ collection_tags_update_request: CollectionTagsUpdateRequest,
1883
+ _request_timeout: Union[
1884
+ None,
1885
+ Annotated[StrictFloat, Field(gt=0)],
1886
+ Tuple[
1887
+ Annotated[StrictFloat, Field(gt=0)],
1888
+ Annotated[StrictFloat, Field(gt=0)]
1889
+ ]
1890
+ ] = None,
1891
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1892
+ _content_type: Optional[StrictStr] = None,
1893
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1894
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1895
+ ) -> BaseResponseCollectionTagsUpdateResponse:
1896
+ """Updates a collection tags
1897
+
1898
+ Updates/changes a collection tags to whatever is provided in the request. After this update the collection will only contain the tags provided in the request.
1899
+
1900
+ :param collection_id: (required)
1901
+ :type collection_id: int
1902
+ :param collection_tags_update_request: (required)
1903
+ :type collection_tags_update_request: CollectionTagsUpdateRequest
1904
+ :param _request_timeout: timeout setting for this request. If one
1905
+ number provided, it will be total request
1906
+ timeout. It can also be a pair (tuple) of
1907
+ (connection, read) timeouts.
1908
+ :type _request_timeout: int, tuple(int, int), optional
1909
+ :param _request_auth: set to override the auth_settings for an a single
1910
+ request; this effectively ignores the
1911
+ authentication in the spec for a single request.
1912
+ :type _request_auth: dict, optional
1913
+ :param _content_type: force content-type for the request.
1914
+ :type _content_type: str, Optional
1915
+ :param _headers: set to override the headers for a single
1916
+ request; this effectively ignores the headers
1917
+ in the spec for a single request.
1918
+ :type _headers: dict, optional
1919
+ :param _host_index: set to override the host_index for a single
1920
+ request; this effectively ignores the host_index
1921
+ in the spec for a single request.
1922
+ :type _host_index: int, optional
1923
+ :return: Returns the result object.
1924
+ """ # noqa: E501
1925
+
1926
+ _param = self._update_collection_tags_serialize(
1927
+ collection_id=collection_id,
1928
+ collection_tags_update_request=collection_tags_update_request,
1929
+ _request_auth=_request_auth,
1930
+ _content_type=_content_type,
1931
+ _headers=_headers,
1932
+ _host_index=_host_index
1933
+ )
1934
+
1935
+ _response_types_map: Dict[str, Optional[str]] = {
1936
+ '200': "BaseResponseCollectionTagsUpdateResponse",
1937
+ '422': "BaseResponse",
1938
+ }
1939
+ response_data = self.api_client.call_api(
1940
+ *_param,
1941
+ _request_timeout=_request_timeout
1942
+ )
1943
+ response_data.read()
1944
+ return self.api_client.response_deserialize(
1945
+ response_data=response_data,
1946
+ response_types_map=_response_types_map,
1947
+ ).data
1948
+
1949
+
1950
+ @validate_call
1951
+ def update_collection_tags_with_http_info(
1952
+ self,
1953
+ collection_id: StrictInt,
1954
+ collection_tags_update_request: CollectionTagsUpdateRequest,
1955
+ _request_timeout: Union[
1956
+ None,
1957
+ Annotated[StrictFloat, Field(gt=0)],
1958
+ Tuple[
1959
+ Annotated[StrictFloat, Field(gt=0)],
1960
+ Annotated[StrictFloat, Field(gt=0)]
1961
+ ]
1962
+ ] = None,
1963
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1964
+ _content_type: Optional[StrictStr] = None,
1965
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1966
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1967
+ ) -> ApiResponse[BaseResponseCollectionTagsUpdateResponse]:
1968
+ """Updates a collection tags
1969
+
1970
+ Updates/changes a collection tags to whatever is provided in the request. After this update the collection will only contain the tags provided in the request.
1971
+
1972
+ :param collection_id: (required)
1973
+ :type collection_id: int
1974
+ :param collection_tags_update_request: (required)
1975
+ :type collection_tags_update_request: CollectionTagsUpdateRequest
1976
+ :param _request_timeout: timeout setting for this request. If one
1977
+ number provided, it will be total request
1978
+ timeout. It can also be a pair (tuple) of
1979
+ (connection, read) timeouts.
1980
+ :type _request_timeout: int, tuple(int, int), optional
1981
+ :param _request_auth: set to override the auth_settings for an a single
1982
+ request; this effectively ignores the
1983
+ authentication in the spec for a single request.
1984
+ :type _request_auth: dict, optional
1985
+ :param _content_type: force content-type for the request.
1986
+ :type _content_type: str, Optional
1987
+ :param _headers: set to override the headers for a single
1988
+ request; this effectively ignores the headers
1989
+ in the spec for a single request.
1990
+ :type _headers: dict, optional
1991
+ :param _host_index: set to override the host_index for a single
1992
+ request; this effectively ignores the host_index
1993
+ in the spec for a single request.
1994
+ :type _host_index: int, optional
1995
+ :return: Returns the result object.
1996
+ """ # noqa: E501
1997
+
1998
+ _param = self._update_collection_tags_serialize(
1999
+ collection_id=collection_id,
2000
+ collection_tags_update_request=collection_tags_update_request,
2001
+ _request_auth=_request_auth,
2002
+ _content_type=_content_type,
2003
+ _headers=_headers,
2004
+ _host_index=_host_index
2005
+ )
2006
+
2007
+ _response_types_map: Dict[str, Optional[str]] = {
2008
+ '200': "BaseResponseCollectionTagsUpdateResponse",
2009
+ '422': "BaseResponse",
2010
+ }
2011
+ response_data = self.api_client.call_api(
2012
+ *_param,
2013
+ _request_timeout=_request_timeout
2014
+ )
2015
+ response_data.read()
2016
+ return self.api_client.response_deserialize(
2017
+ response_data=response_data,
2018
+ response_types_map=_response_types_map,
2019
+ )
2020
+
2021
+
2022
+ @validate_call
2023
+ def update_collection_tags_without_preload_content(
2024
+ self,
2025
+ collection_id: StrictInt,
2026
+ collection_tags_update_request: CollectionTagsUpdateRequest,
2027
+ _request_timeout: Union[
2028
+ None,
2029
+ Annotated[StrictFloat, Field(gt=0)],
2030
+ Tuple[
2031
+ Annotated[StrictFloat, Field(gt=0)],
2032
+ Annotated[StrictFloat, Field(gt=0)]
2033
+ ]
2034
+ ] = None,
2035
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2036
+ _content_type: Optional[StrictStr] = None,
2037
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2038
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2039
+ ) -> RESTResponseType:
2040
+ """Updates a collection tags
2041
+
2042
+ Updates/changes a collection tags to whatever is provided in the request. After this update the collection will only contain the tags provided in the request.
2043
+
2044
+ :param collection_id: (required)
2045
+ :type collection_id: int
2046
+ :param collection_tags_update_request: (required)
2047
+ :type collection_tags_update_request: CollectionTagsUpdateRequest
2048
+ :param _request_timeout: timeout setting for this request. If one
2049
+ number provided, it will be total request
2050
+ timeout. It can also be a pair (tuple) of
2051
+ (connection, read) timeouts.
2052
+ :type _request_timeout: int, tuple(int, int), optional
2053
+ :param _request_auth: set to override the auth_settings for an a single
2054
+ request; this effectively ignores the
2055
+ authentication in the spec for a single request.
2056
+ :type _request_auth: dict, optional
2057
+ :param _content_type: force content-type for the request.
2058
+ :type _content_type: str, Optional
2059
+ :param _headers: set to override the headers for a single
2060
+ request; this effectively ignores the headers
2061
+ in the spec for a single request.
2062
+ :type _headers: dict, optional
2063
+ :param _host_index: set to override the host_index for a single
2064
+ request; this effectively ignores the host_index
2065
+ in the spec for a single request.
2066
+ :type _host_index: int, optional
2067
+ :return: Returns the result object.
2068
+ """ # noqa: E501
2069
+
2070
+ _param = self._update_collection_tags_serialize(
2071
+ collection_id=collection_id,
2072
+ collection_tags_update_request=collection_tags_update_request,
2073
+ _request_auth=_request_auth,
2074
+ _content_type=_content_type,
2075
+ _headers=_headers,
2076
+ _host_index=_host_index
2077
+ )
2078
+
2079
+ _response_types_map: Dict[str, Optional[str]] = {
2080
+ '200': "BaseResponseCollectionTagsUpdateResponse",
2081
+ '422': "BaseResponse",
2082
+ }
2083
+ response_data = self.api_client.call_api(
2084
+ *_param,
2085
+ _request_timeout=_request_timeout
2086
+ )
2087
+ return response_data.response
2088
+
2089
+
2090
+ def _update_collection_tags_serialize(
2091
+ self,
2092
+ collection_id,
2093
+ collection_tags_update_request,
2094
+ _request_auth,
2095
+ _content_type,
2096
+ _headers,
2097
+ _host_index,
2098
+ ) -> RequestSerialized:
2099
+
2100
+ _host = None
2101
+
2102
+ _collection_formats: Dict[str, str] = {
2103
+ }
2104
+
2105
+ _path_params: Dict[str, str] = {}
2106
+ _query_params: List[Tuple[str, str]] = []
2107
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2108
+ _form_params: List[Tuple[str, str]] = []
2109
+ _files: Dict[
2110
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2111
+ ] = {}
2112
+ _body_params: Optional[bytes] = None
2113
+
2114
+ # process the path parameters
2115
+ if collection_id is not None:
2116
+ _path_params['collection_id'] = collection_id
2117
+ # process the query parameters
2118
+ # process the header parameters
2119
+ # process the form parameters
2120
+ # process the body parameter
2121
+ if collection_tags_update_request is not None:
2122
+ _body_params = collection_tags_update_request
2123
+
2124
+
2125
+ # set the HTTP header `Accept`
2126
+ if 'Accept' not in _header_params:
2127
+ _header_params['Accept'] = self.api_client.select_header_accept(
2128
+ [
2129
+ 'application/json'
2130
+ ]
2131
+ )
2132
+
2133
+ # set the HTTP header `Content-Type`
2134
+ if _content_type:
2135
+ _header_params['Content-Type'] = _content_type
2136
+ else:
2137
+ _default_content_type = (
2138
+ self.api_client.select_header_content_type(
2139
+ [
2140
+ 'application/json'
2141
+ ]
2142
+ )
2143
+ )
2144
+ if _default_content_type is not None:
2145
+ _header_params['Content-Type'] = _default_content_type
2146
+
2147
+ # authentication setting
2148
+ _auth_settings: List[str] = [
2149
+ 'APIKey'
2150
+ ]
2151
+
2152
+ return self.api_client.param_serialize(
2153
+ method='PATCH',
2154
+ resource_path='/v2/collections/{collection_id}/tags',
2155
+ path_params=_path_params,
2156
+ query_params=_query_params,
2157
+ header_params=_header_params,
2158
+ body=_body_params,
2159
+ post_params=_form_params,
2160
+ files=_files,
2161
+ auth_settings=_auth_settings,
2162
+ collection_formats=_collection_formats,
2163
+ _host=_host,
2164
+ _request_auth=_request_auth
2165
+ )
2166
+
2167
+