beamlit 0.0.57rc108__py3-none-any.whl → 0.0.57rc110__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. beamlit/agents/chain.py +0 -2
  2. beamlit/agents/chat.py +1 -8
  3. beamlit/agents/decorator.py +5 -15
  4. beamlit/api/agents/delete_agent.py +1 -22
  5. beamlit/api/agents/get_agent.py +1 -22
  6. beamlit/api/agents/get_agent_metrics.py +13 -34
  7. beamlit/api/agents/get_agent_trace_ids.py +44 -14
  8. beamlit/api/agents/{list_agent_history.py → list_agent_revisions.py} +21 -17
  9. beamlit/api/agents/list_agents.py +4 -36
  10. beamlit/api/default/get_trace_ids.py +0 -15
  11. beamlit/api/default/list_mcp_hub_definitions.py +12 -12
  12. beamlit/api/functions/delete_function.py +1 -22
  13. beamlit/api/functions/get_function.py +1 -22
  14. beamlit/api/functions/get_function_metrics.py +13 -34
  15. beamlit/api/functions/get_function_trace_ids.py +44 -14
  16. beamlit/api/functions/{create_function_release.py → list_function_revisions.py} +26 -18
  17. beamlit/api/functions/list_functions.py +4 -36
  18. beamlit/api/knowledgebases/create_knowledgebase.py +4 -4
  19. beamlit/api/knowledgebases/delete_knowledgebase.py +5 -26
  20. beamlit/api/knowledgebases/get_knowledgebase.py +1 -22
  21. beamlit/api/{environments/get_environment_metrics.py → knowledgebases/list_knowledgebase_revisions.py} +34 -34
  22. beamlit/api/knowledgebases/list_knowledgebases.py +4 -36
  23. beamlit/api/models/create_model.py +4 -8
  24. beamlit/api/models/delete_model.py +1 -22
  25. beamlit/api/models/get_model.py +1 -22
  26. beamlit/api/models/get_model_metrics.py +13 -34
  27. beamlit/api/models/get_model_trace_ids.py +44 -14
  28. beamlit/api/models/{release_model.py → list_model_revisions.py} +26 -22
  29. beamlit/api/models/list_models.py +4 -36
  30. beamlit/api/models/update_model.py +4 -8
  31. beamlit/authentication/credentials.py +2 -7
  32. beamlit/common/settings.py +1 -4
  33. beamlit/deploy/deploy.py +5 -8
  34. beamlit/functions/mcp/mcp.py +3 -4
  35. beamlit/functions/remote/remote.py +1 -5
  36. beamlit/models/__init__.py +8 -38
  37. beamlit/models/agent.py +6 -6
  38. beamlit/models/function.py +6 -6
  39. beamlit/models/knowledgebase.py +6 -6
  40. beamlit/models/last_n_requests_metric.py +0 -9
  41. beamlit/models/model.py +7 -7
  42. beamlit/models/{resource_environment_metrics.py → resource_metrics.py} +20 -26
  43. beamlit/models/{resource_environment_metrics_request_total_per_code.py → resource_metrics_request_total_per_code.py} +5 -5
  44. beamlit/models/{resource_environment_metrics_rps_per_code.py → resource_metrics_rps_per_code.py} +5 -5
  45. beamlit/models/{model_release.py → revision_metadata.py} +20 -20
  46. beamlit/models/runtime.py +2 -2
  47. beamlit/models/workspace.py +0 -9
  48. beamlit/run.py +1 -4
  49. beamlit/serve/app.py +4 -8
  50. {beamlit-0.0.57rc108.dist-info → beamlit-0.0.57rc110.dist-info}/METADATA +1 -1
  51. {beamlit-0.0.57rc108.dist-info → beamlit-0.0.57rc110.dist-info}/RECORD +57 -86
  52. beamlit/api/agents/create_agent_release.py +0 -146
  53. beamlit/api/agents/delete_agent_history.py +0 -155
  54. beamlit/api/agents/get_agent_history.py +0 -155
  55. beamlit/api/agents/put_agent_history.py +0 -181
  56. beamlit/api/environments/__init__.py +0 -0
  57. beamlit/api/environments/create_environment.py +0 -167
  58. beamlit/api/environments/delete_environment.py +0 -154
  59. beamlit/api/environments/get_environment.py +0 -154
  60. beamlit/api/environments/list_environments.py +0 -139
  61. beamlit/api/environments/update_environment.py +0 -180
  62. beamlit/api/generation/__init__.py +0 -0
  63. beamlit/api/generation/run_information_generation_agent.py +0 -168
  64. beamlit/api/history/__init__.py +0 -0
  65. beamlit/api/history/get_agents_history.py +0 -155
  66. beamlit/api/history/list_agents_history.py +0 -131
  67. beamlit/models/agent_history.py +0 -167
  68. beamlit/models/agent_history_event.py +0 -133
  69. beamlit/models/agent_information_request.py +0 -63
  70. beamlit/models/agent_information_response.py +0 -79
  71. beamlit/models/agent_release.py +0 -70
  72. beamlit/models/environment.py +0 -96
  73. beamlit/models/environment_metadata.py +0 -148
  74. beamlit/models/environment_metrics.py +0 -77
  75. beamlit/models/environment_spec.py +0 -63
  76. beamlit/models/function_release.py +0 -70
  77. beamlit/models/knowledgebase_release.py +0 -70
  78. beamlit/models/mcp_hub_artifact.py +0 -188
  79. beamlit/models/mcp_hub_artifact_entrypoint.py +0 -45
  80. beamlit/models/mcp_hub_artifact_form.py +0 -45
  81. /beamlit/api/agents/{get_agent_environment_logs.py → get_agent_logs.py} +0 -0
  82. /beamlit/api/functions/{get_function_environment_logs.py → get_function_logs.py} +0 -0
  83. /beamlit/api/models/{get_model_environment_logs.py → get_model_logs.py} +0 -0
  84. {beamlit-0.0.57rc108.dist-info → beamlit-0.0.57rc110.dist-info}/WHEEL +0 -0
  85. {beamlit-0.0.57rc108.dist-info → beamlit-0.0.57rc110.dist-info}/entry_points.txt +0 -0
  86. {beamlit-0.0.57rc108.dist-info → beamlit-0.0.57rc110.dist-info}/licenses/LICENSE +0 -0
