hyperstack 1.25.0a0__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 (401) hide show
  1. hyperstack/__init__.py +420 -0
  2. hyperstack/api/__init__.py +48 -0
  3. hyperstack/api/alive_api.py +270 -0
  4. hyperstack/api/api_key_api.py +1161 -0
  5. hyperstack/api/assigning_member_role_api.py +615 -0
  6. hyperstack/api/auth_api.py +292 -0
  7. hyperstack/api/billing_api.py +5946 -0
  8. hyperstack/api/calculate_api.py +326 -0
  9. hyperstack/api/callbacks_api.py +1795 -0
  10. hyperstack/api/cluster_events_api.py +308 -0
  11. hyperstack/api/clusters_api.py +1651 -0
  12. hyperstack/api/compliance_api.py +1169 -0
  13. hyperstack/api/credit_api.py +295 -0
  14. hyperstack/api/customer_contract_api.py +922 -0
  15. hyperstack/api/dashboard_api.py +292 -0
  16. hyperstack/api/deployment_api.py +1122 -0
  17. hyperstack/api/environment_api.py +1490 -0
  18. hyperstack/api/firewall_attachment_api.py +343 -0
  19. hyperstack/api/firewalls_api.py +1819 -0
  20. hyperstack/api/flavor_api.py +315 -0
  21. hyperstack/api/floating_ip_api.py +585 -0
  22. hyperstack/api/gpu_api.py +292 -0
  23. hyperstack/api/image_api.py +1228 -0
  24. hyperstack/api/invite_api.py +857 -0
  25. hyperstack/api/keypair_api.py +1217 -0
  26. hyperstack/api/organization_api.py +864 -0
  27. hyperstack/api/payment_api.py +584 -0
  28. hyperstack/api/permission_api.py +292 -0
  29. hyperstack/api/policy_api.py +292 -0
  30. hyperstack/api/pricebook_api.py +293 -0
  31. hyperstack/api/profile_api.py +1131 -0
  32. hyperstack/api/rbac_role_api.py +1434 -0
  33. hyperstack/api/region_api.py +292 -0
  34. hyperstack/api/security_rules_api.py +292 -0
  35. hyperstack/api/snapshot_events_api.py +291 -0
  36. hyperstack/api/snapshots_api.py +1779 -0
  37. hyperstack/api/stock_api.py +292 -0
  38. hyperstack/api/template_api.py +1497 -0
  39. hyperstack/api/user_api.py +871 -0
  40. hyperstack/api/user_detail_choice_api.py +295 -0
  41. hyperstack/api/user_permission_api.py +567 -0
  42. hyperstack/api/virtual_machine_api.py +5289 -0
  43. hyperstack/api/virtual_machine_events_api.py +311 -0
  44. hyperstack/api/vnc_url_api.py +595 -0
  45. hyperstack/api/volume_api.py +1742 -0
  46. hyperstack/api/volume_attachment_api.py +650 -0
  47. hyperstack/api_client.py +797 -0
  48. hyperstack/api_response.py +21 -0
  49. hyperstack/configuration.py +605 -0
  50. hyperstack/exceptions.py +199 -0
  51. hyperstack/models/__init__.py +360 -0
  52. hyperstack/models/add_update_flavor_organization_payload.py +111 -0
  53. hyperstack/models/add_user_info_success_response_model.py +95 -0
  54. hyperstack/models/allocated_gpu_count_graph.py +89 -0
  55. hyperstack/models/api_key_fields.py +96 -0
  56. hyperstack/models/api_key_verify_fields.py +93 -0
  57. hyperstack/models/assign_rbac_role_payload.py +87 -0
  58. hyperstack/models/attach_callback_payload.py +87 -0
  59. hyperstack/models/attach_callback_response.py +91 -0
  60. hyperstack/models/attach_firewall_with_vm.py +87 -0
  61. hyperstack/models/attach_firewalls_to_vm_payload.py +87 -0
  62. hyperstack/models/attach_volume_fields.py +96 -0
  63. hyperstack/models/attach_volumes.py +99 -0
  64. hyperstack/models/attach_volumes_payload.py +87 -0
  65. hyperstack/models/auth_get_token_response_model.py +97 -0
  66. hyperstack/models/auth_request_login_fields.py +89 -0
  67. hyperstack/models/auth_request_login_response_model.py +95 -0
  68. hyperstack/models/auth_user_fields.py +94 -0
  69. hyperstack/models/auth_user_info_response_model.py +95 -0
  70. hyperstack/models/billing_immune_resources_response.py +95 -0
  71. hyperstack/models/billing_response.py +100 -0
  72. hyperstack/models/billingmetricesfields.py +108 -0
  73. hyperstack/models/billingmetricesresponse.py +99 -0
  74. hyperstack/models/cluster_events.py +99 -0
  75. hyperstack/models/cluster_events_fields.py +104 -0
  76. hyperstack/models/cluster_fields.py +114 -0
  77. hyperstack/models/cluster_list_response.py +99 -0
  78. hyperstack/models/cluster_response.py +95 -0
  79. hyperstack/models/cluster_versions.py +91 -0
  80. hyperstack/models/common_response_model.py +89 -0
  81. hyperstack/models/compliance_fields.py +93 -0
  82. hyperstack/models/compliance_model_fields.py +99 -0
  83. hyperstack/models/compliance_payload.py +97 -0
  84. hyperstack/models/compliance_response.py +95 -0
  85. hyperstack/models/container_overview_fields.py +95 -0
  86. hyperstack/models/contract.py +105 -0
  87. hyperstack/models/contract_billing_history.py +97 -0
  88. hyperstack/models/contract_billing_history_response_attributes.py +99 -0
  89. hyperstack/models/contract_billing_history_response_model.py +95 -0
  90. hyperstack/models/contract_change_payload.py +101 -0
  91. hyperstack/models/contract_discount_plan_fields.py +103 -0
  92. hyperstack/models/contract_eligible_instance_fields.py +99 -0
  93. hyperstack/models/contract_eligible_instances_response.py +101 -0
  94. hyperstack/models/contract_event_create_model.py +91 -0
  95. hyperstack/models/contract_gpu_allocation_graph_response.py +95 -0
  96. hyperstack/models/contract_instance_fields.py +102 -0
  97. hyperstack/models/contract_instances_response.py +99 -0
  98. hyperstack/models/contract_resource_payload.py +95 -0
  99. hyperstack/models/contractl_billing_history_response_metrics.py +87 -0
  100. hyperstack/models/create_cluster_payload.py +101 -0
  101. hyperstack/models/create_contract_fields.py +110 -0
  102. hyperstack/models/create_contract_payload.py +106 -0
  103. hyperstack/models/create_discount_response.py +95 -0
  104. hyperstack/models/create_discounts_payload.py +112 -0
  105. hyperstack/models/create_environment.py +90 -0
  106. hyperstack/models/create_firewall_payload.py +91 -0
  107. hyperstack/models/create_firewall_rule_payload.py +104 -0
  108. hyperstack/models/create_gpu.py +91 -0
  109. hyperstack/models/create_image.py +91 -0
  110. hyperstack/models/create_image_payload.py +89 -0
  111. hyperstack/models/create_instances_payload.py +134 -0
  112. hyperstack/models/create_instances_response.py +99 -0
  113. hyperstack/models/create_profile_payload.py +92 -0
  114. hyperstack/models/create_profile_response.py +95 -0
  115. hyperstack/models/create_security_rule_payload.py +104 -0
  116. hyperstack/models/create_snapshot_payload.py +93 -0
  117. hyperstack/models/create_snapshot_response.py +95 -0
  118. hyperstack/models/create_update_compliance_response.py +95 -0
  119. hyperstack/models/create_update_permission_payload.py +93 -0
  120. hyperstack/models/create_update_permission_response_model.py +95 -0
  121. hyperstack/models/create_update_policy_payload.py +93 -0
  122. hyperstack/models/create_update_policy_response_model.py +95 -0
  123. hyperstack/models/create_update_rbac_role_payload.py +94 -0
  124. hyperstack/models/create_volume_payload.py +100 -0
  125. hyperstack/models/creditrechargelimitfield.py +93 -0
  126. hyperstack/models/creditrechargelimitresponse.py +99 -0
  127. hyperstack/models/creditrequestresponse.py +99 -0
  128. hyperstack/models/creditrequests.py +96 -0
  129. hyperstack/models/customer_contract_detail_response_model.py +95 -0
  130. hyperstack/models/customer_contract_fields.py +112 -0
  131. hyperstack/models/customer_fields.py +89 -0
  132. hyperstack/models/customer_payload.py +89 -0
  133. hyperstack/models/dashboard_info_response.py +95 -0
  134. hyperstack/models/data.py +91 -0
  135. hyperstack/models/deployment_fields.py +98 -0
  136. hyperstack/models/deployment_fieldsforstartdeployments.py +100 -0
  137. hyperstack/models/deployments.py +99 -0
  138. hyperstack/models/detach_volumes.py +99 -0
  139. hyperstack/models/detach_volumes_payload.py +87 -0
  140. hyperstack/models/discount_entity_model.py +97 -0
  141. hyperstack/models/discount_fields.py +100 -0
  142. hyperstack/models/discount_plan_fields.py +108 -0
  143. hyperstack/models/discount_resource_fields.py +93 -0
  144. hyperstack/models/discount_resource_payload.py +93 -0
  145. hyperstack/models/editlabelofanexisting_vm_payload.py +87 -0
  146. hyperstack/models/environment.py +95 -0
  147. hyperstack/models/environment_features.py +87 -0
  148. hyperstack/models/environment_fields.py +100 -0
  149. hyperstack/models/environment_fieldsfor_volume.py +87 -0
  150. hyperstack/models/environments.py +105 -0
  151. hyperstack/models/error_response_model.py +91 -0
  152. hyperstack/models/exclude_billing_post_payload.py +91 -0
  153. hyperstack/models/exclude_billing_post_response.py +91 -0
  154. hyperstack/models/export_billing_data_request.py +105 -0
  155. hyperstack/models/export_billing_data_response.py +89 -0
  156. hyperstack/models/field_change.py +91 -0
  157. hyperstack/models/firewall_attachment_model.py +98 -0
  158. hyperstack/models/firewall_attachment_vm_model.py +98 -0
  159. hyperstack/models/firewall_detail_fields.py +122 -0
  160. hyperstack/models/firewall_detail_response.py +95 -0
  161. hyperstack/models/firewall_environment_fields.py +91 -0
  162. hyperstack/models/firewall_fields.py +102 -0
  163. hyperstack/models/firewall_response.py +95 -0
  164. hyperstack/models/firewall_rule.py +95 -0
  165. hyperstack/models/firewalls_list_response.py +105 -0
  166. hyperstack/models/flavor_fields.py +120 -0
  167. hyperstack/models/flavor_item_get_response.py +99 -0
  168. hyperstack/models/flavor_list_response.py +99 -0
  169. hyperstack/models/flavor_object_fields.py +95 -0
  170. hyperstack/models/flavor_payload.py +101 -0
  171. hyperstack/models/flavor_response.py +95 -0
  172. hyperstack/models/flavor_vm_fields.py +100 -0
  173. hyperstack/models/flavor_vms_response.py +99 -0
  174. hyperstack/models/future_node_model.py +106 -0
  175. hyperstack/models/future_node_response_model.py +97 -0
  176. hyperstack/models/future_node_stock_model.py +93 -0
  177. hyperstack/models/future_node_update_model.py +98 -0
  178. hyperstack/models/future_nodes_stock_model.py +95 -0
  179. hyperstack/models/generate_update_api_key_payload.py +89 -0
  180. hyperstack/models/generate_update_api_key_response_model.py +95 -0
  181. hyperstack/models/get_all_contract_fields.py +100 -0
  182. hyperstack/models/get_all_contracts_response_model.py +99 -0
  183. hyperstack/models/get_all_discount_for_all_organization_response.py +99 -0
  184. hyperstack/models/get_all_discounts_fields.py +106 -0
  185. hyperstack/models/get_api_keys_response_model.py +99 -0
  186. hyperstack/models/get_customer_contracts_list_response_model.py +101 -0
  187. hyperstack/models/get_discount_detail_response.py +95 -0
  188. hyperstack/models/get_discount_response.py +99 -0
  189. hyperstack/models/get_entity_discount_detail_response.py +108 -0
  190. hyperstack/models/get_invites_response_model.py +99 -0
  191. hyperstack/models/get_organization_response_model.py +95 -0
  192. hyperstack/models/get_permissions_response_model.py +99 -0
  193. hyperstack/models/get_policies_response_model.py +99 -0
  194. hyperstack/models/get_rbac_roles_response_model.py +99 -0
  195. hyperstack/models/get_token_payload.py +89 -0
  196. hyperstack/models/get_user_permissions_response_model.py +99 -0
  197. hyperstack/models/get_version_response.py +91 -0
  198. hyperstack/models/getcreditandthresholdinfo.py +91 -0
  199. hyperstack/models/getcreditandthresholdinfoinresponse.py +95 -0
  200. hyperstack/models/gpu.py +95 -0
  201. hyperstack/models/gpu_fields.py +106 -0
  202. hyperstack/models/gpu_list.py +99 -0
  203. hyperstack/models/gpu_region_fields.py +89 -0
  204. hyperstack/models/graph_datetime_value_model.py +89 -0
  205. hyperstack/models/historical_instance.py +101 -0
  206. hyperstack/models/historical_instances_fields.py +110 -0
  207. hyperstack/models/image.py +91 -0
  208. hyperstack/models/image_fields.py +113 -0
  209. hyperstack/models/image_get_response.py +101 -0
  210. hyperstack/models/image_logos.py +99 -0
  211. hyperstack/models/images.py +99 -0
  212. hyperstack/models/import_keypair_payload.py +92 -0
  213. hyperstack/models/import_keypair_response.py +95 -0
  214. hyperstack/models/infrahub_resource_object_response.py +119 -0
  215. hyperstack/models/infrahub_resource_object_response_for_customer.py +109 -0
  216. hyperstack/models/insert_discount_plan_fields.py +112 -0
  217. hyperstack/models/instance.py +95 -0
  218. hyperstack/models/instance_environment_fields.py +99 -0
  219. hyperstack/models/instance_events.py +99 -0
  220. hyperstack/models/instance_events_fields.py +102 -0
  221. hyperstack/models/instance_fields.py +162 -0
  222. hyperstack/models/instance_flavor_fields.py +101 -0
  223. hyperstack/models/instance_image_fields.py +87 -0
  224. hyperstack/models/instance_keypair_fields.py +87 -0
  225. hyperstack/models/instance_overview_fields.py +95 -0
  226. hyperstack/models/instance_resize_payload.py +93 -0
  227. hyperstack/models/instances.py +105 -0
  228. hyperstack/models/instances_summary_fields.py +120 -0
  229. hyperstack/models/internal_environment_fields.py +94 -0
  230. hyperstack/models/internal_instance_fields.py +156 -0
  231. hyperstack/models/internal_instance_flavor_fields.py +104 -0
  232. hyperstack/models/internal_instance_image_fields.py +95 -0
  233. hyperstack/models/internal_instance_keypair_fields.py +98 -0
  234. hyperstack/models/internal_instances_response.py +99 -0
  235. hyperstack/models/internal_security_rules_fields_for_instance.py +104 -0
  236. hyperstack/models/internal_volume_attachment_fields.py +98 -0
  237. hyperstack/models/internal_volume_fields.py +95 -0
  238. hyperstack/models/internal_volumes_response.py +99 -0
  239. hyperstack/models/invite_fields.py +94 -0
  240. hyperstack/models/invite_user_payload.py +88 -0
  241. hyperstack/models/invite_user_response_model.py +95 -0
  242. hyperstack/models/keypair_fields.py +98 -0
  243. hyperstack/models/keypairs.py +105 -0
  244. hyperstack/models/lable_resonse.py +89 -0
  245. hyperstack/models/lastdaycostfields.py +93 -0
  246. hyperstack/models/lastdaycostresponse.py +95 -0
  247. hyperstack/models/logo_get_response.py +91 -0
  248. hyperstack/models/logout_payload.py +87 -0
  249. hyperstack/models/metric_item_fields.py +91 -0
  250. hyperstack/models/metrics_fields.py +116 -0
  251. hyperstack/models/name_available_model.py +91 -0
  252. hyperstack/models/new_configurations_response.py +95 -0
  253. hyperstack/models/new_model_response.py +101 -0
  254. hyperstack/models/new_stock_response.py +99 -0
  255. hyperstack/models/new_stock_retrive_response.py +95 -0
  256. hyperstack/models/new_stock_update_response_model.py +89 -0
  257. hyperstack/models/node_model.py +114 -0
  258. hyperstack/models/node_payload_model.py +97 -0
  259. hyperstack/models/node_power_usage_model.py +120 -0
  260. hyperstack/models/node_response_model.py +97 -0
  261. hyperstack/models/node_stock_payload_model.py +95 -0
  262. hyperstack/models/node_stock_response_model.py +95 -0
  263. hyperstack/models/node_stocks_payload.py +93 -0
  264. hyperstack/models/organization_fields.py +114 -0
  265. hyperstack/models/organization_level_billing_history.py +99 -0
  266. hyperstack/models/organization_level_billing_history_resources.py +97 -0
  267. hyperstack/models/organization_level_billing_history_response_attributes.py +87 -0
  268. hyperstack/models/organization_level_billing_history_response_metrics.py +97 -0
  269. hyperstack/models/organization_level_billing_history_response_model.py +95 -0
  270. hyperstack/models/organization_object_response.py +97 -0
  271. hyperstack/models/organization_thresholdfields.py +95 -0
  272. hyperstack/models/organization_user_response_model.py +112 -0
  273. hyperstack/models/organizationcreditrechargelimitresponse.py +95 -0
  274. hyperstack/models/organizationthresholdsresponse.py +99 -0
  275. hyperstack/models/organizationthresholdupdateresponse.py +95 -0
  276. hyperstack/models/overview_info.py +103 -0
  277. hyperstack/models/pagination_data.py +91 -0
  278. hyperstack/models/payment_details_fields.py +106 -0
  279. hyperstack/models/payment_details_response.py +95 -0
  280. hyperstack/models/payment_initiate_fields.py +87 -0
  281. hyperstack/models/payment_initiate_payload.py +87 -0
  282. hyperstack/models/payment_initiate_response.py +95 -0
  283. hyperstack/models/permission_fields.py +98 -0
  284. hyperstack/models/policy_fields.py +104 -0
  285. hyperstack/models/policy_permission_fields.py +91 -0
  286. hyperstack/models/power_usage_model.py +89 -0
  287. hyperstack/models/pricebook_model.py +100 -0
  288. hyperstack/models/pricebook_resource_object_response.py +107 -0
  289. hyperstack/models/pricebook_resource_object_response_for_customer.py +99 -0
  290. hyperstack/models/profile_fields.py +96 -0
  291. hyperstack/models/profile_list_response.py +99 -0
  292. hyperstack/models/profile_object_fields.py +89 -0
  293. hyperstack/models/rbac_role_detail_response_model.py +95 -0
  294. hyperstack/models/rbac_role_detail_response_model_fixed.py +95 -0
  295. hyperstack/models/rbac_role_field.py +87 -0
  296. hyperstack/models/rbac_role_fields.py +114 -0
  297. hyperstack/models/refresh_token_payload.py +89 -0
  298. hyperstack/models/region_fields.py +91 -0
  299. hyperstack/models/region_payload.py +89 -0
  300. hyperstack/models/region_response.py +95 -0
  301. hyperstack/models/regions.py +99 -0
  302. hyperstack/models/remove_member_from_organization_response_model.py +89 -0
  303. hyperstack/models/remove_member_payload.py +88 -0
  304. hyperstack/models/request_console.py +91 -0
  305. hyperstack/models/resource_billing_events_history_metrics.py +95 -0
  306. hyperstack/models/resource_billing_events_history_response.py +99 -0
  307. hyperstack/models/resource_billing_response_for_customer.py +95 -0
  308. hyperstack/models/resource_level_billing_details_attributes.py +91 -0
  309. hyperstack/models/resource_level_billing_details_metrics.py +101 -0
  310. hyperstack/models/resource_level_billing_details_vm.py +99 -0
  311. hyperstack/models/resource_level_billing_details_volume.py +99 -0
  312. hyperstack/models/resource_level_billing_details_volume_attributes.py +95 -0
  313. hyperstack/models/resource_level_billing_details_volume_metrics.py +95 -0
  314. hyperstack/models/resource_level_billing_history.py +105 -0
  315. hyperstack/models/resource_level_billing_history_resources.py +97 -0
  316. hyperstack/models/resource_level_billing_history_response_attributes.py +93 -0
  317. hyperstack/models/resource_level_billing_history_response_metrics.py +91 -0
  318. hyperstack/models/resource_level_billing_vm_details_resources.py +97 -0
  319. hyperstack/models/resource_level_billing_volume_details_resources.py +97 -0
  320. hyperstack/models/resource_level_graph_billing_detail_volume.py +101 -0
  321. hyperstack/models/resource_level_graph_billing_details_attributes.py +91 -0
  322. hyperstack/models/resource_level_graph_billing_details_metrics.py +97 -0
  323. hyperstack/models/resource_level_graph_billing_details_vm.py +101 -0
  324. hyperstack/models/resource_level_graph_billing_vm_details_resources.py +97 -0
  325. hyperstack/models/resource_level_graph_billing_volume_details_resources.py +97 -0
  326. hyperstack/models/resource_level_vm_billing_details_response_model.py +95 -0
  327. hyperstack/models/resource_level_vm_billing_history_response_model.py +95 -0
  328. hyperstack/models/resource_level_vm_graph_billing_details_response_model.py +95 -0
  329. hyperstack/models/resource_level_volume_billing_details_response_model.py +95 -0
  330. hyperstack/models/resource_level_volume_billing_history_response_model.py +95 -0
  331. hyperstack/models/resource_level_volume_graph_billing_details_response_model.py +95 -0
  332. hyperstack/models/resource_object_response_for_customer.py +93 -0
  333. hyperstack/models/response_model.py +89 -0
  334. hyperstack/models/role_permission_fields.py +91 -0
  335. hyperstack/models/role_policy_fields.py +91 -0
  336. hyperstack/models/security_group_rule.py +95 -0
  337. hyperstack/models/security_group_rule_fields.py +104 -0
  338. hyperstack/models/security_rules_fieldsfor_instance.py +104 -0
  339. hyperstack/models/security_rules_protocol_fields.py +91 -0
  340. hyperstack/models/set_defaults_payload.py +89 -0
  341. hyperstack/models/single_visibility_user_response.py +91 -0
  342. hyperstack/models/snapshot_fields.py +105 -0
  343. hyperstack/models/snapshot_restore_request.py +89 -0
  344. hyperstack/models/snapshot_retrieve.py +95 -0
  345. hyperstack/models/snapshot_retrieve_fields.py +103 -0
  346. hyperstack/models/snapshots.py +105 -0
  347. hyperstack/models/start_deployment.py +95 -0
  348. hyperstack/models/start_deployment_payload.py +93 -0
  349. hyperstack/models/stock_visibility_user_list_response.py +99 -0
  350. hyperstack/models/stock_visibility_user_payload.py +87 -0
  351. hyperstack/models/sub_resource_graph_billing_details_metrics.py +152 -0
  352. hyperstack/models/sub_resources_costs_response_model.py +101 -0
  353. hyperstack/models/sub_resources_graph_billing_history_fields.py +97 -0
  354. hyperstack/models/sub_resources_graph_response_model.py +95 -0
  355. hyperstack/models/subscribeorunsubscribeupdatepayload.py +87 -0
  356. hyperstack/models/success_response_model.py +89 -0
  357. hyperstack/models/template.py +95 -0
  358. hyperstack/models/template_fields.py +98 -0
  359. hyperstack/models/templates.py +99 -0
  360. hyperstack/models/token_fields.py +91 -0
  361. hyperstack/models/update_contract_payload.py +104 -0
  362. hyperstack/models/update_discounts_payload.py +102 -0
  363. hyperstack/models/update_discounts_status_payload.py +87 -0
  364. hyperstack/models/update_environment.py +88 -0
  365. hyperstack/models/update_gpu.py +91 -0
  366. hyperstack/models/update_keypair_name.py +88 -0
  367. hyperstack/models/update_keypairnameresponse.py +95 -0
  368. hyperstack/models/update_organization_payload.py +88 -0
  369. hyperstack/models/update_organization_response_model.py +89 -0
  370. hyperstack/models/update_template.py +91 -0
  371. hyperstack/models/user_default_choice_for_user_fields.py +91 -0
  372. hyperstack/models/user_default_choices_for_user_response.py +99 -0
  373. hyperstack/models/user_permission_fields.py +91 -0
  374. hyperstack/models/user_transfer_payload.py +89 -0
  375. hyperstack/models/userinfopostpayload.py +107 -0
  376. hyperstack/models/users_info_fields.py +114 -0
  377. hyperstack/models/users_info_list_response.py +95 -0
  378. hyperstack/models/verify_api_key_payload.py +87 -0
  379. hyperstack/models/verify_api_key_response_model.py +95 -0
  380. hyperstack/models/virtual_machine_usage.py +93 -0
  381. hyperstack/models/vm_usage_request_payload.py +87 -0
  382. hyperstack/models/vm_usage_response.py +101 -0
  383. hyperstack/models/vncurl.py +95 -0
  384. hyperstack/models/vncurl_fields.py +89 -0
  385. hyperstack/models/volume.py +95 -0
  386. hyperstack/models/volume_attachment_fields.py +98 -0
  387. hyperstack/models/volume_fields.py +116 -0
  388. hyperstack/models/volume_fieldsfor_instance.py +97 -0
  389. hyperstack/models/volume_overview_fields.py +91 -0
  390. hyperstack/models/volume_status_change_fields.py +96 -0
  391. hyperstack/models/volume_types.py +91 -0
  392. hyperstack/models/volumes.py +99 -0
  393. hyperstack/models/volumes_last_status_change_response.py +99 -0
  394. hyperstack/models/warning_mail_log_fields.py +99 -0
  395. hyperstack/models/warning_mail_log_response.py +101 -0
  396. hyperstack/py.typed +0 -0
  397. hyperstack/rest.py +257 -0
  398. hyperstack-1.25.0a0.dist-info/METADATA +23 -0
  399. hyperstack-1.25.0a0.dist-info/RECORD +401 -0
  400. hyperstack-1.25.0a0.dist-info/WHEEL +5 -0
  401. hyperstack-1.25.0a0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1497 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Infrahub-API
