beamlit 0.0.20rc3__py3-none-any.whl → 0.0.20rc5__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. beamlit/api/agents/delete_agent_history.py +155 -0
  2. beamlit/api/agents/get_agent_deployment.py +1 -22
  3. beamlit/api/agents/get_agent_environment_logs.py +151 -0
  4. beamlit/api/agents/get_agent_history.py +155 -0
  5. beamlit/api/agents/list_agent_history.py +151 -0
  6. beamlit/api/agents/put_agent_history.py +181 -0
  7. beamlit/api/functions/get_function_environment_logs.py +151 -0
  8. beamlit/api/models/get_model_environment_logs.py +155 -0
  9. beamlit/authentication/__init__.py +4 -0
  10. beamlit/authentication/apikey.py +6 -0
  11. beamlit/authentication/authentication.py +31 -2
  12. beamlit/authentication/clientcredentials.py +20 -9
  13. beamlit/authentication/credentials.py +1 -0
  14. beamlit/authentication/device_mode.py +10 -1
  15. beamlit/common/generate.py +8 -3
  16. beamlit/common/logger.py +2 -0
  17. beamlit/common/settings.py +1 -5
  18. beamlit/models/__init__.py +28 -30
  19. beamlit/models/acl.py +2 -0
  20. beamlit/models/agent.py +2 -0
  21. beamlit/models/agent_chain.py +2 -0
  22. beamlit/models/agent_configuration.py +2 -0
  23. beamlit/models/agent_deployment.py +44 -99
  24. beamlit/models/agent_deployment_configuration.py +45 -0
  25. beamlit/models/agent_deployment_history.py +15 -46
  26. beamlit/models/agent_deployment_history_event.py +24 -78
  27. beamlit/models/agent_deployment_pod_template.py +45 -0
  28. beamlit/models/agent_history.py +165 -0
  29. beamlit/models/agent_history_event.py +131 -0
  30. beamlit/models/agent_metadata.py +144 -0
  31. beamlit/models/agent_release.py +2 -0
  32. beamlit/models/agent_spec.py +238 -0
  33. beamlit/models/agent_with_deployments.py +2 -0
  34. beamlit/models/api_key.py +2 -0
  35. beamlit/models/authentication_provider_model.py +2 -0
  36. beamlit/models/authentication_provider_organization.py +2 -0
  37. beamlit/models/configuration.py +2 -0
  38. beamlit/models/continent.py +2 -0
  39. beamlit/models/core_spec.py +179 -0
  40. beamlit/models/country.py +2 -0
  41. beamlit/models/create_api_key_for_service_account_body.py +2 -0
  42. beamlit/models/create_workspace_service_account_body.py +2 -0
  43. beamlit/models/create_workspace_service_account_response_200.py +2 -0
  44. beamlit/models/delete_workspace_service_account_response_200.py +2 -0
  45. beamlit/models/deployment_configuration.py +2 -0
  46. beamlit/models/deployment_configurations.py +2 -0
  47. beamlit/models/deployment_serverless_config.py +131 -0
  48. beamlit/models/environment.py +2 -0
  49. beamlit/models/environment_metrics.py +2 -0
  50. beamlit/models/environment_spec.py +61 -0
  51. beamlit/models/flavor.py +2 -0
  52. beamlit/models/function.py +2 -0
  53. beamlit/models/function_configuration.py +2 -0
  54. beamlit/models/function_deployment.py +44 -99
  55. beamlit/models/function_deployment_configuration.py +45 -0
  56. beamlit/models/function_deployment_pod_template.py +45 -0
  57. beamlit/models/function_kit.py +2 -0
  58. beamlit/models/function_metadata.py +144 -0
  59. beamlit/models/function_provider_ref.py +2 -0
  60. beamlit/models/function_release.py +2 -0
  61. beamlit/models/function_spec.py +240 -0
  62. beamlit/models/function_with_deployments.py +2 -0
  63. beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -0
  64. beamlit/models/increase_and_rate_metric.py +2 -0
  65. beamlit/models/integration.py +2 -0
  66. beamlit/models/integration_config.py +2 -0
  67. beamlit/models/integration_connection.py +2 -0
  68. beamlit/models/integration_connection_config.py +2 -0
  69. beamlit/models/integration_connection_secret.py +2 -0
  70. beamlit/models/integration_connection_spec.py +99 -0
  71. beamlit/models/integration_model.py +2 -0
  72. beamlit/models/integration_secret.py +2 -0
  73. beamlit/models/invite_workspace_user_body.py +2 -0
  74. beamlit/models/labels_type_0.py +2 -0
  75. beamlit/models/location.py +2 -0
  76. beamlit/models/location_response.py +2 -0
  77. beamlit/models/metadata.py +135 -0
  78. beamlit/models/metadata_labels.py +43 -0
  79. beamlit/models/metric.py +2 -0
  80. beamlit/models/metrics.py +2 -0
  81. beamlit/models/model.py +2 -0
  82. beamlit/models/model_deployment.py +66 -85
  83. beamlit/models/model_deployment_log.py +2 -0
  84. beamlit/models/model_deployment_metrics.py +2 -0
  85. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +2 -0
  86. beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +2 -0
  87. beamlit/models/model_deployment_pod_template.py +45 -0
  88. beamlit/models/model_metadata.py +144 -0
  89. beamlit/models/model_metrics.py +2 -0
  90. beamlit/models/model_provider.py +2 -0
  91. beamlit/models/model_provider_ref.py +2 -0
  92. beamlit/models/model_release.py +2 -0
  93. beamlit/models/model_spec.py +188 -0
  94. beamlit/models/model_with_deployments.py +2 -0
  95. beamlit/models/owner_fields.py +68 -0
  96. beamlit/models/pending_invitation.py +2 -0
  97. beamlit/models/pending_invitation_accept.py +2 -0
  98. beamlit/models/pending_invitation_render.py +2 -0
  99. beamlit/models/pending_invitation_render_invited_by.py +2 -0
  100. beamlit/models/pending_invitation_render_workspace.py +2 -0
  101. beamlit/models/pending_invitation_workspace_details.py +2 -0
  102. beamlit/models/pod_template_spec.py +43 -0
  103. beamlit/models/policy.py +36 -8
  104. beamlit/models/policy_location.py +2 -0
  105. beamlit/models/policy_spec.py +119 -0
  106. beamlit/models/provider_config.py +2 -0
  107. beamlit/models/qps.py +2 -0
  108. beamlit/models/resource_deployment_log.py +2 -0
  109. beamlit/models/resource_deployment_metrics.py +70 -155
  110. beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
  111. beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +77 -0
  112. beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
  113. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +75 -0
  114. beamlit/models/resource_environment_metrics.py +172 -0
  115. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +75 -0
  116. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
  117. beamlit/models/resource_log.py +68 -0
  118. beamlit/models/resource_metrics.py +2 -0
  119. beamlit/models/runtime.py +14 -29
  120. beamlit/models/runtime_readiness_probe.py +45 -0
  121. beamlit/models/runtime_resources.py +2 -0
  122. beamlit/models/runtime_type_0.py +111 -0
  123. beamlit/models/runtime_type_0_readiness_probe.py +43 -0
  124. beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
  125. beamlit/models/runtime_type_0_resources.py +59 -0
  126. beamlit/models/serverless_config.py +2 -0
  127. beamlit/models/spec_configuration.py +68 -0
  128. beamlit/models/standard_fields_dynamo_db.py +2 -0
  129. beamlit/models/store_agent.py +15 -29
  130. beamlit/models/store_agent_configuration.py +2 -0
  131. beamlit/models/store_agent_labels.py +45 -0
  132. beamlit/models/store_configuration.py +6 -15
  133. beamlit/models/store_configuration_option.py +7 -18
  134. beamlit/models/store_function.py +15 -29
  135. beamlit/models/store_function_configuration.py +2 -0
  136. beamlit/models/store_function_kit.py +2 -0
  137. beamlit/models/store_function_labels.py +45 -0
  138. beamlit/models/store_function_parameter.py +2 -0
  139. beamlit/models/time_fields.py +68 -0
  140. beamlit/models/update_workspace_service_account_body.py +2 -0
  141. beamlit/models/update_workspace_service_account_response_200.py +2 -0
  142. beamlit/models/update_workspace_user_role_body.py +2 -0
  143. beamlit/models/websocket_channel.py +86 -0
  144. beamlit/models/workspace.py +2 -0
  145. beamlit/models/workspace_labels.py +2 -0
  146. beamlit/models/workspace_user.py +2 -0
  147. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc5.dist-info}/METADATA +1 -1
  148. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc5.dist-info}/RECORD +149 -102
  149. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc5.dist-info}/WHEEL +0 -0
