agenta 0.48.9__py3-none-any.whl → 0.48.10__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.

Potentially problematic release.


This version of agenta might be problematic. Click here for more details.

Files changed (295) hide show
  1. agenta/__init__.py +3 -2
  2. agenta/client/Readme.md +258 -80
  3. agenta/client/__init__.py +205 -29
  4. agenta/client/backend/__init__.py +461 -0
  5. agenta/client/backend/access_control/__init__.py +2 -0
  6. agenta/client/backend/access_control/client.py +53 -73
  7. agenta/client/backend/access_control/raw_client.py +180 -0
  8. agenta/client/backend/admin/__init__.py +2 -0
  9. agenta/client/backend/admin/client.py +473 -268
  10. agenta/client/backend/admin/raw_client.py +1017 -0
  11. agenta/client/backend/api_keys/__init__.py +2 -0
  12. agenta/client/backend/api_keys/client.py +43 -276
  13. agenta/client/backend/api_keys/raw_client.py +364 -0
  14. agenta/client/backend/apps/__init__.py +2 -0
  15. agenta/client/backend/apps/client.py +132 -895
  16. agenta/client/backend/apps/raw_client.py +1516 -0
  17. agenta/client/backend/bases/__init__.py +2 -0
  18. agenta/client/backend/bases/client.py +33 -73
  19. agenta/client/backend/bases/raw_client.py +179 -0
  20. agenta/client/backend/billing/__init__.py +3 -0
  21. agenta/client/backend/billing/client.py +564 -0
  22. agenta/client/backend/billing/raw_client.py +805 -0
  23. agenta/client/backend/client.py +1268 -0
  24. agenta/client/backend/configs/__init__.py +2 -0
  25. agenta/client/backend/configs/client.py +49 -361
  26. agenta/client/backend/configs/raw_client.py +402 -0
  27. agenta/client/backend/containers/__init__.py +1 -3
  28. agenta/client/backend/containers/client.py +25 -548
  29. agenta/client/backend/containers/raw_client.py +112 -0
  30. agenta/client/backend/core/__init__.py +5 -0
  31. agenta/client/backend/core/api_error.py +12 -6
  32. agenta/client/backend/core/client_wrapper.py +4 -4
  33. agenta/client/backend/core/file.py +1 -3
  34. agenta/client/backend/core/force_multipart.py +16 -0
  35. agenta/client/backend/core/http_client.py +78 -34
  36. agenta/client/backend/core/http_response.py +55 -0
  37. agenta/client/backend/core/jsonable_encoder.py +0 -1
  38. agenta/client/backend/core/pydantic_utilities.py +88 -113
  39. agenta/client/backend/core/serialization.py +9 -3
  40. agenta/client/backend/environment.py +7 -0
  41. agenta/client/backend/environments/__init__.py +2 -0
  42. agenta/client/backend/environments/client.py +43 -79
  43. agenta/client/backend/environments/raw_client.py +193 -0
  44. agenta/client/backend/errors/__init__.py +2 -0
  45. agenta/client/backend/errors/unprocessable_entity_error.py +8 -2
  46. agenta/client/backend/evals/__init__.py +3 -0
  47. agenta/client/backend/evals/client.py +1042 -0
  48. agenta/client/backend/evals/raw_client.py +1549 -0
  49. agenta/client/backend/evaluations/__init__.py +2 -0
  50. agenta/client/backend/evaluations/client.py +106 -590
  51. agenta/client/backend/evaluations/raw_client.py +1344 -0
  52. agenta/client/backend/evaluators/__init__.py +2 -0
  53. agenta/client/backend/evaluators/client.py +99 -516
  54. agenta/client/backend/evaluators/raw_client.py +1182 -0
  55. agenta/client/backend/human_evaluations/__init__.py +2 -0
  56. agenta/client/backend/human_evaluations/client.py +120 -680
  57. agenta/client/backend/human_evaluations/raw_client.py +1577 -0
  58. agenta/client/backend/observability/__init__.py +14 -2
  59. agenta/client/backend/observability/client.py +185 -341
  60. agenta/client/backend/observability/raw_client.py +943 -0
  61. agenta/client/backend/observability/types/__init__.py +10 -2
  62. agenta/client/backend/observability/types/{format.py → fetch_trace_by_id_request_trace_id.py} +1 -1
  63. agenta/client/backend/observability/types/fetch_trace_by_id_response.py +15 -0
  64. agenta/client/backend/observability/types/query_analytics_response.py +2 -1
  65. agenta/client/backend/observability/types/query_traces_response.py +7 -3
  66. agenta/client/backend/organization/__init__.py +2 -0
  67. agenta/client/backend/organization/client.py +105 -361
  68. agenta/client/backend/organization/raw_client.py +774 -0
  69. agenta/client/backend/raw_client.py +1432 -0
  70. agenta/client/backend/scopes/__init__.py +2 -0
  71. agenta/client/backend/scopes/client.py +31 -45
  72. agenta/client/backend/scopes/raw_client.py +105 -0
  73. agenta/client/backend/testsets/__init__.py +14 -0
  74. agenta/client/backend/testsets/client.py +1098 -653
  75. agenta/client/backend/testsets/raw_client.py +2348 -0
  76. agenta/client/backend/testsets/types/__init__.py +17 -0
  77. agenta/client/backend/testsets/types/create_testset_from_file_request_file_type.py +7 -0
  78. agenta/client/backend/testsets/types/fetch_testset_to_file_request_file_type.py +7 -0
  79. agenta/client/backend/testsets/types/update_testset_from_file_request_file_type.py +7 -0
  80. agenta/client/backend/tracing/__init__.py +7 -0
  81. agenta/client/backend/tracing/client.py +782 -0
  82. agenta/client/backend/tracing/raw_client.py +1223 -0
  83. agenta/client/backend/tracing/types/__init__.py +8 -0
  84. agenta/client/backend/{types/variant_action_enum.py → tracing/types/fetch_trace_request_trace_id.py} +1 -1
  85. agenta/client/backend/tracing/types/remove_trace_request_trace_id.py +5 -0
  86. agenta/client/backend/types/__init__.py +153 -26
  87. agenta/client/backend/types/account_request.py +24 -0
  88. agenta/client/backend/types/account_response.py +5 -7
  89. agenta/client/backend/types/agenta_node_dto.py +13 -13
  90. agenta/client/backend/types/agenta_node_dto_nodes_value.py +1 -0
  91. agenta/client/backend/types/agenta_nodes_response.py +14 -8
  92. agenta/client/backend/types/agenta_root_dto.py +16 -8
  93. agenta/client/backend/types/agenta_roots_response.py +16 -8
  94. agenta/client/backend/types/agenta_tree_dto.py +16 -8
  95. agenta/client/backend/types/agenta_trees_response.py +16 -8
  96. agenta/client/backend/types/aggregated_result.py +5 -7
  97. agenta/client/backend/types/aggregated_result_evaluator_config.py +1 -0
  98. agenta/client/backend/types/analytics_response.py +4 -6
  99. agenta/client/backend/types/annotation.py +50 -0
  100. agenta/client/backend/types/annotation_create.py +39 -0
  101. agenta/client/backend/types/annotation_edit.py +31 -0
  102. agenta/client/backend/types/annotation_kind.py +5 -0
  103. agenta/client/backend/types/{uri.py → annotation_link.py} +6 -7
  104. agenta/client/backend/types/{provider_key_dto.py → annotation_link_response.py} +6 -7
  105. agenta/client/backend/types/annotation_query.py +40 -0
  106. agenta/client/backend/types/annotation_query_request.py +20 -0
  107. agenta/client/backend/types/annotation_reference.py +21 -0
  108. agenta/client/backend/types/annotation_references.py +22 -0
  109. agenta/client/backend/types/{docker_env_vars.py → annotation_response.py} +6 -7
  110. agenta/client/backend/types/annotation_source.py +5 -0
  111. agenta/client/backend/types/annotations_response.py +24 -0
  112. agenta/client/backend/types/app.py +3 -5
  113. agenta/client/backend/types/app_variant_response.py +3 -6
  114. agenta/client/backend/types/app_variant_revision.py +5 -6
  115. agenta/client/backend/types/artifact.py +44 -0
  116. agenta/client/backend/types/base_output.py +3 -5
  117. agenta/client/backend/types/body_fetch_workflow_revision.py +21 -0
  118. agenta/client/backend/types/body_import_testset.py +3 -5
  119. agenta/client/backend/types/bucket_dto.py +4 -6
  120. agenta/client/backend/types/collect_status_response.py +3 -5
  121. agenta/client/backend/types/config_db.py +3 -5
  122. agenta/client/backend/types/config_dto.py +5 -7
  123. agenta/client/backend/types/config_response_model.py +5 -7
  124. agenta/client/backend/types/correct_answer.py +3 -5
  125. agenta/client/backend/types/create_app_output.py +3 -5
  126. agenta/client/backend/types/custom_model_settings_dto.py +3 -5
  127. agenta/client/backend/types/custom_provider_dto.py +6 -9
  128. agenta/client/backend/types/custom_provider_kind.py +5 -5
  129. agenta/client/backend/types/custom_provider_settings_dto.py +3 -5
  130. agenta/client/backend/types/data.py +2 -1
  131. agenta/client/backend/types/delete_evaluation.py +3 -5
  132. agenta/client/backend/types/environment_output.py +3 -5
  133. agenta/client/backend/types/environment_output_extended.py +4 -6
  134. agenta/client/backend/types/environment_revision.py +5 -5
  135. agenta/client/backend/types/error.py +3 -5
  136. agenta/client/backend/types/evaluation.py +6 -8
  137. agenta/client/backend/types/evaluation_scenario.py +5 -7
  138. agenta/client/backend/types/evaluation_scenario_input.py +3 -5
  139. agenta/client/backend/types/evaluation_scenario_output.py +4 -6
  140. agenta/client/backend/types/evaluation_scenario_result.py +4 -6
  141. agenta/client/backend/types/evaluator.py +31 -12
  142. agenta/client/backend/types/evaluator_config.py +3 -5
  143. agenta/client/backend/types/evaluator_flags.py +21 -0
  144. agenta/client/backend/types/evaluator_mapping_output_interface.py +3 -5
  145. agenta/client/backend/types/evaluator_output_interface.py +3 -5
  146. agenta/client/backend/types/evaluator_query.py +32 -0
  147. agenta/client/backend/types/evaluator_query_request.py +30 -0
  148. agenta/client/backend/types/evaluator_request.py +20 -0
  149. agenta/client/backend/types/evaluator_response.py +21 -0
  150. agenta/client/backend/types/evaluators_response.py +21 -0
  151. agenta/client/backend/types/exception_dto.py +3 -5
  152. agenta/client/backend/types/{o_tel_spans_response.py → extended_o_tel_tracing_response.py} +5 -7
  153. agenta/client/backend/types/focus.py +5 -0
  154. agenta/client/backend/types/format.py +5 -0
  155. agenta/client/backend/types/full_json_input.py +34 -0
  156. agenta/client/backend/types/full_json_output.py +29 -0
  157. agenta/client/backend/types/get_config_response.py +3 -5
  158. agenta/client/backend/types/{header_dto.py → header.py} +4 -6
  159. agenta/client/backend/types/http_validation_error.py +4 -6
  160. agenta/client/backend/types/human_evaluation.py +3 -5
  161. agenta/client/backend/types/human_evaluation_scenario.py +4 -6
  162. agenta/client/backend/types/human_evaluation_scenario_input.py +3 -5
  163. agenta/client/backend/types/human_evaluation_scenario_output.py +3 -5
  164. agenta/client/backend/types/invite_request.py +4 -6
  165. agenta/client/backend/types/legacy_analytics_response.py +4 -6
  166. agenta/client/backend/types/legacy_data_point.py +3 -5
  167. agenta/client/backend/types/legacy_evaluator.py +26 -0
  168. agenta/client/backend/types/legacy_scope_request.py +4 -6
  169. agenta/client/backend/types/legacy_scopes_response.py +3 -5
  170. agenta/client/backend/types/legacy_subscription_request.py +19 -0
  171. agenta/client/backend/types/legacy_user_request.py +5 -7
  172. agenta/client/backend/types/legacy_user_response.py +3 -5
  173. agenta/client/backend/types/lifecycle_dto.py +3 -5
  174. agenta/client/backend/types/link_dto.py +4 -6
  175. agenta/client/backend/types/list_api_keys_response.py +3 -5
  176. agenta/client/backend/types/llm_run_rate_limit.py +3 -5
  177. agenta/client/backend/types/meta_request.py +30 -0
  178. agenta/client/backend/types/metrics_dto.py +3 -5
  179. agenta/client/backend/types/new_testset.py +3 -5
  180. agenta/client/backend/types/node_dto.py +4 -6
  181. agenta/client/backend/types/o_tel_context_dto.py +3 -5
  182. agenta/client/backend/types/o_tel_event.py +35 -0
  183. agenta/client/backend/types/o_tel_event_dto.py +3 -5
  184. agenta/client/backend/types/o_tel_extra_dto.py +4 -6
  185. agenta/client/backend/types/o_tel_flat_span.py +56 -0
  186. agenta/client/backend/types/o_tel_flat_span_input_end_time.py +6 -0
  187. agenta/client/backend/types/o_tel_flat_span_input_start_time.py +6 -0
  188. agenta/client/backend/types/o_tel_flat_span_output_end_time.py +6 -0
  189. agenta/client/backend/types/o_tel_flat_span_output_start_time.py +6 -0
  190. agenta/client/backend/types/o_tel_link.py +34 -0
  191. agenta/client/backend/types/o_tel_link_dto.py +4 -6
  192. agenta/client/backend/types/o_tel_links_response.py +22 -0
  193. agenta/client/backend/types/o_tel_span.py +58 -0
  194. agenta/client/backend/types/o_tel_span_dto.py +8 -10
  195. agenta/client/backend/types/o_tel_span_input_end_time.py +6 -0
  196. agenta/client/backend/types/o_tel_span_input_spans_value.py +7 -0
  197. agenta/client/backend/types/o_tel_span_input_start_time.py +6 -0
  198. agenta/client/backend/types/o_tel_span_output_end_time.py +6 -0
  199. agenta/client/backend/types/o_tel_span_output_spans_value.py +30 -0
  200. agenta/client/backend/types/o_tel_span_output_start_time.py +6 -0
  201. agenta/client/backend/types/o_tel_spans_tree.py +22 -0
  202. agenta/client/backend/types/o_tel_spans_tree_input_spans_value.py +7 -0
  203. agenta/client/backend/types/o_tel_spans_tree_output_spans_value.py +5 -0
  204. agenta/client/backend/types/o_tel_status_code.py +1 -1
  205. agenta/client/backend/types/o_tel_tracing_data_response.py +22 -0
  206. agenta/client/backend/types/o_tel_tracing_request.py +22 -0
  207. agenta/client/backend/types/o_tel_tracing_response.py +27 -0
  208. agenta/client/backend/types/organization.py +3 -5
  209. agenta/client/backend/types/organization_details.py +3 -5
  210. agenta/client/backend/types/organization_membership_request.py +5 -7
  211. agenta/client/backend/types/organization_output.py +3 -5
  212. agenta/client/backend/types/organization_request.py +3 -5
  213. agenta/client/backend/types/parent_dto.py +3 -5
  214. agenta/client/backend/types/permission.py +11 -0
  215. agenta/client/backend/types/plan.py +14 -0
  216. agenta/client/backend/types/project_membership_request.py +5 -7
  217. agenta/client/backend/types/project_request.py +4 -6
  218. agenta/client/backend/types/project_scope.py +5 -7
  219. agenta/client/backend/types/projects_response.py +3 -5
  220. agenta/client/backend/types/recursive_types.py +23 -0
  221. agenta/client/backend/types/reference.py +18 -5
  222. agenta/client/backend/types/reference_dto.py +4 -5
  223. agenta/client/backend/types/reference_request_model.py +4 -5
  224. agenta/client/backend/types/result.py +4 -6
  225. agenta/client/backend/types/root_dto.py +3 -5
  226. agenta/client/backend/types/scopes_response_model.py +4 -6
  227. agenta/client/backend/types/secret_dto.py +5 -7
  228. agenta/client/backend/types/secret_response_dto.py +11 -11
  229. agenta/client/backend/types/simple_evaluation_output.py +4 -6
  230. agenta/client/backend/types/span_dto.py +18 -14
  231. agenta/client/backend/types/span_dto_nodes_value.py +1 -1
  232. agenta/client/backend/types/standard_provider_dto.py +5 -7
  233. agenta/client/backend/types/standard_provider_settings_dto.py +3 -5
  234. agenta/client/backend/types/status_dto.py +4 -6
  235. agenta/client/backend/types/tags_request.py +30 -0
  236. agenta/client/backend/types/test_set_output_response.py +5 -7
  237. agenta/client/backend/types/test_set_simple_response.py +3 -5
  238. agenta/client/backend/types/testcase_response.py +33 -0
  239. agenta/client/backend/types/testset.py +46 -0
  240. agenta/client/backend/types/testset_request.py +20 -0
  241. agenta/client/backend/types/testset_response.py +21 -0
  242. agenta/client/backend/types/testsets_response.py +21 -0
  243. agenta/client/backend/types/time_dto.py +3 -5
  244. agenta/client/backend/types/timestamp.py +6 -0
  245. agenta/client/backend/types/tree_dto.py +4 -6
  246. agenta/client/backend/types/update_app_output.py +3 -5
  247. agenta/client/backend/types/user_request.py +3 -5
  248. agenta/client/backend/types/validation_error.py +4 -6
  249. agenta/client/backend/types/workflow_artifact.py +45 -0
  250. agenta/client/backend/types/workflow_data.py +20 -0
  251. agenta/client/backend/types/workflow_flags.py +21 -0
  252. agenta/client/backend/types/workflow_request.py +20 -0
  253. agenta/client/backend/types/workflow_response.py +21 -0
  254. agenta/client/backend/types/workflow_revision.py +57 -0
  255. agenta/client/backend/types/workflow_revision_request.py +20 -0
  256. agenta/client/backend/types/workflow_revision_response.py +21 -0
  257. agenta/client/backend/types/workflow_revisions_response.py +21 -0
  258. agenta/client/backend/types/workflow_variant.py +48 -0
  259. agenta/client/backend/types/workflow_variant_request.py +20 -0
  260. agenta/client/backend/types/workflow_variant_response.py +21 -0
  261. agenta/client/backend/types/workflow_variants_response.py +21 -0
  262. agenta/client/backend/types/workflows_response.py +21 -0
  263. agenta/client/backend/types/workspace.py +3 -5
  264. agenta/client/backend/types/workspace_member_response.py +4 -6
  265. agenta/client/backend/types/workspace_membership_request.py +5 -7
  266. agenta/client/backend/types/workspace_permission.py +5 -7
  267. agenta/client/backend/types/workspace_request.py +4 -6
  268. agenta/client/backend/types/workspace_response.py +4 -6
  269. agenta/client/backend/variants/__init__.py +2 -0
  270. agenta/client/backend/variants/client.py +306 -1651
  271. agenta/client/backend/variants/raw_client.py +2482 -0
  272. agenta/client/backend/variants/types/__init__.py +2 -0
  273. agenta/client/backend/variants/types/add_variant_from_base_and_config_response.py +1 -0
  274. agenta/client/backend/vault/__init__.py +2 -0
  275. agenta/client/backend/vault/client.py +69 -323
  276. agenta/client/backend/vault/raw_client.py +616 -0
  277. agenta/client/backend/workflows/__init__.py +3 -0
  278. agenta/client/backend/workflows/client.py +2398 -0
  279. agenta/client/backend/workflows/raw_client.py +3639 -0
  280. agenta/client/backend/workspace/__init__.py +2 -0
  281. agenta/client/backend/workspace/client.py +46 -147
  282. agenta/client/backend/workspace/raw_client.py +376 -0
  283. agenta/client/types.py +4 -0
  284. agenta/sdk/types.py +28 -1
  285. {agenta-0.48.9.dist-info → agenta-0.48.10.dist-info}/METADATA +1 -1
  286. agenta-0.48.10.dist-info/RECORD +362 -0
  287. agenta/client/backend/containers/types/__init__.py +0 -5
  288. agenta/client/backend/containers/types/container_templates_response.py +0 -6
  289. agenta/client/backend/types/image.py +0 -25
  290. agenta/client/backend/types/provider_kind.py +0 -21
  291. agenta/client/backend/types/template.py +0 -23
  292. agenta/client/backend/types/template_image_info.py +0 -29
  293. agenta/client/backend/types/variant_action.py +0 -22
  294. agenta-0.48.9.dist-info/RECORD +0 -255
  295. {agenta-0.48.9.dist-info → agenta-0.48.10.dist-info}/WHEEL +0 -0
