amsdal 0.4.13__cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.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 (269) hide show
  1. amsdal/Third-Party Materials - AMSDAL Dependencies - License Notices.md +1334 -0
  2. amsdal/__about__.py +4 -0
  3. amsdal/__about__.pyi +1 -0
  4. amsdal/__init__.py +23 -0
  5. amsdal/__init__.pyi +9 -0
  6. amsdal/__migrations__/0000_initial.py +217 -0
  7. amsdal/__migrations__/0001_datetime_type.py +18 -0
  8. amsdal/__migrations__/0002_fixture_order.py +44 -0
  9. amsdal/__migrations__/0003_schema_type_in_class_meta.py +44 -0
  10. amsdal/cloud/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
  11. amsdal/cloud/__init__.pyi +0 -0
  12. amsdal/cloud/client.cpython-312-x86_64-linux-gnu.so +0 -0
  13. amsdal/cloud/client.pyi +57 -0
  14. amsdal/cloud/constants.cpython-312-x86_64-linux-gnu.so +0 -0
  15. amsdal/cloud/constants.pyi +13 -0
  16. amsdal/cloud/enums.cpython-312-x86_64-linux-gnu.so +0 -0
  17. amsdal/cloud/enums.pyi +68 -0
  18. amsdal/cloud/models/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
  19. amsdal/cloud/models/__init__.pyi +0 -0
  20. amsdal/cloud/models/base.cpython-312-x86_64-linux-gnu.so +0 -0
  21. amsdal/cloud/models/base.pyi +247 -0
  22. amsdal/cloud/services/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
  23. amsdal/cloud/services/__init__.pyi +0 -0
  24. amsdal/cloud/services/actions/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
  25. amsdal/cloud/services/actions/__init__.pyi +0 -0
  26. amsdal/cloud/services/actions/add_allowlist_ip.cpython-312-x86_64-linux-gnu.so +0 -0
  27. amsdal/cloud/services/actions/add_allowlist_ip.pyi +19 -0
  28. amsdal/cloud/services/actions/add_basic_auth.cpython-312-x86_64-linux-gnu.so +0 -0
  29. amsdal/cloud/services/actions/add_basic_auth.pyi +21 -0
  30. amsdal/cloud/services/actions/add_dependency.cpython-312-x86_64-linux-gnu.so +0 -0
  31. amsdal/cloud/services/actions/add_dependency.pyi +19 -0
  32. amsdal/cloud/services/actions/add_secret.cpython-312-x86_64-linux-gnu.so +0 -0
  33. amsdal/cloud/services/actions/add_secret.pyi +20 -0
  34. amsdal/cloud/services/actions/base.cpython-312-x86_64-linux-gnu.so +0 -0
  35. amsdal/cloud/services/actions/base.pyi +122 -0
  36. amsdal/cloud/services/actions/create_deploy.cpython-312-x86_64-linux-gnu.so +0 -0
  37. amsdal/cloud/services/actions/create_deploy.pyi +41 -0
  38. amsdal/cloud/services/actions/create_env.cpython-312-x86_64-linux-gnu.so +0 -0
  39. amsdal/cloud/services/actions/create_env.pyi +19 -0
  40. amsdal/cloud/services/actions/create_session.cpython-312-x86_64-linux-gnu.so +0 -0
  41. amsdal/cloud/services/actions/create_session.pyi +17 -0
  42. amsdal/cloud/services/actions/delete_allowlist_ip.cpython-312-x86_64-linux-gnu.so +0 -0
  43. amsdal/cloud/services/actions/delete_allowlist_ip.pyi +19 -0
  44. amsdal/cloud/services/actions/delete_basic_auth.cpython-312-x86_64-linux-gnu.so +0 -0
  45. amsdal/cloud/services/actions/delete_basic_auth.pyi +20 -0
  46. amsdal/cloud/services/actions/delete_dependency.cpython-312-x86_64-linux-gnu.so +0 -0
  47. amsdal/cloud/services/actions/delete_dependency.pyi +21 -0
  48. amsdal/cloud/services/actions/delete_env.cpython-312-x86_64-linux-gnu.so +0 -0
  49. amsdal/cloud/services/actions/delete_env.pyi +21 -0
  50. amsdal/cloud/services/actions/delete_secret.cpython-312-x86_64-linux-gnu.so +0 -0
  51. amsdal/cloud/services/actions/delete_secret.pyi +21 -0
  52. amsdal/cloud/services/actions/destroy_deploy.cpython-312-x86_64-linux-gnu.so +0 -0
  53. amsdal/cloud/services/actions/destroy_deploy.pyi +18 -0
  54. amsdal/cloud/services/actions/expose_db.cpython-312-x86_64-linux-gnu.so +0 -0
  55. amsdal/cloud/services/actions/expose_db.pyi +22 -0
  56. amsdal/cloud/services/actions/get_basic_auth_credentials.cpython-312-x86_64-linux-gnu.so +0 -0
  57. amsdal/cloud/services/actions/get_basic_auth_credentials.pyi +21 -0
  58. amsdal/cloud/services/actions/get_monitoring_info.cpython-312-x86_64-linux-gnu.so +0 -0
  59. amsdal/cloud/services/actions/get_monitoring_info.pyi +21 -0
  60. amsdal/cloud/services/actions/list_dependencies.cpython-312-x86_64-linux-gnu.so +0 -0
  61. amsdal/cloud/services/actions/list_dependencies.pyi +21 -0
  62. amsdal/cloud/services/actions/list_deploys.cpython-312-x86_64-linux-gnu.so +0 -0
  63. amsdal/cloud/services/actions/list_deploys.pyi +19 -0
  64. amsdal/cloud/services/actions/list_envs.cpython-312-x86_64-linux-gnu.so +0 -0
  65. amsdal/cloud/services/actions/list_envs.pyi +20 -0
  66. amsdal/cloud/services/actions/list_secrets.cpython-312-x86_64-linux-gnu.so +0 -0
  67. amsdal/cloud/services/actions/list_secrets.pyi +22 -0
  68. amsdal/cloud/services/actions/manager.cpython-312-x86_64-linux-gnu.so +0 -0
  69. amsdal/cloud/services/actions/manager.pyi +278 -0
  70. amsdal/cloud/services/actions/signup_action.cpython-312-x86_64-linux-gnu.so +0 -0
  71. amsdal/cloud/services/actions/signup_action.pyi +20 -0
  72. amsdal/cloud/services/actions/update_deploy.cpython-312-x86_64-linux-gnu.so +0 -0
  73. amsdal/cloud/services/actions/update_deploy.pyi +19 -0
  74. amsdal/cloud/services/auth/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
  75. amsdal/cloud/services/auth/__init__.pyi +0 -0
  76. amsdal/cloud/services/auth/base.cpython-312-x86_64-linux-gnu.so +0 -0
  77. amsdal/cloud/services/auth/base.pyi +6 -0
  78. amsdal/cloud/services/auth/credentials.cpython-312-x86_64-linux-gnu.so +0 -0
  79. amsdal/cloud/services/auth/credentials.pyi +30 -0
  80. amsdal/cloud/services/auth/manager.cpython-312-x86_64-linux-gnu.so +0 -0
  81. amsdal/cloud/services/auth/manager.pyi +26 -0
  82. amsdal/cloud/services/auth/signup_service.cpython-312-x86_64-linux-gnu.so +0 -0
  83. amsdal/cloud/services/auth/signup_service.pyi +32 -0
  84. amsdal/cloud/services/auth/token.cpython-312-x86_64-linux-gnu.so +0 -0
  85. amsdal/cloud/services/auth/token.pyi +27 -0
  86. amsdal/configs/__init__.py +0 -0
  87. amsdal/configs/__init__.pyi +0 -0
  88. amsdal/configs/constants.py +33 -0
  89. amsdal/configs/constants.pyi +22 -0
  90. amsdal/configs/main.py +258 -0
  91. amsdal/configs/main.pyi +173 -0
  92. amsdal/context/__init__.py +0 -0
  93. amsdal/context/__init__.pyi +0 -0
  94. amsdal/context/manager.py +69 -0
  95. amsdal/context/manager.pyi +50 -0
  96. amsdal/contrib/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
  97. amsdal/contrib/__init__.pyi +0 -0
  98. amsdal/contrib/app_config.py +7 -0
  99. amsdal/contrib/app_config.pyi +6 -0
  100. amsdal/contrib/auth/__init__.py +0 -0
  101. amsdal/contrib/auth/__init__.pyi +0 -0
  102. amsdal/contrib/auth/app.py +27 -0
  103. amsdal/contrib/auth/app.pyi +15 -0
  104. amsdal/contrib/auth/decorators/__init__.py +35 -0
  105. amsdal/contrib/auth/decorators/__init__.pyi +6 -0
  106. amsdal/contrib/auth/errors.py +7 -0
  107. amsdal/contrib/auth/errors.pyi +4 -0
  108. amsdal/contrib/auth/fixtures/basic_permissions.json +64 -0
  109. amsdal/contrib/auth/lifecycle/__init__.py +0 -0
  110. amsdal/contrib/auth/lifecycle/__init__.pyi +0 -0
  111. amsdal/contrib/auth/lifecycle/consumer.py +394 -0
  112. amsdal/contrib/auth/lifecycle/consumer.pyi +108 -0
  113. amsdal/contrib/auth/migrations/0000_initial.py +84 -0
  114. amsdal/contrib/auth/models/__init__.py +0 -0
  115. amsdal/contrib/auth/models/__init__.pyi +0 -0
  116. amsdal/contrib/auth/models/login_session.py +118 -0
  117. amsdal/contrib/auth/models/login_session.pyi +37 -0
  118. amsdal/contrib/auth/models/permission.py +23 -0
  119. amsdal/contrib/auth/models/permission.pyi +18 -0
  120. amsdal/contrib/auth/models/user.py +106 -0
  121. amsdal/contrib/auth/models/user.pyi +46 -0
  122. amsdal/contrib/auth/settings.py +36 -0
  123. amsdal/contrib/auth/settings.pyi +26 -0
  124. amsdal/contrib/frontend_configs/__init__.py +0 -0
  125. amsdal/contrib/frontend_configs/__init__.pyi +0 -0
  126. amsdal/contrib/frontend_configs/app.py +24 -0
  127. amsdal/contrib/frontend_configs/app.pyi +19 -0
  128. amsdal/contrib/frontend_configs/constants.py +1 -0
  129. amsdal/contrib/frontend_configs/constants.pyi +1 -0
  130. amsdal/contrib/frontend_configs/conversion/__init__.py +5 -0
  131. amsdal/contrib/frontend_configs/conversion/__init__.pyi +3 -0
  132. amsdal/contrib/frontend_configs/conversion/convert.py +286 -0
  133. amsdal/contrib/frontend_configs/conversion/convert.pyi +22 -0
  134. amsdal/contrib/frontend_configs/lifecycle/__init__.py +0 -0
  135. amsdal/contrib/frontend_configs/lifecycle/__init__.pyi +0 -0
  136. amsdal/contrib/frontend_configs/lifecycle/consumer.py +306 -0
  137. amsdal/contrib/frontend_configs/lifecycle/consumer.pyi +98 -0
  138. amsdal/contrib/frontend_configs/migrations/0000_initial.py +256 -0
  139. amsdal/contrib/frontend_configs/models/__init__.py +0 -0
  140. amsdal/contrib/frontend_configs/models/__init__.pyi +0 -0
  141. amsdal/contrib/frontend_configs/models/frontend_activator_config.py +22 -0
  142. amsdal/contrib/frontend_configs/models/frontend_activator_config.pyi +12 -0
  143. amsdal/contrib/frontend_configs/models/frontend_config_async_validator.py +11 -0
  144. amsdal/contrib/frontend_configs/models/frontend_config_async_validator.pyi +7 -0
  145. amsdal/contrib/frontend_configs/models/frontend_config_control_action.py +54 -0
  146. amsdal/contrib/frontend_configs/models/frontend_config_control_action.pyi +32 -0
  147. amsdal/contrib/frontend_configs/models/frontend_config_group_validator.py +21 -0
  148. amsdal/contrib/frontend_configs/models/frontend_config_group_validator.pyi +11 -0
  149. amsdal/contrib/frontend_configs/models/frontend_config_option.py +12 -0
  150. amsdal/contrib/frontend_configs/models/frontend_config_option.pyi +8 -0
  151. amsdal/contrib/frontend_configs/models/frontend_config_skip_none_base.py +17 -0
  152. amsdal/contrib/frontend_configs/models/frontend_config_skip_none_base.pyi +8 -0
  153. amsdal/contrib/frontend_configs/models/frontend_config_slider_option.py +13 -0
  154. amsdal/contrib/frontend_configs/models/frontend_config_slider_option.pyi +9 -0
  155. amsdal/contrib/frontend_configs/models/frontend_config_text_mask.py +14 -0
  156. amsdal/contrib/frontend_configs/models/frontend_config_text_mask.pyi +10 -0
  157. amsdal/contrib/frontend_configs/models/frontend_config_validator.py +28 -0
  158. amsdal/contrib/frontend_configs/models/frontend_config_validator.pyi +15 -0
  159. amsdal/contrib/frontend_configs/models/frontend_control_config.py +87 -0
  160. amsdal/contrib/frontend_configs/models/frontend_control_config.pyi +35 -0
  161. amsdal/contrib/frontend_configs/models/frontend_model_config.py +14 -0
  162. amsdal/contrib/frontend_configs/models/frontend_model_config.pyi +9 -0
  163. amsdal/contrib/frontend_configs/utils.py +29 -0
  164. amsdal/contrib/frontend_configs/utils.pyi +17 -0
  165. amsdal/errors.py +31 -0
  166. amsdal/errors.pyi +12 -0
  167. amsdal/fixtures/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
  168. amsdal/fixtures/__init__.pyi +0 -0
  169. amsdal/fixtures/manager.cpython-312-x86_64-linux-gnu.so +0 -0
  170. amsdal/fixtures/manager.pyi +170 -0
  171. amsdal/fixtures/utils.cpython-312-x86_64-linux-gnu.so +0 -0
  172. amsdal/fixtures/utils.pyi +9 -0
  173. amsdal/manager.cpython-312-x86_64-linux-gnu.so +0 -0
  174. amsdal/manager.pyi +265 -0
  175. amsdal/mixins/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
  176. amsdal/mixins/__init__.pyi +0 -0
  177. amsdal/mixins/class_versions_mixin.cpython-312-x86_64-linux-gnu.so +0 -0
  178. amsdal/mixins/class_versions_mixin.pyi +12 -0
  179. amsdal/models/__init__.py +19 -0
  180. amsdal/models/__init__.pyi +9 -0
  181. amsdal/models/core/__init__.py +0 -0
  182. amsdal/models/core/__init__.pyi +0 -0
  183. amsdal/models/core/class_object.py +37 -0
  184. amsdal/models/core/class_object.pyi +24 -0
  185. amsdal/models/core/class_object_meta.py +26 -0
  186. amsdal/models/core/class_object_meta.pyi +15 -0
  187. amsdal/models/core/class_property.py +20 -0
  188. amsdal/models/core/class_property.pyi +11 -0
  189. amsdal/models/core/class_property_meta.py +15 -0
  190. amsdal/models/core/class_property_meta.pyi +10 -0
  191. amsdal/models/core/file.py +156 -0
  192. amsdal/models/core/file.pyi +104 -0
  193. amsdal/models/core/fixture.py +25 -0
  194. amsdal/models/core/fixture.pyi +14 -0
  195. amsdal/models/core/option.py +11 -0
  196. amsdal/models/core/option.pyi +8 -0
  197. amsdal/models/core/validator.py +12 -0
  198. amsdal/models/core/validator.pyi +8 -0
  199. amsdal/models/types/__init__.py +0 -0
  200. amsdal/models/types/__init__.pyi +0 -0
  201. amsdal/models/types/object.py +26 -0
  202. amsdal/models/types/object.pyi +16 -0
  203. amsdal/py.typed +0 -0
  204. amsdal/queryset/__init__.py +21 -0
  205. amsdal/queryset/__init__.pyi +6 -0
  206. amsdal/schemas/__init__.py +0 -0
  207. amsdal/schemas/__init__.pyi +0 -0
  208. amsdal/schemas/core/class_object/model.json +31 -0
  209. amsdal/schemas/core/class_object/properties/display_name.py +9 -0
  210. amsdal/schemas/core/class_object_meta/model.json +59 -0
  211. amsdal/schemas/core/class_property/model.json +22 -0
  212. amsdal/schemas/core/class_property_meta/model.json +23 -0
  213. amsdal/schemas/core/file/hooks/pre_create.py +24 -0
  214. amsdal/schemas/core/file/hooks/pre_update.py +24 -0
  215. amsdal/schemas/core/file/model.json +23 -0
  216. amsdal/schemas/core/file/properties/from_file.py +34 -0
  217. amsdal/schemas/core/file/properties/mimetype.py +13 -0
  218. amsdal/schemas/core/file/properties/str.py +6 -0
  219. amsdal/schemas/core/file/properties/to_file.py +24 -0
  220. amsdal/schemas/core/file/properties/validate_data.py +32 -0
  221. amsdal/schemas/core/fixture/model.json +35 -0
  222. amsdal/schemas/core/option/model.json +19 -0
  223. amsdal/schemas/core/validator/model.json +19 -0
  224. amsdal/schemas/interfaces.py +25 -0
  225. amsdal/schemas/interfaces.pyi +20 -0
  226. amsdal/schemas/manager.cpython-312-x86_64-linux-gnu.so +0 -0
  227. amsdal/schemas/manager.py +0 -0
  228. amsdal/schemas/manager.pyi +0 -0
  229. amsdal/schemas/mixins/__init__.py +0 -0
  230. amsdal/schemas/mixins/__init__.pyi +0 -0
  231. amsdal/schemas/mixins/check_dependencies_mixin.py +125 -0
  232. amsdal/schemas/mixins/check_dependencies_mixin.pyi +45 -0
  233. amsdal/schemas/mixins/verify_schemas_mixin.py +96 -0
  234. amsdal/schemas/mixins/verify_schemas_mixin.pyi +33 -0
  235. amsdal/schemas/repository.py +84 -0
  236. amsdal/schemas/repository.pyi +22 -0
  237. amsdal/schemas/types/anything/model.json +7 -0
  238. amsdal/schemas/types/array/model.json +7 -0
  239. amsdal/schemas/types/binary/model.json +7 -0
  240. amsdal/schemas/types/boolean/model.json +17 -0
  241. amsdal/schemas/types/date/model.json +7 -0
  242. amsdal/schemas/types/datetime/model.json +7 -0
  243. amsdal/schemas/types/dictionary/model.json +8 -0
  244. amsdal/schemas/types/number/model.json +8 -0
  245. amsdal/schemas/types/object/model.json +53 -0
  246. amsdal/schemas/types/string/model.json +8 -0
  247. amsdal/schemas/utils.py +16 -0
  248. amsdal/schemas/utils.pyi +10 -0
  249. amsdal/services/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
  250. amsdal/services/__init__.pyi +0 -0
  251. amsdal/services/transaction_execution.cpython-312-x86_64-linux-gnu.so +0 -0
  252. amsdal/services/transaction_execution.pyi +93 -0
  253. amsdal/transactions/__init__.py +13 -0
  254. amsdal/transactions/__init__.pyi +4 -0
  255. amsdal/utils/__init__.py +0 -0
  256. amsdal/utils/__init__.pyi +0 -0
  257. amsdal/utils/contrib_paths.py +23 -0
  258. amsdal/utils/contrib_paths.pyi +14 -0
  259. amsdal/utils/rollback/__init__.py +440 -0
  260. amsdal/utils/rollback/__init__.pyi +38 -0
  261. amsdal/utils/tests/__init__.py +0 -0
  262. amsdal/utils/tests/enums.py +18 -0
  263. amsdal/utils/tests/factories.py +49 -0
  264. amsdal/utils/tests/helpers.py +499 -0
  265. amsdal-0.4.13.dist-info/METADATA +369 -0
  266. amsdal-0.4.13.dist-info/RECORD +269 -0
  267. amsdal-0.4.13.dist-info/WHEEL +6 -0
  268. amsdal-0.4.13.dist-info/licenses/LICENSE.txt +107 -0
  269. amsdal-0.4.13.dist-info/top_level.txt +1 -0