@@ -0,0 +1,45 @@
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="AgentDeploymentConfiguration")
7
+
8
+
9
+ @_attrs_define
10
+ class AgentDeploymentConfiguration:
11
+ """Agent configuration, this is a key value storage. In your agent 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
+ agent_deployment_configuration = cls()
27
+
28
+ agent_deployment_configuration.additional_properties = d
29
+ return agent_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,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -22,13 +22,13 @@ class AgentDeploymentHistory:
22
22
  updated_at (Union[Unset, str]): The date and time when the resource was updated
23
23
  updated_by (Union[Unset, str]): The user or service account who updated the resource
24
24
  agent (Union[Unset, str]): Agent name
25
- end (Union[None, Unset, str]): End time
25
+ end (Union[Unset, str]): End time
26
26
  environment (Union[Unset, str]): Environment name
27
27
  events (Union[Unset, List['AgentDeploymentHistoryEvent']]): Events
28
28
  request_id (Union[Unset, str]): Request ID
29
- start (Union[None, Unset, str]): Start time
29
+ start (Union[Unset, str]): Start time
30
30
  status (Union[Unset, str]): Status, eg: running, success, failed
31
- took (Union[None, Unset, int]): Number of milliseconds it took to complete the event
31
+ took (Union[Unset, int]): Number of milliseconds it took to complete the event
32
32
  workspace (Union[Unset, str]): The workspace the agent deployment belongs to
33
33
  """