@@ -1,167 +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.agent_history_event import AgentHistoryEvent
10
-
11
-
12
- T = TypeVar("T", bound="AgentHistory")
13
-
14
-
15
- @_attrs_define
16
- class AgentHistory:
17
- """Agent deployment history
18
-
19
- Attributes:
20
- created_at (Union[Unset, str]): The date and time when the resource was created
21
- updated_at (Union[Unset, str]): The date and time when the resource was updated
22
- agent (Union[Unset, str]): Agent name
23
- end (Union[Unset, str]): End time
24
- environment (Union[Unset, str]): Environment name
25
- events (Union[Unset, list['AgentHistoryEvent']]): Events
26
- request_id (Union[Unset, str]): Request ID
27
- start (Union[Unset, str]): Start time
28
- status (Union[Unset, str]): Status, eg: running, success, failed
29
- took (Union[Unset, int]): Number of milliseconds it took to complete the event
30
- workspace (Union[Unset, str]): The workspace the agent deployment belongs to
31
- """
32
-
33
- created_at: Union[Unset, str] = UNSET
34
- updated_at: Union[Unset, str] = UNSET
35
- agent: Union[Unset, str] = UNSET
36
- end: Union[Unset, str] = UNSET
37
- environment: Union[Unset, str] = UNSET
38
- events: Union[Unset, list["AgentHistoryEvent"]] = UNSET
39
- request_id: Union[Unset, str] = UNSET
40
- start: Union[Unset, str] = UNSET
41
- status: Union[Unset, str] = UNSET
42
- took: Union[Unset, int] = UNSET
43
- workspace: Union[Unset, str] = UNSET
44
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
45
-
46
- def to_dict(self) -> dict[str, Any]:
47
- created_at = self.created_at
48
-
49
- updated_at = self.updated_at
50
-
51
- agent = self.agent
52
-
53
- end = self.end
54
-
55
- environment = self.environment
56
-
57
- events: Union[Unset, list[dict[str, Any]]] = UNSET
58
- if not isinstance(self.events, Unset):
59
- events = []
60
- for events_item_data in self.events:
61
- events_item = events_item_data.to_dict()
62
- events.append(events_item)
63
-
64
- request_id = self.request_id
65
-
66
- start = self.start
67
-
68
- status = self.status
69
-
70
- took = self.took
71
-
72
- workspace = self.workspace
73
-
74
- field_dict: dict[str, Any] = {}
75
- field_dict.update(self.additional_properties)
76
- field_dict.update({})
77
- if created_at is not UNSET:
78
- field_dict["createdAt"] = created_at
79
- if updated_at is not UNSET:
80
- field_dict["updatedAt"] = updated_at
81
- if agent is not UNSET:
82
- field_dict["agent"] = agent
83
- if end is not UNSET:
84
- field_dict["end"] = end
85
- if environment is not UNSET:
86
- field_dict["environment"] = environment
87
- if events is not UNSET:
88
- field_dict["events"] = events
89
- if request_id is not UNSET:
90
- field_dict["request_id"] = request_id
91
- if start is not UNSET:
92
- field_dict["start"] = start
93
- if status is not UNSET:
94
- field_dict["status"] = status
95
- if took is not UNSET:
96
- field_dict["took"] = took
97
- if workspace is not UNSET:
98
- field_dict["workspace"] = workspace
99
-
100
- return field_dict
101
-
102
- @classmethod
103
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
104
- from ..models.agent_history_event import AgentHistoryEvent
105
-
106
- if not src_dict:
107
- return None
108
- d = src_dict.copy()
109
- created_at = d.pop("createdAt", UNSET)
110
-
111
- updated_at = d.pop("updatedAt", UNSET)
112
-
113
- agent = d.pop("agent", UNSET)
114
-
115
- end = d.pop("end", UNSET)
116
-
117
- environment = d.pop("environment", UNSET)
118
-
119
- events = []
120
- _events = d.pop("events", UNSET)
121
- for events_item_data in _events or []:
122
- events_item = AgentHistoryEvent.from_dict(events_item_data)
123
-
124
- events.append(events_item)
125
-
126
- request_id = d.pop("request_id", UNSET)
127
-
128
- start = d.pop("start", UNSET)
129
-
130
- status = d.pop("status", UNSET)
131
-
132
- took = d.pop("took", UNSET)
133
-
134
- workspace = d.pop("workspace", UNSET)
135
-
136
- agent_history = cls(
137
- created_at=created_at,
138
- updated_at=updated_at,
139
- agent=agent,
140
- end=end,
141
- environment=environment,
142
- events=events,
143
- request_id=request_id,
144
- start=start,
145
- status=status,
146
- took=took,
147
- workspace=workspace,
148
- )
149
-
150
- agent_history.additional_properties = d
151
- return agent_history
152
-
153
- @property
154
- def additional_keys(self) -> list[str]:
155
- return list(self.additional_properties.keys())
156
-
157
- def __getitem__(self, key: str) -> Any:
158
- return self.additional_properties[key]
159
-
160
- def __setitem__(self, key: str, value: Any) -> None:
161
- self.additional_properties[key] = value
162
-
163
- def __delitem__(self, key: str) -> None:
164
- del self.additional_properties[key]
165
-
166
- def __contains__(self, key: str) -> bool:
167
- return key in self.additional_properties
@@ -1,133 +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="AgentHistoryEvent")
9
-
10
-
11
- @_attrs_define
12
- class AgentHistoryEvent:
13
- """Agent deployment history event
14
-
15
- Attributes:
16
- end (Union[Unset, str]): End time
17
- error (Union[Unset, str]): Error message
18
- name (Union[Unset, str]): Name of the function or agent
19
- parameters (Union[Unset, str]): Parameters
20
- start (Union[Unset, str]): Start time
21
- status (Union[Unset, str]): Status, eg: running, success, failed
22
- sub_function (Union[Unset, str]): Function used in kit if a kit was used
23
- took (Union[Unset, int]): Number of milliseconds it took to complete the event
24
- type_ (Union[Unset, str]): Type, one of function or agent
25
- """
26
-
27
- end: Union[Unset, str] = UNSET
28
- error: Union[Unset, str] = UNSET
29
- name: Union[Unset, str] = UNSET
30
- parameters: Union[Unset, str] = UNSET
31
- start: Union[Unset, str] = UNSET
32
- status: Union[Unset, str] = UNSET
33
- sub_function: Union[Unset, str] = UNSET
34
- took: Union[Unset, int] = UNSET
35
- type_: Union[Unset, str] = UNSET
36
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
37
-
38
- def to_dict(self) -> dict[str, Any]:
39
- end = self.end
40
-
41
- error = self.error
42
-
43
- name = self.name
44
-
45
- parameters = self.parameters
46
-
47
- start = self.start
48
-
49
- status = self.status
50
-
51
- sub_function = self.sub_function
52
-
53
- took = self.took
54
-
55
- type_ = self.type_
56
-
57
- field_dict: dict[str, Any] = {}
58
- field_dict.update(self.additional_properties)
59
- field_dict.update({})
60
- if end is not UNSET:
61
- field_dict["end"] = end
62
- if error is not UNSET:
63
- field_dict["error"] = error
64
- if name is not UNSET:
65
- field_dict["name"] = name
66
- if parameters is not UNSET:
67
- field_dict["parameters"] = parameters
68
- if start is not UNSET:
69
- field_dict["start"] = start
70
- if status is not UNSET:
71
- field_dict["status"] = status
72
- if sub_function is not UNSET:
73
- field_dict["subFunction"] = sub_function
74
- if took is not UNSET:
75
- field_dict["took"] = took
76
- if type_ is not UNSET:
77
- field_dict["type"] = type_
78
-
79
- return field_dict
80
-
81
- @classmethod
82
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
83
- if not src_dict:
84
- return None
85
- d = src_dict.copy()
86
- end = d.pop("end", UNSET)
87
-
88
- error = d.pop("error", UNSET)
89
-
90
- name = d.pop("name", UNSET)
91
-
92
- parameters = d.pop("parameters", UNSET)
93
-
94
- start = d.pop("start", UNSET)
95
-
96
- status = d.pop("status", UNSET)
97
-
98
- sub_function = d.pop("subFunction", UNSET)
99
-
100
- took = d.pop("took", UNSET)
101
-
102
- type_ = d.pop("type", UNSET)
103
-
104
- agent_history_event = cls(
105
- end=end,
106
- error=error,
107
- name=name,
108
- parameters=parameters,
109
- start=start,
110
- status=status,
111
- sub_function=sub_function,
112
- took=took,
113
- type_=type_,
114
- )
115
-
116
- agent_history_event.additional_properties = d
117
- return agent_history_event
118
-
119
- @property
120
- def additional_keys(self) -> list[str]:
121
- return list(self.additional_properties.keys())
122
-
123
- def __getitem__(self, key: str) -> Any:
124
- return self.additional_properties[key]
125
-
126
- def __setitem__(self, key: str, value: Any) -> None:
127
- self.additional_properties[key] = value
128
-
129
- def __delitem__(self, key: str) -> None:
130
- del self.additional_properties[key]
131
-
132
- def __contains__(self, key: str) -> bool:
133
- return key in self.additional_properties
@@ -1,63 +0,0 @@
1
- from typing import 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
- T = TypeVar("T", bound="AgentInformationRequest")
9
-
10
-
11
- @_attrs_define
12
- class AgentInformationRequest:
13
- """generation agent information request
14
-
15
- Attributes:
16
- functions (Union[Unset, list[Any]]): Functions to generate information for
17
- """
18
-
19
- functions: Union[Unset, list[Any]] = UNSET
20
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
21
-
22
- def to_dict(self) -> dict[str, Any]:
23
- functions: Union[Unset, list[Any]] = UNSET
24
- if not isinstance(self.functions, Unset):
25
- functions = self.functions
26
-
27
- field_dict: dict[str, Any] = {}
28
- field_dict.update(self.additional_properties)
29
- field_dict.update({})
30
- if functions is not UNSET:
31
- field_dict["functions"] = functions
32
-
33
- return field_dict
34
-
35
- @classmethod
36
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
37
- if not src_dict:
38
- return None
39
- d = src_dict.copy()
40
- functions = cast(list[Any], d.pop("functions", UNSET))
41
-
42
- agent_information_request = cls(
43
- functions=functions,
44
- )
45
-
46
- agent_information_request.additional_properties = d
47
- return agent_information_request
48
-
49
- @property
50
- def additional_keys(self) -> list[str]:
51
- return list(self.additional_properties.keys())
52
-
53
- def __getitem__(self, key: str) -> Any:
54
- return self.additional_properties[key]
55
-
56
- def __setitem__(self, key: str, value: Any) -> None:
57
- self.additional_properties[key] = value
58
-
59
- def __delitem__(self, key: str) -> None:
60
- del self.additional_properties[key]
61
-
62
- def __contains__(self, key: str) -> bool:
63
- return key in self.additional_properties
@@ -1,79 +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="AgentInformationResponse")
9
-
10
-
11
- @_attrs_define
12
- class AgentInformationResponse:
13
- """generation agent information response
14
-
15
- Attributes:
16
- description (Union[Unset, str]): Description of the agent
17
- display_name (Union[Unset, str]): Display name of the agent
18
- prompt (Union[Unset, str]): Prompt of the agent
19
- """
20
-
21
- description: Union[Unset, str] = UNSET
22
- display_name: Union[Unset, str] = UNSET
23
- prompt: Union[Unset, str] = UNSET
24
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
-
26
- def to_dict(self) -> dict[str, Any]:
27
- description = self.description
28
-
29
- display_name = self.display_name
30
-
31
- prompt = self.prompt
32
-
33
- field_dict: dict[str, Any] = {}
34
- field_dict.update(self.additional_properties)
35
- field_dict.update({})
36
- if description is not UNSET:
37
- field_dict["description"] = description
38
- if display_name is not UNSET:
39
- field_dict["displayName"] = display_name
40
- if prompt is not UNSET:
41
- field_dict["prompt"] = prompt
42
-
43
- return field_dict
44
-
45
- @classmethod
46
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
47
- if not src_dict:
48
- return None
49
- d = src_dict.copy()
50
- description = d.pop("description", UNSET)
51
-
52
- display_name = d.pop("displayName", UNSET)
53
-
54
- prompt = d.pop("prompt", UNSET)
55
-
56
- agent_information_response = cls(
57
- description=description,
58
- display_name=display_name,
59
- prompt=prompt,
60
- )
61
-
62
- agent_information_response.additional_properties = d
63
- return agent_information_response
64
-
65
- @property
66
- def additional_keys(self) -> list[str]:
67
- return list(self.additional_properties.keys())
68
-
69
- def __getitem__(self, key: str) -> Any:
70
- return self.additional_properties[key]
71
-
72
- def __setitem__(self, key: str, value: Any) -> None:
73
- self.additional_properties[key] = value
74
-
75
- def __delitem__(self, key: str) -> None:
76
- del self.additional_properties[key]
77
-
78
- def __contains__(self, key: str) -> bool:
79
- return key in self.additional_properties
@@ -1,70 +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="AgentRelease")
9
-
10
-
11
- @_attrs_define
12
- class AgentRelease:
13
- """Agent release, used to deploy a agent from one environment to another
14
-
15
- Attributes:
16
- from_ (Union[Unset, str]): Origin environment from which the agent is released
17
- to (Union[Unset, str]): Destination environment to which the agent is released
18
- """
19
-
20
- from_: Union[Unset, str] = UNSET
21
- to: Union[Unset, str] = UNSET
22
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
-
24
- def to_dict(self) -> dict[str, Any]:
25
- from_ = self.from_
26
-
27
- to = self.to
28
-
29
- field_dict: dict[str, Any] = {}
30
- field_dict.update(self.additional_properties)
31
- field_dict.update({})
32
- if from_ is not UNSET:
33
- field_dict["from"] = from_
34
- if to is not UNSET:
35
- field_dict["to"] = to
36
-
37
- return field_dict
38
-
39
- @classmethod
40
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
41
- if not src_dict:
42
- return None
43
- d = src_dict.copy()
44
- from_ = d.pop("from", UNSET)
45
-
46
- to = d.pop("to", UNSET)
47
-
48
- agent_release = cls(
49
- from_=from_,
50
- to=to,
51
- )
52
-
53
- agent_release.additional_properties = d
54
- return agent_release
55
-
56
- @property
57
- def additional_keys(self) -> list[str]:
58
- return list(self.additional_properties.keys())
59
-
60
- def __getitem__(self, key: str) -> Any:
61
- return self.additional_properties[key]
62
-
63
- def __setitem__(self, key: str, value: Any) -> None:
64
- self.additional_properties[key] = value
65
-
66
- def __delitem__(self, key: str) -> None:
67
- del self.additional_properties[key]
68
-
69
- def __contains__(self, key: str) -> bool:
70
- return key in self.additional_properties
@@ -1,96 +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.environment_spec import EnvironmentSpec
10
- from ..models.metadata import Metadata
11
-
12
-
13
- T = TypeVar("T", bound="Environment")
14
-
15
-
16
- @_attrs_define
17
- class Environment:
18
- """Environment on which deployments will be made (e.g. development, production), enforcing multiple policies at once.
19
-
20
- Attributes:
21
- metadata (Union[Unset, Metadata]): Metadata
22
- spec (Union[Unset, EnvironmentSpec]): Environment specification
23
- """
24
-
25
- metadata: Union[Unset, "Metadata"] = UNSET
26
- spec: Union[Unset, "EnvironmentSpec"] = UNSET
27
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
28
-
29
- def to_dict(self) -> dict[str, Any]:
30
- metadata: Union[Unset, dict[str, Any]] = UNSET
31
- if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
32
- metadata = self.metadata.to_dict()
33
- elif self.metadata and isinstance(self.metadata, dict):
34
- metadata = self.metadata
35
-
36
- spec: Union[Unset, dict[str, Any]] = UNSET
37
- if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
38
- spec = self.spec.to_dict()
39
- elif self.spec and isinstance(self.spec, dict):
40
- spec = self.spec
41
-
42
- field_dict: dict[str, Any] = {}
43
- field_dict.update(self.additional_properties)
44
- field_dict.update({})
45
- if metadata is not UNSET:
46
- field_dict["metadata"] = metadata
47
- if spec is not UNSET:
48
- field_dict["spec"] = spec
49
-
50
- return field_dict
51
-
52
- @classmethod
53
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
54
- from ..models.environment_spec import EnvironmentSpec
55
- from ..models.metadata import Metadata
56
-
57
- if not src_dict:
58
- return None
59
- d = src_dict.copy()
60
- _metadata = d.pop("metadata", UNSET)
61
- metadata: Union[Unset, Metadata]
62
- if isinstance(_metadata, Unset):
63
- metadata = UNSET
64
- else:
65
- metadata = Metadata.from_dict(_metadata)
66
-
67
- _spec = d.pop("spec", UNSET)
68
- spec: Union[Unset, EnvironmentSpec]
69
- if isinstance(_spec, Unset):
70
- spec = UNSET
71
- else:
72
- spec = EnvironmentSpec.from_dict(_spec)
73
-
74
- environment = cls(
75
- metadata=metadata,
76
- spec=spec,
77
- )
78
-
79
- environment.additional_properties = d
80
- return environment
81
-
82
- @property
83
- def additional_keys(self) -> list[str]:
84
- return list(self.additional_properties.keys())
85
-
86
- def __getitem__(self, key: str) -> Any:
87
- return self.additional_properties[key]
88
-
89
- def __setitem__(self, key: str, value: Any) -> None:
90
- self.additional_properties[key] = value
91
-
92
- def __delitem__(self, key: str) -> None:
93
- del self.additional_properties[key]
94
-
95
- def __contains__(self, key: str) -> bool:
96
- return key in self.additional_properties