mirascope 2.0.0__py3-none-any.whl → 2.0.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (443) hide show
  1. mirascope/__init__.py +2 -11
  2. mirascope/graphs/__init__.py +22 -0
  3. mirascope/graphs/finite_state_machine.py +625 -0
  4. mirascope/llm/__init__.py +15 -96
  5. mirascope/llm/agents/__init__.py +15 -0
  6. mirascope/llm/agents/agent.py +97 -0
  7. mirascope/llm/agents/agent_template.py +45 -0
  8. mirascope/llm/agents/decorator.py +176 -0
  9. mirascope/llm/calls/__init__.py +1 -2
  10. mirascope/llm/calls/base_call.py +33 -0
  11. mirascope/llm/calls/calls.py +58 -84
  12. mirascope/llm/calls/decorator.py +120 -140
  13. mirascope/llm/clients/__init__.py +34 -0
  14. mirascope/llm/clients/_missing_import_stubs.py +47 -0
  15. mirascope/llm/clients/anthropic/__init__.py +25 -0
  16. mirascope/llm/{providers/openai/completions → clients/anthropic}/_utils/__init__.py +0 -2
  17. mirascope/llm/{providers → clients}/anthropic/_utils/decode.py +22 -66
  18. mirascope/llm/clients/anthropic/_utils/encode.py +243 -0
  19. mirascope/llm/clients/anthropic/clients.py +819 -0
  20. mirascope/llm/clients/anthropic/model_ids.py +8 -0
  21. mirascope/llm/{providers → clients}/base/__init__.py +5 -4
  22. mirascope/llm/{providers → clients}/base/_utils.py +17 -78
  23. mirascope/llm/{providers/base/base_provider.py → clients/base/client.py} +145 -468
  24. mirascope/llm/{models → clients/base}/params.py +37 -16
  25. mirascope/llm/clients/google/__init__.py +20 -0
  26. mirascope/llm/{providers/openai/responses → clients/google}/_utils/__init__.py +0 -2
  27. mirascope/llm/{providers → clients}/google/_utils/decode.py +22 -98
  28. mirascope/llm/{providers → clients}/google/_utils/encode.py +46 -168
  29. mirascope/llm/clients/google/clients.py +853 -0
  30. mirascope/llm/clients/google/model_ids.py +15 -0
  31. mirascope/llm/clients/openai/__init__.py +25 -0
  32. mirascope/llm/clients/openai/completions/__init__.py +28 -0
  33. mirascope/llm/{providers/google → clients/openai/completions}/_utils/__init__.py +0 -4
  34. mirascope/llm/{providers → clients}/openai/completions/_utils/decode.py +9 -74
  35. mirascope/llm/{providers → clients}/openai/completions/_utils/encode.py +52 -70
  36. mirascope/llm/clients/openai/completions/_utils/model_features.py +81 -0
  37. mirascope/llm/clients/openai/completions/clients.py +833 -0
  38. mirascope/llm/clients/openai/completions/model_ids.py +8 -0
  39. mirascope/llm/clients/openai/responses/__init__.py +26 -0
  40. mirascope/llm/clients/openai/responses/_utils/__init__.py +13 -0
  41. mirascope/llm/{providers → clients}/openai/responses/_utils/decode.py +14 -80
  42. mirascope/llm/{providers → clients}/openai/responses/_utils/encode.py +41 -92
  43. mirascope/llm/clients/openai/responses/_utils/model_features.py +87 -0
  44. mirascope/llm/clients/openai/responses/clients.py +832 -0
  45. mirascope/llm/clients/openai/responses/model_ids.py +8 -0
  46. mirascope/llm/clients/openai/shared/__init__.py +7 -0
  47. mirascope/llm/clients/openai/shared/_utils.py +55 -0
  48. mirascope/llm/clients/providers.py +175 -0
  49. mirascope/llm/content/__init__.py +2 -3
  50. mirascope/llm/content/tool_call.py +0 -6
  51. mirascope/llm/content/tool_output.py +5 -22
  52. mirascope/llm/context/_utils.py +6 -19
  53. mirascope/llm/exceptions.py +43 -298
  54. mirascope/llm/formatting/__init__.py +2 -19
  55. mirascope/llm/formatting/_utils.py +74 -0
  56. mirascope/llm/formatting/format.py +30 -219
  57. mirascope/llm/formatting/from_call_args.py +2 -2
  58. mirascope/llm/formatting/partial.py +7 -80
  59. mirascope/llm/formatting/types.py +64 -21
  60. mirascope/llm/mcp/__init__.py +2 -2
  61. mirascope/llm/mcp/client.py +118 -0
  62. mirascope/llm/messages/__init__.py +0 -3
  63. mirascope/llm/messages/message.py +5 -13
  64. mirascope/llm/models/__init__.py +2 -7
  65. mirascope/llm/models/models.py +139 -315
  66. mirascope/llm/prompts/__init__.py +12 -13
  67. mirascope/llm/prompts/_utils.py +43 -14
  68. mirascope/llm/prompts/decorator.py +204 -144
  69. mirascope/llm/prompts/protocols.py +59 -25
  70. mirascope/llm/responses/__init__.py +1 -9
  71. mirascope/llm/responses/_utils.py +12 -102
  72. mirascope/llm/responses/base_response.py +6 -18
  73. mirascope/llm/responses/base_stream_response.py +50 -173
  74. mirascope/llm/responses/finish_reason.py +0 -1
  75. mirascope/llm/responses/response.py +13 -34
  76. mirascope/llm/responses/root_response.py +29 -100
  77. mirascope/llm/responses/stream_response.py +31 -40
  78. mirascope/llm/tools/__init__.py +2 -9
  79. mirascope/llm/tools/_utils.py +3 -12
  80. mirascope/llm/tools/decorator.py +16 -25
  81. mirascope/llm/tools/protocols.py +4 -4
  82. mirascope/llm/tools/tool_schema.py +19 -87
  83. mirascope/llm/tools/toolkit.py +27 -35
  84. mirascope/llm/tools/tools.py +41 -135
  85. {mirascope-2.0.0.dist-info → mirascope-2.0.0a1.dist-info}/METADATA +13 -90
  86. mirascope-2.0.0a1.dist-info/RECORD +102 -0
  87. {mirascope-2.0.0.dist-info → mirascope-2.0.0a1.dist-info}/WHEEL +1 -1
  88. {mirascope-2.0.0.dist-info → mirascope-2.0.0a1.dist-info}/licenses/LICENSE +1 -1
  89. mirascope/_stubs.py +0 -363
  90. mirascope/api/__init__.py +0 -14
  91. mirascope/api/_generated/README.md +0 -207
  92. mirascope/api/_generated/__init__.py +0 -440
  93. mirascope/api/_generated/annotations/__init__.py +0 -33
  94. mirascope/api/_generated/annotations/client.py +0 -506
  95. mirascope/api/_generated/annotations/raw_client.py +0 -1414
  96. mirascope/api/_generated/annotations/types/__init__.py +0 -31
  97. mirascope/api/_generated/annotations/types/annotations_create_request_label.py +0 -5
  98. mirascope/api/_generated/annotations/types/annotations_create_response.py +0 -48
  99. mirascope/api/_generated/annotations/types/annotations_create_response_label.py +0 -5
  100. mirascope/api/_generated/annotations/types/annotations_get_response.py +0 -48
  101. mirascope/api/_generated/annotations/types/annotations_get_response_label.py +0 -5
  102. mirascope/api/_generated/annotations/types/annotations_list_request_label.py +0 -5
  103. mirascope/api/_generated/annotations/types/annotations_list_response.py +0 -21
  104. mirascope/api/_generated/annotations/types/annotations_list_response_annotations_item.py +0 -50
  105. mirascope/api/_generated/annotations/types/annotations_list_response_annotations_item_label.py +0 -5
  106. mirascope/api/_generated/annotations/types/annotations_update_request_label.py +0 -5
  107. mirascope/api/_generated/annotations/types/annotations_update_response.py +0 -48
  108. mirascope/api/_generated/annotations/types/annotations_update_response_label.py +0 -5
  109. mirascope/api/_generated/api_keys/__init__.py +0 -17
  110. mirascope/api/_generated/api_keys/client.py +0 -530
  111. mirascope/api/_generated/api_keys/raw_client.py +0 -1236
  112. mirascope/api/_generated/api_keys/types/__init__.py +0 -15
  113. mirascope/api/_generated/api_keys/types/api_keys_create_response.py +0 -28
  114. mirascope/api/_generated/api_keys/types/api_keys_get_response.py +0 -27
  115. mirascope/api/_generated/api_keys/types/api_keys_list_all_for_org_response_item.py +0 -40
  116. mirascope/api/_generated/api_keys/types/api_keys_list_response_item.py +0 -27
  117. mirascope/api/_generated/client.py +0 -211
  118. mirascope/api/_generated/core/__init__.py +0 -52
  119. mirascope/api/_generated/core/api_error.py +0 -23
  120. mirascope/api/_generated/core/client_wrapper.py +0 -46
  121. mirascope/api/_generated/core/datetime_utils.py +0 -28
  122. mirascope/api/_generated/core/file.py +0 -67
  123. mirascope/api/_generated/core/force_multipart.py +0 -16
  124. mirascope/api/_generated/core/http_client.py +0 -543
  125. mirascope/api/_generated/core/http_response.py +0 -55
  126. mirascope/api/_generated/core/jsonable_encoder.py +0 -100
  127. mirascope/api/_generated/core/pydantic_utilities.py +0 -255
  128. mirascope/api/_generated/core/query_encoder.py +0 -58
  129. mirascope/api/_generated/core/remove_none_from_dict.py +0 -11
  130. mirascope/api/_generated/core/request_options.py +0 -35
  131. mirascope/api/_generated/core/serialization.py +0 -276
  132. mirascope/api/_generated/docs/__init__.py +0 -4
  133. mirascope/api/_generated/docs/client.py +0 -91
  134. mirascope/api/_generated/docs/raw_client.py +0 -178
  135. mirascope/api/_generated/environment.py +0 -9
  136. mirascope/api/_generated/environments/__init__.py +0 -23
  137. mirascope/api/_generated/environments/client.py +0 -649
  138. mirascope/api/_generated/environments/raw_client.py +0 -1567
  139. mirascope/api/_generated/environments/types/__init__.py +0 -25
  140. mirascope/api/_generated/environments/types/environments_create_response.py +0 -24
  141. mirascope/api/_generated/environments/types/environments_get_analytics_response.py +0 -60
  142. mirascope/api/_generated/environments/types/environments_get_analytics_response_top_functions_item.py +0 -24
  143. mirascope/api/_generated/environments/types/environments_get_analytics_response_top_models_item.py +0 -22
  144. mirascope/api/_generated/environments/types/environments_get_response.py +0 -24
  145. mirascope/api/_generated/environments/types/environments_list_response_item.py +0 -24
  146. mirascope/api/_generated/environments/types/environments_update_response.py +0 -24
  147. mirascope/api/_generated/errors/__init__.py +0 -25
  148. mirascope/api/_generated/errors/bad_request_error.py +0 -14
  149. mirascope/api/_generated/errors/conflict_error.py +0 -14
  150. mirascope/api/_generated/errors/forbidden_error.py +0 -11
  151. mirascope/api/_generated/errors/internal_server_error.py +0 -10
  152. mirascope/api/_generated/errors/not_found_error.py +0 -11
  153. mirascope/api/_generated/errors/payment_required_error.py +0 -15
  154. mirascope/api/_generated/errors/service_unavailable_error.py +0 -14
  155. mirascope/api/_generated/errors/too_many_requests_error.py +0 -15
  156. mirascope/api/_generated/errors/unauthorized_error.py +0 -11
  157. mirascope/api/_generated/functions/__init__.py +0 -39
  158. mirascope/api/_generated/functions/client.py +0 -647
  159. mirascope/api/_generated/functions/raw_client.py +0 -1890
  160. mirascope/api/_generated/functions/types/__init__.py +0 -53
  161. mirascope/api/_generated/functions/types/functions_create_request_dependencies_value.py +0 -20
  162. mirascope/api/_generated/functions/types/functions_create_response.py +0 -37
  163. mirascope/api/_generated/functions/types/functions_create_response_dependencies_value.py +0 -20
  164. mirascope/api/_generated/functions/types/functions_find_by_hash_response.py +0 -39
  165. mirascope/api/_generated/functions/types/functions_find_by_hash_response_dependencies_value.py +0 -20
  166. mirascope/api/_generated/functions/types/functions_get_by_env_response.py +0 -53
  167. mirascope/api/_generated/functions/types/functions_get_by_env_response_dependencies_value.py +0 -22
  168. mirascope/api/_generated/functions/types/functions_get_response.py +0 -37
  169. mirascope/api/_generated/functions/types/functions_get_response_dependencies_value.py +0 -20
  170. mirascope/api/_generated/functions/types/functions_list_by_env_response.py +0 -25
  171. mirascope/api/_generated/functions/types/functions_list_by_env_response_functions_item.py +0 -56
  172. mirascope/api/_generated/functions/types/functions_list_by_env_response_functions_item_dependencies_value.py +0 -22
  173. mirascope/api/_generated/functions/types/functions_list_response.py +0 -21
  174. mirascope/api/_generated/functions/types/functions_list_response_functions_item.py +0 -41
  175. mirascope/api/_generated/functions/types/functions_list_response_functions_item_dependencies_value.py +0 -20
  176. mirascope/api/_generated/health/__init__.py +0 -7
  177. mirascope/api/_generated/health/client.py +0 -92
  178. mirascope/api/_generated/health/raw_client.py +0 -175
  179. mirascope/api/_generated/health/types/__init__.py +0 -8
  180. mirascope/api/_generated/health/types/health_check_response.py +0 -22
  181. mirascope/api/_generated/health/types/health_check_response_status.py +0 -5
  182. mirascope/api/_generated/organization_invitations/__init__.py +0 -33
  183. mirascope/api/_generated/organization_invitations/client.py +0 -546
  184. mirascope/api/_generated/organization_invitations/raw_client.py +0 -1519
  185. mirascope/api/_generated/organization_invitations/types/__init__.py +0 -53
  186. mirascope/api/_generated/organization_invitations/types/organization_invitations_accept_response.py +0 -34
  187. mirascope/api/_generated/organization_invitations/types/organization_invitations_accept_response_role.py +0 -7
  188. mirascope/api/_generated/organization_invitations/types/organization_invitations_create_request_role.py +0 -7
  189. mirascope/api/_generated/organization_invitations/types/organization_invitations_create_response.py +0 -48
  190. mirascope/api/_generated/organization_invitations/types/organization_invitations_create_response_role.py +0 -7
  191. mirascope/api/_generated/organization_invitations/types/organization_invitations_create_response_status.py +0 -7
  192. mirascope/api/_generated/organization_invitations/types/organization_invitations_get_response.py +0 -48
  193. mirascope/api/_generated/organization_invitations/types/organization_invitations_get_response_role.py +0 -7
  194. mirascope/api/_generated/organization_invitations/types/organization_invitations_get_response_status.py +0 -7
  195. mirascope/api/_generated/organization_invitations/types/organization_invitations_list_response_item.py +0 -48
  196. mirascope/api/_generated/organization_invitations/types/organization_invitations_list_response_item_role.py +0 -7
  197. mirascope/api/_generated/organization_invitations/types/organization_invitations_list_response_item_status.py +0 -7
  198. mirascope/api/_generated/organization_memberships/__init__.py +0 -19
  199. mirascope/api/_generated/organization_memberships/client.py +0 -302
  200. mirascope/api/_generated/organization_memberships/raw_client.py +0 -736
  201. mirascope/api/_generated/organization_memberships/types/__init__.py +0 -27
  202. mirascope/api/_generated/organization_memberships/types/organization_memberships_list_response_item.py +0 -33
  203. mirascope/api/_generated/organization_memberships/types/organization_memberships_list_response_item_role.py +0 -7
  204. mirascope/api/_generated/organization_memberships/types/organization_memberships_update_request_role.py +0 -7
  205. mirascope/api/_generated/organization_memberships/types/organization_memberships_update_response.py +0 -31
  206. mirascope/api/_generated/organization_memberships/types/organization_memberships_update_response_role.py +0 -7
  207. mirascope/api/_generated/organizations/__init__.py +0 -51
  208. mirascope/api/_generated/organizations/client.py +0 -869
  209. mirascope/api/_generated/organizations/raw_client.py +0 -2593
  210. mirascope/api/_generated/organizations/types/__init__.py +0 -71
  211. mirascope/api/_generated/organizations/types/organizations_create_payment_intent_response.py +0 -24
  212. mirascope/api/_generated/organizations/types/organizations_create_response.py +0 -26
  213. mirascope/api/_generated/organizations/types/organizations_create_response_role.py +0 -5
  214. mirascope/api/_generated/organizations/types/organizations_get_response.py +0 -26
  215. mirascope/api/_generated/organizations/types/organizations_get_response_role.py +0 -5
  216. mirascope/api/_generated/organizations/types/organizations_list_response_item.py +0 -26
  217. mirascope/api/_generated/organizations/types/organizations_list_response_item_role.py +0 -5
  218. mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_request_target_plan.py +0 -7
  219. mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_response.py +0 -47
  220. mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_response_validation_errors_item.py +0 -33
  221. mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_response_validation_errors_item_resource.py +0 -7
  222. mirascope/api/_generated/organizations/types/organizations_router_balance_response.py +0 -24
  223. mirascope/api/_generated/organizations/types/organizations_subscription_response.py +0 -53
  224. mirascope/api/_generated/organizations/types/organizations_subscription_response_current_plan.py +0 -7
  225. mirascope/api/_generated/organizations/types/organizations_subscription_response_payment_method.py +0 -26
  226. mirascope/api/_generated/organizations/types/organizations_subscription_response_scheduled_change.py +0 -34
  227. mirascope/api/_generated/organizations/types/organizations_subscription_response_scheduled_change_target_plan.py +0 -7
  228. mirascope/api/_generated/organizations/types/organizations_update_response.py +0 -26
  229. mirascope/api/_generated/organizations/types/organizations_update_response_role.py +0 -5
  230. mirascope/api/_generated/organizations/types/organizations_update_subscription_request_target_plan.py +0 -7
  231. mirascope/api/_generated/organizations/types/organizations_update_subscription_response.py +0 -35
  232. mirascope/api/_generated/project_memberships/__init__.py +0 -25
  233. mirascope/api/_generated/project_memberships/client.py +0 -437
  234. mirascope/api/_generated/project_memberships/raw_client.py +0 -1039
  235. mirascope/api/_generated/project_memberships/types/__init__.py +0 -29
  236. mirascope/api/_generated/project_memberships/types/project_memberships_create_request_role.py +0 -7
  237. mirascope/api/_generated/project_memberships/types/project_memberships_create_response.py +0 -35
  238. mirascope/api/_generated/project_memberships/types/project_memberships_create_response_role.py +0 -7
  239. mirascope/api/_generated/project_memberships/types/project_memberships_list_response_item.py +0 -33
  240. mirascope/api/_generated/project_memberships/types/project_memberships_list_response_item_role.py +0 -7
  241. mirascope/api/_generated/project_memberships/types/project_memberships_update_request_role.py +0 -7
  242. mirascope/api/_generated/project_memberships/types/project_memberships_update_response.py +0 -35
  243. mirascope/api/_generated/project_memberships/types/project_memberships_update_response_role.py +0 -7
  244. mirascope/api/_generated/projects/__init__.py +0 -7
  245. mirascope/api/_generated/projects/client.py +0 -428
  246. mirascope/api/_generated/projects/raw_client.py +0 -1302
  247. mirascope/api/_generated/projects/types/__init__.py +0 -10
  248. mirascope/api/_generated/projects/types/projects_create_response.py +0 -25
  249. mirascope/api/_generated/projects/types/projects_get_response.py +0 -25
  250. mirascope/api/_generated/projects/types/projects_list_response_item.py +0 -25
  251. mirascope/api/_generated/projects/types/projects_update_response.py +0 -25
  252. mirascope/api/_generated/reference.md +0 -4915
  253. mirascope/api/_generated/tags/__init__.py +0 -19
  254. mirascope/api/_generated/tags/client.py +0 -504
  255. mirascope/api/_generated/tags/raw_client.py +0 -1288
  256. mirascope/api/_generated/tags/types/__init__.py +0 -17
  257. mirascope/api/_generated/tags/types/tags_create_response.py +0 -41
  258. mirascope/api/_generated/tags/types/tags_get_response.py +0 -41
  259. mirascope/api/_generated/tags/types/tags_list_response.py +0 -23
  260. mirascope/api/_generated/tags/types/tags_list_response_tags_item.py +0 -41
  261. mirascope/api/_generated/tags/types/tags_update_response.py +0 -41
  262. mirascope/api/_generated/token_cost/__init__.py +0 -7
  263. mirascope/api/_generated/token_cost/client.py +0 -160
  264. mirascope/api/_generated/token_cost/raw_client.py +0 -264
  265. mirascope/api/_generated/token_cost/types/__init__.py +0 -8
  266. mirascope/api/_generated/token_cost/types/token_cost_calculate_request_usage.py +0 -54
  267. mirascope/api/_generated/token_cost/types/token_cost_calculate_response.py +0 -52
  268. mirascope/api/_generated/traces/__init__.py +0 -97
  269. mirascope/api/_generated/traces/client.py +0 -1103
  270. mirascope/api/_generated/traces/raw_client.py +0 -2322
  271. mirascope/api/_generated/traces/types/__init__.py +0 -155
  272. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item.py +0 -29
  273. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource.py +0 -27
  274. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item.py +0 -23
  275. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value.py +0 -38
  276. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_array_value.py +0 -19
  277. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value.py +0 -22
  278. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value_values_item.py +0 -20
  279. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item.py +0 -29
  280. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope.py +0 -31
  281. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item.py +0 -23
  282. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value.py +0 -38
  283. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_array_value.py +0 -19
  284. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_kvlist_value.py +0 -22
  285. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_kvlist_value_values_item.py +0 -22
  286. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item.py +0 -48
  287. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item.py +0 -23
  288. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value.py +0 -38
  289. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_array_value.py +0 -19
  290. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_kvlist_value.py +0 -24
  291. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_kvlist_value_values_item.py +0 -22
  292. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_status.py +0 -20
  293. mirascope/api/_generated/traces/types/traces_create_response.py +0 -24
  294. mirascope/api/_generated/traces/types/traces_create_response_partial_success.py +0 -22
  295. mirascope/api/_generated/traces/types/traces_get_analytics_summary_response.py +0 -60
  296. mirascope/api/_generated/traces/types/traces_get_analytics_summary_response_top_functions_item.py +0 -24
  297. mirascope/api/_generated/traces/types/traces_get_analytics_summary_response_top_models_item.py +0 -22
  298. mirascope/api/_generated/traces/types/traces_get_trace_detail_by_env_response.py +0 -33
  299. mirascope/api/_generated/traces/types/traces_get_trace_detail_by_env_response_spans_item.py +0 -88
  300. mirascope/api/_generated/traces/types/traces_get_trace_detail_response.py +0 -33
  301. mirascope/api/_generated/traces/types/traces_get_trace_detail_response_spans_item.py +0 -88
  302. mirascope/api/_generated/traces/types/traces_list_by_function_hash_response.py +0 -25
  303. mirascope/api/_generated/traces/types/traces_list_by_function_hash_response_traces_item.py +0 -44
  304. mirascope/api/_generated/traces/types/traces_search_by_env_request_attribute_filters_item.py +0 -26
  305. mirascope/api/_generated/traces/types/traces_search_by_env_request_attribute_filters_item_operator.py +0 -7
  306. mirascope/api/_generated/traces/types/traces_search_by_env_request_sort_by.py +0 -7
  307. mirascope/api/_generated/traces/types/traces_search_by_env_request_sort_order.py +0 -7
  308. mirascope/api/_generated/traces/types/traces_search_by_env_response.py +0 -26
  309. mirascope/api/_generated/traces/types/traces_search_by_env_response_spans_item.py +0 -50
  310. mirascope/api/_generated/traces/types/traces_search_request_attribute_filters_item.py +0 -26
  311. mirascope/api/_generated/traces/types/traces_search_request_attribute_filters_item_operator.py +0 -7
  312. mirascope/api/_generated/traces/types/traces_search_request_sort_by.py +0 -7
  313. mirascope/api/_generated/traces/types/traces_search_request_sort_order.py +0 -5
  314. mirascope/api/_generated/traces/types/traces_search_response.py +0 -26
  315. mirascope/api/_generated/traces/types/traces_search_response_spans_item.py +0 -50
  316. mirascope/api/_generated/types/__init__.py +0 -85
  317. mirascope/api/_generated/types/already_exists_error.py +0 -22
  318. mirascope/api/_generated/types/already_exists_error_tag.py +0 -5
  319. mirascope/api/_generated/types/bad_request_error_body.py +0 -50
  320. mirascope/api/_generated/types/click_house_error.py +0 -22
  321. mirascope/api/_generated/types/database_error.py +0 -22
  322. mirascope/api/_generated/types/database_error_tag.py +0 -5
  323. mirascope/api/_generated/types/date.py +0 -3
  324. mirascope/api/_generated/types/http_api_decode_error.py +0 -27
  325. mirascope/api/_generated/types/http_api_decode_error_tag.py +0 -5
  326. mirascope/api/_generated/types/immutable_resource_error.py +0 -22
  327. mirascope/api/_generated/types/internal_server_error_body.py +0 -49
  328. mirascope/api/_generated/types/issue.py +0 -38
  329. mirascope/api/_generated/types/issue_tag.py +0 -10
  330. mirascope/api/_generated/types/not_found_error_body.py +0 -22
  331. mirascope/api/_generated/types/not_found_error_tag.py +0 -5
  332. mirascope/api/_generated/types/number_from_string.py +0 -3
  333. mirascope/api/_generated/types/permission_denied_error.py +0 -22
  334. mirascope/api/_generated/types/permission_denied_error_tag.py +0 -5
  335. mirascope/api/_generated/types/plan_limit_exceeded_error.py +0 -32
  336. mirascope/api/_generated/types/plan_limit_exceeded_error_tag.py +0 -7
  337. mirascope/api/_generated/types/pricing_unavailable_error.py +0 -23
  338. mirascope/api/_generated/types/property_key.py +0 -7
  339. mirascope/api/_generated/types/property_key_key.py +0 -25
  340. mirascope/api/_generated/types/property_key_key_tag.py +0 -5
  341. mirascope/api/_generated/types/rate_limit_error.py +0 -31
  342. mirascope/api/_generated/types/rate_limit_error_tag.py +0 -5
  343. mirascope/api/_generated/types/service_unavailable_error_body.py +0 -24
  344. mirascope/api/_generated/types/service_unavailable_error_tag.py +0 -7
  345. mirascope/api/_generated/types/stripe_error.py +0 -20
  346. mirascope/api/_generated/types/subscription_past_due_error.py +0 -31
  347. mirascope/api/_generated/types/subscription_past_due_error_tag.py +0 -7
  348. mirascope/api/_generated/types/unauthorized_error_body.py +0 -21
  349. mirascope/api/_generated/types/unauthorized_error_tag.py +0 -5
  350. mirascope/api/client.py +0 -255
  351. mirascope/api/settings.py +0 -99
  352. mirascope/llm/formatting/output_parser.py +0 -178
  353. mirascope/llm/formatting/primitives.py +0 -192
  354. mirascope/llm/mcp/mcp_client.py +0 -130
  355. mirascope/llm/messages/_utils.py +0 -34
  356. mirascope/llm/models/thinking_config.py +0 -61
  357. mirascope/llm/prompts/prompts.py +0 -487
  358. mirascope/llm/providers/__init__.py +0 -62
  359. mirascope/llm/providers/anthropic/__init__.py +0 -11
  360. mirascope/llm/providers/anthropic/_utils/__init__.py +0 -27
  361. mirascope/llm/providers/anthropic/_utils/beta_decode.py +0 -282
  362. mirascope/llm/providers/anthropic/_utils/beta_encode.py +0 -266
  363. mirascope/llm/providers/anthropic/_utils/encode.py +0 -418
  364. mirascope/llm/providers/anthropic/_utils/errors.py +0 -46
  365. mirascope/llm/providers/anthropic/beta_provider.py +0 -374
  366. mirascope/llm/providers/anthropic/model_id.py +0 -23
  367. mirascope/llm/providers/anthropic/model_info.py +0 -87
  368. mirascope/llm/providers/anthropic/provider.py +0 -479
  369. mirascope/llm/providers/google/__init__.py +0 -6
  370. mirascope/llm/providers/google/_utils/errors.py +0 -50
  371. mirascope/llm/providers/google/model_id.py +0 -22
  372. mirascope/llm/providers/google/model_info.py +0 -63
  373. mirascope/llm/providers/google/provider.py +0 -492
  374. mirascope/llm/providers/mirascope/__init__.py +0 -5
  375. mirascope/llm/providers/mirascope/_utils.py +0 -73
  376. mirascope/llm/providers/mirascope/provider.py +0 -349
  377. mirascope/llm/providers/mlx/__init__.py +0 -9
  378. mirascope/llm/providers/mlx/_utils.py +0 -141
  379. mirascope/llm/providers/mlx/encoding/__init__.py +0 -8
  380. mirascope/llm/providers/mlx/encoding/base.py +0 -72
  381. mirascope/llm/providers/mlx/encoding/transformers.py +0 -150
  382. mirascope/llm/providers/mlx/mlx.py +0 -254
  383. mirascope/llm/providers/mlx/model_id.py +0 -17
  384. mirascope/llm/providers/mlx/provider.py +0 -452
  385. mirascope/llm/providers/model_id.py +0 -16
  386. mirascope/llm/providers/ollama/__init__.py +0 -7
  387. mirascope/llm/providers/ollama/provider.py +0 -71
  388. mirascope/llm/providers/openai/__init__.py +0 -15
  389. mirascope/llm/providers/openai/_utils/__init__.py +0 -5
  390. mirascope/llm/providers/openai/_utils/errors.py +0 -46
  391. mirascope/llm/providers/openai/completions/__init__.py +0 -7
  392. mirascope/llm/providers/openai/completions/base_provider.py +0 -542
  393. mirascope/llm/providers/openai/completions/provider.py +0 -22
  394. mirascope/llm/providers/openai/model_id.py +0 -31
  395. mirascope/llm/providers/openai/model_info.py +0 -303
  396. mirascope/llm/providers/openai/provider.py +0 -441
  397. mirascope/llm/providers/openai/responses/__init__.py +0 -5
  398. mirascope/llm/providers/openai/responses/provider.py +0 -513
  399. mirascope/llm/providers/provider_id.py +0 -24
  400. mirascope/llm/providers/provider_registry.py +0 -299
  401. mirascope/llm/providers/together/__init__.py +0 -7
  402. mirascope/llm/providers/together/provider.py +0 -40
  403. mirascope/llm/responses/usage.py +0 -95
  404. mirascope/ops/__init__.py +0 -111
  405. mirascope/ops/_internal/__init__.py +0 -5
  406. mirascope/ops/_internal/closure.py +0 -1169
  407. mirascope/ops/_internal/configuration.py +0 -177
  408. mirascope/ops/_internal/context.py +0 -76
  409. mirascope/ops/_internal/exporters/__init__.py +0 -26
  410. mirascope/ops/_internal/exporters/exporters.py +0 -395
  411. mirascope/ops/_internal/exporters/processors.py +0 -104
  412. mirascope/ops/_internal/exporters/types.py +0 -165
  413. mirascope/ops/_internal/exporters/utils.py +0 -29
  414. mirascope/ops/_internal/instrumentation/__init__.py +0 -8
  415. mirascope/ops/_internal/instrumentation/llm/__init__.py +0 -8
  416. mirascope/ops/_internal/instrumentation/llm/common.py +0 -530
  417. mirascope/ops/_internal/instrumentation/llm/cost.py +0 -190
  418. mirascope/ops/_internal/instrumentation/llm/encode.py +0 -238
  419. mirascope/ops/_internal/instrumentation/llm/gen_ai_types/__init__.py +0 -38
  420. mirascope/ops/_internal/instrumentation/llm/gen_ai_types/gen_ai_input_messages.py +0 -31
  421. mirascope/ops/_internal/instrumentation/llm/gen_ai_types/gen_ai_output_messages.py +0 -38
  422. mirascope/ops/_internal/instrumentation/llm/gen_ai_types/gen_ai_system_instructions.py +0 -18
  423. mirascope/ops/_internal/instrumentation/llm/gen_ai_types/shared.py +0 -100
  424. mirascope/ops/_internal/instrumentation/llm/llm.py +0 -161
  425. mirascope/ops/_internal/instrumentation/llm/model.py +0 -1798
  426. mirascope/ops/_internal/instrumentation/llm/response.py +0 -521
  427. mirascope/ops/_internal/instrumentation/llm/serialize.py +0 -300
  428. mirascope/ops/_internal/propagation.py +0 -198
  429. mirascope/ops/_internal/protocols.py +0 -133
  430. mirascope/ops/_internal/session.py +0 -139
  431. mirascope/ops/_internal/spans.py +0 -232
  432. mirascope/ops/_internal/traced_calls.py +0 -375
  433. mirascope/ops/_internal/traced_functions.py +0 -523
  434. mirascope/ops/_internal/tracing.py +0 -353
  435. mirascope/ops/_internal/types.py +0 -13
  436. mirascope/ops/_internal/utils.py +0 -123
  437. mirascope/ops/_internal/versioned_calls.py +0 -512
  438. mirascope/ops/_internal/versioned_functions.py +0 -357
  439. mirascope/ops/_internal/versioning.py +0 -303
  440. mirascope/ops/exceptions.py +0 -21
  441. mirascope-2.0.0.dist-info/RECORD +0 -423
  442. /mirascope/llm/{providers → clients}/base/kwargs.py +0 -0
  443. /mirascope/llm/{providers → clients}/google/message.py +0 -0