@@ -0,0 +1,247 @@
1
+ from amsdal.cloud.enums import ResponseStatus as ResponseStatus
2
+ from pydantic import BaseModel
3
+ from typing import Any
4
+
5
+ class ResponseBaseModel(BaseModel):
6
+ """
7
+ Base model for responses.
8
+
9
+ Attributes:
10
+ status (ResponseStatus): The status of the response.
11
+ errors (list[str] | None): A list of error messages, if any.
12
+ """
13
+ status: ResponseStatus
14
+ errors: list[str] | None
15
+
16
+ class DeployResponse(BaseModel):
17
+ """
18
+ Model representing a deployment response.
19
+
20
+ Attributes:
21
+ status (str): The status of the deployment.
22
+ client_id (str): The client ID associated with the deployment.
23
+ deployment_id (str): The unique identifier for the deployment.
24
+ created_at (float): The timestamp when the deployment was created.
25
+ last_update_at (float): The timestamp of the last update to the deployment.
26
+ environment_name (str | None): The name of the environment, if any.
27
+ application_uuid (str | None): The UUID of the application, if any.
28
+ application_name (str | None): The name of the application, if any.
29
+ domain_url (str | None): The URL of the domain, if any.
30
+ """
31
+ status: str
32
+ client_id: str
33
+ deployment_id: str
34
+ created_at: float
35
+ last_update_at: float
36
+ environment_name: str | None
37
+ application_uuid: str | None
38
+ application_name: str | None
39
+ domain_url: str | None
40
+
41
+ class UpdateDeployStatusResponse(BaseModel):
42
+ """
43
+ Model representing an update to the deployment status.
44
+
45
+ Attributes:
46
+ status (str): The status of the deployment.
47
+ deployment_id (str): The unique identifier for the deployment.
48
+ created_at (float): The timestamp when the deployment was created.
49
+ last_update_at (float): The timestamp of the last update to the deployment.
50
+ updated (bool): Indicates whether the deployment status was updated.
51
+ """
52
+ status: str
53
+ deployment_id: str
54
+ created_at: float
55
+ last_update_at: float
56
+ updated: bool
57
+
58
+ class ListDeployResponse(BaseModel):
59
+ """
60
+ Model representing a list of deployment responses.
61
+
62
+ Attributes:
63
+ deployments (list[DeployResponse]): A list of deployment responses.
64
+ """
65
+ deployments: list[DeployResponse]
66
+
67
+ class DeployTransactionResponse(ResponseBaseModel):
68
+ """
69
+ Model representing a deployment transaction response.
70
+
71
+ Attributes:
72
+ details (DeployResponse | UpdateDeployStatusResponse | ListDeployResponse | None):
73
+ The details of the deployment transaction response, which can be one of
74
+ DeployResponse, UpdateDeployStatusResponse, ListDeployResponse, or None.
75
+ """
76
+ details: DeployResponse | UpdateDeployStatusResponse | ListDeployResponse | None
77
+
78
+ class ListSecretsDetails(BaseModel):
79
+ """
80
+ Model representing the details of listed secrets.
81
+
82
+ Attributes:
83
+ secrets (list[str]): A list of secret strings.
84
+ """
85
+ secrets: list[str]
86
+
87
+ class ListSecretsResponse(ResponseBaseModel):
88
+ """
89
+ Model representing a response containing the details of listed secrets.
90
+
91
+ Attributes:
92
+ details (ListSecretsDetails | None): The details of the listed secrets, if any.
93
+ """
94
+ details: ListSecretsDetails | None
95
+
96
+ class SignupReponseCredentials(BaseModel):
97
+ """
98
+ Model representing the credentials for a signup response.
99
+
100
+ Attributes:
101
+ amsdal_access_key_id (str): The access key ID for AMSDAL.
102
+ amsdal_secret_access_key (str): The secret access key for AMSDAL.
103
+ """
104
+ amsdal_access_key_id: str
105
+ amsdal_secret_access_key: str
106
+
107
+ class SignupResponse(ResponseBaseModel):
108
+ """
109
+ Model representing a signup response.
110
+
111
+ Attributes:
112
+ details (SignupReponseCredentials | None): The credentials for the signup response, if any.
113
+ """
114
+ details: SignupReponseCredentials | None
115
+
116
+ class CreateSessionDetails(BaseModel):
117
+ """
118
+ Model representing the details for creating a session.
119
+
120
+ Attributes:
121
+ token (str): The token for the session.
122
+ """
123
+ token: str
124
+
125
+ class CreateSessionResponse(ResponseBaseModel):
126
+ """
127
+ Model representing a response for creating a session.
128
+
129
+ Attributes:
130
+ details (CreateSessionDetails | None): The details for creating a session, if any.
131
+ """
132
+ details: CreateSessionDetails | None
133
+
134
+ class ListDependenciesDetails(BaseModel):
135
+ """
136
+ Model representing the details of listed dependencies.
137
+
138
+ Attributes:
139
+ dependencies (list[str]): A list of dependencies.
140
+ all (list[str]): A list of all dependencies.
141
+ """
142
+ dependencies: list[str]
143
+ all: list[str]
144
+
145
+ class ListApplicationDependenciesResponse(ResponseBaseModel):
146
+ """
147
+ Model representing a response containing the details of listed application dependencies.
148
+
149
+ Attributes:
150
+ details (ListDependenciesDetails | None): The details of the listed application dependencies, if any.
151
+ """
152
+ details: ListDependenciesDetails | None
153
+
154
+ class ExposeApplicationDBResponse(ResponseBaseModel):
155
+ """
156
+ Model representing a response for exposing an application database.
157
+
158
+ Attributes:
159
+ details (dict[str, Any] | None): The details of the exposed application database, if any.
160
+ """
161
+ details: dict[str, Any] | None
162
+
163
+ class MonitoringInfo(BaseModel):
164
+ """
165
+ Model representing monitoring information.
166
+
167
+ Attributes:
168
+ url (str): The URL for monitoring.
169
+ username (str): The username for monitoring access.
170
+ password (str): The password for monitoring access.
171
+ """
172
+ url: str
173
+ username: str
174
+ password: str
175
+
176
+ class GetMonitoringInfoResponse(ResponseBaseModel):
177
+ """
178
+ Model representing a response containing monitoring information.
179
+
180
+ Attributes:
181
+ details (MonitoringInfo | None): The monitoring information details, if any.
182
+ """
183
+ details: MonitoringInfo | None
184
+
185
+ class BasicAuthCredentials(BaseModel):
186
+ """
187
+ Model representing basic authentication credentials.
188
+
189
+ Attributes:
190
+ username (str): The username for basic authentication.
191
+ password (str): The password for basic authentication.
192
+ """
193
+ username: str
194
+ password: str
195
+
196
+ class AddBasicAuthResponse(ResponseBaseModel):
197
+ """
198
+ Model representing a response for adding basic authentication.
199
+
200
+ Attributes:
201
+ details (BasicAuthCredentials | None): The basic authentication credentials, if any.
202
+ """
203
+ details: BasicAuthCredentials | None
204
+
205
+ class ListEnvsDetails(BaseModel):
206
+ """
207
+ Model representing the details of listed environments.
208
+
209
+ Attributes:
210
+ application_uuid (str): The UUID of the application.
211
+ application_name (str): The name of the application.
212
+ environments (list[str]): A list of environment names.
213
+ """
214
+ application_uuid: str
215
+ application_name: str
216
+ environments: list[str]
217
+
218
+ class ListEnvsResponse(ResponseBaseModel):
219
+ """
220
+ Model representing a response containing the details of listed environments.
221
+
222
+ Attributes:
223
+ details (ListEnvsDetails | None): The details of the listed environments, if any.
224
+ """
225
+ details: ListEnvsDetails | None
226
+
227
+ class CreateEnvDetails(BaseModel):
228
+ """
229
+ Model representing the details for creating an environment.
230
+
231
+ Attributes:
232
+ environment_name (str): The name of the environment.
233
+ application_uuid (str): The UUID of the application.
234
+ application_name (str): The name of the application.
235
+ """
236
+ environment_name: str
237
+ application_uuid: str
238
+ application_name: str
239
+
240
+ class CreateEnvResponse(ResponseBaseModel):
241
+ """
242
+ Model representing a response for creating an environment.
243
+
244
+ Attributes:
245
+ details (CreateEnvDetails | None): The details for creating an environment, if any.
246
+ """
247
+ details: CreateEnvDetails | None
File without changes
File without changes
@@ -0,0 +1,19 @@
1
+ from amsdal.cloud.services.actions.base import CloudActionBase as CloudActionBase
2
+
3
+ class AddAllowlistIPAction(CloudActionBase):
4
+ """
5
+ Action class for adding an IP address to the allowlist.
6
+ """
7
+ def action(self, env_name: str, ip_address: str | None = None, application_name: str | None = None, application_uuid: str | None = None) -> bool:
8
+ """
9
+ Executes the action to add an IP address to the allowlist.
10
+
11
+ Args:
12
+ env_name (str): The name of the environment.
13
+ ip_address (str, optional): The IP address to add to the allowlist. Defaults to None.
14
+ application_name (str, optional): The name of the application. Defaults to None.
15
+ application_uuid (str, optional): The UUID of the application. Defaults to None.
16
+
17
+ Returns:
18
+ bool: True if the action was executed successfully.
19
+ """
@@ -0,0 +1,21 @@
1
+ from amsdal.cloud.models.base import AddBasicAuthResponse as AddBasicAuthResponse
2
+ from amsdal.cloud.services.actions.base import CloudActionBase as CloudActionBase
3
+
4
+ class AddBasicAuthAction(CloudActionBase):
5
+ """
6
+ Action class for adding basic authentication.
7
+ """
8
+ def action(self, env_name: str, username: str | None = None, password: str | None = None, application_name: str | None = None, application_uuid: str | None = None) -> AddBasicAuthResponse:
9
+ """
10
+ Executes the action to add basic authentication.
11
+
12
+ Args:
13
+ env_name (str): The name of the environment.
14
+ username (str, optional): The username for basic authentication. Defaults to None.
15
+ password (str, optional): The password for basic authentication. Defaults to None.
16
+ application_name (str, optional): The name of the application. Defaults to None.
17
+ application_uuid (str, optional): The UUID of the application. Defaults to None.
18
+
19
+ Returns:
20
+ AddBasicAuthResponse: The response containing the basic authentication details.
21
+ """
@@ -0,0 +1,19 @@
1
+ from amsdal.cloud.services.actions.base import CloudActionBase as CloudActionBase
2
+
3
+ class AddDepenencyAction(CloudActionBase):
4
+ """
5
+ Action class for adding a dependency to an application.
6
+ """
7
+ def action(self, dependency_name: str, env_name: str, application_name: str | None = None, application_uuid: str | None = None) -> bool:
8
+ """
9
+ Executes the action to add a dependency to an application.
10
+
11
+ Args:
12
+ dependency_name (str): The name of the dependency.
13
+ env_name (str): The name of the environment.
14
+ application_name (str, optional): The name of the application. Defaults to None.
15
+ application_uuid (str, optional): The UUID of the application. Defaults to None.
16
+
17
+ Returns:
18
+ bool: True if the action was executed successfully.
19
+ """
@@ -0,0 +1,20 @@
1
+ from amsdal.cloud.services.actions.base import CloudActionBase as CloudActionBase
2
+
3
+ class AddSecretAction(CloudActionBase):
4
+ """
5
+ Action class for adding a secret to an application.
6
+ """
7
+ def action(self, secret_name: str, secret_value: str, env_name: str, application_uuid: str | None = None, application_name: str | None = None) -> bool:
8
+ """
9
+ Executes the action to add a secret to an application.
10
+
11
+ Args:
12
+ secret_name (str): The name of the secret.
13
+ secret_value (str): The value of the secret.
14
+ env_name (str): The name of the environment.
15
+ application_uuid (str, optional): The UUID of the application. Defaults to None.
16
+ application_name (str, optional): The name of the application. Defaults to None.
17
+
18
+ Returns:
19
+ bool: True if the action was executed successfully.
20
+ """
@@ -0,0 +1,122 @@
1
+ import abc
2
+ from _typeshed import Incomplete
3
+ from abc import ABC, abstractmethod
4
+ from amsdal.cloud.client import AuthClientService as AuthClientService
5
+ from amsdal.cloud.constants import ENCRYPT_PUBLIC_KEY as ENCRYPT_PUBLIC_KEY
6
+ from amsdal.cloud.enums import ResponseStatus as ResponseStatus
7
+ from amsdal.cloud.models.base import ResponseBaseModel as ResponseBaseModel
8
+ from amsdal.configs.main import settings as settings
9
+ from amsdal.errors import AmsdalCloudAlreadyDeployedError as AmsdalCloudAlreadyDeployedError, AmsdalCloudError as AmsdalCloudError
10
+ from enum import Enum
11
+ from typing import Any
12
+
13
+ class AuthErrorCodes(str, Enum):
14
+ """
15
+ Enum for authentication error codes.
16
+
17
+ Attributes:
18
+ INVALID_EMAIL (str): Error code for invalid email.
19
+ MISSING_CREDENTIALS (str): Error code for missing credentials.
20
+ INVALID_CREDENTIALS (str): Error code for invalid credentials.
21
+ INVALID_APPLICATION_UUID (str): Error code for invalid application UUID.
22
+ CLIENT_IS_INACTIVE (str): Error code for inactive client.
23
+ CLIENT_ALREADY_EXISTS (str): Error code for client already exists.
24
+ DEPLOY_FAILED (str): Error code for deploy failed.
25
+ DEPLOY_ALREADY_EXISTS (str): Error code for deploy already exists.
26
+ DEPLOY_NOT_IN_DEPLOYED_STATUS (str): Error code for deploy not in deployed status.
27
+ DESTROY_FAILED (str): Error code for destroy failed.
28
+ DEPLOY_NOT_FOUND (str): Error code for deploy not found.
29
+ INVALID_DEPENDENCY (str): Error code for invalid dependency.
30
+ EXPOSE_DB_ACCESS_FAILED (str): Error code for expose DB access failed.
31
+ APPLICATION_ALREADY_EXISTS (str): Error code for application already exists.
32
+ MULTIPLE_APPLICATIONS_FOUND (str): Error code for multiple applications found.
33
+ MAXIMUM_APPLICATIONS_REACHED (str): Error code for maximum applications reached.
34
+ INTERNAL_SECRET (str): Error code for internal secret.
35
+ BA_DOES_NOT_EXIST (str): Error code for basic authentication does not exist.
36
+ INVALID_IP_ADDRESS (str): Error code for invalid IP address.
37
+ MONITORING_NOT_FOUND (str): Error code for monitoring not found.
38
+ INVALID_ENVIRONMENT_NAME (str): Error code for invalid environment name.
39
+ SAME_ENVIRONMENT_NAME (str): Error code for same environment name.
40
+ ENVIRONMENT_NOT_FOUND (str): Error code for environment not found.
41
+ ENVIRONMENT_NOT_DEPLOYED (str): Error code for environment not deployed.
42
+ MAXIMUM_DEPLOYS_PER_APPLICATION_REACHED (str): Error code for maximum deploys per application reached.
43
+ CANNOT_DELETE_ENVIRONMENT (str): Error code for cannot delete environment.
44
+ """
45
+ INVALID_EMAIL = 'invalid_email'
46
+ MISSING_CREDENTIALS = 'missing_credentials'
47
+ INVALID_CREDENTIALS = 'invalid_credentials'
48
+ INVALID_APPLICATION_UUID = 'invalid_application_uuid'
49
+ CLIENT_IS_INACTIVE = 'client_is_inactive'
50
+ CLIENT_ALREADY_EXISTS = 'client_already_exists'
51
+ DEPLOY_FAILED = 'deploy_failed'
52
+ DEPLOY_ALREADY_EXISTS = 'deploy_already_exists'
53
+ DEPLOY_NOT_IN_DEPLOYED_STATUS = 'deploy_not_in_deployed_status'
54
+ DESTROY_FAILED = 'destroy_failed'
55
+ DEPLOY_NOT_FOUND = 'deploy_not_found'
56
+ INVALID_DEPENDENCY = 'invalid_dependency'
57
+ EXPOSE_DB_ACCESS_FAILED = 'expose_access_failed'
58
+ APPLICATION_ALREADY_EXISTS = 'application_already_exists'
59
+ MULTIPLE_APPLICATIONS_FOUND = 'multiple_applications_found'
60
+ MAXIMUM_APPLICATIONS_REACHED = 'maximum_applications_reached'
61
+ INTERNAL_SECRET = 'internal_secret'
62
+ BA_DOES_NOT_EXIST = 'ba_does_not_exist'
63
+ INVALID_IP_ADDRESS = 'invalid_ip_address'
64
+ MONITORING_NOT_FOUND = 'monitoring_not_found'
65
+ INVALID_ENVIRONMENT_NAME = 'invalid_environment_name'
66
+ SAME_ENVIRONMENT_NAME = 'same_environment_name'
67
+ ENVIRONMENT_NOT_FOUND = 'environment_not_found'
68
+ ENVIRONMENT_NOT_DEPLOYED = 'environment_not_deployed'
69
+ MAXIMUM_DEPLOYS_PER_APPLICATION_REACHED = 'maximum_deploys_per_application_reached'
70
+ CANNOT_DELETE_ENVIRONMENT = 'cannot_delete_environment'
71
+
72
+ FRIENDLY_ERROR_MESSAGES: Incomplete
73
+
74
+ class CloudActionBase(ABC, metaclass=abc.ABCMeta):
75
+ """
76
+ Abstract base class for cloud actions.
77
+ """
78
+ auth_client: Incomplete
79
+ def __init__(self) -> None: ...
80
+ @abstractmethod
81
+ def action(self, *args: Any, **kwargs: Any) -> Any:
82
+ """
83
+ Abstract method to be implemented by subclasses to execute the action.
84
+
85
+ Args:
86
+ *args (Any): Variable length argument list.
87
+ **kwargs (Any): Arbitrary keyword arguments.
88
+
89
+ Returns:
90
+ Any: The result of the action.
91
+ """
92
+ def _credentials_data(self) -> bytes: ...
93
+ @staticmethod
94
+ def _input(msg: str) -> str: ...
95
+ @staticmethod
96
+ def _print(msg: str) -> None: ...
97
+ def execute_transaction(self, transaction_name: str, data: dict[str, Any]) -> dict[str, Any]:
98
+ """
99
+ Executes a transaction with the given name and data.
100
+
101
+ Args:
102
+ transaction_name (str): The name of the transaction to execute.
103
+ data (dict[str, Any]): The data to be sent with the transaction.
104
+
105
+ Returns:
106
+ dict[str, Any]: The response data from the transaction.
107
+
108
+ Raises:
109
+ AmsdalCloudError: If the transaction cannot be executed or if the transaction fails.
110
+ AmsdalCloudAlreadyDeployedError: If the deploy already exists.
111
+ """
112
+ def process_errors(self, response: ResponseBaseModel) -> None:
113
+ """
114
+ Processes errors in the response and raises appropriate exceptions.
115
+
116
+ Args:
117
+ response (ResponseBaseModel): The response model containing the status and errors.
118
+
119
+ Raises:
120
+ AmsdalCloudAlreadyDeployedError: If the deploy already exists.
121
+ AmsdalCloudError: If there are other errors in the response or if the transaction failed.
122
+ """
@@ -0,0 +1,41 @@
1
+ from amsdal.cloud.constants import AMSDAL_ENV_SUBDOMAIN as AMSDAL_ENV_SUBDOMAIN
2
+ from amsdal.cloud.models.base import DeployResponse as DeployResponse
3
+ from amsdal.cloud.services.actions.base import CloudActionBase as CloudActionBase
4
+ from amsdal.errors import AmsdalCloudAlreadyDeployedError as AmsdalCloudAlreadyDeployedError
5
+ from typing import Any
6
+
7
+ class CreateDeployAction(CloudActionBase):
8
+ """
9
+ Class to handle the creation of a deploy action.
10
+ """
11
+ def want_deploy_input(self) -> str:
12
+ """
13
+ Prompts the user to confirm if they want to deploy the app.
14
+
15
+ Returns:
16
+ str: The user's input, stripped of leading and trailing whitespace.
17
+ """
18
+ def want_redeploy_input(self) -> str:
19
+ """
20
+ Prompts the user to confirm if they want to redeploy the app.
21
+
22
+ Returns:
23
+ str: The user's input, stripped of leading and trailing whitespace.
24
+ """
25
+ def action(self, deploy_type: str, lakehouse_type: str, env_name: str, from_env: str | None = None, application_uuid: str | None = None, application_name: str | None = None, *, no_input: bool = False) -> bool:
26
+ """
27
+ Executes the deploy action with the given parameters.
28
+
29
+ Args:
30
+ deploy_type (str): The type of deploy to perform.
31
+ lakehouse_type (str): The type of lakehouse to deploy.
32
+ env_name (str): The name of the environment to deploy to.
33
+ from_env (str | None, optional): The environment to deploy from. Defaults to None.
34
+ application_uuid (str | None, optional): The UUID of the application. Defaults to None.
35
+ application_name (str | None, optional): The name of the application. Defaults to None.
36
+ no_input (bool, optional): If True, skips user input prompts. Defaults to False.
37
+
38
+ Returns:
39
+ bool: True if the deploy action was successful, False otherwise.
40
+ """
41
+ def _redeploy(self, deploy_data: dict[str, Any]) -> bool: ...
@@ -0,0 +1,19 @@
1
+ from amsdal.cloud.models.base import CreateEnvResponse as CreateEnvResponse
2
+ from amsdal.cloud.services.actions.base import CloudActionBase as CloudActionBase
3
+
4
+ class CreateEnvAction(CloudActionBase):
5
+ """
6
+ Class to handle the creation of an environment action.
7
+ """
8
+ def action(self, *, env_name: str, application_name: str | None = None, application_uuid: str | None = None) -> CreateEnvResponse:
9
+ """
10
+ Executes the environment creation action with the given parameters.
11
+
12
+ Args:
13
+ env_name (str): The name of the environment to create.
14
+ application_name (str | None, optional): The name of the application. Defaults to None.
15
+ application_uuid (str | None, optional): The UUID of the application. Defaults to None.
16
+
17
+ Returns:
18
+ CreateEnvResponse: The response model containing the details of the created environment.
19
+ """
@@ -0,0 +1,17 @@
1
+ from amsdal.cloud.models.base import CreateSessionDetails as CreateSessionDetails
2
+ from amsdal.cloud.services.actions.base import CloudActionBase as CloudActionBase
3
+
4
+ class CreateSessionAction(CloudActionBase):
5
+ """
6
+ Class to handle the creation of a client session.
7
+ """
8
+ def action(self, encrypted_data: bytes) -> CreateSessionDetails:
9
+ """
10
+ Executes the client session creation action with the given encrypted data.
11
+
12
+ Args:
13
+ encrypted_data (bytes): The encrypted data required for session creation.
14
+
15
+ Returns:
16
+ CreateSessionDetails: The response model containing the details of the created session.
17
+ """
@@ -0,0 +1,19 @@
1
+ from amsdal.cloud.services.actions.base import CloudActionBase as CloudActionBase
2
+
3
+ class DeleteAllowlistIPAction(CloudActionBase):
4
+ """
5
+ Class to handle the deletion of an allowlist IP action.
6
+ """
7
+ def action(self, env_name: str, ip_address: str | None = None, application_name: str | None = None, application_uuid: str | None = None) -> bool:
8
+ """
9
+ Executes the allowlist IP deletion action with the given parameters.
10
+
11
+ Args:
12
+ env_name (str): The name of the environment.
13
+ ip_address (str | None, optional): The IP address to remove from the allowlist. Defaults to None.
14
+ application_name (str | None, optional): The name of the application. Defaults to None.
15
+ application_uuid (str | None, optional): The UUID of the application. Defaults to None.
16
+
17
+ Returns:
18
+ bool: True if the allowlist IP deletion action was successful.
19
+ """
@@ -0,0 +1,20 @@
1
+ from amsdal.cloud.services.actions.base import CloudActionBase as CloudActionBase
2
+
3
+ class DeleteBasicAuthAction(CloudActionBase):
4
+ """
5
+ Class to handle the deletion of basic authentication.
6
+
7
+ This class provides functionality to remove basic authentication for a given environment and application.
8
+ """
9
+ def action(self, env_name: str, application_name: str | None = None, application_uuid: str | None = None) -> bool:
10
+ """
11
+ Executes the basic authentication deletion action with the given parameters.
12
+
13
+ Args:
14
+ env_name (str): The name of the environment.
15
+ application_name (str | None, optional): The name of the application. Defaults to None.
16
+ application_uuid (str | None, optional): The UUID of the application. Defaults to None.
17
+
18
+ Returns:
19
+ bool: True if the basic authentication deletion action was successful.
20
+ """
@@ -0,0 +1,21 @@
1
+ from amsdal.cloud.services.actions.base import CloudActionBase as CloudActionBase
2
+
3
+ class DeleteDepenencyAction(CloudActionBase):
4
+ """
5
+ Class to handle the deletion of an application dependency.
6
+
7
+ This class provides functionality to remove a specified dependency for a given environment and application.
8
+ """
9
+ def action(self, dependency_name: str, env_name: str, application_name: str | None = None, application_uuid: str | None = None) -> bool:
10
+ """
11
+ Executes the application dependency deletion action with the given parameters.
12
+
13
+ Args:
14
+ dependency_name (str): The name of the dependency to remove.
15
+ env_name (str): The name of the environment.
16
+ application_name (str | None, optional): The name of the application. Defaults to None.
17
+ application_uuid (str | None, optional): The UUID of the application. Defaults to None.
18
+
19
+ Returns:
20
+ bool: True if the application dependency deletion action was successful.
21
+ """
@@ -0,0 +1,21 @@
1
+ from amsdal.cloud.models.base import CreateEnvResponse as CreateEnvResponse
2
+ from amsdal.cloud.services.actions.base import CloudActionBase as CloudActionBase
3
+
4
+ class DeleteEnvAction(CloudActionBase):
5
+ """
6
+ Class to handle the deletion of an environment.
7
+
8
+ This class provides functionality to remove an environment for a given application.
9
+ """
10
+ def action(self, *, env_name: str, application_name: str | None = None, application_uuid: str | None = None) -> CreateEnvResponse:
11
+ """
12
+ Executes the environment deletion action with the given parameters.
13
+
14
+ Args:
15
+ env_name (str): The name of the environment.
16
+ application_name (str | None, optional): The name of the application. Defaults to None.
17
+ application_uuid (str | None, optional): The UUID of the application. Defaults to None.
18
+
19
+ Returns:
20
+ CreateEnvResponse: The response data after the environment deletion action.
21
+ """