34
34
 
@@ -37,13 +37,13 @@ class AgentDeploymentHistory:
37
37
  updated_at: Union[Unset, str] = UNSET
38
38
  updated_by: Union[Unset, str] = UNSET
39
39
  agent: Union[Unset, str] = UNSET
40
- end: Union[None, Unset, str] = UNSET
40
+ end: Union[Unset, str] = UNSET
41
41
  environment: Union[Unset, str] = UNSET
42
42
  events: Union[Unset, List["AgentDeploymentHistoryEvent"]] = UNSET
43
43
  request_id: Union[Unset, str] = UNSET
44
- start: Union[None, Unset, str] = UNSET
44
+ start: Union[Unset, str] = UNSET
45
45
  status: Union[Unset, str] = UNSET
46
- took: Union[None, Unset, int] = UNSET
46
+ took: Union[Unset, int] = UNSET
47
47
  workspace: Union[Unset, str] = UNSET
48
48
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
49
49
 
@@ -58,11 +58,7 @@ class AgentDeploymentHistory:
58
58
 
59
59
  agent = self.agent
60
60
 
61
- end: Union[None, Unset, str]
62
- if isinstance(self.end, Unset):
63
- end = UNSET
64
- else:
65
- end = self.end
61
+ end = self.end
66
62
 
67
63
  environment = self.environment
68
64
 
@@ -75,19 +71,11 @@ class AgentDeploymentHistory:
75
71
 
76
72
  request_id = self.request_id
77
73
 
