beamlit 0.0.24rc20__py3-none-any.whl → 0.0.24rc21__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. beamlit/agents/chat.py +37 -11
  2. beamlit/agents/decorator.py +97 -65
  3. beamlit/api/agents/create_agent.py +9 -14
  4. beamlit/api/agents/delete_agent.py +22 -1
  5. beamlit/api/agents/delete_agent_history.py +2 -6
  6. beamlit/api/agents/get_agent.py +22 -1
  7. beamlit/api/agents/get_agent_environment_logs.py +11 -11
  8. beamlit/api/agents/get_agent_history.py +2 -6
  9. beamlit/api/agents/get_agent_metrics.py +22 -1
  10. beamlit/api/agents/list_agent_history.py +11 -11
  11. beamlit/api/agents/list_agents.py +36 -4
  12. beamlit/api/agents/put_agent_history.py +2 -6
  13. beamlit/api/agents/update_agent.py +9 -14
  14. beamlit/api/functions/create_function.py +9 -14
  15. beamlit/api/functions/delete_function.py +22 -1
  16. beamlit/api/functions/get_function.py +22 -1
  17. beamlit/api/functions/get_function_environment_logs.py +11 -11
  18. beamlit/api/functions/get_function_metrics.py +22 -1
  19. beamlit/api/functions/list_functions.py +36 -4
  20. beamlit/api/functions/update_function.py +9 -14
  21. beamlit/api/history/get_agents_history.py +12 -12
  22. beamlit/api/history/list_agents_history.py +12 -12
  23. beamlit/api/integrations/get_integration_connection.py +16 -12
  24. beamlit/api/integrations/get_integration_connection_model.py +8 -1
  25. beamlit/api/integrations/get_integration_model.py +8 -1
  26. beamlit/api/locations/list_locations.py +12 -12
  27. beamlit/api/models/create_model.py +13 -14
  28. beamlit/api/models/delete_model.py +22 -1
  29. beamlit/api/models/get_model.py +22 -1
  30. beamlit/api/models/get_model_environment_logs.py +11 -11
  31. beamlit/api/models/get_model_metrics.py +38 -13
  32. beamlit/api/models/list_models.py +36 -4
  33. beamlit/api/models/update_model.py +13 -14
  34. beamlit/api/privateclusters/__init__.py +0 -0
  35. beamlit/api/{agents/get_agent_deployment_metrics.py → privateclusters/create_private_cluster.py} +28 -55
  36. beamlit/api/{functions/list_function_deployments.py → privateclusters/delete_private_cluster.py} +38 -37
  37. beamlit/api/{agents/get_agent_deployment.py → privateclusters/get_private_cluster.py} +40 -44
  38. beamlit/api/privateclusters/get_private_cluster_health.py +97 -0
  39. beamlit/api/{agents/list_agent_deployments.py → privateclusters/list_private_clusters.py} +30 -45
  40. beamlit/api/{models/list_model_deployments.py → privateclusters/update_private_cluster.py} +38 -45
  41. beamlit/api/privateclusters/update_private_cluster_health.py +97 -0
  42. beamlit/authentication/device_mode.py +3 -9
  43. beamlit/common/generate.py +47 -34
  44. beamlit/common/settings.py +29 -27
  45. beamlit/deploy/deploy.py +101 -342
  46. beamlit/deploy/format.py +70 -0
  47. beamlit/deploy/parser.py +175 -0
  48. beamlit/functions/decorator.py +8 -11
  49. beamlit/models/__init__.py +64 -78
  50. beamlit/models/acl.py +4 -22
  51. beamlit/models/agent.py +34 -95
  52. beamlit/models/agent_history.py +7 -5
  53. beamlit/models/agent_history_event.py +11 -9
  54. beamlit/models/agent_metadata.py +5 -3
  55. beamlit/models/agent_spec.py +54 -45
  56. beamlit/models/api_key.py +14 -14
  57. beamlit/models/configuration.py +11 -0
  58. beamlit/models/core_spec.py +45 -32
  59. beamlit/models/{model_deployment_metrics_query_per_second_per_region_per_code.py → core_spec_configurations.py} +22 -22
  60. beamlit/models/environment.py +33 -105
  61. beamlit/models/environment_metadata.py +146 -0
  62. beamlit/models/environment_spec.py +8 -6
  63. beamlit/models/function.py +34 -95
  64. beamlit/models/function_metadata.py +5 -3
  65. beamlit/models/function_spec.py +53 -40
  66. beamlit/models/integration_connection.py +31 -137
  67. beamlit/models/integration_connection_spec.py +6 -4
  68. beamlit/models/metadata.py +5 -3
  69. beamlit/models/metadata_labels.py +4 -2
  70. beamlit/models/model.py +33 -94
  71. beamlit/models/model_metadata.py +5 -3
  72. beamlit/models/{function_provider_ref.py → model_private_cluster.py} +23 -14
  73. beamlit/models/model_provider.py +27 -43
  74. beamlit/models/model_spec.py +45 -32
  75. beamlit/models/owner_fields.py +4 -2
  76. beamlit/models/pending_invitation.py +14 -14
  77. beamlit/models/pod_template_spec.py +4 -2
  78. beamlit/models/policy.py +33 -159
  79. beamlit/models/policy_spec.py +24 -28
  80. beamlit/models/private_cluster.py +183 -0
  81. beamlit/models/{model_provider_ref.py → private_location.py} +7 -16
  82. beamlit/models/resource_deployment_metrics.py +0 -108
  83. beamlit/models/resource_environment_metrics.py +143 -71
  84. beamlit/models/{resource_deployment_metrics_inference_per_region.py → resource_environment_metrics_inference_per_region.py} +5 -5
  85. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +9 -11
  86. beamlit/models/{resource_deployment_metrics_query_per_region_per_code.py → resource_environment_metrics_query_per_region_per_code.py} +5 -5
  87. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +5 -3
  88. beamlit/models/resource_log.py +4 -2
  89. beamlit/models/runtime.py +20 -2
  90. beamlit/models/serverless_config.py +28 -21
  91. beamlit/models/spec_configuration.py +7 -5
  92. beamlit/models/store_agent.py +14 -14
  93. beamlit/models/store_function.py +14 -14
  94. beamlit/models/time_fields.py +4 -2
  95. beamlit/models/websocket_channel.py +4 -2
  96. beamlit/models/workspace.py +23 -14
  97. beamlit/run.py +0 -1
  98. beamlit/serve/app.py +1 -0
  99. beamlit/serve/middlewares/accesslog.py +3 -1
  100. {beamlit-0.0.24rc20.dist-info → beamlit-0.0.24rc21.dist-info}/METADATA +1 -1
  101. beamlit-0.0.24rc21.dist-info/RECORD +243 -0
  102. beamlit/api/agents/delete_agent_deployment.py +0 -163
  103. beamlit/api/agents/delete_agent_deployment_history.py +0 -172
  104. beamlit/api/agents/get_agent_deployment_history.py +0 -172
  105. beamlit/api/agents/get_agent_deployment_logs.py +0 -164
  106. beamlit/api/agents/list_agent_deployment_history.py +0 -164
  107. beamlit/api/agents/put_agent_deployment.py +0 -185
  108. beamlit/api/agents/put_agent_deployment_history.py +0 -198
  109. beamlit/api/functions/delete_function_deployment.py +0 -163
  110. beamlit/api/functions/get_function_deployment.py +0 -163
  111. beamlit/api/functions/get_function_deployment_logs.py +0 -164
  112. beamlit/api/functions/get_function_deployment_metrics.py +0 -159
  113. beamlit/api/functions/put_function_deployment.py +0 -185
  114. beamlit/api/models/delete_model_deployment.py +0 -171
  115. beamlit/api/models/get_model_deployment.py +0 -171
  116. beamlit/api/models/get_model_deployment_logs.py +0 -168
  117. beamlit/api/models/get_model_deployment_metrics.py +0 -163
  118. beamlit/api/models/put_model_deployment.py +0 -193
  119. beamlit/models/agent_configuration.py +0 -70
  120. beamlit/models/agent_deployment.py +0 -340
  121. beamlit/models/agent_deployment_configuration.py +0 -45
  122. beamlit/models/agent_deployment_configuration_type_0.py +0 -43
  123. beamlit/models/agent_deployment_history.py +0 -185
  124. beamlit/models/agent_deployment_history_event.py +0 -133
  125. beamlit/models/agent_deployment_pod_template.py +0 -45
  126. beamlit/models/agent_deployment_pod_template_type_0.py +0 -43
  127. beamlit/models/agent_with_deployments.py +0 -176
  128. beamlit/models/authentication_provider_model.py +0 -144
  129. beamlit/models/authentication_provider_organization.py +0 -88
  130. beamlit/models/deployment_configuration.py +0 -70
  131. beamlit/models/deployment_configurations.py +0 -58
  132. beamlit/models/deployment_serverless_config.py +0 -131
  133. beamlit/models/deployment_serverless_config_type_0.py +0 -220
  134. beamlit/models/function_configuration.py +0 -70
  135. beamlit/models/function_deployment.py +0 -340
  136. beamlit/models/function_deployment_configuration.py +0 -45
  137. beamlit/models/function_deployment_configuration_type_0.py +0 -43
  138. beamlit/models/function_deployment_pod_template.py +0 -45
  139. beamlit/models/function_deployment_pod_template_type_0.py +0 -43
  140. beamlit/models/function_with_deployments.py +0 -176
  141. beamlit/models/integration.py +0 -198
  142. beamlit/models/integration_config.py +0 -45
  143. beamlit/models/integration_secret.py +0 -61
  144. beamlit/models/labels_type_0.py +0 -45
  145. beamlit/models/location.py +0 -122
  146. beamlit/models/model_deployment.py +0 -296
  147. beamlit/models/model_deployment_log.py +0 -70
  148. beamlit/models/model_deployment_metrics.py +0 -172
  149. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +0 -77
  150. beamlit/models/model_deployment_pod_template.py +0 -45
  151. beamlit/models/model_deployment_pod_template_type_0.py +0 -43
  152. beamlit/models/model_metrics.py +0 -96
  153. beamlit/models/model_with_deployments.py +0 -176
  154. beamlit/models/resource_deployment_log.py +0 -70
  155. beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +0 -79
  156. beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +0 -79
  157. beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +0 -73
  158. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +0 -73
  159. beamlit/models/runtime_readiness_probe_type_0.py +0 -43
  160. beamlit/models/runtime_type_0.py +0 -111
  161. beamlit/models/runtime_type_0_readiness_probe.py +0 -43
  162. beamlit/models/runtime_type_0_readiness_probe_type_0.py +0 -43
  163. beamlit/models/runtime_type_0_resources.py +0 -59
  164. beamlit/models/standard_fields_dynamo_db.py +0 -88
  165. beamlit/models/store_agent_configuration.py +0 -97
  166. beamlit/models/store_agent_labels_type_0.py +0 -43
  167. beamlit/models/store_function_configuration.py +0 -97
  168. beamlit/models/store_function_labels_type_0.py +0 -43
  169. beamlit-0.0.24rc20.dist-info/RECORD +0 -303
  170. {beamlit-0.0.24rc20.dist-info → beamlit-0.0.24rc21.dist-info}/WHEEL +0 -0