5
+
6
+ Leverage the Infrahub API and Hyperstack platform to easily create, manage, and scale powerful GPU virtual machines and their associated resources. Access this SDK to automate the deployment of your workloads and streamline your infrastructure management. To contribute, please raise an issue with a bug report, feature request, feedback, or general inquiry.
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictBytes, StrictInt, StrictStr
20
+ from typing import Optional, Tuple, Union
21
+ from typing_extensions import Annotated
22
+ from ..models.response_model import ResponseModel
23
+ from ..models.template import Template
24
+ from ..models.templates import Templates
25
+ from ..models.update_template import UpdateTemplate
26
+
27
+ from ..api_client import ApiClient, RequestSerialized
28
+ from ..api_response import ApiResponse
29
+ from ..rest import RESTResponseType
30
+
31
+
32
+ class TemplateApi:
33
+ """NOTE: This class is auto generated by OpenAPI Generator
34
+ Ref: https://openapi-generator.tech
35
+
36
+ Do not edit the class manually.
37
+ """
38
+
39
+ def __init__(self, api_client=None) -> None:
40
+ if api_client is None:
41
+ api_client = ApiClient.get_default()
42
+ self.api_client = api_client
43
+
44
+
45
+ @validate_call
46
+ def create_template(
47
+ self,
48
+ content: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="YAML file is required")],
49
+ description: Annotated[StrictStr, Field(description="description is required")],
50
+ is_public: Annotated[StrictStr, Field(description="is_public is required")],
51
+ name: Annotated[StrictStr, Field(description="name is required")],
52
+ _request_timeout: Union[
53
+ None,
54
+ Annotated[StrictFloat, Field(gt=0)],
55
+ Tuple[
56
+ Annotated[StrictFloat, Field(gt=0)],
57
+ Annotated[StrictFloat, Field(gt=0)]
58
+ ]
59
+ ] = None,
60
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
61
+ _content_type: Optional[StrictStr] = None,
62
+ _headers: Optional[Dict[StrictStr, Any]] = None,
63
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
64
+ ) -> Template:
65
+ """Create template
66
+
67
+ Creates a resource template for deployment.
68
+
69
+ :param content: YAML file is required (required)
70
+ :type content: bytearray
71
+ :param description: description is required (required)
72
+ :type description: str
73
+ :param is_public: is_public is required (required)
74
+ :type is_public: str
75
+ :param name: name is required (required)
76
+ :type name: str
77
+ :param _request_timeout: timeout setting for this request. If one
78
+ number provided, it will be total request
79
+ timeout. It can also be a pair (tuple) of
80
+ (connection, read) timeouts.
81
+ :type _request_timeout: int, tuple(int, int), optional
82
+ :param _request_auth: set to override the auth_settings for an a single
83
+ request; this effectively ignores the
84
+ authentication in the spec for a single request.
85
+ :type _request_auth: dict, optional
86
+ :param _content_type: force content-type for the request.
87
+ :type _content_type: str, Optional
88
+ :param _headers: set to override the headers for a single
89
+ request; this effectively ignores the headers
90
+ in the spec for a single request.
91
+ :type _headers: dict, optional
92
+ :param _host_index: set to override the host_index for a single
93
+ request; this effectively ignores the host_index
94
+ in the spec for a single request.
95
+ :type _host_index: int, optional
96
+ :return: Returns the result object.
97
+ """ # noqa: E501
98
+
99
+ _param = self._create_template_serialize(
100
+ content=content,
101
+ description=description,
102
+ is_public=is_public,
103
+ name=name,
104
+ _request_auth=_request_auth,
105
+ _content_type=_content_type,
106
+ _headers=_headers,
107
+ _host_index=_host_index
108
+ )
109
+
110
+ _response_types_map: Dict[str, Optional[str]] = {
111
+ '201': "Template",
112
+ '400': "ErrorResponseModel",
113
+ '401': "ErrorResponseModel",
114
+ '500': None,
115
+ }
116
+ response_data = self.api_client.call_api(
117
+ *_param,
118
+ _request_timeout=_request_timeout
119
+ )
120
+ response_data.read()
121
+ return self.api_client.response_deserialize(
122
+ response_data=response_data,
123
+ response_types_map=_response_types_map,
124
+ ).data
125
+
126
+
127
+ @validate_call
128
+ def create_template_with_http_info(
129
+ self,
130
+ content: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="YAML file is required")],
131
+ description: Annotated[StrictStr, Field(description="description is required")],
132
+ is_public: Annotated[StrictStr, Field(description="is_public is required")],
133
+ name: Annotated[StrictStr, Field(description="name is required")],
134
+ _request_timeout: Union[
135
+ None,
136
+ Annotated[StrictFloat, Field(gt=0)],
137
+ Tuple[
138
+ Annotated[StrictFloat, Field(gt=0)],
139
+ Annotated[StrictFloat, Field(gt=0)]
140
+ ]
141
+ ] = None,
142
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
143
+ _content_type: Optional[StrictStr] = None,
144
+ _headers: Optional[Dict[StrictStr, Any]] = None,
145
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
146
+ ) -> ApiResponse[Template]:
147
+ """Create template
148
+
149
+ Creates a resource template for deployment.
150
+
151
+ :param content: YAML file is required (required)
152
+ :type content: bytearray
153
+ :param description: description is required (required)
154
+ :type description: str
155
+ :param is_public: is_public is required (required)
156
+ :type is_public: str
157
+ :param name: name is required (required)
158
+ :type name: str
159
+ :param _request_timeout: timeout setting for this request. If one
160
+ number provided, it will be total request
161
+ timeout. It can also be a pair (tuple) of
162
+ (connection, read) timeouts.
163
+ :type _request_timeout: int, tuple(int, int), optional
164
+ :param _request_auth: set to override the auth_settings for an a single
165
+ request; this effectively ignores the
166
+ authentication in the spec for a single request.
167
+ :type _request_auth: dict, optional
168
+ :param _content_type: force content-type for the request.
169
+ :type _content_type: str, Optional
170
+ :param _headers: set to override the headers for a single
171
+ request; this effectively ignores the headers
172
+ in the spec for a single request.
173
+ :type _headers: dict, optional
174
+ :param _host_index: set to override the host_index for a single
175
+ request; this effectively ignores the host_index
176
+ in the spec for a single request.
177
+ :type _host_index: int, optional
178
+ :return: Returns the result object.
179
+ """ # noqa: E501
180
+
181
+ _param = self._create_template_serialize(
182
+ content=content,
183
+ description=description,
184
+ is_public=is_public,
185
+ name=name,
186
+ _request_auth=_request_auth,
187
+ _content_type=_content_type,
188
+ _headers=_headers,
189
+ _host_index=_host_index
190
+ )
191
+
192
+ _response_types_map: Dict[str, Optional[str]] = {
193
+ '201': "Template",
194
+ '400': "ErrorResponseModel",
195
+ '401': "ErrorResponseModel",
196
+ '500': None,
197
+ }
198
+ response_data = self.api_client.call_api(
199
+ *_param,
200
+ _request_timeout=_request_timeout
201
+ )
202
+ response_data.read()
203
+ return self.api_client.response_deserialize(
204
+ response_data=response_data,
205
+ response_types_map=_response_types_map,
206
+ )
207
+
208
+
209
+ @validate_call
210
+ def create_template_without_preload_content(
211
+ self,
212
+ content: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="YAML file is required")],
213
+ description: Annotated[StrictStr, Field(description="description is required")],
214
+ is_public: Annotated[StrictStr, Field(description="is_public is required")],
215
+ name: Annotated[StrictStr, Field(description="name is required")],
216
+ _request_timeout: Union[
217
+ None,
218
+ Annotated[StrictFloat, Field(gt=0)],
219
+ Tuple[
220
+ Annotated[StrictFloat, Field(gt=0)],
221
+ Annotated[StrictFloat, Field(gt=0)]
222
+ ]
223
+ ] = None,
224
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
225
+ _content_type: Optional[StrictStr] = None,
226
+ _headers: Optional[Dict[StrictStr, Any]] = None,
227
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
228
+ ) -> RESTResponseType:
229
+ """Create template
230
+
231
+ Creates a resource template for deployment.
232
+
233
+ :param content: YAML file is required (required)
234
+ :type content: bytearray
235
+ :param description: description is required (required)
236
+ :type description: str
237
+ :param is_public: is_public is required (required)
238
+ :type is_public: str
239
+ :param name: name is required (required)
240
+ :type name: str
241
+ :param _request_timeout: timeout setting for this request. If one
242
+ number provided, it will be total request
243
+ timeout. It can also be a pair (tuple) of
244
+ (connection, read) timeouts.
245
+ :type _request_timeout: int, tuple(int, int), optional
246
+ :param _request_auth: set to override the auth_settings for an a single
247
+ request; this effectively ignores the
248
+ authentication in the spec for a single request.
249
+ :type _request_auth: dict, optional
250
+ :param _content_type: force content-type for the request.
251
+ :type _content_type: str, Optional
252
+ :param _headers: set to override the headers for a single
253
+ request; this effectively ignores the headers
254
+ in the spec for a single request.
255
+ :type _headers: dict, optional
256
+ :param _host_index: set to override the host_index for a single
257
+ request; this effectively ignores the host_index
258
+ in the spec for a single request.
259
+ :type _host_index: int, optional
260
+ :return: Returns the result object.
261
+ """ # noqa: E501
262
+
263
+ _param = self._create_template_serialize(
264
+ content=content,
265
+ description=description,
266
+ is_public=is_public,
267
+ name=name,
268
+ _request_auth=_request_auth,
269
+ _content_type=_content_type,
270
+ _headers=_headers,
271
+ _host_index=_host_index
272
+ )
273
+
274
+ _response_types_map: Dict[str, Optional[str]] = {
275
+ '201': "Template",
276
+ '400': "ErrorResponseModel",
277
+ '401': "ErrorResponseModel",
278
+ '500': None,
279
+ }
280
+ response_data = self.api_client.call_api(
281
+ *_param,
282
+ _request_timeout=_request_timeout
283
+ )
284
+ return response_data.response
285
+
286
+
287
+ def _create_template_serialize(
288
+ self,
289
+ content,
290
+ description,
291
+ is_public,
292
+ name,
293
+ _request_auth,
294
+ _content_type,
295
+ _headers,
296
+ _host_index,
297
+ ) -> RequestSerialized:
298
+
299
+ _host = None
300
+
301
+ _collection_formats: Dict[str, str] = {
302
+ }
303
+
304
+ _path_params: Dict[str, str] = {}
305
+ _query_params: List[Tuple[str, str]] = []
306
+ _header_params: Dict[str, Optional[str]] = _headers or {}
307
+ _form_params: List[Tuple[str, str]] = []
308
+ _files: Dict[
309
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
310
+ ] = {}
311
+ _body_params: Optional[bytes] = None
312
+
313
+ # process the path parameters
314
+ # process the query parameters
315
+ # process the header parameters
316
+ # process the form parameters
317
+ if content is not None:
318
+ _files['content'] = content
319
+ if description is not None:
320
+ _form_params.append(('description', description))
321
+ if is_public is not None:
322
+ _form_params.append(('is_public', is_public))
323
+ if name is not None:
324
+ _form_params.append(('name', name))
325
+ # process the body parameter
326
+
327
+
328
+ # set the HTTP header `Accept`
329
+ if 'Accept' not in _header_params:
330
+ _header_params['Accept'] = self.api_client.select_header_accept(
331
+ [
332
+ 'application/json'
333
+ ]
334
+ )
335
+
336
+ # set the HTTP header `Content-Type`
337
+ if _content_type:
338
+ _header_params['Content-Type'] = _content_type
339
+ else:
340
+ _default_content_type = (
341
+ self.api_client.select_header_content_type(
342
+ [
343
+ 'multipart/form-data'
344
+ ]
345
+ )
346
+ )
347
+ if _default_content_type is not None:
348
+ _header_params['Content-Type'] = _default_content_type
349
+
350
+ # authentication setting
351
+ _auth_settings: List[str] = [
352
+ 'apiKey',
353
+ 'accessToken'
354
+ ]
355
+
356
+ return self.api_client.param_serialize(
357
+ method='POST',
358
+ resource_path='/core/marketplace/templates',
359
+ path_params=_path_params,
360
+ query_params=_query_params,
361
+ header_params=_header_params,
362
+ body=_body_params,
363
+ post_params=_form_params,
364
+ files=_files,
365
+ auth_settings=_auth_settings,
366
+ collection_formats=_collection_formats,
367
+ _host=_host,
368
+ _request_auth=_request_auth
369
+ )
370
+
371
+
372
+
373
+
374
+ @validate_call
375
+ def delete_template(
376
+ self,
377
+ id: StrictInt,
378
+ _request_timeout: Union[
379
+ None,
380
+ Annotated[StrictFloat, Field(gt=0)],
381
+ Tuple[
382
+ Annotated[StrictFloat, Field(gt=0)],
383
+ Annotated[StrictFloat, Field(gt=0)]
384
+ ]
385
+ ] = None,
386
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
387
+ _content_type: Optional[StrictStr] = None,
388
+ _headers: Optional[Dict[StrictStr, Any]] = None,
389
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
390
+ ) -> ResponseModel:
391
+ """Delete template
392
+
393
+ Permanently deletes a template. Supply the template ID in the path to delete the specified template.
394
+
395
+ :param id: (required)
396
+ :type id: int
397
+ :param _request_timeout: timeout setting for this request. If one
398
+ number provided, it will be total request
399
+ timeout. It can also be a pair (tuple) of
400
+ (connection, read) timeouts.
401
+ :type _request_timeout: int, tuple(int, int), optional
402
+ :param _request_auth: set to override the auth_settings for an a single
403
+ request; this effectively ignores the
404
+ authentication in the spec for a single request.
405
+ :type _request_auth: dict, optional
406
+ :param _content_type: force content-type for the request.
407
+ :type _content_type: str, Optional
408
+ :param _headers: set to override the headers for a single
409
+ request; this effectively ignores the headers
410
+ in the spec for a single request.
411
+ :type _headers: dict, optional
412
+ :param _host_index: set to override the host_index for a single
413
+ request; this effectively ignores the host_index
414
+ in the spec for a single request.
415
+ :type _host_index: int, optional
416
+ :return: Returns the result object.
417
+ """ # noqa: E501
418
+
419
+ _param = self._delete_template_serialize(
420
+ id=id,
421
+ _request_auth=_request_auth,
422
+ _content_type=_content_type,
423
+ _headers=_headers,
424
+ _host_index=_host_index
425
+ )
426
+
427
+ _response_types_map: Dict[str, Optional[str]] = {
428
+ '200': "ResponseModel",
429
+ '400': "ErrorResponseModel",
430
+ '401': "ErrorResponseModel",
431
+ '404': "ErrorResponseModel",
432
+ '500': None,
433
+ }
434
+ response_data = self.api_client.call_api(
435
+ *_param,
436
+ _request_timeout=_request_timeout
437
+ )
438
+ response_data.read()
439
+ return self.api_client.response_deserialize(
440
+ response_data=response_data,
441
+ response_types_map=_response_types_map,
442
+ ).data
443
+
444
+
445
+ @validate_call
446
+ def delete_template_with_http_info(
447
+ self,
448
+ id: StrictInt,
449
+ _request_timeout: Union[
450
+ None,
451
+ Annotated[StrictFloat, Field(gt=0)],
452
+ Tuple[
453
+ Annotated[StrictFloat, Field(gt=0)],
454
+ Annotated[StrictFloat, Field(gt=0)]
455
+ ]
456
+ ] = None,
457
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
458
+ _content_type: Optional[StrictStr] = None,
459
+ _headers: Optional[Dict[StrictStr, Any]] = None,
460
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
461
+ ) -> ApiResponse[ResponseModel]:
462
+ """Delete template
463
+
464
+ Permanently deletes a template. Supply the template ID in the path to delete the specified template.
465
+
466
+ :param id: (required)
467
+ :type id: int
468
+ :param _request_timeout: timeout setting for this request. If one
469
+ number provided, it will be total request
470
+ timeout. It can also be a pair (tuple) of
471
+ (connection, read) timeouts.
472
+ :type _request_timeout: int, tuple(int, int), optional
473
+ :param _request_auth: set to override the auth_settings for an a single
474
+ request; this effectively ignores the
475
+ authentication in the spec for a single request.
476
+ :type _request_auth: dict, optional
477
+ :param _content_type: force content-type for the request.
478
+ :type _content_type: str, Optional
479
+ :param _headers: set to override the headers for a single
480
+ request; this effectively ignores the headers
481
+ in the spec for a single request.
482
+ :type _headers: dict, optional
483
+ :param _host_index: set to override the host_index for a single
484
+ request; this effectively ignores the host_index
485
+ in the spec for a single request.
486
+ :type _host_index: int, optional
487
+ :return: Returns the result object.
488
+ """ # noqa: E501
489
+
490
+ _param = self._delete_template_serialize(
491
+ id=id,
492
+ _request_auth=_request_auth,
493
+ _content_type=_content_type,
494
+ _headers=_headers,
495
+ _host_index=_host_index
496
+ )
497
+
498
+ _response_types_map: Dict[str, Optional[str]] = {
499
+ '200': "ResponseModel",
500
+ '400': "ErrorResponseModel",
501
+ '401': "ErrorResponseModel",
502
+ '404': "ErrorResponseModel",
503
+ '500': None,
504
+ }
505
+ response_data = self.api_client.call_api(
506
+ *_param,
507
+ _request_timeout=_request_timeout
508
+ )
509
+ response_data.read()
510
+ return self.api_client.response_deserialize(
511
+ response_data=response_data,
512
+ response_types_map=_response_types_map,
513
+ )
514
+
515
+
516
+ @validate_call
517
+ def delete_template_without_preload_content(
518
+ self,
519
+ id: StrictInt,
520
+ _request_timeout: Union[
521
+ None,
522
+ Annotated[StrictFloat, Field(gt=0)],
523
+ Tuple[
524
+ Annotated[StrictFloat, Field(gt=0)],
525
+ Annotated[StrictFloat, Field(gt=0)]
526
+ ]
527
+ ] = None,
528
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
529
+ _content_type: Optional[StrictStr] = None,
530
+ _headers: Optional[Dict[StrictStr, Any]] = None,
531
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
532
+ ) -> RESTResponseType:
533
+ """Delete template
534
+
535
+ Permanently deletes a template. Supply the template ID in the path to delete the specified template.
536
+
537
+ :param id: (required)
538
+ :type id: int
539
+ :param _request_timeout: timeout setting for this request. If one
540
+ number provided, it will be total request
541
+ timeout. It can also be a pair (tuple) of
542
+ (connection, read) timeouts.
543
+ :type _request_timeout: int, tuple(int, int), optional
544
+ :param _request_auth: set to override the auth_settings for an a single
545
+ request; this effectively ignores the
546
+ authentication in the spec for a single request.
547
+ :type _request_auth: dict, optional
548
+ :param _content_type: force content-type for the request.
549
+ :type _content_type: str, Optional
550
+ :param _headers: set to override the headers for a single
551
+ request; this effectively ignores the headers
552
+ in the spec for a single request.
553
+ :type _headers: dict, optional
554
+ :param _host_index: set to override the host_index for a single
555
+ request; this effectively ignores the host_index
556
+ in the spec for a single request.
557
+ :type _host_index: int, optional
558
+ :return: Returns the result object.
559
+ """ # noqa: E501
560
+
561
+ _param = self._delete_template_serialize(
562
+ id=id,
563
+ _request_auth=_request_auth,
564
+ _content_type=_content_type,
565
+ _headers=_headers,
566
+ _host_index=_host_index
567
+ )
568
+
569
+ _response_types_map: Dict[str, Optional[str]] = {
570
+ '200': "ResponseModel",
571
+ '400': "ErrorResponseModel",
572
+ '401': "ErrorResponseModel",
573
+ '404': "ErrorResponseModel",
574
+ '500': None,
575
+ }
576
+ response_data = self.api_client.call_api(
577
+ *_param,
578
+ _request_timeout=_request_timeout
579
+ )
580
+ return response_data.response
581
+
582
+
583
+ def _delete_template_serialize(
584
+ self,
585
+ id,
586
+ _request_auth,
587
+ _content_type,
588
+ _headers,
589
+ _host_index,
590
+ ) -> RequestSerialized:
591
+
592
+ _host = None
593
+
594
+ _collection_formats: Dict[str, str] = {
595
+ }
596
+
597
+ _path_params: Dict[str, str] = {}
598
+ _query_params: List[Tuple[str, str]] = []
599
+ _header_params: Dict[str, Optional[str]] = _headers or {}
600
+ _form_params: List[Tuple[str, str]] = []
601
+ _files: Dict[
602
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
603
+ ] = {}
604
+ _body_params: Optional[bytes] = None
605
+
606
+ # process the path parameters
607
+ if id is not None:
608
+ _path_params['id'] = id
609
+ # process the query parameters
610
+ # process the header parameters
611
+ # process the form parameters
612
+ # process the body parameter
613
+
614
+
615
+ # set the HTTP header `Accept`
616
+ if 'Accept' not in _header_params:
617
+ _header_params['Accept'] = self.api_client.select_header_accept(
618
+ [
619
+ 'application/json'
620
+ ]
621
+ )
622
+
623
+
624
+ # authentication setting
625
+ _auth_settings: List[str] = [
626
+ 'apiKey',
627
+ 'accessToken'
628
+ ]
629
+
630
+ return self.api_client.param_serialize(
631
+ method='DELETE',
632
+ resource_path='/core/marketplace/templates/{id}',
633
+ path_params=_path_params,
634
+ query_params=_query_params,
635
+ header_params=_header_params,
636
+ body=_body_params,
637
+ post_params=_form_params,
638
+ files=_files,
639
+ auth_settings=_auth_settings,
640
+ collection_formats=_collection_formats,
641
+ _host=_host,
642
+ _request_auth=_request_auth
643
+ )
644
+
645
+
646
+
647
+
648
+ @validate_call
649
+ def list_templates(
650
+ self,
651
+ visibility: Annotated[Optional[StrictStr], Field(description="Specify the `visibility` status as either `public` or `private` to filter and retrieve templates with the desired visibility.")] = None,
652
+ _request_timeout: Union[
653
+ None,
654
+ Annotated[StrictFloat, Field(gt=0)],
655
+ Tuple[
656
+ Annotated[StrictFloat, Field(gt=0)],
657
+ Annotated[StrictFloat, Field(gt=0)]
658
+ ]
659
+ ] = None,
660
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
661
+ _content_type: Optional[StrictStr] = None,
662
+ _headers: Optional[Dict[StrictStr, Any]] = None,
663
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
664
+ ) -> Templates:
665
+ """List templates
666
+
667
+ Returns a comprehensive list of templates, providing resource configuration details for each. Optionally, specify the `visibility` as `public` or `private` to retrieve templates with the desired visibility status. To learn more about the templates feature, [**click here**](https://infrahub-doc.nexgencloud.com/docs/features/templates#view-a-list-of-templates).
668
+
669
+ :param visibility: Specify the `visibility` status as either `public` or `private` to filter and retrieve templates with the desired visibility.
670
+ :type visibility: str
671
+ :param _request_timeout: timeout setting for this request. If one
672
+ number provided, it will be total request
673
+ timeout. It can also be a pair (tuple) of
674
+ (connection, read) timeouts.
675
+ :type _request_timeout: int, tuple(int, int), optional
676
+ :param _request_auth: set to override the auth_settings for an a single
677
+ request; this effectively ignores the
678
+ authentication in the spec for a single request.
679
+ :type _request_auth: dict, optional
680
+ :param _content_type: force content-type for the request.
681
+ :type _content_type: str, Optional
682
+ :param _headers: set to override the headers for a single
683
+ request; this effectively ignores the headers
684
+ in the spec for a single request.
685
+ :type _headers: dict, optional
686
+ :param _host_index: set to override the host_index for a single
687
+ request; this effectively ignores the host_index
688
+ in the spec for a single request.
689
+ :type _host_index: int, optional
690
+ :return: Returns the result object.
691
+ """ # noqa: E501
692
+
693
+ _param = self._list_templates_serialize(
694
+ visibility=visibility,
695
+ _request_auth=_request_auth,
696
+ _content_type=_content_type,
697
+ _headers=_headers,
698
+ _host_index=_host_index
699
+ )
700
+
701
+ _response_types_map: Dict[str, Optional[str]] = {
702
+ '200': "Templates",
703
+ '400': "ErrorResponseModel",
704
+ '401': "ErrorResponseModel",
705
+ '406': "ErrorResponseModel",
706
+ '500': None,
707
+ }
708
+ response_data = self.api_client.call_api(
709
+ *_param,
710
+ _request_timeout=_request_timeout
711
+ )
712
+ response_data.read()
713
+ return self.api_client.response_deserialize(
714
+ response_data=response_data,
715
+ response_types_map=_response_types_map,
716
+ ).data
717
+
718
+
719
+ @validate_call
720
+ def list_templates_with_http_info(
721
+ self,
722
+ visibility: Annotated[Optional[StrictStr], Field(description="Specify the `visibility` status as either `public` or `private` to filter and retrieve templates with the desired visibility.")] = None,
723
+ _request_timeout: Union[
724
+ None,
725
+ Annotated[StrictFloat, Field(gt=0)],
726
+ Tuple[
727
+ Annotated[StrictFloat, Field(gt=0)],
728
+ Annotated[StrictFloat, Field(gt=0)]
729
+ ]
730
+ ] = None,
731
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
732
+ _content_type: Optional[StrictStr] = None,
733
+ _headers: Optional[Dict[StrictStr, Any]] = None,
734
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
735
+ ) -> ApiResponse[Templates]:
736
+ """List templates
737
+
738
+ Returns a comprehensive list of templates, providing resource configuration details for each. Optionally, specify the `visibility` as `public` or `private` to retrieve templates with the desired visibility status. To learn more about the templates feature, [**click here**](https://infrahub-doc.nexgencloud.com/docs/features/templates#view-a-list-of-templates).
739
+
740
+ :param visibility: Specify the `visibility` status as either `public` or `private` to filter and retrieve templates with the desired visibility.
741
+ :type visibility: str
742
+ :param _request_timeout: timeout setting for this request. If one
743
+ number provided, it will be total request
744
+ timeout. It can also be a pair (tuple) of
745
+ (connection, read) timeouts.
746
+ :type _request_timeout: int, tuple(int, int), optional
747
+ :param _request_auth: set to override the auth_settings for an a single
748
+ request; this effectively ignores the
749
+ authentication in the spec for a single request.
750
+ :type _request_auth: dict, optional
751
+ :param _content_type: force content-type for the request.
752
+ :type _content_type: str, Optional
753
+ :param _headers: set to override the headers for a single
754
+ request; this effectively ignores the headers
755
+ in the spec for a single request.
756
+ :type _headers: dict, optional
757
+ :param _host_index: set to override the host_index for a single
758
+ request; this effectively ignores the host_index
759
+ in the spec for a single request.
760
+ :type _host_index: int, optional
761
+ :return: Returns the result object.
762
+ """ # noqa: E501
763
+
764
+ _param = self._list_templates_serialize(
765
+ visibility=visibility,
766
+ _request_auth=_request_auth,
767
+ _content_type=_content_type,
768
+ _headers=_headers,
769
+ _host_index=_host_index
770
+ )
771
+
772
+ _response_types_map: Dict[str, Optional[str]] = {
773
+ '200': "Templates",
774
+ '400': "ErrorResponseModel",
775
+ '401': "ErrorResponseModel",
776
+ '406': "ErrorResponseModel",
777
+ '500': None,
778
+ }
779
+ response_data = self.api_client.call_api(
780
+ *_param,
781
+ _request_timeout=_request_timeout
782
+ )
783
+ response_data.read()
784
+ return self.api_client.response_deserialize(
785
+ response_data=response_data,
786
+ response_types_map=_response_types_map,
787
+ )
788
+
789
+
790
+ @validate_call
791
+ def list_templates_without_preload_content(
792
+ self,
793
+ visibility: Annotated[Optional[StrictStr], Field(description="Specify the `visibility` status as either `public` or `private` to filter and retrieve templates with the desired visibility.")] = None,
794
+ _request_timeout: Union[
795
+ None,
796
+ Annotated[StrictFloat, Field(gt=0)],
797
+ Tuple[
798
+ Annotated[StrictFloat, Field(gt=0)],
799
+ Annotated[StrictFloat, Field(gt=0)]
800
+ ]
801
+ ] = None,
802
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
803
+ _content_type: Optional[StrictStr] = None,
804
+ _headers: Optional[Dict[StrictStr, Any]] = None,
805
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
806
+ ) -> RESTResponseType:
807
+ """List templates
808
+
809
+ Returns a comprehensive list of templates, providing resource configuration details for each. Optionally, specify the `visibility` as `public` or `private` to retrieve templates with the desired visibility status. To learn more about the templates feature, [**click here**](https://infrahub-doc.nexgencloud.com/docs/features/templates#view-a-list-of-templates).
810
+
811
+ :param visibility: Specify the `visibility` status as either `public` or `private` to filter and retrieve templates with the desired visibility.
812
+ :type visibility: str
813
+ :param _request_timeout: timeout setting for this request. If one
814
+ number provided, it will be total request
815
+ timeout. It can also be a pair (tuple) of
816
+ (connection, read) timeouts.
817
+ :type _request_timeout: int, tuple(int, int), optional
818
+ :param _request_auth: set to override the auth_settings for an a single
819
+ request; this effectively ignores the
820
+ authentication in the spec for a single request.
821
+ :type _request_auth: dict, optional
822
+ :param _content_type: force content-type for the request.
823
+ :type _content_type: str, Optional
824
+ :param _headers: set to override the headers for a single
825
+ request; this effectively ignores the headers
826
+ in the spec for a single request.
827
+ :type _headers: dict, optional
828
+ :param _host_index: set to override the host_index for a single
829
+ request; this effectively ignores the host_index
830
+ in the spec for a single request.
831
+ :type _host_index: int, optional
832
+ :return: Returns the result object.
833
+ """ # noqa: E501
834
+
835
+ _param = self._list_templates_serialize(
836
+ visibility=visibility,
837
+ _request_auth=_request_auth,
838
+ _content_type=_content_type,
839
+ _headers=_headers,
840
+ _host_index=_host_index
841
+ )
842
+
843
+ _response_types_map: Dict[str, Optional[str]] = {
844
+ '200': "Templates",
845
+ '400': "ErrorResponseModel",
846
+ '401': "ErrorResponseModel",
847
+ '406': "ErrorResponseModel",
848
+ '500': None,
849
+ }
850
+ response_data = self.api_client.call_api(
851
+ *_param,
852
+ _request_timeout=_request_timeout
853
+ )
854
+ return response_data.response
855
+
856
+
857
+ def _list_templates_serialize(
858
+ self,
859
+ visibility,
860
+ _request_auth,
861
+ _content_type,
862
+ _headers,
863
+ _host_index,
864
+ ) -> RequestSerialized:
865
+
866
+ _host = None
867
+
868
+ _collection_formats: Dict[str, str] = {
869
+ }
870
+
871
+ _path_params: Dict[str, str] = {}
872
+ _query_params: List[Tuple[str, str]] = []
873
+ _header_params: Dict[str, Optional[str]] = _headers or {}
874
+ _form_params: List[Tuple[str, str]] = []
875
+ _files: Dict[
876
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
877
+ ] = {}
878
+ _body_params: Optional[bytes] = None
879
+
880
+ # process the path parameters
881
+ # process the query parameters
882
+ if visibility is not None:
883
+
884
+ _query_params.append(('visibility', visibility))
885
+
886
+ # process the header parameters
887
+ # process the form parameters
888
+ # process the body parameter
889
+
890
+
891
+ # set the HTTP header `Accept`
892
+ if 'Accept' not in _header_params:
893
+ _header_params['Accept'] = self.api_client.select_header_accept(
894
+ [
895
+ 'application/json'
896
+ ]
897
+ )
898
+
899
+
900
+ # authentication setting
901
+ _auth_settings: List[str] = [
902
+ 'apiKey',
903
+ 'accessToken'
904
+ ]
905
+
906
+ return self.api_client.param_serialize(
907
+ method='GET',
908
+ resource_path='/core/marketplace/templates',
909
+ path_params=_path_params,
910
+ query_params=_query_params,
911
+ header_params=_header_params,
912
+ body=_body_params,
913
+ post_params=_form_params,
914
+ files=_files,
915
+ auth_settings=_auth_settings,
916
+ collection_formats=_collection_formats,
917
+ _host=_host,
918
+ _request_auth=_request_auth
919
+ )
920
+
921
+
922
+
923
+
924
+ @validate_call
925
+ def retrieve_template_details(
926
+ self,
927
+ id: StrictInt,
928
+ _request_timeout: Union[
929
+ None,
930
+ Annotated[StrictFloat, Field(gt=0)],
931
+ Tuple[
932
+ Annotated[StrictFloat, Field(gt=0)],
933
+ Annotated[StrictFloat, Field(gt=0)]
934
+ ]
935
+ ] = None,
936
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
937
+ _content_type: Optional[StrictStr] = None,
938
+ _headers: Optional[Dict[StrictStr, Any]] = None,
939
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
940
+ ) -> Template:
941
+ """Retrieve template details
942
+
943
+ Retrieves the resource configuration details for a specified template. Provide the template ID in the path to retrieve details for the specified template. For additional information on template configuration details, [**click here**](https://infrahub-doc.nexgencloud.com/docs/features/templates#retrieve-the-details-for-a-template).
944
+
945
+ :param id: (required)
946
+ :type id: int
947
+ :param _request_timeout: timeout setting for this request. If one
948
+ number provided, it will be total request
949
+ timeout. It can also be a pair (tuple) of
950
+ (connection, read) timeouts.
951
+ :type _request_timeout: int, tuple(int, int), optional
952
+ :param _request_auth: set to override the auth_settings for an a single
953
+ request; this effectively ignores the
954
+ authentication in the spec for a single request.
955
+ :type _request_auth: dict, optional
956
+ :param _content_type: force content-type for the request.
957
+ :type _content_type: str, Optional
958
+ :param _headers: set to override the headers for a single
959
+ request; this effectively ignores the headers
960
+ in the spec for a single request.
961
+ :type _headers: dict, optional
962
+ :param _host_index: set to override the host_index for a single
963
+ request; this effectively ignores the host_index
964
+ in the spec for a single request.
965
+ :type _host_index: int, optional
966
+ :return: Returns the result object.
967
+ """ # noqa: E501
968
+
969
+ _param = self._retrieve_template_details_serialize(
970
+ id=id,
971
+ _request_auth=_request_auth,
972
+ _content_type=_content_type,
973
+ _headers=_headers,
974
+ _host_index=_host_index
975
+ )
976
+
977
+ _response_types_map: Dict[str, Optional[str]] = {
978
+ '200': "Template",
979
+ '400': "ErrorResponseModel",
980
+ '401': "ErrorResponseModel",
981
+ '404': "ErrorResponseModel",
982
+ '500': None,
983
+ }
984
+ response_data = self.api_client.call_api(
985
+ *_param,
986
+ _request_timeout=_request_timeout
987
+ )
988
+ response_data.read()
989
+ return self.api_client.response_deserialize(
990
+ response_data=response_data,
991
+ response_types_map=_response_types_map,
992
+ ).data
993
+
994
+
995
+ @validate_call
996
+ def retrieve_template_details_with_http_info(
997
+ self,
998
+ id: StrictInt,
999
+ _request_timeout: Union[
1000
+ None,
1001
+ Annotated[StrictFloat, Field(gt=0)],
1002
+ Tuple[
1003
+ Annotated[StrictFloat, Field(gt=0)],
1004
+ Annotated[StrictFloat, Field(gt=0)]
1005
+ ]
1006
+ ] = None,
1007
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1008
+ _content_type: Optional[StrictStr] = None,
1009
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1010
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1011
+ ) -> ApiResponse[Template]:
1012
+ """Retrieve template details
1013
+
1014
+ Retrieves the resource configuration details for a specified template. Provide the template ID in the path to retrieve details for the specified template. For additional information on template configuration details, [**click here**](https://infrahub-doc.nexgencloud.com/docs/features/templates#retrieve-the-details-for-a-template).
1015
+
1016
+ :param id: (required)
1017
+ :type id: int
1018
+ :param _request_timeout: timeout setting for this request. If one
1019
+ number provided, it will be total request
1020
+ timeout. It can also be a pair (tuple) of
1021
+ (connection, read) timeouts.
1022
+ :type _request_timeout: int, tuple(int, int), optional
1023
+ :param _request_auth: set to override the auth_settings for an a single
1024
+ request; this effectively ignores the
1025
+ authentication in the spec for a single request.
1026
+ :type _request_auth: dict, optional
1027
+ :param _content_type: force content-type for the request.
1028
+ :type _content_type: str, Optional
1029
+ :param _headers: set to override the headers for a single
1030
+ request; this effectively ignores the headers
1031
+ in the spec for a single request.
1032
+ :type _headers: dict, optional
1033
+ :param _host_index: set to override the host_index for a single
1034
+ request; this effectively ignores the host_index
1035
+ in the spec for a single request.
1036
+ :type _host_index: int, optional
1037
+ :return: Returns the result object.
1038
+ """ # noqa: E501
1039
+
1040
+ _param = self._retrieve_template_details_serialize(
1041
+ id=id,
1042
+ _request_auth=_request_auth,
1043
+ _content_type=_content_type,
1044
+ _headers=_headers,
1045
+ _host_index=_host_index
1046
+ )
1047
+
1048
+ _response_types_map: Dict[str, Optional[str]] = {
1049
+ '200': "Template",
1050
+ '400': "ErrorResponseModel",
1051
+ '401': "ErrorResponseModel",
1052
+ '404': "ErrorResponseModel",
1053
+ '500': None,
1054
+ }
1055
+ response_data = self.api_client.call_api(
1056
+ *_param,
1057
+ _request_timeout=_request_timeout
1058
+ )
1059
+ response_data.read()
1060
+ return self.api_client.response_deserialize(
1061
+ response_data=response_data,
1062
+ response_types_map=_response_types_map,
1063
+ )
1064
+
1065
+
1066
+ @validate_call
1067
+ def retrieve_template_details_without_preload_content(
1068
+ self,
1069
+ id: StrictInt,
1070
+ _request_timeout: Union[
1071
+ None,
1072
+ Annotated[StrictFloat, Field(gt=0)],
1073
+ Tuple[
1074
+ Annotated[StrictFloat, Field(gt=0)],
1075
+ Annotated[StrictFloat, Field(gt=0)]
1076
+ ]
1077
+ ] = None,
1078
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1079
+ _content_type: Optional[StrictStr] = None,
1080
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1081
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1082
+ ) -> RESTResponseType:
1083
+ """Retrieve template details
1084
+
1085
+ Retrieves the resource configuration details for a specified template. Provide the template ID in the path to retrieve details for the specified template. For additional information on template configuration details, [**click here**](https://infrahub-doc.nexgencloud.com/docs/features/templates#retrieve-the-details-for-a-template).
1086
+
1087
+ :param id: (required)
1088
+ :type id: int
1089
+ :param _request_timeout: timeout setting for this request. If one
1090
+ number provided, it will be total request
1091
+ timeout. It can also be a pair (tuple) of
1092
+ (connection, read) timeouts.
1093
+ :type _request_timeout: int, tuple(int, int), optional
1094
+ :param _request_auth: set to override the auth_settings for an a single
1095
+ request; this effectively ignores the
1096
+ authentication in the spec for a single request.
1097
+ :type _request_auth: dict, optional
1098
+ :param _content_type: force content-type for the request.
1099
+ :type _content_type: str, Optional
1100
+ :param _headers: set to override the headers for a single
1101
+ request; this effectively ignores the headers
1102
+ in the spec for a single request.
1103
+ :type _headers: dict, optional
1104
+ :param _host_index: set to override the host_index for a single
1105
+ request; this effectively ignores the host_index
1106
+ in the spec for a single request.
1107
+ :type _host_index: int, optional
1108
+ :return: Returns the result object.
1109
+ """ # noqa: E501
1110
+
1111
+ _param = self._retrieve_template_details_serialize(
1112
+ id=id,
1113
+ _request_auth=_request_auth,
1114
+ _content_type=_content_type,
1115
+ _headers=_headers,
1116
+ _host_index=_host_index
1117
+ )
1118
+
1119
+ _response_types_map: Dict[str, Optional[str]] = {
1120
+ '200': "Template",
1121
+ '400': "ErrorResponseModel",
1122
+ '401': "ErrorResponseModel",
1123
+ '404': "ErrorResponseModel",
1124
+ '500': None,
1125
+ }
1126
+ response_data = self.api_client.call_api(
1127
+ *_param,
1128
+ _request_timeout=_request_timeout
1129
+ )
1130
+ return response_data.response
1131
+
1132
+
1133
+ def _retrieve_template_details_serialize(
1134
+ self,
1135
+ id,
1136
+ _request_auth,
1137
+ _content_type,
1138
+ _headers,
1139
+ _host_index,
1140
+ ) -> RequestSerialized:
1141
+
1142
+ _host = None
1143
+
1144
+ _collection_formats: Dict[str, str] = {
1145
+ }
1146
+
1147
+ _path_params: Dict[str, str] = {}
1148
+ _query_params: List[Tuple[str, str]] = []
1149
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1150
+ _form_params: List[Tuple[str, str]] = []
1151
+ _files: Dict[
1152
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1153
+ ] = {}
1154
+ _body_params: Optional[bytes] = None
1155
+
1156
+ # process the path parameters
1157
+ if id is not None:
1158
+ _path_params['id'] = id
1159
+ # process the query parameters
1160
+ # process the header parameters
1161
+ # process the form parameters
1162
+ # process the body parameter
1163
+
1164
+
1165
+ # set the HTTP header `Accept`
1166
+ if 'Accept' not in _header_params:
1167
+ _header_params['Accept'] = self.api_client.select_header_accept(
1168
+ [
1169
+ 'application/json'
1170
+ ]
1171
+ )
1172
+
1173
+
1174
+ # authentication setting
1175
+ _auth_settings: List[str] = [
1176
+ 'apiKey',
1177
+ 'accessToken'
1178
+ ]
1179
+
1180
+ return self.api_client.param_serialize(
1181
+ method='GET',
1182
+ resource_path='/core/marketplace/templates/{id}',
1183
+ path_params=_path_params,
1184
+ query_params=_query_params,
1185
+ header_params=_header_params,
1186
+ body=_body_params,
1187
+ post_params=_form_params,
1188
+ files=_files,
1189
+ auth_settings=_auth_settings,
1190
+ collection_formats=_collection_formats,
1191
+ _host=_host,
1192
+ _request_auth=_request_auth
1193
+ )
1194
+
1195
+
1196
+
1197
+
1198
+ @validate_call
1199
+ def update_template(
1200
+ self,
1201
+ id: StrictInt,
1202
+ payload: UpdateTemplate,
1203
+ _request_timeout: Union[
1204
+ None,
1205
+ Annotated[StrictFloat, Field(gt=0)],
1206
+ Tuple[
1207
+ Annotated[StrictFloat, Field(gt=0)],
1208
+ Annotated[StrictFloat, Field(gt=0)]
1209
+ ]
1210
+ ] = None,
1211
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1212
+ _content_type: Optional[StrictStr] = None,
1213
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1214
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1215
+ ) -> Template:
1216
+ """Update template
1217
+
1218
+ Updates the details of a template. Modify the template name, description and/or `is_public` status to change the public/private visibility of the template.
1219
+
1220
+ :param id: (required)
1221
+ :type id: int
1222
+ :param payload: (required)
1223
+ :type payload: UpdateTemplate
1224
+ :param _request_timeout: timeout setting for this request. If one
1225
+ number provided, it will be total request
1226
+ timeout. It can also be a pair (tuple) of
1227
+ (connection, read) timeouts.
1228
+ :type _request_timeout: int, tuple(int, int), optional
1229
+ :param _request_auth: set to override the auth_settings for an a single
1230
+ request; this effectively ignores the
1231
+ authentication in the spec for a single request.
1232
+ :type _request_auth: dict, optional
1233
+ :param _content_type: force content-type for the request.
1234
+ :type _content_type: str, Optional
1235
+ :param _headers: set to override the headers for a single
1236
+ request; this effectively ignores the headers
1237
+ in the spec for a single request.
1238
+ :type _headers: dict, optional
1239
+ :param _host_index: set to override the host_index for a single
1240
+ request; this effectively ignores the host_index
1241
+ in the spec for a single request.
1242
+ :type _host_index: int, optional
1243
+ :return: Returns the result object.
1244
+ """ # noqa: E501
1245
+
1246
+ _param = self._update_template_serialize(
1247
+ id=id,
1248
+ payload=payload,
1249
+ _request_auth=_request_auth,
1250
+ _content_type=_content_type,
1251
+ _headers=_headers,
1252
+ _host_index=_host_index
1253
+ )
1254
+
1255
+ _response_types_map: Dict[str, Optional[str]] = {
1256
+ '200': "Template",
1257
+ '400': "ErrorResponseModel",
1258
+ '401': "ErrorResponseModel",
1259
+ '404': "ErrorResponseModel",
1260
+ '500': None,
1261
+ }
1262
+ response_data = self.api_client.call_api(
1263
+ *_param,
1264
+ _request_timeout=_request_timeout
1265
+ )
1266
+ response_data.read()
1267
+ return self.api_client.response_deserialize(
1268
+ response_data=response_data,
1269
+ response_types_map=_response_types_map,
1270
+ ).data
1271
+
1272
+
1273
+ @validate_call
1274
+ def update_template_with_http_info(
1275
+ self,
1276
+ id: StrictInt,
1277
+ payload: UpdateTemplate,
1278
+ _request_timeout: Union[
1279
+ None,
1280
+ Annotated[StrictFloat, Field(gt=0)],
1281
+ Tuple[
1282
+ Annotated[StrictFloat, Field(gt=0)],
1283
+ Annotated[StrictFloat, Field(gt=0)]
1284
+ ]
1285
+ ] = None,
1286
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1287
+ _content_type: Optional[StrictStr] = None,
1288
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1289
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1290
+ ) -> ApiResponse[Template]:
1291
+ """Update template
1292
+
1293
+ Updates the details of a template. Modify the template name, description and/or `is_public` status to change the public/private visibility of the template.
1294
+
1295
+ :param id: (required)
1296
+ :type id: int
1297
+ :param payload: (required)
1298
+ :type payload: UpdateTemplate
1299
+ :param _request_timeout: timeout setting for this request. If one
1300
+ number provided, it will be total request
1301
+ timeout. It can also be a pair (tuple) of
1302
+ (connection, read) timeouts.
1303
+ :type _request_timeout: int, tuple(int, int), optional
1304
+ :param _request_auth: set to override the auth_settings for an a single
1305
+ request; this effectively ignores the
1306
+ authentication in the spec for a single request.
1307
+ :type _request_auth: dict, optional
1308
+ :param _content_type: force content-type for the request.
1309
+ :type _content_type: str, Optional
1310
+ :param _headers: set to override the headers for a single
1311
+ request; this effectively ignores the headers
1312
+ in the spec for a single request.
1313
+ :type _headers: dict, optional
1314
+ :param _host_index: set to override the host_index for a single
1315
+ request; this effectively ignores the host_index
1316
+ in the spec for a single request.
1317
+ :type _host_index: int, optional
1318
+ :return: Returns the result object.
1319
+ """ # noqa: E501
1320
+
1321
+ _param = self._update_template_serialize(
1322
+ id=id,
1323
+ payload=payload,
1324
+ _request_auth=_request_auth,
1325
+ _content_type=_content_type,
1326
+ _headers=_headers,
1327
+ _host_index=_host_index
1328
+ )
1329
+
1330
+ _response_types_map: Dict[str, Optional[str]] = {
1331
+ '200': "Template",
1332
+ '400': "ErrorResponseModel",
1333
+ '401': "ErrorResponseModel",
1334
+ '404': "ErrorResponseModel",
1335
+ '500': None,
1336
+ }
1337
+ response_data = self.api_client.call_api(
1338
+ *_param,
1339
+ _request_timeout=_request_timeout
1340
+ )
1341
+ response_data.read()
1342
+ return self.api_client.response_deserialize(
1343
+ response_data=response_data,
1344
+ response_types_map=_response_types_map,
1345
+ )
1346
+
1347
+
1348
+ @validate_call
1349
+ def update_template_without_preload_content(
1350
+ self,
1351
+ id: StrictInt,
1352
+ payload: UpdateTemplate,
1353
+ _request_timeout: Union[
1354
+ None,
1355
+ Annotated[StrictFloat, Field(gt=0)],
1356
+ Tuple[
1357
+ Annotated[StrictFloat, Field(gt=0)],
1358
+ Annotated[StrictFloat, Field(gt=0)]
1359
+ ]
1360
+ ] = None,
1361
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1362
+ _content_type: Optional[StrictStr] = None,
1363
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1364
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1365
+ ) -> RESTResponseType:
1366
+ """Update template
1367
+
1368
+ Updates the details of a template. Modify the template name, description and/or `is_public` status to change the public/private visibility of the template.
1369
+
1370
+ :param id: (required)
1371
+ :type id: int
1372
+ :param payload: (required)
1373
+ :type payload: UpdateTemplate
1374
+ :param _request_timeout: timeout setting for this request. If one
1375
+ number provided, it will be total request
1376
+ timeout. It can also be a pair (tuple) of
1377
+ (connection, read) timeouts.
1378
+ :type _request_timeout: int, tuple(int, int), optional
1379
+ :param _request_auth: set to override the auth_settings for an a single
1380
+ request; this effectively ignores the
1381
+ authentication in the spec for a single request.
1382
+ :type _request_auth: dict, optional
1383
+ :param _content_type: force content-type for the request.
1384
+ :type _content_type: str, Optional
1385
+ :param _headers: set to override the headers for a single
1386
+ request; this effectively ignores the headers
1387
+ in the spec for a single request.
1388
+ :type _headers: dict, optional
1389
+ :param _host_index: set to override the host_index for a single
1390
+ request; this effectively ignores the host_index
1391
+ in the spec for a single request.
1392
+ :type _host_index: int, optional
1393
+ :return: Returns the result object.
1394
+ """ # noqa: E501
1395
+
1396
+ _param = self._update_template_serialize(
1397
+ id=id,
1398
+ payload=payload,
1399
+ _request_auth=_request_auth,
1400
+ _content_type=_content_type,
1401
+ _headers=_headers,
1402
+ _host_index=_host_index
1403
+ )
1404
+
1405
+ _response_types_map: Dict[str, Optional[str]] = {
1406
+ '200': "Template",
1407
+ '400': "ErrorResponseModel",
1408
+ '401': "ErrorResponseModel",
1409
+ '404': "ErrorResponseModel",
1410
+ '500': None,
1411
+ }
1412
+ response_data = self.api_client.call_api(
1413
+ *_param,
1414
+ _request_timeout=_request_timeout
1415
+ )
1416
+ return response_data.response
1417
+
1418
+
1419
+ def _update_template_serialize(
1420
+ self,
1421
+ id,
1422
+ payload,
1423
+ _request_auth,
1424
+ _content_type,
1425
+ _headers,
1426
+ _host_index,
1427
+ ) -> RequestSerialized:
1428
+
1429
+ _host = None
1430
+
1431
+ _collection_formats: Dict[str, str] = {
1432
+ }
1433
+
1434
+ _path_params: Dict[str, str] = {}
1435
+ _query_params: List[Tuple[str, str]] = []
1436
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1437
+ _form_params: List[Tuple[str, str]] = []
1438
+ _files: Dict[
1439
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1440
+ ] = {}
1441
+ _body_params: Optional[bytes] = None
1442
+
1443
+ # process the path parameters
1444
+ if id is not None:
1445
+ _path_params['id'] = id
1446
+ # process the query parameters
1447
+ # process the header parameters
1448
+ # process the form parameters
1449
+ # process the body parameter
1450
+ if payload is not None:
1451
+ _body_params = payload
1452
+
1453
+
1454
+ # set the HTTP header `Accept`
1455
+ if 'Accept' not in _header_params:
1456
+ _header_params['Accept'] = self.api_client.select_header_accept(
1457
+ [
1458
+ 'application/json'
1459
+ ]
1460
+ )
1461
+
1462
+ # set the HTTP header `Content-Type`
1463
+ if _content_type:
1464
+ _header_params['Content-Type'] = _content_type
1465
+ else:
1466
+ _default_content_type = (
1467
+ self.api_client.select_header_content_type(
1468
+ [
1469
+ 'application/json'
1470
+ ]
1471
+ )
1472
+ )
1473
+ if _default_content_type is not None:
1474
+ _header_params['Content-Type'] = _default_content_type
1475
+
1476
+ # authentication setting
1477
+ _auth_settings: List[str] = [
1478
+ 'apiKey',
1479
+ 'accessToken'
1480
+ ]
1481
+
1482
+ return self.api_client.param_serialize(
1483
+ method='PUT',
1484
+ resource_path='/core/marketplace/templates/{id}',
1485
+ path_params=_path_params,
1486
+ query_params=_query_params,
1487
+ header_params=_header_params,
1488
+ body=_body_params,
1489
+ post_params=_form_params,
1490
+ files=_files,
1491
+ auth_settings=_auth_settings,
1492
+ collection_formats=_collection_formats,
1493
+ _host=_host,
1494
+ _request_auth=_request_auth
1495
+ )
1496
+
1497
+