@@ -1,1302 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
- from json.decoder import JSONDecodeError
5
-
6
- from ..core.api_error import ApiError
7
- from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
- from ..core.http_response import AsyncHttpResponse, HttpResponse
9
- from ..core.jsonable_encoder import jsonable_encoder
10
- from ..core.pydantic_utilities import parse_obj_as
11
- from ..core.request_options import RequestOptions
12
- from ..errors.bad_request_error import BadRequestError
13
- from ..errors.conflict_error import ConflictError
14
- from ..errors.forbidden_error import ForbiddenError
15
- from ..errors.internal_server_error import InternalServerError
16
- from ..errors.not_found_error import NotFoundError
17
- from ..errors.payment_required_error import PaymentRequiredError
18
- from ..errors.service_unavailable_error import ServiceUnavailableError
19
- from ..errors.too_many_requests_error import TooManyRequestsError
20
- from ..types.not_found_error_body import NotFoundErrorBody
21
- from ..types.permission_denied_error import PermissionDeniedError
22
- from ..types.plan_limit_exceeded_error import PlanLimitExceededError
23
- from ..types.rate_limit_error import RateLimitError
24
- from .types.projects_create_response import ProjectsCreateResponse
25
- from .types.projects_get_response import ProjectsGetResponse
26
- from .types.projects_list_response_item import ProjectsListResponseItem
27
- from .types.projects_update_response import ProjectsUpdateResponse
28
-
29
- # this is used as the default value for optional parameters
30
- OMIT = typing.cast(typing.Any, ...)
31
-
32
-
33
- class RawProjectsClient:
34
- def __init__(self, *, client_wrapper: SyncClientWrapper):
35
- self._client_wrapper = client_wrapper
36
-
37
- def list(
38
- self,
39
- organization_id: str,
40
- *,
41
- request_options: typing.Optional[RequestOptions] = None,
42
- ) -> HttpResponse[typing.List[ProjectsListResponseItem]]:
43
- """
44
- Parameters
45
- ----------
46
- organization_id : str
47
-
48
- request_options : typing.Optional[RequestOptions]
49
- Request-specific configuration.
50
-
51
- Returns
52
- -------
53
- HttpResponse[typing.List[ProjectsListResponseItem]]
54
- Success
55
- """
56
- _response = self._client_wrapper.httpx_client.request(
57
- f"organizations/{jsonable_encoder(organization_id)}/projects",
58
- method="GET",
59
- request_options=request_options,
60
- )
61
- try:
62
- if 200 <= _response.status_code < 300:
63
- _data = typing.cast(
64
- typing.List[ProjectsListResponseItem],
65
- parse_obj_as(
66
- type_=typing.List[ProjectsListResponseItem], # type: ignore
67
- object_=_response.json(),
68
- ),
69
- )
70
- return HttpResponse(response=_response, data=_data)
71
- if _response.status_code == 400:
72
- raise BadRequestError(
73
- headers=dict(_response.headers),
74
- body=typing.cast(
75
- typing.Optional[typing.Any],
76
- parse_obj_as(
77
- type_=typing.Optional[typing.Any], # type: ignore
78
- object_=_response.json(),
79
- ),
80
- ),
81
- )
82
- if _response.status_code == 403:
83
- raise ForbiddenError(
84
- headers=dict(_response.headers),
85
- body=typing.cast(
86
- PermissionDeniedError,
87
- parse_obj_as(
88
- type_=PermissionDeniedError, # type: ignore
89
- object_=_response.json(),
90
- ),
91
- ),
92
- )
93
- if _response.status_code == 404:
94
- raise NotFoundError(
95
- headers=dict(_response.headers),
96
- body=typing.cast(
97
- NotFoundErrorBody,
98
- parse_obj_as(
99
- type_=NotFoundErrorBody, # type: ignore
100
- object_=_response.json(),
101
- ),
102
- ),
103
- )
104
- if _response.status_code == 429:
105
- raise TooManyRequestsError(
106
- headers=dict(_response.headers),
107
- body=typing.cast(
108
- RateLimitError,
109
- parse_obj_as(
110
- type_=RateLimitError, # type: ignore
111
- object_=_response.json(),
112
- ),
113
- ),
114
- )
115
- if _response.status_code == 500:
116
- raise InternalServerError(
117
- headers=dict(_response.headers),
118
- body=typing.cast(
119
- typing.Optional[typing.Any],
120
- parse_obj_as(
121
- type_=typing.Optional[typing.Any], # type: ignore
122
- object_=_response.json(),
123
- ),
124
- ),
125
- )
126
- if _response.status_code == 503:
127
- raise ServiceUnavailableError(
128
- headers=dict(_response.headers),
129
- body=typing.cast(
130
- typing.Optional[typing.Any],
131
- parse_obj_as(
132
- type_=typing.Optional[typing.Any], # type: ignore
133
- object_=_response.json(),
134
- ),
135
- ),
136
- )
137
- _response_json = _response.json()
138
- except JSONDecodeError:
139
- raise ApiError(
140
- status_code=_response.status_code,
141
- headers=dict(_response.headers),
142
- body=_response.text,
143
- )
144
- raise ApiError(
145
- status_code=_response.status_code,
146
- headers=dict(_response.headers),
147
- body=_response_json,
148
- )
149
-
150
- def create(
151
- self,
152
- organization_id: str,
153
- *,
154
- name: str,
155
- slug: str,
156
- request_options: typing.Optional[RequestOptions] = None,
157
- ) -> HttpResponse[ProjectsCreateResponse]:
158
- """
159
- Parameters
160
- ----------
161
- organization_id : str
162
-
163
- name : str
164
- a string at most 100 character(s) long
165
-
166
- slug : str
167
- a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
168
-
169
- request_options : typing.Optional[RequestOptions]
170
- Request-specific configuration.
171
-
172
- Returns
173
- -------
174
- HttpResponse[ProjectsCreateResponse]
175
- Success
176
- """
177
- _response = self._client_wrapper.httpx_client.request(
178
- f"organizations/{jsonable_encoder(organization_id)}/projects",
179
- method="POST",
180
- json={
181
- "name": name,
182
- "slug": slug,
183
- },
184
- headers={
185
- "content-type": "application/json",
186
- },
187
- request_options=request_options,
188
- omit=OMIT,
189
- )
190
- try:
191
- if 200 <= _response.status_code < 300:
192
- _data = typing.cast(
193
- ProjectsCreateResponse,
194
- parse_obj_as(
195
- type_=ProjectsCreateResponse, # type: ignore
196
- object_=_response.json(),
197
- ),
198
- )
199
- return HttpResponse(response=_response, data=_data)
200
- if _response.status_code == 400:
201
- raise BadRequestError(
202
- headers=dict(_response.headers),
203
- body=typing.cast(
204
- typing.Optional[typing.Any],
205
- parse_obj_as(
206
- type_=typing.Optional[typing.Any], # type: ignore
207
- object_=_response.json(),
208
- ),
209
- ),
210
- )
211
- if _response.status_code == 402:
212
- raise PaymentRequiredError(
213
- headers=dict(_response.headers),
214
- body=typing.cast(
215
- PlanLimitExceededError,
216
- parse_obj_as(
217
- type_=PlanLimitExceededError, # type: ignore
218
- object_=_response.json(),
219
- ),
220
- ),
221
- )
222
- if _response.status_code == 403:
223
- raise ForbiddenError(
224
- headers=dict(_response.headers),
225
- body=typing.cast(
226
- PermissionDeniedError,
227
- parse_obj_as(
228
- type_=PermissionDeniedError, # type: ignore
229
- object_=_response.json(),
230
- ),
231
- ),
232
- )
233
- if _response.status_code == 404:
234
- raise NotFoundError(
235
- headers=dict(_response.headers),
236
- body=typing.cast(
237
- NotFoundErrorBody,
238
- parse_obj_as(
239
- type_=NotFoundErrorBody, # type: ignore
240
- object_=_response.json(),
241
- ),
242
- ),
243
- )
244
- if _response.status_code == 409:
245
- raise ConflictError(
246
- headers=dict(_response.headers),
247
- body=typing.cast(
248
- typing.Optional[typing.Any],
249
- parse_obj_as(
250
- type_=typing.Optional[typing.Any], # type: ignore
251
- object_=_response.json(),
252
- ),
253
- ),
254
- )
255
- if _response.status_code == 429:
256
- raise TooManyRequestsError(
257
- headers=dict(_response.headers),
258
- body=typing.cast(
259
- RateLimitError,
260
- parse_obj_as(
261
- type_=RateLimitError, # type: ignore
262
- object_=_response.json(),
263
- ),
264
- ),
265
- )
266
- if _response.status_code == 500:
267
- raise InternalServerError(
268
- headers=dict(_response.headers),
269
- body=typing.cast(
270
- typing.Optional[typing.Any],
271
- parse_obj_as(
272
- type_=typing.Optional[typing.Any], # type: ignore
273
- object_=_response.json(),
274
- ),
275
- ),
276
- )
277
- if _response.status_code == 503:
278
- raise ServiceUnavailableError(
279
- headers=dict(_response.headers),
280
- body=typing.cast(
281
- typing.Optional[typing.Any],
282
- parse_obj_as(
283
- type_=typing.Optional[typing.Any], # type: ignore
284
- object_=_response.json(),
285
- ),
286
- ),
287
- )
288
- _response_json = _response.json()
289
- except JSONDecodeError:
290
- raise ApiError(
291
- status_code=_response.status_code,
292
- headers=dict(_response.headers),
293
- body=_response.text,
294
- )
295
- raise ApiError(
296
- status_code=_response.status_code,
297
- headers=dict(_response.headers),
298
- body=_response_json,
299
- )
300
-
301
- def get(
302
- self,
303
- organization_id: str,
304
- project_id: str,
305
- *,
306
- request_options: typing.Optional[RequestOptions] = None,
307
- ) -> HttpResponse[ProjectsGetResponse]:
308
- """
309
- Parameters
310
- ----------
311
- organization_id : str
312
-
313
- project_id : str
314
-
315
- request_options : typing.Optional[RequestOptions]
316
- Request-specific configuration.
317
-
318
- Returns
319
- -------
320
- HttpResponse[ProjectsGetResponse]
321
- Success
322
- """
323
- _response = self._client_wrapper.httpx_client.request(
324
- f"organizations/{jsonable_encoder(organization_id)}/projects/{jsonable_encoder(project_id)}",
325
- method="GET",
326
- request_options=request_options,
327
- )
328
- try:
329
- if 200 <= _response.status_code < 300:
330
- _data = typing.cast(
331
- ProjectsGetResponse,
332
- parse_obj_as(
333
- type_=ProjectsGetResponse, # type: ignore
334
- object_=_response.json(),
335
- ),
336
- )
337
- return HttpResponse(response=_response, data=_data)
338
- if _response.status_code == 400:
339
- raise BadRequestError(
340
- headers=dict(_response.headers),
341
- body=typing.cast(
342
- typing.Optional[typing.Any],
343
- parse_obj_as(
344
- type_=typing.Optional[typing.Any], # type: ignore
345
- object_=_response.json(),
346
- ),
347
- ),
348
- )
349
- if _response.status_code == 403:
350
- raise ForbiddenError(
351
- headers=dict(_response.headers),
352
- body=typing.cast(
353
- PermissionDeniedError,
354
- parse_obj_as(
355
- type_=PermissionDeniedError, # type: ignore
356
- object_=_response.json(),
357
- ),
358
- ),
359
- )
360
- if _response.status_code == 404:
361
- raise NotFoundError(
362
- headers=dict(_response.headers),
363
- body=typing.cast(
364
- NotFoundErrorBody,
365
- parse_obj_as(
366
- type_=NotFoundErrorBody, # type: ignore
367
- object_=_response.json(),
368
- ),
369
- ),
370
- )
371
- if _response.status_code == 429:
372
- raise TooManyRequestsError(
373
- headers=dict(_response.headers),
374
- body=typing.cast(
375
- RateLimitError,
376
- parse_obj_as(
377
- type_=RateLimitError, # type: ignore
378
- object_=_response.json(),
379
- ),
380
- ),
381
- )
382
- if _response.status_code == 500:
383
- raise InternalServerError(
384
- headers=dict(_response.headers),
385
- body=typing.cast(
386
- typing.Optional[typing.Any],
387
- parse_obj_as(
388
- type_=typing.Optional[typing.Any], # type: ignore
389
- object_=_response.json(),
390
- ),
391
- ),
392
- )
393
- if _response.status_code == 503:
394
- raise ServiceUnavailableError(
395
- headers=dict(_response.headers),
396
- body=typing.cast(
397
- typing.Optional[typing.Any],
398
- parse_obj_as(
399
- type_=typing.Optional[typing.Any], # type: ignore
400
- object_=_response.json(),
401
- ),
402
- ),
403
- )
404
- _response_json = _response.json()
405
- except JSONDecodeError:
406
- raise ApiError(
407
- status_code=_response.status_code,
408
- headers=dict(_response.headers),
409
- body=_response.text,
410
- )
411
- raise ApiError(
412
- status_code=_response.status_code,
413
- headers=dict(_response.headers),
414
- body=_response_json,
415
- )
416
-
417
- def update(
418
- self,
419
- organization_id: str,
420
- project_id: str,
421
- *,
422
- name: typing.Optional[str] = OMIT,
423
- slug: typing.Optional[str] = OMIT,
424
- request_options: typing.Optional[RequestOptions] = None,
425
- ) -> HttpResponse[ProjectsUpdateResponse]:
426
- """
427
- Parameters
428
- ----------
429
- organization_id : str
430
-
431
- project_id : str
432
-
433
- name : typing.Optional[str]
434
- a string at most 100 character(s) long
435
-
436
- slug : typing.Optional[str]
437
- a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
438
-
439
- request_options : typing.Optional[RequestOptions]
440
- Request-specific configuration.
441
-
442
- Returns
443
- -------
444
- HttpResponse[ProjectsUpdateResponse]
445
- Success
446
- """
447
- _response = self._client_wrapper.httpx_client.request(
448
- f"organizations/{jsonable_encoder(organization_id)}/projects/{jsonable_encoder(project_id)}",
449
- method="PUT",
450
- json={
451
- "name": name,
452
- "slug": slug,
453
- },
454
- headers={
455
- "content-type": "application/json",
456
- },
457
- request_options=request_options,
458
- omit=OMIT,
459
- )
460
- try:
461
- if 200 <= _response.status_code < 300:
462
- _data = typing.cast(
463
- ProjectsUpdateResponse,
464
- parse_obj_as(
465
- type_=ProjectsUpdateResponse, # type: ignore
466
- object_=_response.json(),
467
- ),
468
- )
469
- return HttpResponse(response=_response, data=_data)
470
- if _response.status_code == 400:
471
- raise BadRequestError(
472
- headers=dict(_response.headers),
473
- body=typing.cast(
474
- typing.Optional[typing.Any],
475
- parse_obj_as(
476
- type_=typing.Optional[typing.Any], # type: ignore
477
- object_=_response.json(),
478
- ),
479
- ),
480
- )
481
- if _response.status_code == 403:
482
- raise ForbiddenError(
483
- headers=dict(_response.headers),
484
- body=typing.cast(
485
- PermissionDeniedError,
486
- parse_obj_as(
487
- type_=PermissionDeniedError, # type: ignore
488
- object_=_response.json(),
489
- ),
490
- ),
491
- )
492
- if _response.status_code == 404:
493
- raise NotFoundError(
494
- headers=dict(_response.headers),
495
- body=typing.cast(
496
- NotFoundErrorBody,
497
- parse_obj_as(
498
- type_=NotFoundErrorBody, # type: ignore
499
- object_=_response.json(),
500
- ),
501
- ),
502
- )
503
- if _response.status_code == 409:
504
- raise ConflictError(
505
- headers=dict(_response.headers),
506
- body=typing.cast(
507
- typing.Optional[typing.Any],
508
- parse_obj_as(
509
- type_=typing.Optional[typing.Any], # type: ignore
510
- object_=_response.json(),
511
- ),
512
- ),
513
- )
514
- if _response.status_code == 429:
515
- raise TooManyRequestsError(
516
- headers=dict(_response.headers),
517
- body=typing.cast(
518
- RateLimitError,
519
- parse_obj_as(
520
- type_=RateLimitError, # type: ignore
521
- object_=_response.json(),
522
- ),
523
- ),
524
- )
525
- if _response.status_code == 500:
526
- raise InternalServerError(
527
- headers=dict(_response.headers),
528
- body=typing.cast(
529
- typing.Optional[typing.Any],
530
- parse_obj_as(
531
- type_=typing.Optional[typing.Any], # type: ignore
532
- object_=_response.json(),
533
- ),
534
- ),
535
- )
536
- if _response.status_code == 503:
537
- raise ServiceUnavailableError(
538
- headers=dict(_response.headers),
539
- body=typing.cast(
540
- typing.Optional[typing.Any],
541
- parse_obj_as(
542
- type_=typing.Optional[typing.Any], # type: ignore
543
- object_=_response.json(),
544
- ),
545
- ),
546
- )
547
- _response_json = _response.json()
548
- except JSONDecodeError:
549
- raise ApiError(
550
- status_code=_response.status_code,
551
- headers=dict(_response.headers),
552
- body=_response.text,
553
- )
554
- raise ApiError(
555
- status_code=_response.status_code,
556
- headers=dict(_response.headers),
557
- body=_response_json,
558
- )
559
-
560
- def delete(
561
- self,
562
- organization_id: str,
563
- project_id: str,
564
- *,
565
- request_options: typing.Optional[RequestOptions] = None,
566
- ) -> HttpResponse[None]:
567
- """
568
- Parameters
569
- ----------
570
- organization_id : str
571
-
572
- project_id : str
573
-
574
- request_options : typing.Optional[RequestOptions]
575
- Request-specific configuration.
576
-
577
- Returns
578
- -------
579
- HttpResponse[None]
580
- """
581
- _response = self._client_wrapper.httpx_client.request(
582
- f"organizations/{jsonable_encoder(organization_id)}/projects/{jsonable_encoder(project_id)}",
583
- method="DELETE",
584
- request_options=request_options,
585
- )
586
- try:
587
- if 200 <= _response.status_code < 300:
588
- return HttpResponse(response=_response, data=None)
589
- if _response.status_code == 400:
590
- raise BadRequestError(
591
- headers=dict(_response.headers),
592
- body=typing.cast(
593
- typing.Optional[typing.Any],
594
- parse_obj_as(
595
- type_=typing.Optional[typing.Any], # type: ignore
596
- object_=_response.json(),
597
- ),
598
- ),
599
- )
600
- if _response.status_code == 403:
601
- raise ForbiddenError(
602
- headers=dict(_response.headers),
603
- body=typing.cast(
604
- PermissionDeniedError,
605
- parse_obj_as(
606
- type_=PermissionDeniedError, # type: ignore
607
- object_=_response.json(),
608
- ),
609
- ),
610
- )
611
- if _response.status_code == 404:
612
- raise NotFoundError(
613
- headers=dict(_response.headers),
614
- body=typing.cast(
615
- NotFoundErrorBody,
616
- parse_obj_as(
617
- type_=NotFoundErrorBody, # type: ignore
618
- object_=_response.json(),
619
- ),
620
- ),
621
- )
622
- if _response.status_code == 429:
623
- raise TooManyRequestsError(
624
- headers=dict(_response.headers),
625
- body=typing.cast(
626
- RateLimitError,
627
- parse_obj_as(
628
- type_=RateLimitError, # type: ignore
629
- object_=_response.json(),
630
- ),
631
- ),
632
- )
633
- if _response.status_code == 500:
634
- raise InternalServerError(
635
- headers=dict(_response.headers),
636
- body=typing.cast(
637
- typing.Optional[typing.Any],
638
- parse_obj_as(
639
- type_=typing.Optional[typing.Any], # type: ignore
640
- object_=_response.json(),
641
- ),
642
- ),
643
- )
644
- if _response.status_code == 503:
645
- raise ServiceUnavailableError(
646
- headers=dict(_response.headers),
647
- body=typing.cast(
648
- typing.Optional[typing.Any],
649
- parse_obj_as(
650
- type_=typing.Optional[typing.Any], # type: ignore
651
- object_=_response.json(),
652
- ),
653
- ),
654
- )
655
- _response_json = _response.json()
656
- except JSONDecodeError:
657
- raise ApiError(
658
- status_code=_response.status_code,
659
- headers=dict(_response.headers),
660
- body=_response.text,
661
- )
662
- raise ApiError(
663
- status_code=_response.status_code,
664
- headers=dict(_response.headers),
665
- body=_response_json,
666
- )
667
-
668
-
669
- class AsyncRawProjectsClient:
670
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
671
- self._client_wrapper = client_wrapper
672
-
673
- async def list(
674
- self,
675
- organization_id: str,
676
- *,
677
- request_options: typing.Optional[RequestOptions] = None,
678
- ) -> AsyncHttpResponse[typing.List[ProjectsListResponseItem]]:
679
- """
680
- Parameters
681
- ----------
682
- organization_id : str
683
-
684
- request_options : typing.Optional[RequestOptions]
685
- Request-specific configuration.
686
-
687
- Returns
688
- -------
689
- AsyncHttpResponse[typing.List[ProjectsListResponseItem]]
690
- Success
691
- """
692
- _response = await self._client_wrapper.httpx_client.request(
693
- f"organizations/{jsonable_encoder(organization_id)}/projects",
694
- method="GET",
695
- request_options=request_options,
696
- )
697
- try:
698
- if 200 <= _response.status_code < 300:
699
- _data = typing.cast(
700
- typing.List[ProjectsListResponseItem],
701
- parse_obj_as(
702
- type_=typing.List[ProjectsListResponseItem], # type: ignore
703
- object_=_response.json(),
704
- ),
705
- )
706
- return AsyncHttpResponse(response=_response, data=_data)
707
- if _response.status_code == 400:
708
- raise BadRequestError(
709
- headers=dict(_response.headers),
710
- body=typing.cast(
711
- typing.Optional[typing.Any],
712
- parse_obj_as(
713
- type_=typing.Optional[typing.Any], # type: ignore
714
- object_=_response.json(),
715
- ),
716
- ),
717
- )
718
- if _response.status_code == 403:
719
- raise ForbiddenError(
720
- headers=dict(_response.headers),
721
- body=typing.cast(
722
- PermissionDeniedError,
723
- parse_obj_as(
724
- type_=PermissionDeniedError, # type: ignore
725
- object_=_response.json(),
726
- ),
727
- ),
728
- )
729
- if _response.status_code == 404:
730
- raise NotFoundError(
731
- headers=dict(_response.headers),
732
- body=typing.cast(
733
- NotFoundErrorBody,
734
- parse_obj_as(
735
- type_=NotFoundErrorBody, # type: ignore
736
- object_=_response.json(),
737
- ),
738
- ),
739
- )
740
- if _response.status_code == 429:
741
- raise TooManyRequestsError(
742
- headers=dict(_response.headers),
743
- body=typing.cast(
744
- RateLimitError,
745
- parse_obj_as(
746
- type_=RateLimitError, # type: ignore
747
- object_=_response.json(),
748
- ),
749
- ),
750
- )
751
- if _response.status_code == 500:
752
- raise InternalServerError(
753
- headers=dict(_response.headers),
754
- body=typing.cast(
755
- typing.Optional[typing.Any],
756
- parse_obj_as(
757
- type_=typing.Optional[typing.Any], # type: ignore
758
- object_=_response.json(),
759
- ),
760
- ),
761
- )
762
- if _response.status_code == 503:
763
- raise ServiceUnavailableError(
764
- headers=dict(_response.headers),
765
- body=typing.cast(
766
- typing.Optional[typing.Any],
767
- parse_obj_as(
768
- type_=typing.Optional[typing.Any], # type: ignore
769
- object_=_response.json(),
770
- ),
771
- ),
772
- )
773
- _response_json = _response.json()
774
- except JSONDecodeError:
775
- raise ApiError(
776
- status_code=_response.status_code,
777
- headers=dict(_response.headers),
778
- body=_response.text,
779
- )
780
- raise ApiError(
781
- status_code=_response.status_code,
782
- headers=dict(_response.headers),
783
- body=_response_json,
784
- )
785
-
786
- async def create(
787
- self,
788
- organization_id: str,
789
- *,
790
- name: str,
791
- slug: str,
792
- request_options: typing.Optional[RequestOptions] = None,
793
- ) -> AsyncHttpResponse[ProjectsCreateResponse]:
794
- """
795
- Parameters
796
- ----------
797
- organization_id : str
798
-
799
- name : str
800
- a string at most 100 character(s) long
801
-
802
- slug : str
803
- a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
804
-
805
- request_options : typing.Optional[RequestOptions]
806
- Request-specific configuration.
807
-
808
- Returns
809
- -------
810
- AsyncHttpResponse[ProjectsCreateResponse]
811
- Success
812
- """
813
- _response = await self._client_wrapper.httpx_client.request(
814
- f"organizations/{jsonable_encoder(organization_id)}/projects",
815
- method="POST",
816
- json={
817
- "name": name,
818
- "slug": slug,
819
- },
820
- headers={
821
- "content-type": "application/json",
822
- },
823
- request_options=request_options,
824
- omit=OMIT,
825
- )
826
- try:
827
- if 200 <= _response.status_code < 300:
828
- _data = typing.cast(
829
- ProjectsCreateResponse,
830
- parse_obj_as(
831
- type_=ProjectsCreateResponse, # type: ignore
832
- object_=_response.json(),
833
- ),
834
- )
835
- return AsyncHttpResponse(response=_response, data=_data)
836
- if _response.status_code == 400:
837
- raise BadRequestError(
838
- headers=dict(_response.headers),
839
- body=typing.cast(
840
- typing.Optional[typing.Any],
841
- parse_obj_as(
842
- type_=typing.Optional[typing.Any], # type: ignore
843
- object_=_response.json(),
844
- ),
845
- ),
846
- )
847
- if _response.status_code == 402:
848
- raise PaymentRequiredError(
849
- headers=dict(_response.headers),
850
- body=typing.cast(
851
- PlanLimitExceededError,
852
- parse_obj_as(
853
- type_=PlanLimitExceededError, # type: ignore
854
- object_=_response.json(),
855
- ),
856
- ),
857
- )
858
- if _response.status_code == 403:
859
- raise ForbiddenError(
860
- headers=dict(_response.headers),
861
- body=typing.cast(
862
- PermissionDeniedError,
863
- parse_obj_as(
864
- type_=PermissionDeniedError, # type: ignore
865
- object_=_response.json(),
866
- ),
867
- ),
868
- )
869
- if _response.status_code == 404:
870
- raise NotFoundError(
871
- headers=dict(_response.headers),
872
- body=typing.cast(
873
- NotFoundErrorBody,
874
- parse_obj_as(
875
- type_=NotFoundErrorBody, # type: ignore
876
- object_=_response.json(),
877
- ),
878
- ),
879
- )
880
- if _response.status_code == 409:
881
- raise ConflictError(
882
- headers=dict(_response.headers),
883
- body=typing.cast(
884
- typing.Optional[typing.Any],
885
- parse_obj_as(
886
- type_=typing.Optional[typing.Any], # type: ignore
887
- object_=_response.json(),
888
- ),
889
- ),
890
- )
891
- if _response.status_code == 429:
892
- raise TooManyRequestsError(
893
- headers=dict(_response.headers),
894
- body=typing.cast(
895
- RateLimitError,
896
- parse_obj_as(
897
- type_=RateLimitError, # type: ignore
898
- object_=_response.json(),
899
- ),
900
- ),
901
- )
902
- if _response.status_code == 500:
903
- raise InternalServerError(
904
- headers=dict(_response.headers),
905
- body=typing.cast(
906
- typing.Optional[typing.Any],
907
- parse_obj_as(
908
- type_=typing.Optional[typing.Any], # type: ignore
909
- object_=_response.json(),
910
- ),
911
- ),
912
- )
913
- if _response.status_code == 503:
914
- raise ServiceUnavailableError(
915
- headers=dict(_response.headers),
916
- body=typing.cast(
917
- typing.Optional[typing.Any],
918
- parse_obj_as(
919
- type_=typing.Optional[typing.Any], # type: ignore
920
- object_=_response.json(),
921
- ),
922
- ),
923
- )
924
- _response_json = _response.json()
925
- except JSONDecodeError:
926
- raise ApiError(
927
- status_code=_response.status_code,
928
- headers=dict(_response.headers),
929
- body=_response.text,
930
- )
931
- raise ApiError(
932
- status_code=_response.status_code,
933
- headers=dict(_response.headers),
934
- body=_response_json,
935
- )
936
-
937
- async def get(
938
- self,
939
- organization_id: str,
940
- project_id: str,
941
- *,
942
- request_options: typing.Optional[RequestOptions] = None,
943
- ) -> AsyncHttpResponse[ProjectsGetResponse]:
944
- """
945
- Parameters
946
- ----------
947
- organization_id : str
948
-
949
- project_id : str
950
-
951
- request_options : typing.Optional[RequestOptions]
952
- Request-specific configuration.
953
-
954
- Returns
955
- -------
956
- AsyncHttpResponse[ProjectsGetResponse]
957
- Success
958
- """
959
- _response = await self._client_wrapper.httpx_client.request(
960
- f"organizations/{jsonable_encoder(organization_id)}/projects/{jsonable_encoder(project_id)}",
961
- method="GET",
962
- request_options=request_options,
963
- )
964
- try:
965
- if 200 <= _response.status_code < 300:
966
- _data = typing.cast(
967
- ProjectsGetResponse,
968
- parse_obj_as(
969
- type_=ProjectsGetResponse, # type: ignore
970
- object_=_response.json(),
971
- ),
972
- )
973
- return AsyncHttpResponse(response=_response, data=_data)
974
- if _response.status_code == 400:
975
- raise BadRequestError(
976
- headers=dict(_response.headers),
977
- body=typing.cast(
978
- typing.Optional[typing.Any],
979
- parse_obj_as(
980
- type_=typing.Optional[typing.Any], # type: ignore
981
- object_=_response.json(),
982
- ),
983
- ),
984
- )
985
- if _response.status_code == 403:
986
- raise ForbiddenError(
987
- headers=dict(_response.headers),
988
- body=typing.cast(
989
- PermissionDeniedError,
990
- parse_obj_as(
991
- type_=PermissionDeniedError, # type: ignore
992
- object_=_response.json(),
993
- ),
994
- ),
995
- )
996
- if _response.status_code == 404:
997
- raise NotFoundError(
998
- headers=dict(_response.headers),
999
- body=typing.cast(
1000
- NotFoundErrorBody,
1001
- parse_obj_as(
1002
- type_=NotFoundErrorBody, # type: ignore
1003
- object_=_response.json(),
1004
- ),
1005
- ),
1006
- )
1007
- if _response.status_code == 429:
1008
- raise TooManyRequestsError(
1009
- headers=dict(_response.headers),
1010
- body=typing.cast(
1011
- RateLimitError,
1012
- parse_obj_as(
1013
- type_=RateLimitError, # type: ignore
1014
- object_=_response.json(),
1015
- ),
1016
- ),
1017
- )
1018
- if _response.status_code == 500:
1019
- raise InternalServerError(
1020
- headers=dict(_response.headers),
1021
- body=typing.cast(
1022
- typing.Optional[typing.Any],
1023
- parse_obj_as(
1024
- type_=typing.Optional[typing.Any], # type: ignore
1025
- object_=_response.json(),
1026
- ),
1027
- ),
1028
- )
1029
- if _response.status_code == 503:
1030
- raise ServiceUnavailableError(
1031
- headers=dict(_response.headers),
1032
- body=typing.cast(
1033
- typing.Optional[typing.Any],
1034
- parse_obj_as(
1035
- type_=typing.Optional[typing.Any], # type: ignore
1036
- object_=_response.json(),
1037
- ),
1038
- ),
1039
- )
1040
- _response_json = _response.json()
1041
- except JSONDecodeError:
1042
- raise ApiError(
1043
- status_code=_response.status_code,
1044
- headers=dict(_response.headers),
1045
- body=_response.text,
1046
- )
1047
- raise ApiError(
1048
- status_code=_response.status_code,
1049
- headers=dict(_response.headers),
1050
- body=_response_json,
1051
- )
1052
-
1053
- async def update(
1054
- self,
1055
- organization_id: str,
1056
- project_id: str,
1057
- *,
1058
- name: typing.Optional[str] = OMIT,
1059
- slug: typing.Optional[str] = OMIT,
1060
- request_options: typing.Optional[RequestOptions] = None,
1061
- ) -> AsyncHttpResponse[ProjectsUpdateResponse]:
1062
- """
1063
- Parameters
1064
- ----------
1065
- organization_id : str
1066
-
1067
- project_id : str
1068
-
1069
- name : typing.Optional[str]
1070
- a string at most 100 character(s) long
1071
-
1072
- slug : typing.Optional[str]
1073
- a string matching the pattern ^[a-z0-9][a-z0-9_-]*[a-z0-9]$
1074
-
1075
- request_options : typing.Optional[RequestOptions]
1076
- Request-specific configuration.
1077
-
1078
- Returns
1079
- -------
1080
- AsyncHttpResponse[ProjectsUpdateResponse]
1081
- Success
1082
- """
1083
- _response = await self._client_wrapper.httpx_client.request(
1084
- f"organizations/{jsonable_encoder(organization_id)}/projects/{jsonable_encoder(project_id)}",
1085
- method="PUT",
1086
- json={
1087
- "name": name,
1088
- "slug": slug,
1089
- },
1090
- headers={
1091
- "content-type": "application/json",
1092
- },
1093
- request_options=request_options,
1094
- omit=OMIT,
1095
- )
1096
- try:
1097
- if 200 <= _response.status_code < 300:
1098
- _data = typing.cast(
1099
- ProjectsUpdateResponse,
1100
- parse_obj_as(
1101
- type_=ProjectsUpdateResponse, # type: ignore
1102
- object_=_response.json(),
1103
- ),
1104
- )
1105
- return AsyncHttpResponse(response=_response, data=_data)
1106
- if _response.status_code == 400:
1107
- raise BadRequestError(
1108
- headers=dict(_response.headers),
1109
- body=typing.cast(
1110
- typing.Optional[typing.Any],
1111
- parse_obj_as(
1112
- type_=typing.Optional[typing.Any], # type: ignore
1113
- object_=_response.json(),
1114
- ),
1115
- ),
1116
- )
1117
- if _response.status_code == 403:
1118
- raise ForbiddenError(
1119
- headers=dict(_response.headers),
1120
- body=typing.cast(
1121
- PermissionDeniedError,
1122
- parse_obj_as(
1123
- type_=PermissionDeniedError, # type: ignore
1124
- object_=_response.json(),
1125
- ),
1126
- ),
1127
- )
1128
- if _response.status_code == 404:
1129
- raise NotFoundError(
1130
- headers=dict(_response.headers),
1131
- body=typing.cast(
1132
- NotFoundErrorBody,
1133
- parse_obj_as(
1134
- type_=NotFoundErrorBody, # type: ignore
1135
- object_=_response.json(),
1136
- ),
1137
- ),
1138
- )
1139
- if _response.status_code == 409:
1140
- raise ConflictError(
1141
- headers=dict(_response.headers),
1142
- body=typing.cast(
1143
- typing.Optional[typing.Any],
1144
- parse_obj_as(
1145
- type_=typing.Optional[typing.Any], # type: ignore
1146
- object_=_response.json(),
1147
- ),
1148
- ),
1149
- )
1150
- if _response.status_code == 429:
1151
- raise TooManyRequestsError(
1152
- headers=dict(_response.headers),
1153
- body=typing.cast(
1154
- RateLimitError,
1155
- parse_obj_as(
1156
- type_=RateLimitError, # type: ignore
1157
- object_=_response.json(),
1158
- ),
1159
- ),
1160
- )
1161
- if _response.status_code == 500:
1162
- raise InternalServerError(
1163
- headers=dict(_response.headers),
1164
- body=typing.cast(
1165
- typing.Optional[typing.Any],
1166
- parse_obj_as(
1167
- type_=typing.Optional[typing.Any], # type: ignore
1168
- object_=_response.json(),
1169
- ),
1170
- ),
1171
- )
1172
- if _response.status_code == 503:
1173
- raise ServiceUnavailableError(
1174
- headers=dict(_response.headers),
1175
- body=typing.cast(
1176
- typing.Optional[typing.Any],
1177
- parse_obj_as(
1178
- type_=typing.Optional[typing.Any], # type: ignore
1179
- object_=_response.json(),
1180
- ),
1181
- ),
1182
- )
1183
- _response_json = _response.json()
1184
- except JSONDecodeError:
1185
- raise ApiError(
1186
- status_code=_response.status_code,
1187
- headers=dict(_response.headers),
1188
- body=_response.text,
1189
- )
1190
- raise ApiError(
1191
- status_code=_response.status_code,
1192
- headers=dict(_response.headers),
1193
- body=_response_json,
1194
- )
1195
-
1196
- async def delete(
1197
- self,
1198
- organization_id: str,
1199
- project_id: str,
1200
- *,
1201
- request_options: typing.Optional[RequestOptions] = None,
1202
- ) -> AsyncHttpResponse[None]:
1203
- """
1204
- Parameters
1205
- ----------
1206
- organization_id : str
1207
-
1208
- project_id : str
1209
-
1210
- request_options : typing.Optional[RequestOptions]
1211
- Request-specific configuration.
1212
-
1213
- Returns
1214
- -------
1215
- AsyncHttpResponse[None]
1216
- """
1217
- _response = await self._client_wrapper.httpx_client.request(
1218
- f"organizations/{jsonable_encoder(organization_id)}/projects/{jsonable_encoder(project_id)}",
1219
- method="DELETE",
1220
- request_options=request_options,
1221
- )
1222
- try:
1223
- if 200 <= _response.status_code < 300:
1224
- return AsyncHttpResponse(response=_response, data=None)
1225
- if _response.status_code == 400:
1226
- raise BadRequestError(
1227
- headers=dict(_response.headers),
1228
- body=typing.cast(
1229
- typing.Optional[typing.Any],
1230
- parse_obj_as(
1231
- type_=typing.Optional[typing.Any], # type: ignore
1232
- object_=_response.json(),
1233
- ),
1234
- ),
1235
- )
1236
- if _response.status_code == 403:
1237
- raise ForbiddenError(
1238
- headers=dict(_response.headers),
1239
- body=typing.cast(
1240
- PermissionDeniedError,
1241
- parse_obj_as(
1242
- type_=PermissionDeniedError, # type: ignore
1243
- object_=_response.json(),
1244
- ),
1245
- ),
1246
- )
1247
- if _response.status_code == 404:
1248
- raise NotFoundError(
1249
- headers=dict(_response.headers),
1250
- body=typing.cast(
1251
- NotFoundErrorBody,
1252
- parse_obj_as(
1253
- type_=NotFoundErrorBody, # type: ignore
1254
- object_=_response.json(),
1255
- ),
1256
- ),
1257
- )
1258
- if _response.status_code == 429:
1259
- raise TooManyRequestsError(
1260
- headers=dict(_response.headers),
1261
- body=typing.cast(
1262
- RateLimitError,
1263
- parse_obj_as(
1264
- type_=RateLimitError, # type: ignore
1265
- object_=_response.json(),
1266
- ),
1267
- ),
1268
- )
1269
- if _response.status_code == 500:
1270
- raise InternalServerError(
1271
- headers=dict(_response.headers),
1272
- body=typing.cast(
1273
- typing.Optional[typing.Any],
1274
- parse_obj_as(
1275
- type_=typing.Optional[typing.Any], # type: ignore
1276
- object_=_response.json(),
1277
- ),
1278
- ),
1279
- )
1280
- if _response.status_code == 503:
1281
- raise ServiceUnavailableError(
1282
- headers=dict(_response.headers),
1283
- body=typing.cast(
1284
- typing.Optional[typing.Any],
1285
- parse_obj_as(
1286
- type_=typing.Optional[typing.Any], # type: ignore
1287
- object_=_response.json(),
1288
- ),
1289
- ),
1290
- )
1291
- _response_json = _response.json()
1292
- except JSONDecodeError:
1293
- raise ApiError(
1294
- status_code=_response.status_code,
1295
- headers=dict(_response.headers),
1296
- body=_response.text,
1297
- )
1298
- raise ApiError(
1299
- status_code=_response.status_code,
1300
- headers=dict(_response.headers),
1301
- body=_response_json,
1302
- )