78
- start: Union[None, Unset, str]
79
- if isinstance(self.start, Unset):
80
- start = UNSET
81
- else:
82
- start = self.start
74
+ start = self.start
83
75
 
84
76
  status = self.status
85
77
 
86
- took: Union[None, Unset, int]
87
- if isinstance(self.took, Unset):
88
- took = UNSET
89
- else:
90
- took = self.took
78
+ took = self.took
91
79
 
92
80
  workspace = self.workspace
93
81
 
@@ -127,6 +115,8 @@ class AgentDeploymentHistory:
127
115
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
128
116
  from ..models.agent_deployment_history_event import AgentDeploymentHistoryEvent
129
117
 
118
+ if not src_dict:
119
+ return None
130
120
  d = src_dict.copy()
131
121
  created_at = d.pop("created_at", UNSET)
132
122
 
@@ -138,14 +128,7 @@ class AgentDeploymentHistory:
138
128
 
139
129
  agent = d.pop("agent", UNSET)
140
130
 
141
- def _parse_end(data: object) -> Union[None, Unset, str]:
142
- if data is None:
143
- return data
144
- if isinstance(data, Unset):
145
- return data
146
- return cast(Union[None, Unset, str], data)
147
-
148
- end = _parse_end(d.pop("end", UNSET))
131
+ end = d.pop("end", UNSET)
149
132
 
150
133
  environment = d.pop("environment", UNSET)
151
134
 
@@ -158,25 +141,11 @@ class AgentDeploymentHistory:
158
141
 
159
142
  request_id = d.pop("request_id", UNSET)
160
143
 
161
- def _parse_start(data: object) -> Union[None, Unset, str]:
162
- if data is None:
163
- return data
164
- if isinstance(data, Unset):
165
- return data
166
- return cast(Union[None, Unset, str], data)
167
-
168
- start = _parse_start(d.pop("start", UNSET))
144
+ start = d.pop("start", UNSET)
169
145
 
170
146
  status = d.pop("status", UNSET)
171
147
 
172
- def _parse_took(data: object) -> Union[None, Unset, int]:
173
- if data is None:
174
- return data
175
- if isinstance(data, Unset):
176
- return data
177
- return cast(Union[None, Unset, int], data)
178
-
179
- took = _parse_took(d.pop("took", UNSET))
148
+ took = d.pop("took", UNSET)
180
149
 
181
150
  workspace = d.pop("workspace", UNSET)
182
151
 
@@ -1,4 +1,4 @@
1
- from typing import Any, Type, TypeVar, Union, cast
1
+ from typing import Any, Type, TypeVar, Union
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -13,64 +13,44 @@ class AgentDeploymentHistoryEvent:
13
13
  """Agent deployment history event
14
14
 
15
15
  Attributes:
16
- end (Union[None, Unset, str]): End time
17
- error (Union[None, Unset, str]): Error message
16
+ end (Union[Unset, str]): End time
17
+ error (Union[Unset, str]): Error message
18
18
  name (Union[Unset, str]): Name of the function or agent
19
19
  parameters (Union[Unset, str]): Parameters
20
- start (Union[None, Unset, str]): Start time
20
+ start (Union[Unset, str]): Start time
21
21
  status (Union[Unset, str]): Status, eg: running, success, failed
22
- sub_function (Union[None, Unset, str]): Function used in kit if a kit was used
23
- took (Union[None, Unset, int]): Number of milliseconds it took to complete the event
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
24
  type (Union[Unset, str]): Type, one of function or agent
25
25
  """
26
26
 
27
- end: Union[None, Unset, str] = UNSET
28
- error: Union[None, Unset, str] = UNSET
27
+ end: Union[Unset, str] = UNSET
28
+ error: Union[Unset, str] = UNSET
29
29
  name: Union[Unset, str] = UNSET
30
30
  parameters: Union[Unset, str] = UNSET
31
- start: Union[None, Unset, str] = UNSET
31
+ start: Union[Unset, str] = UNSET
32
32
  status: Union[Unset, str] = UNSET