@@ -1,340 +0,0 @@
1
- from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
2
-
3
- from attrs import define as _attrs_define
4
- from attrs import field as _attrs_field
5
-
6
- from ..types import UNSET, Unset
7
-
8
- if TYPE_CHECKING:
9
- from ..models.deployment_serverless_config import DeploymentServerlessConfig
10
- from ..models.flavor import Flavor
11
- from ..models.function_deployment_configuration import FunctionDeploymentConfiguration
12
- from ..models.function_deployment_pod_template import FunctionDeploymentPodTemplate
13
- from ..models.function_kit import FunctionKit
14
- from ..models.labels_type_0 import LabelsType0
15
- from ..models.runtime import Runtime
16
- from ..models.store_function_parameter import StoreFunctionParameter
17
-
18
-
19
- T = TypeVar("T", bound="FunctionDeployment")
20
-
21
-
22
- @_attrs_define
23
- class FunctionDeployment:
24
- """Function deployment configuration
25
-
26
- Attributes:
27
- created_at (Union[Unset, str]): The date and time when the resource was created
28
- created_by (Union[Unset, str]): The user or service account who created the resource
29
- updated_at (Union[Unset, str]): The date and time when the resource was updated
30
- updated_by (Union[Unset, str]): The user or service account who updated the resource
31
- configuration (Union[Unset, FunctionDeploymentConfiguration]): Function configuration, this is a key value
32
- storage. In your function you can retrieve the value with config[key]
33
- description (Union[Unset, str]): Function description, very important for the agent function to work with an LLM
34
- enabled (Union[Unset, bool]): Whether the function deployment is enabled
35
- environment (Union[Unset, str]): The name of the environment
36
- flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
37
- function (Union[Unset, str]): The name of the function
38
- integration_connections (Union[Unset, list[str]]):
39
- kit (Union[Unset, list['FunctionKit']]): The kit of the function deployment
40
- labels (Union['LabelsType0', None, Unset]): Labels
41
- parameters (Union[Unset, list['StoreFunctionParameter']]): Function parameters, for your function to be callable
42
- with Agent
43
- pod_template (Union[Unset, FunctionDeploymentPodTemplate]): The pod template, should be a valid Kubernetes pod
44
- template
45
- policies (Union[Unset, list[str]]):
46
- runtime (Union[Unset, Runtime]): Set of configurations for a deployment
47
- serverless_config (Union[Unset, DeploymentServerlessConfig]): Configuration for a serverless deployment
48
- store_id (Union[Unset, str]): Create from a store registered function
49
- workspace (Union[Unset, str]): The workspace the function deployment belongs to
50
- """
51
-
52
- created_at: Union[Unset, str] = UNSET
53
- created_by: Union[Unset, str] = UNSET
54
- updated_at: Union[Unset, str] = UNSET
55
- updated_by: Union[Unset, str] = UNSET
56
- configuration: Union[Unset, "FunctionDeploymentConfiguration"] = UNSET
57
- description: Union[Unset, str] = UNSET
58
- enabled: Union[Unset, bool] = UNSET
59
- environment: Union[Unset, str] = UNSET
60
- flavors: Union[Unset, list["Flavor"]] = UNSET
61
- function: Union[Unset, str] = UNSET
62
- integration_connections: Union[Unset, list[str]] = UNSET
63
- kit: Union[Unset, list["FunctionKit"]] = UNSET
64
- labels: Union["LabelsType0", None, Unset] = UNSET
65
- parameters: Union[Unset, list["StoreFunctionParameter"]] = UNSET
66
- pod_template: Union[Unset, "FunctionDeploymentPodTemplate"] = UNSET
67
- policies: Union[Unset, list[str]] = UNSET
68
- runtime: Union[Unset, "Runtime"] = UNSET
69
- serverless_config: Union[Unset, "DeploymentServerlessConfig"] = UNSET
70
- store_id: Union[Unset, str] = UNSET
71
- workspace: Union[Unset, str] = UNSET
72
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
73
-
74
- def to_dict(self) -> dict[str, Any]:
75
- from ..models.labels_type_0 import LabelsType0
76
-
77
- created_at = self.created_at
78
-
79
- created_by = self.created_by
80
-
81
- updated_at = self.updated_at
82
-
83
- updated_by = self.updated_by
84
-
85
- configuration: Union[Unset, dict[str, Any]] = UNSET
86
- if not isinstance(self.configuration, Unset):
87
- configuration = self.configuration.to_dict()
88
-
89
- description = self.description
90
-
91
- enabled = self.enabled
92
-
93
- environment = self.environment
94
-
95
- flavors: Union[Unset, list[dict[str, Any]]] = UNSET
96
- if not isinstance(self.flavors, Unset):
97
- flavors = []
98
- for componentsschemas_flavors_item_data in self.flavors:
99
- componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
100
- flavors.append(componentsschemas_flavors_item)
101
-
102
- function = self.function
103
-
104
- integration_connections: Union[Unset, list[str]] = UNSET
105
- if not isinstance(self.integration_connections, Unset):
106
- integration_connections = self.integration_connections
107
-
108
- kit: Union[Unset, list[dict[str, Any]]] = UNSET
109
- if not isinstance(self.kit, Unset):
110
- kit = []
111
- for kit_item_data in self.kit:
112
- kit_item = kit_item_data.to_dict()
113
- kit.append(kit_item)
114
-
115
- labels: Union[None, Unset, dict[str, Any]]
116
- if isinstance(self.labels, Unset):
117
- labels = UNSET
118
- elif isinstance(self.labels, LabelsType0):
119
- labels = self.labels.to_dict()
120
- else:
121
- labels = self.labels
122
-
123
- parameters: Union[Unset, list[dict[str, Any]]] = UNSET
124
- if not isinstance(self.parameters, Unset):
125
- parameters = []
126
- for parameters_item_data in self.parameters:
127
- parameters_item = parameters_item_data.to_dict()
128
- parameters.append(parameters_item)
129
-
130
- pod_template: Union[Unset, dict[str, Any]] = UNSET
131
- if not isinstance(self.pod_template, Unset):
132
- pod_template = self.pod_template.to_dict()
133
-
134
- policies: Union[Unset, list[str]] = UNSET
135
- if not isinstance(self.policies, Unset):
136
- policies = self.policies
137
-
138
- runtime: Union[Unset, dict[str, Any]] = UNSET
139
- if not isinstance(self.runtime, Unset):
140
- runtime = self.runtime.to_dict()
141
-
142
- serverless_config: Union[Unset, dict[str, Any]] = UNSET
143
- if not isinstance(self.serverless_config, Unset):
144
- serverless_config = self.serverless_config.to_dict()
145
-
146
- store_id = self.store_id
147
-
148
- workspace = self.workspace
149
-
150
- field_dict: dict[str, Any] = {}
151
- field_dict.update(self.additional_properties)
152
- field_dict.update({})
153
- if created_at is not UNSET:
154
- field_dict["created_at"] = created_at
155
- if created_by is not UNSET:
156
- field_dict["created_by"] = created_by
157
- if updated_at is not UNSET:
158
- field_dict["updated_at"] = updated_at
159
- if updated_by is not UNSET:
160
- field_dict["updated_by"] = updated_by
161
- if configuration is not UNSET:
162
- field_dict["configuration"] = configuration
163
- if description is not UNSET:
164
- field_dict["description"] = description
165
- if enabled is not UNSET:
166
- field_dict["enabled"] = enabled
167
- if environment is not UNSET:
168
- field_dict["environment"] = environment
169
- if flavors is not UNSET:
170
- field_dict["flavors"] = flavors
171
- if function is not UNSET:
172
- field_dict["function"] = function
173
- if integration_connections is not UNSET:
174
- field_dict["integration_connections"] = integration_connections
175
- if kit is not UNSET:
176
- field_dict["kit"] = kit
177
- if labels is not UNSET:
178
- field_dict["labels"] = labels
179
- if parameters is not UNSET:
180
- field_dict["parameters"] = parameters
181
- if pod_template is not UNSET:
182
- field_dict["pod_template"] = pod_template
183
- if policies is not UNSET:
184
- field_dict["policies"] = policies
185
- if runtime is not UNSET:
186
- field_dict["runtime"] = runtime
187
- if serverless_config is not UNSET:
188
- field_dict["serverless_config"] = serverless_config
189
- if store_id is not UNSET:
190
- field_dict["store_id"] = store_id
191
- if workspace is not UNSET:
192
- field_dict["workspace"] = workspace
193
-
194
- return field_dict
195
-
196
- @classmethod
197
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
198
- from ..models.deployment_serverless_config import DeploymentServerlessConfig
199
- from ..models.flavor import Flavor
200
- from ..models.function_deployment_configuration import FunctionDeploymentConfiguration
201
- from ..models.function_deployment_pod_template import FunctionDeploymentPodTemplate
202
- from ..models.function_kit import FunctionKit
203
- from ..models.labels_type_0 import LabelsType0
204
- from ..models.runtime import Runtime
205
- from ..models.store_function_parameter import StoreFunctionParameter
206
-
207
- if not src_dict:
208
- return None
209
- d = src_dict.copy()
210
- created_at = d.pop("created_at", UNSET)
211
-
212
- created_by = d.pop("created_by", UNSET)
213
-
214
- updated_at = d.pop("updated_at", UNSET)
215
-
216
- updated_by = d.pop("updated_by", UNSET)
217
-
218
- _configuration = d.pop("configuration", UNSET)
219
- configuration: Union[Unset, FunctionDeploymentConfiguration]
220
- if isinstance(_configuration, Unset):
221
- configuration = UNSET
222
- else:
223
- configuration = FunctionDeploymentConfiguration.from_dict(_configuration)
224
-
225
- description = d.pop("description", UNSET)
226
-
227
- enabled = d.pop("enabled", UNSET)
228
-
229
- environment = d.pop("environment", UNSET)
230
-
231
- flavors = []
232
- _flavors = d.pop("flavors", UNSET)
233
- for componentsschemas_flavors_item_data in _flavors or []:
234
- componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
235
-
236
- flavors.append(componentsschemas_flavors_item)
237
-
238
- function = d.pop("function", UNSET)
239
-
240
- integration_connections = cast(list[str], d.pop("integration_connections", UNSET))
241
-
242
- kit = []
243
- _kit = d.pop("kit", UNSET)
244
- for kit_item_data in _kit or []:
245
- kit_item = FunctionKit.from_dict(kit_item_data)
246
-
247
- kit.append(kit_item)
248
-
249
- def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
250
- if data is None:
251
- return data
252
- if isinstance(data, Unset):
253
- return data
254
- try:
255
- if not isinstance(data, dict):
256
- raise TypeError()
257
- componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
258
-
259
- return componentsschemas_labels_type_0
260
- except: # noqa: E722
261
- pass
262
- return cast(Union["LabelsType0", None, Unset], data)
263
-
264
- labels = _parse_labels(d.pop("labels", UNSET))
265
-
266
- parameters = []
267
- _parameters = d.pop("parameters", UNSET)
268
- for parameters_item_data in _parameters or []:
269
- parameters_item = StoreFunctionParameter.from_dict(parameters_item_data)
270
-
271
- parameters.append(parameters_item)
272
-
273
- _pod_template = d.pop("pod_template", UNSET)
274
- pod_template: Union[Unset, FunctionDeploymentPodTemplate]
275
- if isinstance(_pod_template, Unset):
276
- pod_template = UNSET
277
- else:
278
- pod_template = FunctionDeploymentPodTemplate.from_dict(_pod_template)
279
-
280
- policies = cast(list[str], d.pop("policies", UNSET))
281
-
282
- _runtime = d.pop("runtime", UNSET)
283
- runtime: Union[Unset, Runtime]
284
- if isinstance(_runtime, Unset):
285
- runtime = UNSET
286
- else:
287
- runtime = Runtime.from_dict(_runtime)
288
-
289
- _serverless_config = d.pop("serverless_config", UNSET)
290
- serverless_config: Union[Unset, DeploymentServerlessConfig]
291
- if isinstance(_serverless_config, Unset):
292
- serverless_config = UNSET
293
- else:
294
- serverless_config = DeploymentServerlessConfig.from_dict(_serverless_config)
295
-
296
- store_id = d.pop("store_id", UNSET)
297
-
298
- workspace = d.pop("workspace", UNSET)
299
-
300
- function_deployment = cls(
301
- created_at=created_at,
302
- created_by=created_by,
303
- updated_at=updated_at,
304
- updated_by=updated_by,
305
- configuration=configuration,
306
- description=description,
307
- enabled=enabled,
308
- environment=environment,
309
- flavors=flavors,
310
- function=function,
311
- integration_connections=integration_connections,
312
- kit=kit,
313
- labels=labels,
314
- parameters=parameters,
315
- pod_template=pod_template,
316
- policies=policies,
317
- runtime=runtime,
318
- serverless_config=serverless_config,
319
- store_id=store_id,
320
- workspace=workspace,
321
- )
322
-
323
- function_deployment.additional_properties = d
324
- return function_deployment
325
-
326
- @property
327
- def additional_keys(self) -> list[str]:
328
- return list(self.additional_properties.keys())
329
-
330
- def __getitem__(self, key: str) -> Any:
331
- return self.additional_properties[key]
332
-
333
- def __setitem__(self, key: str, value: Any) -> None:
334
- self.additional_properties[key] = value
335
-
336
- def __delitem__(self, key: str) -> None:
337
- del self.additional_properties[key]
338
-
339
- def __contains__(self, key: str) -> bool:
340
- return key in self.additional_properties
@@ -1,45 +0,0 @@
1
- from typing import Any, TypeVar
2
-
3
- from attrs import define as _attrs_define
4
- from attrs import field as _attrs_field
5
-
6
- T = TypeVar("T", bound="FunctionDeploymentConfiguration")
7
-
8
-
9
- @_attrs_define
10
- class FunctionDeploymentConfiguration:
11
- """Function configuration, this is a key value storage. In your function you can retrieve the value with config[key]"""
12
-
13
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
14
-
15
- def to_dict(self) -> dict[str, Any]:
16
- field_dict: dict[str, Any] = {}
17
- field_dict.update(self.additional_properties)
18
-
19
- return field_dict
20
-
21
- @classmethod
22
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
23
- if not src_dict:
24
- return None
25
- d = src_dict.copy()
26
- function_deployment_configuration = cls()
27
-
28
- function_deployment_configuration.additional_properties = d
29
- return function_deployment_configuration
30
-
31
- @property
32
- def additional_keys(self) -> list[str]:
33
- return list(self.additional_properties.keys())
34
-
35
- def __getitem__(self, key: str) -> Any:
36
- return self.additional_properties[key]
37
-
38
- def __setitem__(self, key: str, value: Any) -> None:
39
- self.additional_properties[key] = value
40
-
41
- def __delitem__(self, key: str) -> None:
42
- del self.additional_properties[key]
43
-
44
- def __contains__(self, key: str) -> bool:
45
- return key in self.additional_properties
@@ -1,43 +0,0 @@
1
- from typing import Any, Type, TypeVar
2
-
3
- from attrs import define as _attrs_define
4
- from attrs import field as _attrs_field
5
-
6
- T = TypeVar("T", bound="FunctionDeploymentConfigurationType0")
7
-
8
-
9
- @_attrs_define
10
- class FunctionDeploymentConfigurationType0:
11
- """Function configuration, this is a key value storage. In your function you can retrieve the value with config[key]"""
12
-
13
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
14
-
15
- def to_dict(self) -> dict[str, Any]:
16
- field_dict: dict[str, Any] = {}
17
- field_dict.update(self.additional_properties)
18
-
19
- return field_dict
20
-
21
- @classmethod
22
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
23
- d = src_dict.copy()
24
- function_deployment_configuration_type_0 = cls()
25
-
26
- function_deployment_configuration_type_0.additional_properties = d
27
- return function_deployment_configuration_type_0
28
-
29
- @property
30
- def additional_keys(self) -> list[str]:
31
- return list(self.additional_properties.keys())
32
-
33
- def __getitem__(self, key: str) -> Any:
34
- return self.additional_properties[key]
35
-
36
- def __setitem__(self, key: str, value: Any) -> None:
37
- self.additional_properties[key] = value
38
-
39
- def __delitem__(self, key: str) -> None:
40
- del self.additional_properties[key]
41
-
42
- def __contains__(self, key: str) -> bool:
43
- return key in self.additional_properties
@@ -1,45 +0,0 @@
1
- from typing import Any, TypeVar
2
-
3
- from attrs import define as _attrs_define
4
- from attrs import field as _attrs_field
5
-
6
- T = TypeVar("T", bound="FunctionDeploymentPodTemplate")
7
-
8
-
9
- @_attrs_define
10
- class FunctionDeploymentPodTemplate:
11
- """The pod template, should be a valid Kubernetes pod template"""
12
-
13
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
14
-
15
- def to_dict(self) -> dict[str, Any]:
16
- field_dict: dict[str, Any] = {}
17
- field_dict.update(self.additional_properties)
18
-
19
- return field_dict
20
-
21
- @classmethod
22
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
23
- if not src_dict:
24
- return None
25
- d = src_dict.copy()
26
- function_deployment_pod_template = cls()
27
-
28
- function_deployment_pod_template.additional_properties = d
29
- return function_deployment_pod_template
30
-
31
- @property
32
- def additional_keys(self) -> list[str]:
33
- return list(self.additional_properties.keys())
34
-
35
- def __getitem__(self, key: str) -> Any:
36
- return self.additional_properties[key]
37
-
38
- def __setitem__(self, key: str, value: Any) -> None:
39
- self.additional_properties[key] = value
40
-
41
- def __delitem__(self, key: str) -> None:
42
- del self.additional_properties[key]
43
-
44
- def __contains__(self, key: str) -> bool:
45
- return key in self.additional_properties
@@ -1,43 +0,0 @@
1
- from typing import Any, Type, TypeVar
2
-
3
- from attrs import define as _attrs_define
4
- from attrs import field as _attrs_field
5
-
6
- T = TypeVar("T", bound="FunctionDeploymentPodTemplateType0")
7
-
8
-
9
- @_attrs_define
10
- class FunctionDeploymentPodTemplateType0:
11
- """The pod template, should be a valid Kubernetes pod template"""
12
-
13
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
14
-
15
- def to_dict(self) -> dict[str, Any]:
16
- field_dict: dict[str, Any] = {}
17
- field_dict.update(self.additional_properties)
18
-
19
- return field_dict
20
-
21
- @classmethod
22
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
23
- d = src_dict.copy()
24
- function_deployment_pod_template_type_0 = cls()
25
-
26
- function_deployment_pod_template_type_0.additional_properties = d
27
- return function_deployment_pod_template_type_0
28
-
29
- @property
30
- def additional_keys(self) -> list[str]:
31
- return list(self.additional_properties.keys())
32
-
33
- def __getitem__(self, key: str) -> Any:
34
- return self.additional_properties[key]
35
-
36
- def __setitem__(self, key: str, value: Any) -> None:
37
- self.additional_properties[key] = value
38
-
39
- def __delitem__(self, key: str) -> None:
40
- del self.additional_properties[key]
41
-
42
- def __contains__(self, key: str) -> bool:
43
- return key in self.additional_properties
@@ -1,176 +0,0 @@
1
- from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
2
-
3
- from attrs import define as _attrs_define
4
- from attrs import field as _attrs_field
5
-
6
- from ..types import UNSET, Unset
7
-
8
- if TYPE_CHECKING:
9
- from ..models.function_deployment import FunctionDeployment
10
- from ..models.labels_type_0 import LabelsType0
11
-
12
-
13
- T = TypeVar("T", bound="FunctionWithDeployments")
14
-
15
-
16
- @_attrs_define
17
- class FunctionWithDeployments:
18
- """Logical object representing a function but with deployment definition inside
19
-
20
- Attributes:
21
- created_at (Union[Unset, str]): The date and time when the resource was created
22
- created_by (Union[Unset, str]): The user or service account who created the resource
23
- updated_at (Union[Unset, str]): The date and time when the resource was updated
24
- updated_by (Union[Unset, str]): The user or service account who updated the resource
25
- display_name (Union[Unset, str]): Function display name
26
- labels (Union['LabelsType0', None, Unset]): Labels
27
- name (Union[Unset, str]): Function name
28
- workspace (Union[Unset, str]): Workspace name
29
- deployments (Union[Unset, list['FunctionDeployment']]):
30
- """
31
-
32
- created_at: Union[Unset, str] = UNSET
33
- created_by: Union[Unset, str] = UNSET
34
- updated_at: Union[Unset, str] = UNSET
35
- updated_by: Union[Unset, str] = UNSET
36
- display_name: Union[Unset, str] = UNSET
37
- labels: Union["LabelsType0", None, Unset] = UNSET
38
- name: Union[Unset, str] = UNSET
39
- workspace: Union[Unset, str] = UNSET
40
- deployments: Union[Unset, list["FunctionDeployment"]] = UNSET
41
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
42
-
43
- def to_dict(self) -> dict[str, Any]:
44
- from ..models.labels_type_0 import LabelsType0
45
-
46
- created_at = self.created_at
47
-
48
- created_by = self.created_by
49
-
50
- updated_at = self.updated_at
51
-
52
- updated_by = self.updated_by
53
-
54
- display_name = self.display_name
55
-
56
- labels: Union[None, Unset, dict[str, Any]]
57
- if isinstance(self.labels, Unset):
58
- labels = UNSET
59
- elif isinstance(self.labels, LabelsType0):
60
- labels = self.labels.to_dict()
61
- else:
62
- labels = self.labels
63
-
64
- name = self.name
65
-
66
- workspace = self.workspace
67
-
68
- deployments: Union[Unset, list[dict[str, Any]]] = UNSET
69
- if not isinstance(self.deployments, Unset):
70
- deployments = []
71
- for componentsschemas_function_deployments_item_data in self.deployments:
72
- componentsschemas_function_deployments_item = componentsschemas_function_deployments_item_data.to_dict()
73
- deployments.append(componentsschemas_function_deployments_item)
74
-
75
- field_dict: dict[str, Any] = {}
76
- field_dict.update(self.additional_properties)
77
- field_dict.update({})
78
- if created_at is not UNSET:
79
- field_dict["created_at"] = created_at
80
- if created_by is not UNSET:
81
- field_dict["created_by"] = created_by
82
- if updated_at is not UNSET:
83
- field_dict["updated_at"] = updated_at
84
- if updated_by is not UNSET:
85
- field_dict["updated_by"] = updated_by
86
- if display_name is not UNSET:
87
- field_dict["display_name"] = display_name
88
- if labels is not UNSET:
89
- field_dict["labels"] = labels
90
- if name is not UNSET:
91
- field_dict["name"] = name
92
- if workspace is not UNSET:
93
- field_dict["workspace"] = workspace
94
- if deployments is not UNSET:
95
- field_dict["deployments"] = deployments
96
-
97
- return field_dict
98
-
99
- @classmethod
100
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
101
- from ..models.function_deployment import FunctionDeployment
102
- from ..models.labels_type_0 import LabelsType0
103
-
104
- if not src_dict:
105
- return None
106
- d = src_dict.copy()
107
- created_at = d.pop("created_at", UNSET)
108
-
109
- created_by = d.pop("created_by", UNSET)
110
-
111
- updated_at = d.pop("updated_at", UNSET)
112
-
113
- updated_by = d.pop("updated_by", UNSET)
114
-
115
- display_name = d.pop("display_name", UNSET)
116
-
117
- def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
118
- if data is None:
119
- return data
120
- if isinstance(data, Unset):
121
- return data
122
- try:
123
- if not isinstance(data, dict):
124
- raise TypeError()
125
- componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
126
-
127
- return componentsschemas_labels_type_0
128
- except: # noqa: E722
129
- pass
130
- return cast(Union["LabelsType0", None, Unset], data)
131
-
132
- labels = _parse_labels(d.pop("labels", UNSET))
133
-
134
- name = d.pop("name", UNSET)
135
-
136
- workspace = d.pop("workspace", UNSET)
137
-
138
- deployments = []
139
- _deployments = d.pop("deployments", UNSET)
140
- for componentsschemas_function_deployments_item_data in _deployments or []:
141
- componentsschemas_function_deployments_item = FunctionDeployment.from_dict(
142
- componentsschemas_function_deployments_item_data
143
- )
144
-
145
- deployments.append(componentsschemas_function_deployments_item)
146
-
147
- function_with_deployments = cls(
148
- created_at=created_at,
149
- created_by=created_by,
150
- updated_at=updated_at,
151
- updated_by=updated_by,
152
- display_name=display_name,
153
- labels=labels,
154
- name=name,
155
- workspace=workspace,
156
- deployments=deployments,
157
- )
158
-
159
- function_with_deployments.additional_properties = d
160
- return function_with_deployments
161
-
162
- @property
163
- def additional_keys(self) -> list[str]:
164
- return list(self.additional_properties.keys())
165
-
166
- def __getitem__(self, key: str) -> Any:
167
- return self.additional_properties[key]
168
-
169
- def __setitem__(self, key: str, value: Any) -> None:
170
- self.additional_properties[key] = value
171
-
172
- def __delitem__(self, key: str) -> None:
173
- del self.additional_properties[key]
174
-
175
- def __contains__(self, key: str) -> bool:
176
- return key in self.additional_properties