@@ -1,28 +1,19 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing
4
- from ..core.client_wrapper import SyncClientWrapper
4
+
5
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
5
6
  from ..core.request_options import RequestOptions
6
- from .types.add_variant_from_base_and_config_response import (
7
- AddVariantFromBaseAndConfigResponse,
8
- )
9
- from ..core.pydantic_utilities import parse_obj_as
10
- from ..errors.unprocessable_entity_error import UnprocessableEntityError
11
- from ..types.http_validation_error import HttpValidationError
12
- from json.decoder import JSONDecodeError
13
- from ..core.api_error import ApiError
14
7
  from ..types.app_variant_response import AppVariantResponse
15
- from ..core.jsonable_encoder import jsonable_encoder
16
- from ..types.variant_action import VariantAction
17
- from ..types.docker_env_vars import DockerEnvVars
18
- from ..types.uri import Uri
19
- from ..core.serialization import convert_and_respect_annotation_metadata
20
8
  from ..types.app_variant_revision import AppVariantRevision
21
- from ..types.reference_request_model import ReferenceRequestModel
22
- from ..types.config_response_model import ConfigResponseModel
23
9
  from ..types.config_dto import ConfigDto
10
+ from ..types.config_response_model import ConfigResponseModel
24
11
  from ..types.reference_dto import ReferenceDto
25
- from ..core.client_wrapper import AsyncClientWrapper
12
+ from ..types.reference_request_model import ReferenceRequestModel
13
+ from .raw_client import AsyncRawVariantsClient, RawVariantsClient
14
+ from .types.add_variant_from_base_and_config_response import (
15
+ AddVariantFromBaseAndConfigResponse,
16
+ )
26
17
 
27
18
  # this is used as the default value for optional parameters
28
19
  OMIT = typing.cast(typing.Any, ...)
@@ -30,7 +21,18 @@ OMIT = typing.cast(typing.Any, ...)
30
21
 
31
22
  class VariantsClient:
32
23
  def __init__(self, *, client_wrapper: SyncClientWrapper):
33
- self._client_wrapper = client_wrapper
24
+ self._raw_client = RawVariantsClient(client_wrapper=client_wrapper)
25
+
26
+ @property
27
+ def with_raw_response(self) -> RawVariantsClient:
28
+ """
29
+ Retrieves a raw implementation of this client that returns raw responses.
30
+
31
+ Returns
32
+ -------
33
+ RawVariantsClient
34
+ """
35
+ return self._raw_client
34
36
 
35
37
  def add_variant_from_base_and_config(
36
38
  self,
@@ -39,6 +41,7 @@ class VariantsClient:
39
41
  new_variant_name: str,
40
42
  new_config_name: str,
41
43
  parameters: typing.Dict[str, typing.Optional[typing.Any]],
44
+ commit_message: typing.Optional[str] = OMIT,
42
45
  request_options: typing.Optional[RequestOptions] = None,
43
46
  ) -> AddVariantFromBaseAndConfigResponse:
44
47
  """
@@ -64,6 +67,8 @@ class VariantsClient:
64
67
 
65
68
  parameters : typing.Dict[str, typing.Optional[typing.Any]]
66
69
 
70
+ commit_message : typing.Optional[str]
71
+
67
72
  request_options : typing.Optional[RequestOptions]
68
73
  Request-specific configuration.
69
74
 
@@ -78,7 +83,6 @@ class VariantsClient:
78
83
 
79
84
  client = AgentaApi(
80
85
  api_key="YOUR_API_KEY",
81
- base_url="https://yourhost.com/path/to/api",
82
86
  )
83
87
  client.variants.add_variant_from_base_and_config(
84
88
  base_id="base_id",
@@ -87,44 +91,15 @@ class VariantsClient:
87
91
  parameters={"key": "value"},
88
92
  )
89
93
  """
90
- _response = self._client_wrapper.httpx_client.request(
91
- "variants/from-base",
92
- method="POST",
93
- json={
94
- "base_id": base_id,
95
- "new_variant_name": new_variant_name,
96
- "new_config_name": new_config_name,
97
- "parameters": parameters,
98
- },
99
- headers={
100
- "content-type": "application/json",
101
- },
94
+ _response = self._raw_client.add_variant_from_base_and_config(
95
+ base_id=base_id,
96
+ new_variant_name=new_variant_name,
97
+ new_config_name=new_config_name,
98
+ parameters=parameters,
99
+ commit_message=commit_message,
102
100
  request_options=request_options,
103
- omit=OMIT,
104
- )
105
- try:
106
- if 200 <= _response.status_code < 300:
107
- return typing.cast(
108
- AddVariantFromBaseAndConfigResponse,
109
- parse_obj_as(
110
- type_=AddVariantFromBaseAndConfigResponse, # type: ignore
111
- object_=_response.json(),
112
- ),
113
- )
114
- if _response.status_code == 422:
115
- raise UnprocessableEntityError(
116
- typing.cast(
117
- HttpValidationError,
118
- parse_obj_as(
119
- type_=HttpValidationError, # type: ignore
120
- object_=_response.json(),
121
- ),
122
- )
123
- )
124
- _response_json = _response.json()
125
- except JSONDecodeError:
126
- raise ApiError(status_code=_response.status_code, body=_response.text)
127
- raise ApiError(status_code=_response.status_code, body=_response_json)
101
+ )
102
+ return _response.data
128
103
 