33
- sub_function: Union[None, Unset, str] = UNSET
34
- took: Union[None, Unset, int] = UNSET
33
+ sub_function: Union[Unset, str] = UNSET
34
+ took: Union[Unset, int] = UNSET
35
35
  type: Union[Unset, str] = UNSET
36
36
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
37
37
 
38
38
  def to_dict(self) -> dict[str, Any]:
39
- end: Union[None, Unset, str]
40
- if isinstance(self.end, Unset):
41
- end = UNSET
42
- else:
43
- end = self.end
44
-
45
- error: Union[None, Unset, str]
46
- if isinstance(self.error, Unset):
47
- error = UNSET
48
- else:
49
- error = self.error
39
+ end = self.end
40
+
41
+ error = self.error
50
42
 
51
43
  name = self.name
52
44
 
53
45
  parameters = self.parameters
54
46
 
55
- start: Union[None, Unset, str]
56
- if isinstance(self.start, Unset):
57
- start = UNSET
58
- else:
59
- start = self.start
47
+ start = self.start
60
48
 
61
49
  status = self.status
62
50
 
63
- sub_function: Union[None, Unset, str]
64
- if isinstance(self.sub_function, Unset):
65
- sub_function = UNSET
66
- else:
67
- sub_function = self.sub_function
51
+ sub_function = self.sub_function
68
52
 
69
- took: Union[None, Unset, int]
70
- if isinstance(self.took, Unset):
71
- took = UNSET
72
- else:
73
- took = self.took
53
+ took = self.took
74
54
 
75
55
  type = self.type
76
56
 
@@ -100,58 +80,24 @@ class AgentDeploymentHistoryEvent:
100
80
 
101
81
  @classmethod
102
82
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
83
+ if not src_dict:
84
+ return None
103
85
  d = src_dict.copy()
86
+ end = d.pop("end", UNSET)
104
87
 
105
- def _parse_end(data: object) -> Union[None, Unset, str]:
106
- if data is None:
107
- return data
108
- if isinstance(data, Unset):
109
- return data
110
- return cast(Union[None, Unset, str], data)
111
-
112
- end = _parse_end(d.pop("end", UNSET))
113
-
114
- def _parse_error(data: object) -> Union[None, Unset, str]:
115
- if data is None:
116
- return data
117
- if isinstance(data, Unset):
118
- return data
119
- return cast(Union[None, Unset, str], data)
120
-
121
- error = _parse_error(d.pop("error", UNSET))
88
+ error = d.pop("error", UNSET)
122
89
 
123
90
  name = d.pop("name", UNSET)
124
91
 
125
92
  parameters = d.pop("parameters", UNSET)
126
93
 
127
- def _parse_start(data: object) -> Union[None, Unset, str]:
128
- if data is None:
129
- return data
130
- if isinstance(data, Unset):
131
- return data
132
- return cast(Union[None, Unset, str], data)
133
-
134
- start = _parse_start(d.pop("start", UNSET))
94
+ start = d.pop("start", UNSET)
135
95
 
136
96
  status = d.pop("status", UNSET)
137
97
 
138
- def _parse_sub_function(data: object) -> Union[None, Unset, str]:
139
- if data is None:
140
- return data
141
- if isinstance(data, Unset):
142
- return data
143
- return cast(Union[None, Unset, str], data)
144
-
145
- sub_function = _parse_sub_function(d.pop("sub_function", UNSET))
146
-
147
- def _parse_took(data: object) -> Union[None, Unset, int]:
148
- if data is None:
149
- return data
150
- if isinstance(data, Unset):
151
- return data
152
- return cast(Union[None, Unset, int], data)
98
+ sub_function = d.pop("sub_function", UNSET)
153
99
 
154
- took = _parse_took(d.pop("took", UNSET))
100
+ took = d.pop("took", UNSET)
155
101
 
156
102
  type = d.pop("type", UNSET)
