beamlit 0.0.24rc20__py3-none-any.whl → 0.0.25__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.25.dist-info}/METADATA +1 -1
  101. beamlit-0.0.25.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.25.dist-info}/WHEEL +0 -0
@@ -1,198 +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.integration_config import IntegrationConfig
10
- from ..models.integration_secret import IntegrationSecret
11
- from ..models.labels_type_0 import LabelsType0
12
-
13
-
14
- T = TypeVar("T", bound="Integration")
15
-
16
-
17
- @_attrs_define
18
- class Integration:
19
- """Model provider
20
-
21
- Attributes:
22
- created_at (Union[Unset, str]): The date and time when the resource was created
23
- created_by (Union[Unset, str]): The user or service account who created the resource
24
- updated_at (Union[Unset, str]): The date and time when the resource was updated
25
- updated_by (Union[Unset, str]): The user or service account who updated the resource
26
- config (Union[Unset, IntegrationConfig]): Integration config
27
- display_name (Union[Unset, str]): Integration display name
28
- labels (Union['LabelsType0', None, Unset]): Labels
29
- name (Union[Unset, str]): Integration name
30
- secret (Union[Unset, IntegrationSecret]): Integration secret
31
- type_ (Union[Unset, str]): Integration type
32
- workspace (Union[Unset, str]): Workspace name
33
- """
34
-
35
- created_at: Union[Unset, str] = UNSET
36
- created_by: Union[Unset, str] = UNSET
37
- updated_at: Union[Unset, str] = UNSET
38
- updated_by: Union[Unset, str] = UNSET
39
- config: Union[Unset, "IntegrationConfig"] = UNSET
40
- display_name: Union[Unset, str] = UNSET
41
- labels: Union["LabelsType0", None, Unset] = UNSET
42
- name: Union[Unset, str] = UNSET
43
- secret: Union[Unset, "IntegrationSecret"] = UNSET
44
- type_: Union[Unset, str] = UNSET
45
- workspace: Union[Unset, str] = UNSET
46
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
47
-
48
- def to_dict(self) -> dict[str, Any]:
49
- from ..models.labels_type_0 import LabelsType0
50
-
51
- created_at = self.created_at
52
-
53
- created_by = self.created_by
54
-
55
- updated_at = self.updated_at
56
-
57
- updated_by = self.updated_by
58
-
59
- config: Union[Unset, dict[str, Any]] = UNSET
60
- if not isinstance(self.config, Unset):
61
- config = self.config.to_dict()
62
-
63
- display_name = self.display_name
64
-
65
- labels: Union[None, Unset, dict[str, Any]]
66
- if isinstance(self.labels, Unset):
67
- labels = UNSET
68
- elif isinstance(self.labels, LabelsType0):
69
- labels = self.labels.to_dict()
70
- else:
71
- labels = self.labels
72
-
73
- name = self.name
74
-
75
- secret: Union[Unset, dict[str, Any]] = UNSET
76
- if not isinstance(self.secret, Unset):
77
- secret = self.secret.to_dict()
78
-
79
- type_ = self.type_
80
-
81
- workspace = self.workspace
82
-
83
- field_dict: dict[str, Any] = {}
84
- field_dict.update(self.additional_properties)
85
- field_dict.update({})
86
- if created_at is not UNSET:
87
- field_dict["created_at"] = created_at
88
- if created_by is not UNSET:
89
- field_dict["created_by"] = created_by
90
- if updated_at is not UNSET:
91
- field_dict["updated_at"] = updated_at
92
- if updated_by is not UNSET:
93
- field_dict["updated_by"] = updated_by
94
- if config is not UNSET:
95
- field_dict["config"] = config
96
- if display_name is not UNSET:
97
- field_dict["display_name"] = display_name
98
- if labels is not UNSET:
99
- field_dict["labels"] = labels
100
- if name is not UNSET:
101
- field_dict["name"] = name
102
- if secret is not UNSET:
103
- field_dict["secret"] = secret
104
- if type_ is not UNSET:
105
- field_dict["type"] = type_
106
- if workspace is not UNSET:
107
- field_dict["workspace"] = workspace
108
-
109
- return field_dict
110
-
111
- @classmethod
112
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
113
- from ..models.integration_config import IntegrationConfig
114
- from ..models.integration_secret import IntegrationSecret
115
- from ..models.labels_type_0 import LabelsType0
116
-
117
- if not src_dict:
118
- return None
119
- d = src_dict.copy()
120
- created_at = d.pop("created_at", UNSET)
121
-
122
- created_by = d.pop("created_by", UNSET)
123
-
124
- updated_at = d.pop("updated_at", UNSET)
125
-
126
- updated_by = d.pop("updated_by", UNSET)
127
-
128
- _config = d.pop("config", UNSET)
129
- config: Union[Unset, IntegrationConfig]
130
- if isinstance(_config, Unset):
131
- config = UNSET
132
- else:
133
- config = IntegrationConfig.from_dict(_config)
134
-
135
- display_name = d.pop("display_name", UNSET)
136
-
137
- def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
138
- if data is None:
139
- return data
140
- if isinstance(data, Unset):
141
- return data
142
- try:
143
- if not isinstance(data, dict):
144
- raise TypeError()
145
- componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
146
-
147
- return componentsschemas_labels_type_0
148
- except: # noqa: E722
149
- pass
150
- return cast(Union["LabelsType0", None, Unset], data)
151
-
152
- labels = _parse_labels(d.pop("labels", UNSET))
153
-
154
- name = d.pop("name", UNSET)
155
-
156
- _secret = d.pop("secret", UNSET)
157
- secret: Union[Unset, IntegrationSecret]
158
- if isinstance(_secret, Unset):
159
- secret = UNSET
160
- else:
161
- secret = IntegrationSecret.from_dict(_secret)
162
-
163
- type_ = d.pop("type", UNSET)
164
-
165
- workspace = d.pop("workspace", UNSET)
166
-
167
- integration = cls(
168
- created_at=created_at,
169
- created_by=created_by,
170
- updated_at=updated_at,
171
- updated_by=updated_by,
172
- config=config,
173
- display_name=display_name,
174
- labels=labels,
175
- name=name,
176
- secret=secret,
177
- type_=type_,
178
- workspace=workspace,
179
- )
180
-
181
- integration.additional_properties = d
182
- return integration
183
-
184
- @property
185
- def additional_keys(self) -> list[str]:
186
- return list(self.additional_properties.keys())
187
-
188
- def __getitem__(self, key: str) -> Any:
189
- return self.additional_properties[key]
190
-
191
- def __setitem__(self, key: str, value: Any) -> None:
192
- self.additional_properties[key] = value
193
-
194
- def __delitem__(self, key: str) -> None:
195
- del self.additional_properties[key]
196
-
197
- def __contains__(self, key: str) -> bool:
198
- 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="IntegrationConfig")
7
-
8
-
9
- @_attrs_define
10
- class IntegrationConfig:
11
- """Integration config"""
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
- integration_config = cls()
27
-
28
- integration_config.additional_properties = d
29
- return integration_config
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,61 +0,0 @@
1
- from typing import Any, TypeVar, Union
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
- T = TypeVar("T", bound="IntegrationSecret")
9
-
10
-
11
- @_attrs_define
12
- class IntegrationSecret:
13
- """Integration secret
14
-
15
- Attributes:
16
- api_key (Union[Unset, str]): The API key to use for the integration
17
- """
18
-
19
- api_key: Union[Unset, str] = UNSET
20
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
21
-
22
- def to_dict(self) -> dict[str, Any]:
23
- api_key = self.api_key
24
-
25
- field_dict: dict[str, Any] = {}
26
- field_dict.update(self.additional_properties)
27
- field_dict.update({})
28
- if api_key is not UNSET:
29
- field_dict["api_key"] = api_key
30
-
31
- return field_dict
32
-
33
- @classmethod
34
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
35
- if not src_dict:
36
- return None
37
- d = src_dict.copy()
38
- api_key = d.pop("api_key", UNSET)
39
-
40
- integration_secret = cls(
41
- api_key=api_key,
42
- )
43
-
44
- integration_secret.additional_properties = d
45
- return integration_secret
46
-
47
- @property
48
- def additional_keys(self) -> list[str]:
49
- return list(self.additional_properties.keys())
50
-
51
- def __getitem__(self, key: str) -> Any:
52
- return self.additional_properties[key]
53
-
54
- def __setitem__(self, key: str, value: Any) -> None:
55
- self.additional_properties[key] = value
56
-
57
- def __delitem__(self, key: str) -> None:
58
- del self.additional_properties[key]
59
-
60
- def __contains__(self, key: str) -> bool:
61
- 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="LabelsType0")
7
-
8
-
9
- @_attrs_define
10
- class LabelsType0:
11
- """Labels"""
12
-
13
- additional_properties: dict[str, str] = _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
- labels_type_0 = cls()
27
-
28
- labels_type_0.additional_properties = d
29
- return labels_type_0
30
-
31
- @property
32
- def additional_keys(self) -> list[str]:
33
- return list(self.additional_properties.keys())
34
-
35
- def __getitem__(self, key: str) -> str:
36
- return self.additional_properties[key]
37
-
38
- def __setitem__(self, key: str, value: str) -> 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,122 +0,0 @@
1
- from typing import TYPE_CHECKING, Any, TypeVar, Union
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.flavor import Flavor
10
-
11
-
12
- T = TypeVar("T", bound="Location")
13
-
14
-
15
- @_attrs_define
16
- class Location:
17
- """Location availability for policies
18
-
19
- Attributes:
20
- continent (Union[Unset, str]): Location continent
21
- country (Union[Unset, str]): Location country
22
- flavors (Union[Unset, list['Flavor']]): Location flavors
23
- location (Union[Unset, str]): Location name
24
- name (Union[Unset, str]): Location name
25
- status (Union[Unset, str]): Location status
26
- """
27
-
28
- continent: Union[Unset, str] = UNSET
29
- country: Union[Unset, str] = UNSET
30
- flavors: Union[Unset, list["Flavor"]] = UNSET
31
- location: Union[Unset, str] = UNSET
32
- name: Union[Unset, str] = UNSET
33
- status: Union[Unset, str] = UNSET
34
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
35
-
36
- def to_dict(self) -> dict[str, Any]:
37
- continent = self.continent
38
-
39
- country = self.country
40
-
41
- flavors: Union[Unset, list[dict[str, Any]]] = UNSET
42
- if not isinstance(self.flavors, Unset):
43
- flavors = []
44
- for flavors_item_data in self.flavors:
45
- flavors_item = flavors_item_data.to_dict()
46
- flavors.append(flavors_item)
47
-
48
- location = self.location
49
-
50
- name = self.name
51
-
52
- status = self.status
53
-
54
- field_dict: dict[str, Any] = {}
55
- field_dict.update(self.additional_properties)
56
- field_dict.update({})
57
- if continent is not UNSET:
58
- field_dict["continent"] = continent
59
- if country is not UNSET:
60
- field_dict["country"] = country
61
- if flavors is not UNSET:
62
- field_dict["flavors"] = flavors
63
- if location is not UNSET:
64
- field_dict["location"] = location
65
- if name is not UNSET:
66
- field_dict["name"] = name
67
- if status is not UNSET:
68
- field_dict["status"] = status
69
-
70
- return field_dict
71
-
72
- @classmethod
73
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
74
- from ..models.flavor import Flavor
75
-
76
- if not src_dict:
77
- return None
78
- d = src_dict.copy()
79
- continent = d.pop("continent", UNSET)
80
-
81
- country = d.pop("country", UNSET)
82
-
83
- flavors = []
84
- _flavors = d.pop("flavors", UNSET)
85
- for flavors_item_data in _flavors or []:
86
- flavors_item = Flavor.from_dict(flavors_item_data)
87
-
88
- flavors.append(flavors_item)
89
-
90
- location = d.pop("location", UNSET)
91
-
92
- name = d.pop("name", UNSET)
93
-
94
- status = d.pop("status", UNSET)
95
-
96
- location = cls(
97
- continent=continent,
98
- country=country,
99
- flavors=flavors,
100
- location=location,
101
- name=name,
102
- status=status,
103
- )
104
-
105
- location.additional_properties = d
106
- return location
107
-
108
- @property
109
- def additional_keys(self) -> list[str]:
110
- return list(self.additional_properties.keys())
111
-
112
- def __getitem__(self, key: str) -> Any:
113
- return self.additional_properties[key]
114
-
115
- def __setitem__(self, key: str, value: Any) -> None:
116
- self.additional_properties[key] = value
117
-
118
- def __delitem__(self, key: str) -> None:
119
- del self.additional_properties[key]
120
-
121
- def __contains__(self, key: str) -> bool:
122
- return key in self.additional_properties