129
104
  def get_variant(
130
105
  self,
@@ -151,144 +126,24 @@ class VariantsClient:
151
126
 
152
127
  client = AgentaApi(
153
128
  api_key="YOUR_API_KEY",
154
- base_url="https://yourhost.com/path/to/api",
155
129
  )
156
130
  client.variants.get_variant(
157
131
  variant_id="variant_id",
158
132
  )
159
133
  """
160
- _response = self._client_wrapper.httpx_client.request(
161
- f"variants/{jsonable_encoder(variant_id)}",
162
- method="GET",
163
- request_options=request_options,
134
+ _response = self._raw_client.get_variant(
135
+ variant_id, request_options=request_options
164
136
  )
165
- try:
166
- if 200 <= _response.status_code < 300:
167
- return typing.cast(
168
- AppVariantResponse,
169
- parse_obj_as(
170
- type_=AppVariantResponse, # type: ignore
171
- object_=_response.json(),
172
- ),
173
- )
174
- if _response.status_code == 422:
175
- raise UnprocessableEntityError(
176
- typing.cast(
177
- HttpValidationError,
178
- parse_obj_as(
179
- type_=HttpValidationError, # type: ignore
180
- object_=_response.json(),
181
- ),
182
- )
183
- )
184
- _response_json = _response.json()
185
- except JSONDecodeError:
186
- raise ApiError(status_code=_response.status_code, body=_response.text)
187
- raise ApiError(status_code=_response.status_code, body=_response_json)
188
-
189
- def start_variant(
190
- self,
191
- variant_id: str,
192
- *,
193
- action: VariantAction,
194
- env_vars: typing.Optional[DockerEnvVars] = OMIT,
195
- request_options: typing.Optional[RequestOptions] = None,
196
- ) -> Uri:
197
- """
198
- Start a variant of an app.
199
-
200
- Args:
201
- variant_id (str): The ID of the variant to start.
202
- action (VariantAction): The action to perform on the variant (start).
203
- env_vars (Optional[DockerEnvVars], optional): The environment variables to inject to the Docker container. Defaults to None.
204
- =
205
- Returns:
206
- URI: The URL of the started variant.
207
-
208
- Raises:
209
- HTTPException: If the app container cannot be started.
210
-
211
- Parameters
212
- ----------
213
- variant_id : str
214
-
215
- action : VariantAction
216
-
217
- env_vars : typing.Optional[DockerEnvVars]
137
+ return _response.data
218
138
 
219
- request_options : typing.Optional[RequestOptions]
220
- Request-specific configuration.
221
-
222
- Returns
223
- -------
224
- Uri
225
- Successful Response
226
-
227
- Examples
228
- --------
229
- from agenta import AgentaApi, VariantAction
230
-
231
- client = AgentaApi(
232
- api_key="YOUR_API_KEY",
233
- base_url="https://yourhost.com/path/to/api",
234
- )
235
- client.variants.start_variant(
236
- variant_id="variant_id",
237
- action=VariantAction(
238
- action="START",
239
- ),
240
- )
241
- """
242
- _response = self._client_wrapper.httpx_client.request(
243
- f"variants/{jsonable_encoder(variant_id)}",
244
- method="PUT",
245
- json={
246
- "action": convert_and_respect_annotation_metadata(
247
- object_=action, annotation=VariantAction, direction="write"
248
- ),
249
- "env_vars": convert_and_respect_annotation_metadata(
250
- object_=env_vars, annotation=DockerEnvVars, direction="write"
251
- ),
252
- },
253
- headers={
254
- "content-type": "application/json",
255
- },
256
- request_options=request_options,
257
- omit=OMIT,
258
- )
259
- try:
260
- if 200 <= _response.status_code < 300:
261
- return typing.cast(
262
- Uri,
263
- parse_obj_as(
264
- type_=Uri, # type: ignore
265
- object_=_response.json(),
266
- ),
267
- )
268
- if _response.status_code == 422:
269
- raise UnprocessableEntityError(
270
- typing.cast(
271
- HttpValidationError,
272
- parse_obj_as(
273
- type_=HttpValidationError, # type: ignore
274
- object_=_response.json(),
275
- ),
276
- )
277
- )
278
- _response_json = _response.json()
279
- except JSONDecodeError:
280
- raise ApiError(status_code=_response.status_code, body=_response.text)
281
- raise ApiError(status_code=_response.status_code, body=_response_json)
282
-
283
- def remove_variant(
139
+ def mark_variant_as_hidden(
284
140
  self,
285
141
  variant_id: str,
286
142
  *,
287
143
  request_options: typing.Optional[RequestOptions] = None,
288
144
  ) -> typing.Optional[typing.Any]:
289
145
  """
290
- Remove a variant from the server.
291
- In the case it's the last variant using the image, stop the container and remove the image.
146
+ Mark a variant as hidden from the UI.
292
147
 
293
148
  Arguments:
294
149
  app_variant -- AppVariant to remove
@@ -314,46 +169,22 @@ class VariantsClient:
314
169
 
315
170
  client = AgentaApi(
316
171
  api_key="YOUR_API_KEY",
317
- base_url="https://yourhost.com/path/to/api",
318
172
  )
319
- client.variants.remove_variant(
173
+ client.variants.mark_variant_as_hidden(
320
174
  variant_id="variant_id",
321
175
  )
322
176
  """
323
- _response = self._client_wrapper.httpx_client.request(
324
- f"variants/{jsonable_encoder(variant_id)}",
325
- method="DELETE",
326
- request_options=request_options,
177
+ _response = self._raw_client.mark_variant_as_hidden(
178
+ variant_id, request_options=request_options
327
179
  )
328
- try:
329
- if 200 <= _response.status_code < 300:
330
- return typing.cast(
331
- typing.Optional[typing.Any],
332
- parse_obj_as(
333
- type_=typing.Optional[typing.Any], # type: ignore
334
- object_=_response.json(),
335
- ),
336
- )
337
- if _response.status_code == 422:
338
- raise UnprocessableEntityError(
339
- typing.cast(
340
- HttpValidationError,
341
- parse_obj_as(
342
- type_=HttpValidationError, # type: ignore
343
- object_=_response.json(),
344
- ),
345
- )
346
- )
347
- _response_json = _response.json()
348
- except JSONDecodeError:
349
- raise ApiError(status_code=_response.status_code, body=_response.text)
350
- raise ApiError(status_code=_response.status_code, body=_response_json)
180
+ return _response.data
351
181
 
352
182
  def update_variant_parameters(
353
183
  self,
354
184
  variant_id: str,
355
185
  *,
356
186
  parameters: typing.Dict[str, typing.Optional[typing.Any]],
187
+ commit_message: typing.Optional[str] = OMIT,
357
188
  request_options: typing.Optional[RequestOptions] = None,
358
189
  ) -> typing.Optional[typing.Any]:
359
190
  """
@@ -375,6 +206,8 @@ class VariantsClient:
375
206
 
376
207
  parameters : typing.Dict[str, typing.Optional[typing.Any]]
377
208
 
209
+ commit_message : typing.Optional[str]
210
+
378
211
  request_options : typing.Optional[RequestOptions]
379
212
  Request-specific configuration.
380
213
 
@@ -389,151 +222,27 @@ class VariantsClient:
389
222
 
390
223
  client = AgentaApi(
391
224
  api_key="YOUR_API_KEY",
392
- base_url="https://yourhost.com/path/to/api",
393
225
  )
394
226
  client.variants.update_variant_parameters(
395
227
  variant_id="variant_id",
396
228
  parameters={"key": "value"},
397
229
  )
398
230
  """
399
- _response = self._client_wrapper.httpx_client.request(
400
- f"variants/{jsonable_encoder(variant_id)}/parameters",
401
- method="PUT",
402
- json={
403
- "parameters": parameters,
404
- },
405
- headers={
406
- "content-type": "application/json",
407
- },
231
+ _response = self._raw_client.update_variant_parameters(
232
+ variant_id,
233
+ parameters=parameters,
234
+ commit_message=commit_message,
408
235
  request_options=request_options,
409
- omit=OMIT,
410
- )
411
- try:
412
- if 200 <= _response.status_code < 300:
413
- return typing.cast(
414
- typing.Optional[typing.Any],
415
- parse_obj_as(
416
- type_=typing.Optional[typing.Any], # type: ignore
417
- object_=_response.json(),
418
- ),
419
- )
420
- if _response.status_code == 422:
421
- raise UnprocessableEntityError(
422
- typing.cast(
423
- HttpValidationError,
424
- parse_obj_as(
425
- type_=HttpValidationError, # type: ignore
426
- object_=_response.json(),
427
- ),
428
- )
429
- )
430
- _response_json = _response.json()
431
- except JSONDecodeError:
432
- raise ApiError(status_code=_response.status_code, body=_response.text)
433
- raise ApiError(status_code=_response.status_code, body=_response_json)
434
-
435
- def update_variant_image(
436
- self,
437
- variant_id: str,
438
- *,
439
- docker_id: str,
440
- tags: str,
441
- type: typing.Optional[str] = OMIT,
442
- organization_id: typing.Optional[str] = OMIT,
443
- workspace_id: typing.Optional[str] = OMIT,
444
- request_options: typing.Optional[RequestOptions] = None,
445
- ) -> typing.Optional[typing.Any]:
446
- """
447
- Updates the image used in an app variant.
448
-
449
- Args:
450
- variant_id (str): The ID of the app variant to update.
451
- image (Image): The image information to update.
452
-
453
- Raises:
454
- HTTPException: If an error occurs while trying to update the app variant.
455
-
456
- Returns:
457
- JSONResponse: A JSON response indicating whether the update was successful or not.
458
-
459
- Parameters
460
- ----------
461
- variant_id : str
462
-
463
- docker_id : str
464
-
465
- tags : str
466
-
467
- type : typing.Optional[str]
468
-
469
- organization_id : typing.Optional[str]
470
-
471
- workspace_id : typing.Optional[str]
472
-
473
- request_options : typing.Optional[RequestOptions]
474
- Request-specific configuration.
475
-
476
- Returns
477
- -------
478
- typing.Optional[typing.Any]
479
- Successful Response
480
-
481
- Examples
482
- --------
483
- from agenta import AgentaApi
484
-
485
- client = AgentaApi(
486
- api_key="YOUR_API_KEY",
487
- base_url="https://yourhost.com/path/to/api",
488
236
  )
489
- client.variants.update_variant_image(
490
- variant_id="variant_id",
491
- docker_id="docker_id",
492
- tags="tags",
493
- )
494
- """
495
- _response = self._client_wrapper.httpx_client.request(
496
- f"variants/{jsonable_encoder(variant_id)}/image",
497
- method="PUT",
498
- json={
499
- "type": type,
500
- "docker_id": docker_id,
501
- "tags": tags,
502
- "organization_id": organization_id,
503
- "workspace_id": workspace_id,
504
- },
505
- request_options=request_options,
506
- omit=OMIT,
507
- )
508
- try:
509
- if 200 <= _response.status_code < 300:
510
- return typing.cast(
511
- typing.Optional[typing.Any],
512
- parse_obj_as(
513
- type_=typing.Optional[typing.Any], # type: ignore
514
- object_=_response.json(),
515
- ),
516
- )
517
- if _response.status_code == 422:
518
- raise UnprocessableEntityError(
519
- typing.cast(
520
- HttpValidationError,
521
- parse_obj_as(
522
- type_=HttpValidationError, # type: ignore
523
- object_=_response.json(),
524
- ),
525
- )
526
- )
527
- _response_json = _response.json()
528
- except JSONDecodeError:
529
- raise ApiError(status_code=_response.status_code, body=_response.text)
530
- raise ApiError(status_code=_response.status_code, body=_response_json)
237
+ return _response.data
531
238
 
532
239
  def update_variant_url(
533
240
  self,
534
241
  variant_id: str,
535
242
  *,
536
243
  url: str,
244
+ update_variant_url_payload_variant_id: str,
245
+ commit_message: typing.Optional[str] = OMIT,
537
246
  request_options: typing.Optional[RequestOptions] = None,
538
247
  ) -> typing.Optional[typing.Any]:
539
248
  """
@@ -555,6 +264,10 @@ class VariantsClient:
555
264
 
556
265
  url : str
557
266
 
267
+ update_variant_url_payload_variant_id : str
268
+
269
+ commit_message : typing.Optional[str]
270
+
558
271
  request_options : typing.Optional[RequestOptions]
559
272
  Request-specific configuration.
560
273
 
@@ -569,51 +282,28 @@ class VariantsClient:
569
282
 
570
283
  client = AgentaApi(
571
284
  api_key="YOUR_API_KEY",
572
- base_url="https://yourhost.com/path/to/api",
573
285
  )
574
286
  client.variants.update_variant_url(
575
287
  variant_id="variant_id",
576
288
  url="url",
289
+ update_variant_url_payload_variant_id="variant_id",
577
290
  )
578
291
  """
579
- _response = self._client_wrapper.httpx_client.request(
580
- f"variants/{jsonable_encoder(variant_id)}/service",
581
- method="PUT",
582
- params={
583
- "url": url,
584
- },
292
+ _response = self._raw_client.update_variant_url(
293
+ variant_id,
294
+ url=url,
295
+ update_variant_url_payload_variant_id=update_variant_url_payload_variant_id,
296
+ commit_message=commit_message,
585
297
  request_options=request_options,
586
298
  )
587
- try:
588
- if 200 <= _response.status_code < 300:
589
- return typing.cast(
590
- typing.Optional[typing.Any],
591
- parse_obj_as(
592
- type_=typing.Optional[typing.Any], # type: ignore
593
- object_=_response.json(),
594
- ),
595
- )
596
- if _response.status_code == 422:
597
- raise UnprocessableEntityError(
598
- typing.cast(
599
- HttpValidationError,
600
- parse_obj_as(
601
- type_=HttpValidationError, # type: ignore
602
- object_=_response.json(),
603
- ),
604
- )
605
- )
606
- _response_json = _response.json()
607
- except JSONDecodeError:
608
- raise ApiError(status_code=_response.status_code, body=_response.text)
609
- raise ApiError(status_code=_response.status_code, body=_response_json)
610
-
611
- def retrieve_variant_logs(
299
+ return _response.data
300
+
301
+ def get_variant_revisions(
612
302
  self,
613
303
  variant_id: str,
614
304
  *,
615
305
  request_options: typing.Optional[RequestOptions] = None,
616
- ) -> typing.Optional[typing.Any]:
306
+ ) -> typing.List[AppVariantRevision]:
617
307
  """
618
308
  Parameters
619
309
  ----------
@@ -624,7 +314,7 @@ class VariantsClient:
624
314
 
625
315
  Returns
626
316
  -------
627
- typing.Optional[typing.Any]
317
+ typing.List[AppVariantRevision]
628
318
  Successful Response
629
319
 
630
320
  Examples
@@ -633,58 +323,36 @@ class VariantsClient:
633
323
 
634
324
  client = AgentaApi(
635
325
  api_key="YOUR_API_KEY",
636
- base_url="https://yourhost.com/path/to/api",
637
326
  )
638
- client.variants.retrieve_variant_logs(
327
+ client.variants.get_variant_revisions(
639
328
  variant_id="variant_id",
640
329
  )
641
330
  """
642
- _response = self._client_wrapper.httpx_client.request(
643
- f"variants/{jsonable_encoder(variant_id)}/logs",
644
- method="GET",
645
- request_options=request_options,
331
+ _response = self._raw_client.get_variant_revisions(
332
+ variant_id, request_options=request_options
646
333
  )
647
- try:
648
- if 200 <= _response.status_code < 300:
649
- return typing.cast(
650
- typing.Optional[typing.Any],
651
- parse_obj_as(
652
- type_=typing.Optional[typing.Any], # type: ignore
653
- object_=_response.json(),
654
- ),
655
- )
656
- if _response.status_code == 422:
657
- raise UnprocessableEntityError(
658
- typing.cast(
659
- HttpValidationError,
660
- parse_obj_as(
661
- type_=HttpValidationError, # type: ignore
662
- object_=_response.json(),
663
- ),
664
- )
665
- )
666
- _response_json = _response.json()
667
- except JSONDecodeError:
668
- raise ApiError(status_code=_response.status_code, body=_response.text)
669
- raise ApiError(status_code=_response.status_code, body=_response_json)
334
+ return _response.data
670
335
 
671
- def get_variant_revisions(
336
+ def get_variant_revision(
672
337
  self,
673
338
  variant_id: str,
339
+ revision_number: int,
674
340
  *,
675
341
  request_options: typing.Optional[RequestOptions] = None,
676
- ) -> typing.List[AppVariantRevision]:
342
+ ) -> AppVariantRevision:
677
343
  """
678
344
  Parameters
679
345
  ----------
680
346
  variant_id : str
681
347
 
348
+ revision_number : int
349
+
682
350
  request_options : typing.Optional[RequestOptions]
683
351
  Request-specific configuration.
684
352
 
685
353
  Returns
686
354
  -------
687
- typing.List[AppVariantRevision]
355
+ AppVariantRevision
688
356
  Successful Response
689
357
 
690
358
  Examples
@@ -693,61 +361,46 @@ class VariantsClient:
693
361
 
694
362
  client = AgentaApi(
695
363
  api_key="YOUR_API_KEY",
696
- base_url="https://yourhost.com/path/to/api",
697
364
  )
698
- client.variants.get_variant_revisions(
365
+ client.variants.get_variant_revision(
699
366
  variant_id="variant_id",
367
+ revision_number=1,
700
368
  )
701
369
  """
702
- _response = self._client_wrapper.httpx_client.request(
703
- f"variants/{jsonable_encoder(variant_id)}/revisions",
704
- method="GET",
705
- request_options=request_options,
370
+ _response = self._raw_client.get_variant_revision(
371
+ variant_id, revision_number, request_options=request_options
706
372
  )
707
- try:
708
- if 200 <= _response.status_code < 300:
709
- return typing.cast(
710
- typing.List[AppVariantRevision],
711
- parse_obj_as(
712
- type_=typing.List[AppVariantRevision], # type: ignore
713
- object_=_response.json(),
714
- ),
715
- )
716
- if _response.status_code == 422:
717
- raise UnprocessableEntityError(
718
- typing.cast(
719
- HttpValidationError,
720
- parse_obj_as(
721
- type_=HttpValidationError, # type: ignore
722
- object_=_response.json(),
723
- ),
724
- )
725
- )
726
- _response_json = _response.json()
727
- except JSONDecodeError:
728
- raise ApiError(status_code=_response.status_code, body=_response.text)
729
- raise ApiError(status_code=_response.status_code, body=_response_json)
373
+ return _response.data
730
374
 
731
- def get_variant_revision(
375
+ def mark_variant_revision_as_hidden(
732
376
  self,
733
377
  variant_id: str,
734
- revision_number: int,
378
+ revision_id: str,
735
379
  *,
736
380
  request_options: typing.Optional[RequestOptions] = None,
737
- ) -> AppVariantRevision:
381
+ ) -> typing.Optional[typing.Any]:
738
382
  """
383
+ Mark a variant revision as hidden from the UI.
384
+
385
+ Arguments:
386
+ app_variant -- AppVariant to remove
387
+ revision_id -- Revision ID to remove
388
+
389
+ Raises:
390
+ HTTPException: If there is a problem removing the app variant
391
+
739
392
  Parameters
740
393
  ----------
741
394
  variant_id : str
742
395
 
743
- revision_number : int
396
+ revision_id : str
744
397
 
745
398
  request_options : typing.Optional[RequestOptions]
746
399
  Request-specific configuration.
747
400
 
748
401
  Returns
749
402
  -------
750
- AppVariantRevision
403
+ typing.Optional[typing.Any]
751
404
  Successful Response
752
405
 
753
406
  Examples
@@ -756,41 +409,16 @@ class VariantsClient:
756
409
 
757
410
  client = AgentaApi(
758
411
  api_key="YOUR_API_KEY",
759
- base_url="https://yourhost.com/path/to/api",
760
412
  )
761
- client.variants.get_variant_revision(
413
+ client.variants.mark_variant_revision_as_hidden(
762
414
  variant_id="variant_id",
763
- revision_number=1,
415
+ revision_id="revision_id",
764
416
  )
765
417
  """
766
- _response = self._client_wrapper.httpx_client.request(
767
- f"variants/{jsonable_encoder(variant_id)}/revisions/{jsonable_encoder(revision_number)}",
768
- method="GET",
769
- request_options=request_options,
418
+ _response = self._raw_client.mark_variant_revision_as_hidden(
419
+ variant_id, revision_id, request_options=request_options
770
420
  )
771
- try:
772
- if 200 <= _response.status_code < 300:
773
- return typing.cast(
774
- AppVariantRevision,
775
- parse_obj_as(
776
- type_=AppVariantRevision, # type: ignore
777
- object_=_response.json(),
778
- ),
779
- )
780
- if _response.status_code == 422:
781
- raise UnprocessableEntityError(
782
- typing.cast(
783
- HttpValidationError,
784
- parse_obj_as(
785
- type_=HttpValidationError, # type: ignore
786
- object_=_response.json(),
787
- ),
788
- )
789
- )
790
- _response_json = _response.json()
791
- except JSONDecodeError:
792
- raise ApiError(status_code=_response.status_code, body=_response.text)
793
- raise ApiError(status_code=_response.status_code, body=_response_json)
421
+ return _response.data
794
422
 
795
423
  def configs_add(
796
424
  self,
@@ -820,57 +448,18 @@ class VariantsClient:
820
448
 
821
449
  client = AgentaApi(
822
450
  api_key="YOUR_API_KEY",
823
- base_url="https://yourhost.com/path/to/api",
824
451
  )
825
452
  client.variants.configs_add(
826
453
  variant_ref=ReferenceRequestModel(),
827
454
  application_ref=ReferenceRequestModel(),
828
455
  )
829
456
  """
830
- _response = self._client_wrapper.httpx_client.request(
831
- "variants/configs/add",
832
- method="POST",
833
- json={
834
- "variant_ref": convert_and_respect_annotation_metadata(
835
- object_=variant_ref,
836
- annotation=ReferenceRequestModel,
837
- direction="write",
838
- ),
839
- "application_ref": convert_and_respect_annotation_metadata(
840
- object_=application_ref,
841
- annotation=ReferenceRequestModel,
842
- direction="write",
843
- ),
844
- },
845
- headers={
846
- "content-type": "application/json",
847
- },
457
+ _response = self._raw_client.configs_add(
458
+ variant_ref=variant_ref,
459
+ application_ref=application_ref,
848
460
  request_options=request_options,
849
- omit=OMIT,
850
- )
851
- try:
852
- if 200 <= _response.status_code < 300:
853
- return typing.cast(
854
- ConfigResponseModel,
855
- parse_obj_as(
856
- type_=ConfigResponseModel, # type: ignore
857
- object_=_response.json(),
858
- ),
859
- )
860
- if _response.status_code == 422:
861
- raise UnprocessableEntityError(
862
- typing.cast(
863
- HttpValidationError,
864
- parse_obj_as(
865
- type_=HttpValidationError, # type: ignore
866
- object_=_response.json(),
867
- ),
868
- )
869
- )
870
- _response_json = _response.json()
871
- except JSONDecodeError:
872
- raise ApiError(status_code=_response.status_code, body=_response.text)
873
- raise ApiError(status_code=_response.status_code, body=_response_json)
461
+ )
462
+ return _response.data
874
463
 
875
464
  def configs_fetch(
876
465
  self,
@@ -881,6 +470,23 @@ class VariantsClient:
881
470
  request_options: typing.Optional[RequestOptions] = None,
882
471
  ) -> ConfigResponseModel:
883
472
  """
473
+ Fetch configuration for a variant or environment.
474
+
475
+ Either variant_ref OR environment_ref must be provided (if neither is provided,
476
+ a default environment_ref with slug="production" will be used).
477
+
478
+ For each reference object (variant_ref, environment_ref, application_ref):
479
+ - Provide either 'slug' or 'id' field
480
+ - 'version' is optional and can be set to null
481
+ - If 'id' is provided, it will be used directly to fetch the resource
482
+ - Otherwise, 'slug' will be used along with application_ref
483
+
484
+ Returns:
485
+ ConfigResponseModel: The configuration for the requested variant or environment.
486
+
487
+ Raises:
488
+ HTTPException: If the configuration is not found.
489
+
884
490
  Parameters
885
491
  ----------
886
492
  variant_ref : typing.Optional[ReferenceRequestModel]
@@ -903,59 +509,16 @@ class VariantsClient:
903
509
 
904
510
  client = AgentaApi(
905
511
  api_key="YOUR_API_KEY",
906
- base_url="https://yourhost.com/path/to/api",
907
512
  )
908
513
  client.variants.configs_fetch()
909
514
  """
910
- _response = self._client_wrapper.httpx_client.request(
911
- "variants/configs/fetch",
912
- method="POST",
913
- json={
914
- "variant_ref": convert_and_respect_annotation_metadata(
915
- object_=variant_ref,
916
- annotation=ReferenceRequestModel,
917
- direction="write",
918
- ),
919
- "environment_ref": convert_and_respect_annotation_metadata(
920
- object_=environment_ref,
921
- annotation=ReferenceRequestModel,
922
- direction="write",
923
- ),
924
- "application_ref": convert_and_respect_annotation_metadata(
925
- object_=application_ref,
926
- annotation=ReferenceRequestModel,
927
- direction="write",
928
- ),
929
- },
930
- headers={
931
- "content-type": "application/json",
932
- },
515
+ _response = self._raw_client.configs_fetch(
516
+ variant_ref=variant_ref,
517
+ environment_ref=environment_ref,
518
+ application_ref=application_ref,
933
519
  request_options=request_options,
934
- omit=OMIT,
935
- )
936
- try:
937
- if 200 <= _response.status_code < 300:
938
- return typing.cast(
939
- ConfigResponseModel,
940
- parse_obj_as(
941
- type_=ConfigResponseModel, # type: ignore
942
- object_=_response.json(),
943
- ),
944
- )
945
- if _response.status_code == 422:
946
- raise UnprocessableEntityError(
947
- typing.cast(
948
- HttpValidationError,
949
- parse_obj_as(
950
- type_=HttpValidationError, # type: ignore
951
- object_=_response.json(),
952
- ),
953
- )
954
- )
955
- _response_json = _response.json()
956
- except JSONDecodeError:
957
- raise ApiError(status_code=_response.status_code, body=_response.text)
958
- raise ApiError(status_code=_response.status_code, body=_response_json)
520
+ )
521
+ return _response.data
959
522
 
960
523
  def configs_fork(
961
524
  self,
@@ -988,59 +551,16 @@ class VariantsClient:
988
551
 
989
552
  client = AgentaApi(
990
553
  api_key="YOUR_API_KEY",
991
- base_url="https://yourhost.com/path/to/api",
992
554
  )
993
555
  client.variants.configs_fork()
994
556
  """
995
- _response = self._client_wrapper.httpx_client.request(
996
- "variants/configs/fork",
997
- method="POST",
998
- json={
999
- "variant_ref": convert_and_respect_annotation_metadata(
1000
- object_=variant_ref,
1001
- annotation=ReferenceRequestModel,
1002
- direction="write",
1003
- ),
1004
- "environment_ref": convert_and_respect_annotation_metadata(
1005
- object_=environment_ref,
1006
- annotation=ReferenceRequestModel,
1007
- direction="write",
1008
- ),
1009
- "application_ref": convert_and_respect_annotation_metadata(
1010
- object_=application_ref,
1011
- annotation=ReferenceRequestModel,
1012
- direction="write",
1013
- ),
1014
- },
1015
- headers={
1016
- "content-type": "application/json",
1017
- },
557
+ _response = self._raw_client.configs_fork(
558
+ variant_ref=variant_ref,
559
+ environment_ref=environment_ref,
560
+ application_ref=application_ref,
1018
561
  request_options=request_options,
1019
- omit=OMIT,
1020
- )
1021
- try:
1022
- if 200 <= _response.status_code < 300:
1023
- return typing.cast(
1024
- ConfigResponseModel,
1025
- parse_obj_as(
1026
- type_=ConfigResponseModel, # type: ignore
1027
- object_=_response.json(),
1028
- ),
1029
- )
1030
- if _response.status_code == 422:
1031
- raise UnprocessableEntityError(
1032
- typing.cast(
1033
- HttpValidationError,
1034
- parse_obj_as(
1035
- type_=HttpValidationError, # type: ignore
1036
- object_=_response.json(),
1037
- ),
1038
- )
1039
- )
1040
- _response_json = _response.json()
1041
- except JSONDecodeError:
1042
- raise ApiError(status_code=_response.status_code, body=_response.text)
1043
- raise ApiError(status_code=_response.status_code, body=_response_json)
562
+ )
563
+ return _response.data
1044
564
 
1045
565
  def configs_commit(
1046
566
  self,
@@ -1067,7 +587,6 @@ class VariantsClient:
1067
587
 
1068
588
  client = AgentaApi(
1069
589
  api_key="YOUR_API_KEY",
1070
- base_url="https://yourhost.com/path/to/api",
1071
590
  )
1072
591
  client.variants.configs_commit(
1073
592
  config=ConfigDto(
@@ -1075,43 +594,10 @@ class VariantsClient:
1075
594
  ),
1076
595
  )
1077
596
  """
1078
- _response = self._client_wrapper.httpx_client.request(
1079
- "variants/configs/commit",
1080
- method="POST",
1081
- json={
1082
- "config": convert_and_respect_annotation_metadata(
1083
- object_=config, annotation=ConfigDto, direction="write"
1084
- ),
1085
- },
1086
- headers={
1087
- "content-type": "application/json",
1088
- },
1089
- request_options=request_options,
1090
- omit=OMIT,
1091
- )
1092
- try:
1093
- if 200 <= _response.status_code < 300:
1094
- return typing.cast(
1095
- ConfigResponseModel,
1096
- parse_obj_as(
1097
- type_=ConfigResponseModel, # type: ignore
1098
- object_=_response.json(),
1099
- ),
1100
- )
1101
- if _response.status_code == 422:
1102
- raise UnprocessableEntityError(
1103
- typing.cast(
1104
- HttpValidationError,
1105
- parse_obj_as(
1106
- type_=HttpValidationError, # type: ignore
1107
- object_=_response.json(),
1108
- ),
1109
- )
1110
- )
1111
- _response_json = _response.json()
1112
- except JSONDecodeError:
1113
- raise ApiError(status_code=_response.status_code, body=_response.text)
1114
- raise ApiError(status_code=_response.status_code, body=_response_json)
597
+ _response = self._raw_client.configs_commit(
598
+ config=config, request_options=request_options
599
+ )
600
+ return _response.data
1115
601
 
1116
602
  def configs_deploy(
1117
603
  self,
@@ -1144,62 +630,19 @@ class VariantsClient:
1144
630
 
1145
631
  client = AgentaApi(
1146
632
  api_key="YOUR_API_KEY",
1147
- base_url="https://yourhost.com/path/to/api",
1148
633
  )
1149
634
  client.variants.configs_deploy(
1150
635
  variant_ref=ReferenceRequestModel(),
1151
636
  environment_ref=ReferenceRequestModel(),
1152
637
  )
1153
638
  """
1154
- _response = self._client_wrapper.httpx_client.request(
1155
- "variants/configs/deploy",
1156
- method="POST",
1157
- json={
1158
- "variant_ref": convert_and_respect_annotation_metadata(
1159
- object_=variant_ref,
1160
- annotation=ReferenceRequestModel,
1161
- direction="write",
1162
- ),
1163
- "environment_ref": convert_and_respect_annotation_metadata(
1164
- object_=environment_ref,
1165
- annotation=ReferenceRequestModel,
1166
- direction="write",
1167
- ),
1168
- "application_ref": convert_and_respect_annotation_metadata(
1169
- object_=application_ref,
1170
- annotation=ReferenceRequestModel,
1171
- direction="write",
1172
- ),
1173
- },
1174
- headers={
1175
- "content-type": "application/json",
1176
- },
639
+ _response = self._raw_client.configs_deploy(
640
+ variant_ref=variant_ref,
641
+ environment_ref=environment_ref,
642
+ application_ref=application_ref,
1177
643
  request_options=request_options,
1178
- omit=OMIT,
1179
- )
1180
- try:
1181
- if 200 <= _response.status_code < 300:
1182
- return typing.cast(
1183
- ConfigResponseModel,
1184
- parse_obj_as(
1185
- type_=ConfigResponseModel, # type: ignore
1186
- object_=_response.json(),
1187
- ),
1188
- )
1189
- if _response.status_code == 422:
1190
- raise UnprocessableEntityError(
1191
- typing.cast(
1192
- HttpValidationError,
1193
- parse_obj_as(
1194
- type_=HttpValidationError, # type: ignore
1195
- object_=_response.json(),
1196
- ),
1197
- )
1198
- )
1199
- _response_json = _response.json()
1200
- except JSONDecodeError:
1201
- raise ApiError(status_code=_response.status_code, body=_response.text)
1202
- raise ApiError(status_code=_response.status_code, body=_response_json)
644
+ )
645
+ return _response.data
1203
646
 
1204
647
  def configs_delete(
1205
648
  self,
@@ -1229,56 +672,17 @@ class VariantsClient:
1229
672
 
1230
673
  client = AgentaApi(
1231
674
  api_key="YOUR_API_KEY",
1232
- base_url="https://yourhost.com/path/to/api",
1233
675
  )
1234
676
  client.variants.configs_delete(
1235
677
  variant_ref=ReferenceRequestModel(),
1236
678
  )
1237
679
  """
1238
- _response = self._client_wrapper.httpx_client.request(
1239
- "variants/configs/delete",
1240
- method="POST",
1241
- json={
1242
- "variant_ref": convert_and_respect_annotation_metadata(
1243
- object_=variant_ref,
1244
- annotation=ReferenceRequestModel,
1245
- direction="write",
1246
- ),
1247
- "application_ref": convert_and_respect_annotation_metadata(
1248
- object_=application_ref,
1249
- annotation=ReferenceRequestModel,
1250
- direction="write",
1251
- ),
1252
- },
1253
- headers={
1254
- "content-type": "application/json",
1255
- },
680
+ _response = self._raw_client.configs_delete(
681
+ variant_ref=variant_ref,
682
+ application_ref=application_ref,
1256
683
  request_options=request_options,
1257
- omit=OMIT,
1258
- )
1259
- try:
1260
- if 200 <= _response.status_code < 300:
1261
- return typing.cast(
1262
- int,
1263
- parse_obj_as(
1264
- type_=int, # type: ignore
1265
- object_=_response.json(),
1266
- ),
1267
- )
1268
- if _response.status_code == 422:
1269
- raise UnprocessableEntityError(
1270
- typing.cast(
1271
- HttpValidationError,
1272
- parse_obj_as(
1273
- type_=HttpValidationError, # type: ignore
1274
- object_=_response.json(),
1275
- ),
1276
- )
1277
- )
1278
- _response_json = _response.json()
1279
- except JSONDecodeError:
1280
- raise ApiError(status_code=_response.status_code, body=_response.text)
1281
- raise ApiError(status_code=_response.status_code, body=_response_json)
684
+ )
685
+ return _response.data
1282
686
 
1283
687
  def configs_list(
1284
688
  self,
@@ -1305,49 +709,15 @@ class VariantsClient:
1305
709
 
1306
710
  client = AgentaApi(
1307
711
  api_key="YOUR_API_KEY",
1308
- base_url="https://yourhost.com/path/to/api",
1309
712
  )
1310
713
  client.variants.configs_list(
1311
714
  application_ref=ReferenceDto(),
1312
715
  )
1313
716
  """
1314
- _response = self._client_wrapper.httpx_client.request(
1315
- "variants/configs/list",
1316
- method="POST",
1317
- json={
1318
- "application_ref": convert_and_respect_annotation_metadata(
1319
- object_=application_ref, annotation=ReferenceDto, direction="write"
1320
- ),
1321
- },
1322
- headers={
1323
- "content-type": "application/json",
1324
- },
1325
- request_options=request_options,
1326
- omit=OMIT,
1327
- )
1328
- try:
1329
- if 200 <= _response.status_code < 300:
1330
- return typing.cast(
1331
- typing.List[ConfigResponseModel],
1332
- parse_obj_as(
1333
- type_=typing.List[ConfigResponseModel], # type: ignore
1334
- object_=_response.json(),
1335
- ),
1336
- )
1337
- if _response.status_code == 422:
1338
- raise UnprocessableEntityError(
1339
- typing.cast(
1340
- HttpValidationError,
1341
- parse_obj_as(
1342
- type_=HttpValidationError, # type: ignore
1343
- object_=_response.json(),
1344
- ),
1345
- )
1346
- )
1347
- _response_json = _response.json()
1348
- except JSONDecodeError:
1349
- raise ApiError(status_code=_response.status_code, body=_response.text)
1350
- raise ApiError(status_code=_response.status_code, body=_response_json)
717
+ _response = self._raw_client.configs_list(
718
+ application_ref=application_ref, request_options=request_options
719
+ )
720
+ return _response.data
1351
721
 
1352
722
  def configs_history(
1353
723
  self,
@@ -1377,61 +747,33 @@ class VariantsClient:
1377
747
 
1378
748
  client = AgentaApi(
1379
749
  api_key="YOUR_API_KEY",
1380
- base_url="https://yourhost.com/path/to/api",
1381
750
  )
1382
751
  client.variants.configs_history(
1383
752
  variant_ref=ReferenceRequestModel(),
1384
753
  )
1385
754
  """
1386
- _response = self._client_wrapper.httpx_client.request(
1387
- "variants/configs/history",
1388
- method="POST",
1389
- json={
1390
- "variant_ref": convert_and_respect_annotation_metadata(
1391
- object_=variant_ref,
1392
- annotation=ReferenceRequestModel,
1393
- direction="write",
1394
- ),
1395
- "application_ref": convert_and_respect_annotation_metadata(
1396
- object_=application_ref,
1397
- annotation=ReferenceRequestModel,
1398
- direction="write",
1399
- ),
1400
- },
1401
- headers={
1402
- "content-type": "application/json",
1403
- },
755
+ _response = self._raw_client.configs_history(
756
+ variant_ref=variant_ref,
757
+ application_ref=application_ref,
1404
758
  request_options=request_options,
1405
- omit=OMIT,
1406
- )
1407
- try:
1408
- if 200 <= _response.status_code < 300:
1409
- return typing.cast(
1410
- typing.List[ConfigResponseModel],
1411
- parse_obj_as(
1412
- type_=typing.List[ConfigResponseModel], # type: ignore
1413
- object_=_response.json(),
1414
- ),
1415
- )
1416
- if _response.status_code == 422:
1417
- raise UnprocessableEntityError(
1418
- typing.cast(
1419
- HttpValidationError,
1420
- parse_obj_as(
1421
- type_=HttpValidationError, # type: ignore
1422
- object_=_response.json(),
1423
- ),
1424
- )
1425
- )
1426
- _response_json = _response.json()
1427
- except JSONDecodeError:
1428
- raise ApiError(status_code=_response.status_code, body=_response.text)
1429
- raise ApiError(status_code=_response.status_code, body=_response_json)
759
+ )
760
+ return _response.data
1430
761
 
1431
762
 
1432
763
  class AsyncVariantsClient:
1433
764
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
1434
- self._client_wrapper = client_wrapper
765
+ self._raw_client = AsyncRawVariantsClient(client_wrapper=client_wrapper)
766
+
767
+ @property
768
+ def with_raw_response(self) -> AsyncRawVariantsClient:
769
+ """
770
+ Retrieves a raw implementation of this client that returns raw responses.
771
+
772
+ Returns
773
+ -------
774
+ AsyncRawVariantsClient
775
+ """
776
+ return self._raw_client
1435
777
 
1436
778
  async def add_variant_from_base_and_config(
1437
779
  self,
@@ -1440,6 +782,7 @@ class AsyncVariantsClient:
1440
782
  new_variant_name: str,
1441
783
  new_config_name: str,
1442
784
  parameters: typing.Dict[str, typing.Optional[typing.Any]],
785
+ commit_message: typing.Optional[str] = OMIT,
1443
786
  request_options: typing.Optional[RequestOptions] = None,
1444
787
  ) -> AddVariantFromBaseAndConfigResponse:
1445
788
  """
@@ -1465,6 +808,8 @@ class AsyncVariantsClient:
1465
808
 
1466
809
  parameters : typing.Dict[str, typing.Optional[typing.Any]]
1467
810
 
811
+ commit_message : typing.Optional[str]
812
+
1468
813
  request_options : typing.Optional[RequestOptions]
1469
814
  Request-specific configuration.
1470
815
 
@@ -1481,7 +826,6 @@ class AsyncVariantsClient:
1481
826
 
1482
827
  client = AsyncAgentaApi(
1483
828
  api_key="YOUR_API_KEY",
1484
- base_url="https://yourhost.com/path/to/api",
1485
829
  )
1486
830
 
1487
831
 
@@ -1496,44 +840,15 @@ class AsyncVariantsClient:
1496
840
 
1497
841
  asyncio.run(main())
1498
842
  """
1499
- _response = await self._client_wrapper.httpx_client.request(
1500
- "variants/from-base",
1501
- method="POST",
1502
- json={
1503
- "base_id": base_id,
1504
- "new_variant_name": new_variant_name,
1505
- "new_config_name": new_config_name,
1506
- "parameters": parameters,
1507
- },
1508
- headers={
1509
- "content-type": "application/json",
1510
- },
843
+ _response = await self._raw_client.add_variant_from_base_and_config(
844
+ base_id=base_id,
845
+ new_variant_name=new_variant_name,
846
+ new_config_name=new_config_name,
847
+ parameters=parameters,
848
+ commit_message=commit_message,
1511
849
  request_options=request_options,
1512
- omit=OMIT,
1513
- )
1514
- try:
1515
- if 200 <= _response.status_code < 300:
1516
- return typing.cast(
1517
- AddVariantFromBaseAndConfigResponse,
1518
- parse_obj_as(
1519
- type_=AddVariantFromBaseAndConfigResponse, # type: ignore
1520
- object_=_response.json(),
1521
- ),
1522
- )
1523
- if _response.status_code == 422:
1524
- raise UnprocessableEntityError(
1525
- typing.cast(
1526
- HttpValidationError,
1527
- parse_obj_as(
1528
- type_=HttpValidationError, # type: ignore
1529
- object_=_response.json(),
1530
- ),
1531
- )
1532
- )
1533
- _response_json = _response.json()
1534
- except JSONDecodeError:
1535
- raise ApiError(status_code=_response.status_code, body=_response.text)
1536
- raise ApiError(status_code=_response.status_code, body=_response_json)
850
+ )
851
+ return _response.data
1537
852
 
1538
853
  async def get_variant(
1539
854
  self,
@@ -1562,7 +877,6 @@ class AsyncVariantsClient:
1562
877
 
1563
878
  client = AsyncAgentaApi(
1564
879
  api_key="YOUR_API_KEY",
1565
- base_url="https://yourhost.com/path/to/api",
1566
880
  )
1567
881
 
1568
882
 
@@ -1574,146 +888,19 @@ class AsyncVariantsClient:
1574
888
 
1575
889
  asyncio.run(main())
1576
890
  """
1577
- _response = await self._client_wrapper.httpx_client.request(
1578
- f"variants/{jsonable_encoder(variant_id)}",
1579
- method="GET",
1580
- request_options=request_options,
1581
- )
1582
- try:
1583
- if 200 <= _response.status_code < 300:
1584
- return typing.cast(
1585
- AppVariantResponse,
1586
- parse_obj_as(
1587
- type_=AppVariantResponse, # type: ignore
1588
- object_=_response.json(),
1589
- ),
1590
- )
1591
- if _response.status_code == 422:
1592
- raise UnprocessableEntityError(
1593
- typing.cast(
1594
- HttpValidationError,
1595
- parse_obj_as(
1596
- type_=HttpValidationError, # type: ignore
1597
- object_=_response.json(),
1598
- ),
1599
- )
1600
- )
1601
- _response_json = _response.json()
1602
- except JSONDecodeError:
1603
- raise ApiError(status_code=_response.status_code, body=_response.text)
1604
- raise ApiError(status_code=_response.status_code, body=_response_json)
1605
-
1606
- async def start_variant(
1607
- self,
1608
- variant_id: str,
1609
- *,
1610
- action: VariantAction,
1611
- env_vars: typing.Optional[DockerEnvVars] = OMIT,
1612
- request_options: typing.Optional[RequestOptions] = None,
1613
- ) -> Uri:
1614
- """
1615
- Start a variant of an app.
1616
-
1617
- Args:
1618
- variant_id (str): The ID of the variant to start.
1619
- action (VariantAction): The action to perform on the variant (start).
1620
- env_vars (Optional[DockerEnvVars], optional): The environment variables to inject to the Docker container. Defaults to None.
1621
- =
1622
- Returns:
1623
- URI: The URL of the started variant.
1624
-
1625
- Raises:
1626
- HTTPException: If the app container cannot be started.
1627
-
1628
- Parameters
1629
- ----------
1630
- variant_id : str
1631
-
1632
- action : VariantAction
1633
-
1634
- env_vars : typing.Optional[DockerEnvVars]
1635
-
1636
- request_options : typing.Optional[RequestOptions]
1637
- Request-specific configuration.
1638
-
1639
- Returns
1640
- -------
1641
- Uri
1642
- Successful Response
1643
-
1644
- Examples
1645
- --------
1646
- import asyncio
1647
-
1648
- from agenta import AsyncAgentaApi, VariantAction
1649
-
1650
- client = AsyncAgentaApi(
1651
- api_key="YOUR_API_KEY",
1652
- base_url="https://yourhost.com/path/to/api",
891
+ _response = await self._raw_client.get_variant(
892
+ variant_id, request_options=request_options
1653
893
  )
894
+ return _response.data
1654
895
 
1655
-
1656
- async def main() -> None:
1657
- await client.variants.start_variant(
1658
- variant_id="variant_id",
1659
- action=VariantAction(
1660
- action="START",
1661
- ),
1662
- )
1663
-
1664
-
1665
- asyncio.run(main())
1666
- """
1667
- _response = await self._client_wrapper.httpx_client.request(
1668
- f"variants/{jsonable_encoder(variant_id)}",
1669
- method="PUT",
1670
- json={
1671
- "action": convert_and_respect_annotation_metadata(
1672
- object_=action, annotation=VariantAction, direction="write"
1673
- ),
1674
- "env_vars": convert_and_respect_annotation_metadata(
1675
- object_=env_vars, annotation=DockerEnvVars, direction="write"
1676
- ),
1677
- },
1678
- headers={
1679
- "content-type": "application/json",
1680
- },
1681
- request_options=request_options,
1682
- omit=OMIT,
1683
- )
1684
- try:
1685
- if 200 <= _response.status_code < 300:
1686
- return typing.cast(
1687
- Uri,
1688
- parse_obj_as(
1689
- type_=Uri, # type: ignore
1690
- object_=_response.json(),
1691
- ),
1692
- )
1693
- if _response.status_code == 422:
1694
- raise UnprocessableEntityError(
1695
- typing.cast(
1696
- HttpValidationError,
1697
- parse_obj_as(
1698
- type_=HttpValidationError, # type: ignore
1699
- object_=_response.json(),
1700
- ),
1701
- )
1702
- )
1703
- _response_json = _response.json()
1704
- except JSONDecodeError:
1705
- raise ApiError(status_code=_response.status_code, body=_response.text)
1706
- raise ApiError(status_code=_response.status_code, body=_response_json)
1707
-
1708
- async def remove_variant(
896
+ async def mark_variant_as_hidden(
1709
897
  self,
1710
898
  variant_id: str,
1711
899
  *,
1712
900
  request_options: typing.Optional[RequestOptions] = None,
1713
901
  ) -> typing.Optional[typing.Any]:
1714
902
  """
1715
- Remove a variant from the server.
1716
- In the case it's the last variant using the image, stop the container and remove the image.
903
+ Mark a variant as hidden from the UI.
1717
904
 
1718
905
  Arguments:
1719
906
  app_variant -- AppVariant to remove
@@ -1741,52 +928,28 @@ class AsyncVariantsClient:
1741
928
 
1742
929
  client = AsyncAgentaApi(
1743
930
  api_key="YOUR_API_KEY",
1744
- base_url="https://yourhost.com/path/to/api",
1745
931
  )
1746
932
 
1747
933
 
1748
934
  async def main() -> None:
1749
- await client.variants.remove_variant(
935
+ await client.variants.mark_variant_as_hidden(
1750
936
  variant_id="variant_id",
1751
937
  )
1752
938
 
1753
939
 
1754
940
  asyncio.run(main())
1755
941
  """
1756
- _response = await self._client_wrapper.httpx_client.request(
1757
- f"variants/{jsonable_encoder(variant_id)}",
1758
- method="DELETE",
1759
- request_options=request_options,
942
+ _response = await self._raw_client.mark_variant_as_hidden(
943
+ variant_id, request_options=request_options
1760
944
  )
1761
- try:
1762
- if 200 <= _response.status_code < 300:
1763
- return typing.cast(
1764
- typing.Optional[typing.Any],
1765
- parse_obj_as(
1766
- type_=typing.Optional[typing.Any], # type: ignore
1767
- object_=_response.json(),
1768
- ),
1769
- )
1770
- if _response.status_code == 422:
1771
- raise UnprocessableEntityError(
1772
- typing.cast(
1773
- HttpValidationError,
1774
- parse_obj_as(
1775
- type_=HttpValidationError, # type: ignore
1776
- object_=_response.json(),
1777
- ),
1778
- )
1779
- )
1780
- _response_json = _response.json()
1781
- except JSONDecodeError:
1782
- raise ApiError(status_code=_response.status_code, body=_response.text)
1783
- raise ApiError(status_code=_response.status_code, body=_response_json)
945
+ return _response.data
1784
946
 
1785
947
  async def update_variant_parameters(
1786
948
  self,
1787
949
  variant_id: str,
1788
950
  *,
1789
951
  parameters: typing.Dict[str, typing.Optional[typing.Any]],
952
+ commit_message: typing.Optional[str] = OMIT,
1790
953
  request_options: typing.Optional[RequestOptions] = None,
1791
954
  ) -> typing.Optional[typing.Any]:
1792
955
  """
@@ -1808,6 +971,8 @@ class AsyncVariantsClient:
1808
971
 
1809
972
  parameters : typing.Dict[str, typing.Optional[typing.Any]]
1810
973
 
974
+ commit_message : typing.Optional[str]
975
+
1811
976
  request_options : typing.Optional[RequestOptions]
1812
977
  Request-specific configuration.
1813
978
 
@@ -1824,7 +989,6 @@ class AsyncVariantsClient:
1824
989
 
1825
990
  client = AsyncAgentaApi(
1826
991
  api_key="YOUR_API_KEY",
1827
- base_url="https://yourhost.com/path/to/api",
1828
992
  )
1829
993
 
1830
994
 
@@ -1837,152 +1001,21 @@ class AsyncVariantsClient:
1837
1001
 
1838
1002
  asyncio.run(main())
1839
1003
  """
1840
- _response = await self._client_wrapper.httpx_client.request(
1841
- f"variants/{jsonable_encoder(variant_id)}/parameters",
1842
- method="PUT",
1843
- json={
1844
- "parameters": parameters,
1845
- },
1846
- headers={
1847
- "content-type": "application/json",
1848
- },
1004
+ _response = await self._raw_client.update_variant_parameters(
1005
+ variant_id,
1006
+ parameters=parameters,
1007
+ commit_message=commit_message,
1849
1008
  request_options=request_options,
1850
- omit=OMIT,
1851
- )
1852
- try:
1853
- if 200 <= _response.status_code < 300:
1854
- return typing.cast(
1855
- typing.Optional[typing.Any],
1856
- parse_obj_as(
1857
- type_=typing.Optional[typing.Any], # type: ignore
1858
- object_=_response.json(),
1859
- ),
1860
- )
1861
- if _response.status_code == 422:
1862
- raise UnprocessableEntityError(
1863
- typing.cast(
1864
- HttpValidationError,
1865
- parse_obj_as(
1866
- type_=HttpValidationError, # type: ignore
1867
- object_=_response.json(),
1868
- ),
1869
- )
1870
- )
1871
- _response_json = _response.json()
1872
- except JSONDecodeError:
1873
- raise ApiError(status_code=_response.status_code, body=_response.text)
1874
- raise ApiError(status_code=_response.status_code, body=_response_json)
1875
-
1876
- async def update_variant_image(
1877
- self,
1878
- variant_id: str,
1879
- *,
1880
- docker_id: str,
1881
- tags: str,
1882
- type: typing.Optional[str] = OMIT,
1883
- organization_id: typing.Optional[str] = OMIT,
1884
- workspace_id: typing.Optional[str] = OMIT,
1885
- request_options: typing.Optional[RequestOptions] = None,
1886
- ) -> typing.Optional[typing.Any]:
1887
- """
1888
- Updates the image used in an app variant.
1889
-
1890
- Args:
1891
- variant_id (str): The ID of the app variant to update.
1892
- image (Image): The image information to update.
1893
-
1894
- Raises:
1895
- HTTPException: If an error occurs while trying to update the app variant.
1896
-
1897
- Returns:
1898
- JSONResponse: A JSON response indicating whether the update was successful or not.
1899
-
1900
- Parameters
1901
- ----------
1902
- variant_id : str
1903
-
1904
- docker_id : str
1905
-
1906
- tags : str
1907
-
1908
- type : typing.Optional[str]
1909
-
1910
- organization_id : typing.Optional[str]
1911
-
1912
- workspace_id : typing.Optional[str]
1913
-
1914
- request_options : typing.Optional[RequestOptions]
1915
- Request-specific configuration.
1916
-
1917
- Returns
1918
- -------
1919
- typing.Optional[typing.Any]
1920
- Successful Response
1921
-
1922
- Examples
1923
- --------
1924
- import asyncio
1925
-
1926
- from agenta import AsyncAgentaApi
1927
-
1928
- client = AsyncAgentaApi(
1929
- api_key="YOUR_API_KEY",
1930
- base_url="https://yourhost.com/path/to/api",
1931
1009
  )
1932
-
1933
-
1934
- async def main() -> None:
1935
- await client.variants.update_variant_image(
1936
- variant_id="variant_id",
1937
- docker_id="docker_id",
1938
- tags="tags",
1939
- )
1940
-
1941
-
1942
- asyncio.run(main())
1943
- """
1944
- _response = await self._client_wrapper.httpx_client.request(
1945
- f"variants/{jsonable_encoder(variant_id)}/image",
1946
- method="PUT",
1947
- json={
1948
- "type": type,
1949
- "docker_id": docker_id,
1950
- "tags": tags,
1951
- "organization_id": organization_id,
1952
- "workspace_id": workspace_id,
1953
- },
1954
- request_options=request_options,
1955
- omit=OMIT,
1956
- )
1957
- try:
1958
- if 200 <= _response.status_code < 300:
1959
- return typing.cast(
1960
- typing.Optional[typing.Any],
1961
- parse_obj_as(
1962
- type_=typing.Optional[typing.Any], # type: ignore
1963
- object_=_response.json(),
1964
- ),
1965
- )
1966
- if _response.status_code == 422:
1967
- raise UnprocessableEntityError(
1968
- typing.cast(
1969
- HttpValidationError,
1970
- parse_obj_as(
1971
- type_=HttpValidationError, # type: ignore
1972
- object_=_response.json(),
1973
- ),
1974
- )
1975
- )
1976
- _response_json = _response.json()
1977
- except JSONDecodeError:
1978
- raise ApiError(status_code=_response.status_code, body=_response.text)
1979
- raise ApiError(status_code=_response.status_code, body=_response_json)
1010
+ return _response.data
1980
1011
 
1981
1012
  async def update_variant_url(
1982
1013
  self,
1983
1014
  variant_id: str,
1984
1015
  *,
1985
1016
  url: str,
1017
+ update_variant_url_payload_variant_id: str,
1018
+ commit_message: typing.Optional[str] = OMIT,
1986
1019
  request_options: typing.Optional[RequestOptions] = None,
1987
1020
  ) -> typing.Optional[typing.Any]:
1988
1021
  """
@@ -2004,6 +1037,10 @@ class AsyncVariantsClient:
2004
1037
 
2005
1038
  url : str
2006
1039
 
1040
+ update_variant_url_payload_variant_id : str
1041
+
1042
+ commit_message : typing.Optional[str]
1043
+
2007
1044
  request_options : typing.Optional[RequestOptions]
2008
1045
  Request-specific configuration.
2009
1046
 
@@ -2020,7 +1057,6 @@ class AsyncVariantsClient:
2020
1057
 
2021
1058
  client = AsyncAgentaApi(
2022
1059
  api_key="YOUR_API_KEY",
2023
- base_url="https://yourhost.com/path/to/api",
2024
1060
  )
2025
1061
 
2026
1062
 
@@ -2028,49 +1064,27 @@ class AsyncVariantsClient:
2028
1064
  await client.variants.update_variant_url(
2029
1065
  variant_id="variant_id",
2030
1066
  url="url",
1067
+ update_variant_url_payload_variant_id="variant_id",
2031
1068
  )
2032
1069
 
2033
1070
 
2034
1071
  asyncio.run(main())
2035
1072
  """
2036
- _response = await self._client_wrapper.httpx_client.request(
2037
- f"variants/{jsonable_encoder(variant_id)}/service",
2038
- method="PUT",
2039
- params={
2040
- "url": url,
2041
- },
1073
+ _response = await self._raw_client.update_variant_url(
1074
+ variant_id,
1075
+ url=url,
1076
+ update_variant_url_payload_variant_id=update_variant_url_payload_variant_id,
1077
+ commit_message=commit_message,
2042
1078
  request_options=request_options,
2043
1079
  )
2044
- try:
2045
- if 200 <= _response.status_code < 300:
2046
- return typing.cast(
2047
- typing.Optional[typing.Any],
2048
- parse_obj_as(
2049
- type_=typing.Optional[typing.Any], # type: ignore
2050
- object_=_response.json(),
2051
- ),
2052
- )
2053
- if _response.status_code == 422:
2054
- raise UnprocessableEntityError(
2055
- typing.cast(
2056
- HttpValidationError,
2057
- parse_obj_as(
2058
- type_=HttpValidationError, # type: ignore
2059
- object_=_response.json(),
2060
- ),
2061
- )
2062
- )
2063
- _response_json = _response.json()
2064
- except JSONDecodeError:
2065
- raise ApiError(status_code=_response.status_code, body=_response.text)
2066
- raise ApiError(status_code=_response.status_code, body=_response_json)
2067
-
2068
- async def retrieve_variant_logs(
1080
+ return _response.data
1081
+
1082
+ async def get_variant_revisions(
2069
1083
  self,
2070
1084
  variant_id: str,
2071
1085
  *,
2072
1086
  request_options: typing.Optional[RequestOptions] = None,
2073
- ) -> typing.Optional[typing.Any]:
1087
+ ) -> typing.List[AppVariantRevision]:
2074
1088
  """
2075
1089
  Parameters
2076
1090
  ----------
@@ -2081,7 +1095,7 @@ class AsyncVariantsClient:
2081
1095
 
2082
1096
  Returns
2083
1097
  -------
2084
- typing.Optional[typing.Any]
1098
+ typing.List[AppVariantRevision]
2085
1099
  Successful Response
2086
1100
 
2087
1101
  Examples
@@ -2092,64 +1106,42 @@ class AsyncVariantsClient:
2092
1106
 
2093
1107
  client = AsyncAgentaApi(
2094
1108
  api_key="YOUR_API_KEY",
2095
- base_url="https://yourhost.com/path/to/api",
2096
1109
  )
2097
1110
 
2098
1111
 
2099
1112
  async def main() -> None:
2100
- await client.variants.retrieve_variant_logs(
1113
+ await client.variants.get_variant_revisions(
2101
1114
  variant_id="variant_id",
2102
1115
  )
2103
1116
 
2104
1117
 
2105
1118
  asyncio.run(main())
2106
1119
  """
2107
- _response = await self._client_wrapper.httpx_client.request(
2108
- f"variants/{jsonable_encoder(variant_id)}/logs",
2109
- method="GET",
2110
- request_options=request_options,
1120
+ _response = await self._raw_client.get_variant_revisions(
1121
+ variant_id, request_options=request_options
2111
1122
  )
2112
- try:
2113
- if 200 <= _response.status_code < 300:
2114
- return typing.cast(
2115
- typing.Optional[typing.Any],
2116
- parse_obj_as(
2117
- type_=typing.Optional[typing.Any], # type: ignore
2118
- object_=_response.json(),
2119
- ),
2120
- )
2121
- if _response.status_code == 422:
2122
- raise UnprocessableEntityError(
2123
- typing.cast(
2124
- HttpValidationError,
2125
- parse_obj_as(
2126
- type_=HttpValidationError, # type: ignore
2127
- object_=_response.json(),
2128
- ),
2129
- )
2130
- )
2131
- _response_json = _response.json()
2132
- except JSONDecodeError:
2133
- raise ApiError(status_code=_response.status_code, body=_response.text)
2134
- raise ApiError(status_code=_response.status_code, body=_response_json)
1123
+ return _response.data
2135
1124
 
2136
- async def get_variant_revisions(
1125
+ async def get_variant_revision(
2137
1126
  self,
2138
1127
  variant_id: str,
1128
+ revision_number: int,
2139
1129
  *,
2140
1130
  request_options: typing.Optional[RequestOptions] = None,
2141
- ) -> typing.List[AppVariantRevision]:
1131
+ ) -> AppVariantRevision:
2142
1132
  """
2143
1133
  Parameters
2144
1134
  ----------
2145
1135
  variant_id : str
2146
1136
 
1137
+ revision_number : int
1138
+
2147
1139
  request_options : typing.Optional[RequestOptions]
2148
1140
  Request-specific configuration.
2149
1141
 
2150
1142
  Returns
2151
1143
  -------
2152
- typing.List[AppVariantRevision]
1144
+ AppVariantRevision
2153
1145
  Successful Response
2154
1146
 
2155
1147
  Examples
@@ -2160,67 +1152,52 @@ class AsyncVariantsClient:
2160
1152
 
2161
1153
  client = AsyncAgentaApi(
2162
1154
  api_key="YOUR_API_KEY",
2163
- base_url="https://yourhost.com/path/to/api",
2164
1155
  )
2165
1156
 
2166
1157
 
2167
1158
  async def main() -> None:
2168
- await client.variants.get_variant_revisions(
1159
+ await client.variants.get_variant_revision(
2169
1160
  variant_id="variant_id",
1161
+ revision_number=1,
2170
1162
  )
2171
1163
 
2172
1164
 
2173
1165
  asyncio.run(main())
2174
1166
  """
2175
- _response = await self._client_wrapper.httpx_client.request(
2176
- f"variants/{jsonable_encoder(variant_id)}/revisions",
2177
- method="GET",
2178
- request_options=request_options,
1167
+ _response = await self._raw_client.get_variant_revision(
1168
+ variant_id, revision_number, request_options=request_options
2179
1169
  )
2180
- try:
2181
- if 200 <= _response.status_code < 300:
2182
- return typing.cast(
2183
- typing.List[AppVariantRevision],
2184
- parse_obj_as(
2185
- type_=typing.List[AppVariantRevision], # type: ignore
2186
- object_=_response.json(),
2187
- ),
2188
- )
2189
- if _response.status_code == 422:
2190
- raise UnprocessableEntityError(
2191
- typing.cast(
2192
- HttpValidationError,
2193
- parse_obj_as(
2194
- type_=HttpValidationError, # type: ignore
2195
- object_=_response.json(),
2196
- ),
2197
- )
2198
- )
2199
- _response_json = _response.json()
2200
- except JSONDecodeError:
2201
- raise ApiError(status_code=_response.status_code, body=_response.text)
2202
- raise ApiError(status_code=_response.status_code, body=_response_json)
1170
+ return _response.data
2203
1171
 
2204
- async def get_variant_revision(
1172
+ async def mark_variant_revision_as_hidden(
2205
1173
  self,
2206
1174
  variant_id: str,
2207
- revision_number: int,
1175
+ revision_id: str,
2208
1176
  *,
2209
1177
  request_options: typing.Optional[RequestOptions] = None,
2210
- ) -> AppVariantRevision:
1178
+ ) -> typing.Optional[typing.Any]:
2211
1179
  """
1180
+ Mark a variant revision as hidden from the UI.
1181
+
1182
+ Arguments:
1183
+ app_variant -- AppVariant to remove
1184
+ revision_id -- Revision ID to remove
1185
+
1186
+ Raises:
1187
+ HTTPException: If there is a problem removing the app variant
1188
+
2212
1189
  Parameters
2213
1190
  ----------
2214
1191
  variant_id : str
2215
1192
 
2216
- revision_number : int
1193
+ revision_id : str
2217
1194
 
2218
1195
  request_options : typing.Optional[RequestOptions]
2219
1196
  Request-specific configuration.
2220
1197
 
2221
1198
  Returns
2222
1199
  -------
2223
- AppVariantRevision
1200
+ typing.Optional[typing.Any]
2224
1201
  Successful Response
2225
1202
 
2226
1203
  Examples
@@ -2231,47 +1208,22 @@ class AsyncVariantsClient:
2231
1208
 
2232
1209
  client = AsyncAgentaApi(
2233
1210
  api_key="YOUR_API_KEY",
2234
- base_url="https://yourhost.com/path/to/api",
2235
1211
  )
2236
1212
 
2237
1213
 
2238
1214
  async def main() -> None:
2239
- await client.variants.get_variant_revision(
1215
+ await client.variants.mark_variant_revision_as_hidden(
2240
1216
  variant_id="variant_id",
2241
- revision_number=1,
1217
+ revision_id="revision_id",
2242
1218
  )
2243
1219
 
2244
1220
 
2245
1221
  asyncio.run(main())
2246
1222
  """
2247
- _response = await self._client_wrapper.httpx_client.request(
2248
- f"variants/{jsonable_encoder(variant_id)}/revisions/{jsonable_encoder(revision_number)}",
2249
- method="GET",
2250
- request_options=request_options,
1223
+ _response = await self._raw_client.mark_variant_revision_as_hidden(
1224
+ variant_id, revision_id, request_options=request_options
2251
1225
  )
2252
- try:
2253
- if 200 <= _response.status_code < 300:
2254
- return typing.cast(
2255
- AppVariantRevision,
2256
- parse_obj_as(
2257
- type_=AppVariantRevision, # type: ignore
2258
- object_=_response.json(),
2259
- ),
2260
- )
2261
- if _response.status_code == 422:
2262
- raise UnprocessableEntityError(
2263
- typing.cast(
2264
- HttpValidationError,
2265
- parse_obj_as(
2266
- type_=HttpValidationError, # type: ignore
2267
- object_=_response.json(),
2268
- ),
2269
- )
2270
- )
2271
- _response_json = _response.json()
2272
- except JSONDecodeError:
2273
- raise ApiError(status_code=_response.status_code, body=_response.text)
2274
- raise ApiError(status_code=_response.status_code, body=_response_json)
1226
+ return _response.data
2275
1227
 
2276
1228
  async def configs_add(
2277
1229
  self,
@@ -2303,7 +1255,6 @@ class AsyncVariantsClient:
2303
1255
 
2304
1256
  client = AsyncAgentaApi(
2305
1257
  api_key="YOUR_API_KEY",
2306
- base_url="https://yourhost.com/path/to/api",
2307
1258
  )
2308
1259
 
2309
1260
 
@@ -2316,50 +1267,12 @@ class AsyncVariantsClient:
2316
1267
 
2317
1268
  asyncio.run(main())
2318
1269
  """
2319
- _response = await self._client_wrapper.httpx_client.request(
2320
- "variants/configs/add",
2321
- method="POST",
2322
- json={
2323
- "variant_ref": convert_and_respect_annotation_metadata(
2324
- object_=variant_ref,
2325
- annotation=ReferenceRequestModel,
2326
- direction="write",
2327
- ),
2328
- "application_ref": convert_and_respect_annotation_metadata(
2329
- object_=application_ref,
2330
- annotation=ReferenceRequestModel,
2331
- direction="write",
2332
- ),
2333
- },
2334
- headers={
2335
- "content-type": "application/json",
2336
- },
1270
+ _response = await self._raw_client.configs_add(
1271
+ variant_ref=variant_ref,
1272
+ application_ref=application_ref,
2337
1273
  request_options=request_options,
2338
- omit=OMIT,
2339
- )
2340
- try:
2341
- if 200 <= _response.status_code < 300:
2342
- return typing.cast(
2343
- ConfigResponseModel,
2344
- parse_obj_as(
2345
- type_=ConfigResponseModel, # type: ignore
2346
- object_=_response.json(),
2347
- ),
2348
- )
2349
- if _response.status_code == 422:
2350
- raise UnprocessableEntityError(
2351
- typing.cast(
2352
- HttpValidationError,
2353
- parse_obj_as(
2354
- type_=HttpValidationError, # type: ignore
2355
- object_=_response.json(),
2356
- ),
2357
- )
2358
- )
2359
- _response_json = _response.json()
2360
- except JSONDecodeError:
2361
- raise ApiError(status_code=_response.status_code, body=_response.text)
2362
- raise ApiError(status_code=_response.status_code, body=_response_json)
1274
+ )
1275
+ return _response.data
2363
1276
 
2364
1277
  async def configs_fetch(
2365
1278
  self,
@@ -2370,6 +1283,23 @@ class AsyncVariantsClient:
2370
1283
  request_options: typing.Optional[RequestOptions] = None,
2371
1284
  ) -> ConfigResponseModel:
2372
1285
  """
1286
+ Fetch configuration for a variant or environment.
1287
+
1288
+ Either variant_ref OR environment_ref must be provided (if neither is provided,
1289
+ a default environment_ref with slug="production" will be used).
1290
+
1291
+ For each reference object (variant_ref, environment_ref, application_ref):
1292
+ - Provide either 'slug' or 'id' field
1293
+ - 'version' is optional and can be set to null
1294
+ - If 'id' is provided, it will be used directly to fetch the resource
1295
+ - Otherwise, 'slug' will be used along with application_ref
1296
+
1297
+ Returns:
1298
+ ConfigResponseModel: The configuration for the requested variant or environment.
1299
+
1300
+ Raises:
1301
+ HTTPException: If the configuration is not found.
1302
+
2373
1303
  Parameters
2374
1304
  ----------
2375
1305
  variant_ref : typing.Optional[ReferenceRequestModel]
@@ -2394,7 +1324,6 @@ class AsyncVariantsClient:
2394
1324
 
2395
1325
  client = AsyncAgentaApi(
2396
1326
  api_key="YOUR_API_KEY",
2397
- base_url="https://yourhost.com/path/to/api",
2398
1327
  )
2399
1328
 
2400
1329
 
@@ -2404,55 +1333,13 @@ class AsyncVariantsClient:
2404
1333
 
2405
1334
  asyncio.run(main())
2406
1335
  """
2407
- _response = await self._client_wrapper.httpx_client.request(
2408
- "variants/configs/fetch",
2409
- method="POST",
2410
- json={
2411
- "variant_ref": convert_and_respect_annotation_metadata(
2412
- object_=variant_ref,
2413
- annotation=ReferenceRequestModel,
2414
- direction="write",
2415
- ),
2416
- "environment_ref": convert_and_respect_annotation_metadata(
2417
- object_=environment_ref,
2418
- annotation=ReferenceRequestModel,
2419
- direction="write",
2420
- ),
2421
- "application_ref": convert_and_respect_annotation_metadata(
2422
- object_=application_ref,
2423
- annotation=ReferenceRequestModel,
2424
- direction="write",
2425
- ),
2426
- },
2427
- headers={
2428
- "content-type": "application/json",
2429
- },
1336
+ _response = await self._raw_client.configs_fetch(
1337
+ variant_ref=variant_ref,
1338
+ environment_ref=environment_ref,
1339
+ application_ref=application_ref,
2430
1340
  request_options=request_options,
2431
- omit=OMIT,
2432
- )
2433
- try:
2434
- if 200 <= _response.status_code < 300:
2435
- return typing.cast(
2436
- ConfigResponseModel,
2437
- parse_obj_as(
2438
- type_=ConfigResponseModel, # type: ignore
2439
- object_=_response.json(),
2440
- ),
2441
- )
2442
- if _response.status_code == 422:
2443
- raise UnprocessableEntityError(
2444
- typing.cast(
2445
- HttpValidationError,
2446
- parse_obj_as(
2447
- type_=HttpValidationError, # type: ignore
2448
- object_=_response.json(),
2449
- ),
2450
- )
2451
- )
2452
- _response_json = _response.json()
2453
- except JSONDecodeError:
2454
- raise ApiError(status_code=_response.status_code, body=_response.text)
2455
- raise ApiError(status_code=_response.status_code, body=_response_json)
1341
+ )
1342
+ return _response.data
2456
1343
 
2457
1344
  async def configs_fork(
2458
1345
  self,
@@ -2487,7 +1374,6 @@ class AsyncVariantsClient:
2487
1374
 
2488
1375
  client = AsyncAgentaApi(
2489
1376
  api_key="YOUR_API_KEY",
2490
- base_url="https://yourhost.com/path/to/api",
2491
1377
  )
2492
1378
 
2493
1379
 
@@ -2497,55 +1383,13 @@ class AsyncVariantsClient:
2497
1383
 
2498
1384
  asyncio.run(main())
2499
1385
  """
2500
- _response = await self._client_wrapper.httpx_client.request(
2501
- "variants/configs/fork",
2502
- method="POST",
2503
- json={
2504
- "variant_ref": convert_and_respect_annotation_metadata(
2505
- object_=variant_ref,
2506
- annotation=ReferenceRequestModel,
2507
- direction="write",
2508
- ),
2509
- "environment_ref": convert_and_respect_annotation_metadata(
2510
- object_=environment_ref,
2511
- annotation=ReferenceRequestModel,
2512
- direction="write",
2513
- ),
2514
- "application_ref": convert_and_respect_annotation_metadata(
2515
- object_=application_ref,
2516
- annotation=ReferenceRequestModel,
2517
- direction="write",
2518
- ),
2519
- },
2520
- headers={
2521
- "content-type": "application/json",
2522
- },
1386
+ _response = await self._raw_client.configs_fork(
1387
+ variant_ref=variant_ref,
1388
+ environment_ref=environment_ref,
1389
+ application_ref=application_ref,
2523
1390
  request_options=request_options,
2524
- omit=OMIT,
2525
- )
2526
- try:
2527
- if 200 <= _response.status_code < 300:
2528
- return typing.cast(
2529
- ConfigResponseModel,
2530
- parse_obj_as(
2531
- type_=ConfigResponseModel, # type: ignore
2532
- object_=_response.json(),
2533
- ),
2534
- )
2535
- if _response.status_code == 422:
2536
- raise UnprocessableEntityError(
2537
- typing.cast(
2538
- HttpValidationError,
2539
- parse_obj_as(
2540
- type_=HttpValidationError, # type: ignore
2541
- object_=_response.json(),
2542
- ),
2543
- )
2544
- )
2545
- _response_json = _response.json()
2546
- except JSONDecodeError:
2547
- raise ApiError(status_code=_response.status_code, body=_response.text)
2548
- raise ApiError(status_code=_response.status_code, body=_response_json)
1391
+ )
1392
+ return _response.data
2549
1393
 
2550
1394
  async def configs_commit(
2551
1395
  self,
@@ -2574,7 +1418,6 @@ class AsyncVariantsClient:
2574
1418
 
2575
1419
  client = AsyncAgentaApi(
2576
1420
  api_key="YOUR_API_KEY",
2577
- base_url="https://yourhost.com/path/to/api",
2578
1421
  )
2579
1422
 
2580
1423
 
@@ -2588,43 +1431,10 @@ class AsyncVariantsClient:
2588
1431
 
2589
1432
  asyncio.run(main())
2590
1433
  """
2591
- _response = await self._client_wrapper.httpx_client.request(
2592
- "variants/configs/commit",
2593
- method="POST",
2594
- json={
2595
- "config": convert_and_respect_annotation_metadata(
2596
- object_=config, annotation=ConfigDto, direction="write"
2597
- ),
2598
- },
2599
- headers={
2600
- "content-type": "application/json",
2601
- },
2602
- request_options=request_options,
2603
- omit=OMIT,
2604
- )
2605
- try:
2606
- if 200 <= _response.status_code < 300:
2607
- return typing.cast(
2608
- ConfigResponseModel,
2609
- parse_obj_as(
2610
- type_=ConfigResponseModel, # type: ignore
2611
- object_=_response.json(),
2612
- ),
2613
- )
2614
- if _response.status_code == 422:
2615
- raise UnprocessableEntityError(
2616
- typing.cast(
2617
- HttpValidationError,
2618
- parse_obj_as(
2619
- type_=HttpValidationError, # type: ignore
2620
- object_=_response.json(),
2621
- ),
2622
- )
2623
- )
2624
- _response_json = _response.json()
2625
- except JSONDecodeError:
2626
- raise ApiError(status_code=_response.status_code, body=_response.text)
2627
- raise ApiError(status_code=_response.status_code, body=_response_json)
1434
+ _response = await self._raw_client.configs_commit(
1435
+ config=config, request_options=request_options
1436
+ )
1437
+ return _response.data
2628
1438
 
2629
1439
  async def configs_deploy(
2630
1440
  self,
@@ -2659,7 +1469,6 @@ class AsyncVariantsClient:
2659
1469
 
2660
1470
  client = AsyncAgentaApi(
2661
1471
  api_key="YOUR_API_KEY",
2662
- base_url="https://yourhost.com/path/to/api",
2663
1472
  )
2664
1473
 
2665
1474
 
@@ -2672,55 +1481,13 @@ class AsyncVariantsClient:
2672
1481
 
2673
1482
  asyncio.run(main())
2674
1483
  """
2675
- _response = await self._client_wrapper.httpx_client.request(
2676
- "variants/configs/deploy",
2677
- method="POST",
2678
- json={
2679
- "variant_ref": convert_and_respect_annotation_metadata(
2680
- object_=variant_ref,
2681
- annotation=ReferenceRequestModel,
2682
- direction="write",
2683
- ),
2684
- "environment_ref": convert_and_respect_annotation_metadata(
2685
- object_=environment_ref,
2686
- annotation=ReferenceRequestModel,
2687
- direction="write",
2688
- ),
2689
- "application_ref": convert_and_respect_annotation_metadata(
2690
- object_=application_ref,
2691
- annotation=ReferenceRequestModel,
2692
- direction="write",
2693
- ),
2694
- },
2695
- headers={
2696
- "content-type": "application/json",
2697
- },
1484
+ _response = await self._raw_client.configs_deploy(
1485
+ variant_ref=variant_ref,
1486
+ environment_ref=environment_ref,
1487
+ application_ref=application_ref,
2698
1488
  request_options=request_options,
2699
- omit=OMIT,
2700
- )
2701
- try:
2702
- if 200 <= _response.status_code < 300:
2703
- return typing.cast(
2704
- ConfigResponseModel,
2705
- parse_obj_as(
2706
- type_=ConfigResponseModel, # type: ignore
2707
- object_=_response.json(),
2708
- ),
2709
- )
2710
- if _response.status_code == 422:
2711
- raise UnprocessableEntityError(
2712
- typing.cast(
2713
- HttpValidationError,
2714
- parse_obj_as(
2715
- type_=HttpValidationError, # type: ignore
2716
- object_=_response.json(),
2717
- ),
2718
- )
2719
- )
2720
- _response_json = _response.json()
2721
- except JSONDecodeError:
2722
- raise ApiError(status_code=_response.status_code, body=_response.text)
2723
- raise ApiError(status_code=_response.status_code, body=_response_json)
1489
+ )
1490
+ return _response.data
2724
1491
 
2725
1492
  async def configs_delete(
2726
1493
  self,
@@ -2752,7 +1519,6 @@ class AsyncVariantsClient:
2752
1519
 
2753
1520
  client = AsyncAgentaApi(
2754
1521
  api_key="YOUR_API_KEY",
2755
- base_url="https://yourhost.com/path/to/api",
2756
1522
  )
2757
1523
 
2758
1524
 
@@ -2764,50 +1530,12 @@ class AsyncVariantsClient:
2764
1530
 
2765
1531
  asyncio.run(main())
2766
1532
  """
2767
- _response = await self._client_wrapper.httpx_client.request(
2768
- "variants/configs/delete",
2769
- method="POST",
2770
- json={
2771
- "variant_ref": convert_and_respect_annotation_metadata(
2772
- object_=variant_ref,
2773
- annotation=ReferenceRequestModel,
2774
- direction="write",
2775
- ),
2776
- "application_ref": convert_and_respect_annotation_metadata(
2777
- object_=application_ref,
2778
- annotation=ReferenceRequestModel,
2779
- direction="write",
2780
- ),
2781
- },
2782
- headers={
2783
- "content-type": "application/json",
2784
- },
1533
+ _response = await self._raw_client.configs_delete(
1534
+ variant_ref=variant_ref,
1535
+ application_ref=application_ref,
2785
1536
  request_options=request_options,
2786
- omit=OMIT,
2787
- )
2788
- try:
2789
- if 200 <= _response.status_code < 300:
2790
- return typing.cast(
2791
- int,
2792
- parse_obj_as(
2793
- type_=int, # type: ignore
2794
- object_=_response.json(),
2795
- ),
2796
- )
2797
- if _response.status_code == 422:
2798
- raise UnprocessableEntityError(
2799
- typing.cast(
2800
- HttpValidationError,
2801
- parse_obj_as(
2802
- type_=HttpValidationError, # type: ignore
2803
- object_=_response.json(),
2804
- ),
2805
- )
2806
- )
2807
- _response_json = _response.json()
2808
- except JSONDecodeError:
2809
- raise ApiError(status_code=_response.status_code, body=_response.text)
2810
- raise ApiError(status_code=_response.status_code, body=_response_json)
1537
+ )
1538
+ return _response.data
2811
1539
 
2812
1540
  async def configs_list(
2813
1541
  self,
@@ -2836,7 +1564,6 @@ class AsyncVariantsClient:
2836
1564
 
2837
1565
  client = AsyncAgentaApi(
2838
1566
  api_key="YOUR_API_KEY",
2839
- base_url="https://yourhost.com/path/to/api",
2840
1567
  )
2841
1568
 
2842
1569
 
@@ -2848,43 +1575,10 @@ class AsyncVariantsClient:
2848
1575
 
2849
1576
  asyncio.run(main())
2850
1577
  """
2851
- _response = await self._client_wrapper.httpx_client.request(
2852
- "variants/configs/list",
2853
- method="POST",
2854
- json={
2855
- "application_ref": convert_and_respect_annotation_metadata(
2856
- object_=application_ref, annotation=ReferenceDto, direction="write"
2857
- ),
2858
- },
2859
- headers={
2860
- "content-type": "application/json",
2861
- },
2862
- request_options=request_options,
2863
- omit=OMIT,
2864
- )
2865
- try:
2866
- if 200 <= _response.status_code < 300:
2867
- return typing.cast(
2868
- typing.List[ConfigResponseModel],
2869
- parse_obj_as(
2870
- type_=typing.List[ConfigResponseModel], # type: ignore
2871
- object_=_response.json(),
2872
- ),
2873
- )
2874
- if _response.status_code == 422:
2875
- raise UnprocessableEntityError(
2876
- typing.cast(
2877
- HttpValidationError,
2878
- parse_obj_as(
2879
- type_=HttpValidationError, # type: ignore
2880
- object_=_response.json(),
2881
- ),
2882
- )
2883
- )
2884
- _response_json = _response.json()
2885
- except JSONDecodeError:
2886
- raise ApiError(status_code=_response.status_code, body=_response.text)
2887
- raise ApiError(status_code=_response.status_code, body=_response_json)
1578
+ _response = await self._raw_client.configs_list(
1579
+ application_ref=application_ref, request_options=request_options
1580
+ )
1581
+ return _response.data
2888
1582
 
2889
1583
  async def configs_history(
2890
1584
  self,
@@ -2916,7 +1610,6 @@ class AsyncVariantsClient:
2916
1610
 
2917
1611
  client = AsyncAgentaApi(
2918
1612
  api_key="YOUR_API_KEY",
2919
- base_url="https://yourhost.com/path/to/api",
2920
1613
  )
2921
1614
 
2922
1615
 
@@ -2928,47 +1621,9 @@ class AsyncVariantsClient:
2928
1621
 
2929
1622
  asyncio.run(main())
2930
1623
  """
2931
- _response = await self._client_wrapper.httpx_client.request(
2932
- "variants/configs/history",
2933
- method="POST",
2934
- json={
2935
- "variant_ref": convert_and_respect_annotation_metadata(
2936
- object_=variant_ref,
2937
- annotation=ReferenceRequestModel,
2938
- direction="write",
2939
- ),
2940
- "application_ref": convert_and_respect_annotation_metadata(
2941
- object_=application_ref,
2942
- annotation=ReferenceRequestModel,
2943
- direction="write",
2944
- ),
2945
- },
2946
- headers={
2947
- "content-type": "application/json",
2948
- },
1624
+ _response = await self._raw_client.configs_history(
1625
+ variant_ref=variant_ref,
1626
+ application_ref=application_ref,
2949
1627
  request_options=request_options,
2950
- omit=OMIT,
2951
- )
2952
- try:
2953
- if 200 <= _response.status_code < 300:
2954
- return typing.cast(
2955
- typing.List[ConfigResponseModel],
2956
- parse_obj_as(
2957
- type_=typing.List[ConfigResponseModel], # type: ignore
2958
- object_=_response.json(),
2959
- ),
2960
- )
2961
- if _response.status_code == 422:
2962
- raise UnprocessableEntityError(
2963
- typing.cast(
2964
- HttpValidationError,
2965
- parse_obj_as(
2966
- type_=HttpValidationError, # type: ignore
2967
- object_=_response.json(),
2968
- ),
2969
- )
2970
- )
2971
- _response_json = _response.json()
2972
- except JSONDecodeError:
2973
- raise ApiError(status_code=_response.status_code, body=_response.text)
2974
- raise ApiError(status_code=_response.status_code, body=_response_json)
1628
+ )
1629
+ return _response.data