157
103
 
@@ -0,0 +1,45 @@
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="AgentDeploymentPodTemplate")
7
+
8
+
9
+ @_attrs_define
10
+ class AgentDeploymentPodTemplate:
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
+ agent_deployment_pod_template = cls()
27
+
28
+ agent_deployment_pod_template.additional_properties = d
29
+ return agent_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
@@ -0,0 +1,165 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, 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
+ d = src_dict.copy()
107
+ created_at = d.pop("createdAt", UNSET)
108
+
109
+ updated_at = d.pop("updatedAt", UNSET)
110
+
111
+ agent = d.pop("agent", UNSET)
112
+
113
+ end = d.pop("end", UNSET)
114
+
115
+ environment = d.pop("environment", UNSET)
116
+
117
+ events = []
118
+ _events = d.pop("events", UNSET)
119
+ for events_item_data in _events or []:
120
+ events_item = AgentHistoryEvent.from_dict(events_item_data)
121
+
122
+ events.append(events_item)
123
+
124
+ request_id = d.pop("request_id", UNSET)
125
+
126
+ start = d.pop("start", UNSET)
127
+
128
+ status = d.pop("status", UNSET)
129
+
130
+ took = d.pop("took", UNSET)
131
+
132
+ workspace = d.pop("workspace", UNSET)
133
+
134
+ agent_history = cls(
135
+ created_at=created_at,
136
+ updated_at=updated_at,
137
+ agent=agent,
138
+ end=end,
139
+ environment=environment,
140
+ events=events,
141
+ request_id=request_id,
142
+ start=start,
143
+ status=status,
144
+ took=took,
145
+ workspace=workspace,
146
+ )
147
+
148
+ agent_history.additional_properties = d
149
+ return agent_history
150
+
151
+ @property
152
+ def additional_keys(self) -> list[str]:
153
+ return list(self.additional_properties.keys())
154
+
155
+ def __getitem__(self, key: str) -> Any:
156
+ return self.additional_properties[key]
157
+
158
+ def __setitem__(self, key: str, value: Any) -> None:
159
+ self.additional_properties[key] = value
160
+
161
+ def __delitem__(self, key: str) -> None:
162
+ del self.additional_properties[key]
163
+
164
+ def __contains__(self, key: str) -> bool:
165
+ return key in self.additional_properties
@@ -0,0 +1,131 @@
1
+ from typing import Any, Type, 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["sub_function"] = 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
+ d = src_dict.copy()
84
+ end = d.pop("end", UNSET)
85
+
86
+ error = d.pop("error", UNSET)
87
+
88
+ name = d.pop("name", UNSET)
89
+
90
+ parameters = d.pop("parameters", UNSET)
91
+
92
+ start = d.pop("start", UNSET)
93
+
94
+ status = d.pop("status", UNSET)
95
+
96
+ sub_function = d.pop("sub_function", UNSET)
97
+
98
+ took = d.pop("took", UNSET)
99
+
100
+ type = d.pop("type", UNSET)
101
+
102
+ agent_history_event = cls(
103
+ end=end,
104
+ error=error,
105
+ name=name,
106
+ parameters=parameters,
107
+ start=start,
108
+ status=status,
109
+ sub_function=sub_function,
110
+ took=took,
111
+ type=type,
112
+ )
113
+
114
+ agent_history_event.additional_properties = d
115
+ return agent_history_event
116
+
117
+ @property
118
+ def additional_keys(self) -> list[str]:
119
+ return list(self.additional_properties.keys())
120
+
121
+ def __getitem__(self, key: str) -> Any:
122
+ return self.additional_properties[key]
123
+
124
+ def __setitem__(self, key: str, value: Any) -> None:
125
+ self.additional_properties[key] = value
126
+
127
+ def __delitem__(self, key: str) -> None:
128
+ del self.additional_properties[key]
129
+
130
+ def __contains__(self, key: str) -> bool:
131
+ return key in self.additional_properties