blaxel 0.64.0__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 (261) hide show
  1. blaxel/__init__.py +8 -0
  2. blaxel/agents/__init__.py +5 -0
  3. blaxel/agents/chain.py +153 -0
  4. blaxel/agents/chat.py +286 -0
  5. blaxel/agents/decorator.py +208 -0
  6. blaxel/agents/thread.py +24 -0
  7. blaxel/agents/voice/openai.py +255 -0
  8. blaxel/agents/voice/utils.py +25 -0
  9. blaxel/api/__init__.py +1 -0
  10. blaxel/api/agents/__init__.py +0 -0
  11. blaxel/api/agents/create_agent.py +155 -0
  12. blaxel/api/agents/delete_agent.py +146 -0
  13. blaxel/api/agents/get_agent.py +146 -0
  14. blaxel/api/agents/get_agent_logs.py +151 -0
  15. blaxel/api/agents/get_agent_metrics.py +150 -0
  16. blaxel/api/agents/get_agent_trace_ids.py +201 -0
  17. blaxel/api/agents/list_agent_revisions.py +155 -0
  18. blaxel/api/agents/list_agents.py +127 -0
  19. blaxel/api/agents/update_agent.py +168 -0
  20. blaxel/api/configurations/__init__.py +0 -0
  21. blaxel/api/configurations/get_configuration.py +122 -0
  22. blaxel/api/default/__init__.py +0 -0
  23. blaxel/api/default/get_trace.py +150 -0
  24. blaxel/api/default/get_trace_ids.py +218 -0
  25. blaxel/api/default/get_trace_logs.py +186 -0
  26. blaxel/api/default/list_mcp_hub_definitions.py +127 -0
  27. blaxel/api/functions/__init__.py +0 -0
  28. blaxel/api/functions/create_function.py +155 -0
  29. blaxel/api/functions/delete_function.py +146 -0
  30. blaxel/api/functions/get_function.py +146 -0
  31. blaxel/api/functions/get_function_logs.py +151 -0
  32. blaxel/api/functions/get_function_metrics.py +150 -0
  33. blaxel/api/functions/get_function_trace_ids.py +201 -0
  34. blaxel/api/functions/list_function_revisions.py +158 -0
  35. blaxel/api/functions/list_functions.py +131 -0
  36. blaxel/api/functions/update_function.py +168 -0
  37. blaxel/api/integrations/__init__.py +0 -0
  38. blaxel/api/integrations/create_integration_connection.py +167 -0
  39. blaxel/api/integrations/delete_integration_connection.py +158 -0
  40. blaxel/api/integrations/get_integration.py +97 -0
  41. blaxel/api/integrations/get_integration_connection.py +158 -0
  42. blaxel/api/integrations/get_integration_connection_model.py +104 -0
  43. blaxel/api/integrations/get_integration_connection_model_endpoint_configurations.py +97 -0
  44. blaxel/api/integrations/list_integration_connection_models.py +97 -0
  45. blaxel/api/integrations/list_integration_connections.py +139 -0
  46. blaxel/api/integrations/update_integration_connection.py +180 -0
  47. blaxel/api/invitations/__init__.py +0 -0
  48. blaxel/api/invitations/list_all_pending_invitations.py +142 -0
  49. blaxel/api/knowledgebases/__init__.py +0 -0
  50. blaxel/api/knowledgebases/create_knowledgebase.py +163 -0
  51. blaxel/api/knowledgebases/delete_knowledgebase.py +154 -0
  52. blaxel/api/knowledgebases/get_knowledgebase.py +154 -0
  53. blaxel/api/knowledgebases/list_knowledgebase_revisions.py +158 -0
  54. blaxel/api/knowledgebases/list_knowledgebases.py +139 -0
  55. blaxel/api/knowledgebases/update_knowledgebase.py +176 -0
  56. blaxel/api/locations/__init__.py +0 -0
  57. blaxel/api/locations/list_locations.py +139 -0
  58. blaxel/api/metrics/__init__.py +0 -0
  59. blaxel/api/metrics/get_metrics.py +130 -0
  60. blaxel/api/models/__init__.py +0 -0
  61. blaxel/api/models/create_model.py +163 -0
  62. blaxel/api/models/delete_model.py +154 -0
  63. blaxel/api/models/get_model.py +154 -0
  64. blaxel/api/models/get_model_logs.py +155 -0
  65. blaxel/api/models/get_model_metrics.py +158 -0
  66. blaxel/api/models/get_model_trace_ids.py +201 -0
  67. blaxel/api/models/list_model_revisions.py +158 -0
  68. blaxel/api/models/list_models.py +135 -0
  69. blaxel/api/models/update_model.py +176 -0
  70. blaxel/api/policies/__init__.py +0 -0
  71. blaxel/api/policies/create_policy.py +167 -0
  72. blaxel/api/policies/delete_policy.py +154 -0
  73. blaxel/api/policies/get_policy.py +154 -0
  74. blaxel/api/policies/list_policies.py +139 -0
  75. blaxel/api/policies/update_policy.py +180 -0
  76. blaxel/api/privateclusters/__init__.py +0 -0
  77. blaxel/api/privateclusters/create_private_cluster.py +132 -0
  78. blaxel/api/privateclusters/delete_private_cluster.py +156 -0
  79. blaxel/api/privateclusters/get_private_cluster.py +159 -0
  80. blaxel/api/privateclusters/get_private_cluster_health.py +97 -0
  81. blaxel/api/privateclusters/list_private_clusters.py +140 -0
  82. blaxel/api/privateclusters/update_private_cluster.py +156 -0
  83. blaxel/api/privateclusters/update_private_cluster_health.py +97 -0
  84. blaxel/api/service_accounts/__init__.py +0 -0
  85. blaxel/api/service_accounts/create_api_key_for_service_account.py +177 -0
  86. blaxel/api/service_accounts/create_workspace_service_account.py +170 -0
  87. blaxel/api/service_accounts/delete_api_key_for_service_account.py +104 -0
  88. blaxel/api/service_accounts/delete_workspace_service_account.py +160 -0
  89. blaxel/api/service_accounts/get_workspace_service_accounts.py +141 -0
  90. blaxel/api/service_accounts/list_api_keys_for_service_account.py +163 -0
  91. blaxel/api/service_accounts/update_workspace_service_account.py +183 -0
  92. blaxel/api/store/__init__.py +0 -0
  93. blaxel/api/store/get_store_agent.py +146 -0
  94. blaxel/api/store/get_store_function.py +146 -0
  95. blaxel/api/store/list_store_agents.py +131 -0
  96. blaxel/api/store/list_store_functions.py +131 -0
  97. blaxel/api/workspaces/__init__.py +0 -0
  98. blaxel/api/workspaces/accept_workspace_invitation.py +161 -0
  99. blaxel/api/workspaces/create_worspace.py +163 -0
  100. blaxel/api/workspaces/decline_workspace_invitation.py +158 -0
  101. blaxel/api/workspaces/delete_workspace.py +154 -0
  102. blaxel/api/workspaces/get_workspace.py +154 -0
  103. blaxel/api/workspaces/invite_workspace_user.py +174 -0
  104. blaxel/api/workspaces/leave_workspace.py +161 -0
  105. blaxel/api/workspaces/list_workspace_users.py +139 -0
  106. blaxel/api/workspaces/list_workspaces.py +139 -0
  107. blaxel/api/workspaces/remove_workspace_user.py +101 -0
  108. blaxel/api/workspaces/update_workspace.py +176 -0
  109. blaxel/api/workspaces/update_workspace_user_role.py +187 -0
  110. blaxel/authentication/__init__.py +45 -0
  111. blaxel/authentication/apikey.py +50 -0
  112. blaxel/authentication/authentication.py +176 -0
  113. blaxel/authentication/clientcredentials.py +103 -0
  114. blaxel/authentication/credentials.py +295 -0
  115. blaxel/authentication/device_mode.py +197 -0
  116. blaxel/client.py +281 -0
  117. blaxel/common/__init__.py +17 -0
  118. blaxel/common/error.py +27 -0
  119. blaxel/common/instrumentation.py +317 -0
  120. blaxel/common/logger.py +60 -0
  121. blaxel/common/secrets.py +39 -0
  122. blaxel/common/settings.py +150 -0
  123. blaxel/common/slugify.py +18 -0
  124. blaxel/common/utils.py +34 -0
  125. blaxel/deploy/__init__.py +8 -0
  126. blaxel/deploy/deploy.py +316 -0
  127. blaxel/deploy/format.py +46 -0
  128. blaxel/deploy/parser.py +192 -0
  129. blaxel/errors.py +16 -0
  130. blaxel/functions/__init__.py +7 -0
  131. blaxel/functions/common.py +228 -0
  132. blaxel/functions/decorator.py +64 -0
  133. blaxel/functions/local/local.py +48 -0
  134. blaxel/functions/mcp/client.py +96 -0
  135. blaxel/functions/mcp/mcp.py +168 -0
  136. blaxel/functions/mcp/utils.py +56 -0
  137. blaxel/functions/remote/remote.py +183 -0
  138. blaxel/models/__init__.py +233 -0
  139. blaxel/models/acl.py +133 -0
  140. blaxel/models/agent.py +126 -0
  141. blaxel/models/agent_chain.py +88 -0
  142. blaxel/models/agent_spec.py +346 -0
  143. blaxel/models/api_key.py +142 -0
  144. blaxel/models/configuration.py +85 -0
  145. blaxel/models/continent.py +70 -0
  146. blaxel/models/core_event.py +97 -0
  147. blaxel/models/core_spec.py +249 -0
  148. blaxel/models/core_spec_configurations.py +77 -0
  149. blaxel/models/country.py +70 -0
  150. blaxel/models/create_api_key_for_service_account_body.py +69 -0
  151. blaxel/models/create_workspace_service_account_body.py +71 -0
  152. blaxel/models/create_workspace_service_account_response_200.py +105 -0
  153. blaxel/models/delete_workspace_service_account_response_200.py +96 -0
  154. blaxel/models/entrypoint.py +96 -0
  155. blaxel/models/entrypoint_env.py +45 -0
  156. blaxel/models/flavor.py +70 -0
  157. blaxel/models/form.py +120 -0
  158. blaxel/models/form_config.py +45 -0
  159. blaxel/models/form_oauthomitempty.py +45 -0
  160. blaxel/models/form_secrets.py +45 -0
  161. blaxel/models/function.py +126 -0
  162. blaxel/models/function_kit.py +97 -0
  163. blaxel/models/function_spec.py +310 -0
  164. blaxel/models/get_trace_ids_response_200.py +45 -0
  165. blaxel/models/get_trace_logs_response_200.py +45 -0
  166. blaxel/models/get_trace_response_200.py +45 -0
  167. blaxel/models/get_workspace_service_accounts_response_200_item.py +96 -0
  168. blaxel/models/histogram_bucket.py +79 -0
  169. blaxel/models/histogram_stats.py +88 -0
  170. blaxel/models/integration_connection.py +96 -0
  171. blaxel/models/integration_connection_spec.py +114 -0
  172. blaxel/models/integration_connection_spec_config.py +45 -0
  173. blaxel/models/integration_connection_spec_secret.py +45 -0
  174. blaxel/models/integration_model.py +162 -0
  175. blaxel/models/integration_repository.py +88 -0
  176. blaxel/models/invite_workspace_user_body.py +60 -0
  177. blaxel/models/knowledgebase.py +126 -0
  178. blaxel/models/knowledgebase_spec.py +163 -0
  179. blaxel/models/knowledgebase_spec_options.py +45 -0
  180. blaxel/models/last_n_requests_metric.py +79 -0
  181. blaxel/models/latency_metric.py +144 -0
  182. blaxel/models/location_response.py +113 -0
  183. blaxel/models/mcp_definition.py +188 -0
  184. blaxel/models/mcp_definition_entrypoint.py +45 -0
  185. blaxel/models/mcp_definition_form.py +45 -0
  186. blaxel/models/metadata.py +139 -0
  187. blaxel/models/metadata_labels.py +45 -0
  188. blaxel/models/metric.py +79 -0
  189. blaxel/models/metrics.py +169 -0
  190. blaxel/models/metrics_models.py +45 -0
  191. blaxel/models/metrics_request_total_per_code.py +45 -0
  192. blaxel/models/metrics_rps_per_code.py +45 -0
  193. blaxel/models/model.py +126 -0
  194. blaxel/models/model_private_cluster.py +79 -0
  195. blaxel/models/model_spec.py +249 -0
  196. blaxel/models/o_auth.py +72 -0
  197. blaxel/models/owner_fields.py +70 -0
  198. blaxel/models/pending_invitation.py +124 -0
  199. blaxel/models/pending_invitation_accept.py +85 -0
  200. blaxel/models/pending_invitation_render.py +147 -0
  201. blaxel/models/pending_invitation_render_invited_by.py +88 -0
  202. blaxel/models/pending_invitation_render_workspace.py +70 -0
  203. blaxel/models/pending_invitation_workspace_details.py +72 -0
  204. blaxel/models/pod_template_spec.py +45 -0
  205. blaxel/models/policy.py +96 -0
  206. blaxel/models/policy_location.py +70 -0
  207. blaxel/models/policy_max_tokens.py +106 -0
  208. blaxel/models/policy_spec.py +151 -0
  209. blaxel/models/private_cluster.py +183 -0
  210. blaxel/models/private_location.py +61 -0
  211. blaxel/models/repository.py +70 -0
  212. blaxel/models/request_duration_over_time_metric.py +97 -0
  213. blaxel/models/request_duration_over_time_metrics.py +80 -0
  214. blaxel/models/request_total_by_origin_metric.py +115 -0
  215. blaxel/models/request_total_by_origin_metric_request_total_by_origin.py +45 -0
  216. blaxel/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +45 -0
  217. blaxel/models/request_total_metric.py +123 -0
  218. blaxel/models/request_total_metric_request_total_per_code.py +45 -0
  219. blaxel/models/request_total_metric_rps_per_code.py +45 -0
  220. blaxel/models/resource_log.py +79 -0
  221. blaxel/models/resource_metrics.py +270 -0
  222. blaxel/models/resource_metrics_request_total_per_code.py +45 -0
  223. blaxel/models/resource_metrics_rps_per_code.py +45 -0
  224. blaxel/models/revision_configuration.py +97 -0
  225. blaxel/models/revision_metadata.py +124 -0
  226. blaxel/models/runtime.py +196 -0
  227. blaxel/models/runtime_startup_probe.py +45 -0
  228. blaxel/models/serverless_config.py +80 -0
  229. blaxel/models/spec_configuration.py +70 -0
  230. blaxel/models/store_agent.py +178 -0
  231. blaxel/models/store_agent_labels.py +45 -0
  232. blaxel/models/store_configuration.py +151 -0
  233. blaxel/models/store_configuration_option.py +79 -0
  234. blaxel/models/store_function.py +211 -0
  235. blaxel/models/store_function_kit.py +97 -0
  236. blaxel/models/store_function_labels.py +45 -0
  237. blaxel/models/store_function_parameter.py +88 -0
  238. blaxel/models/time_fields.py +70 -0
  239. blaxel/models/token_rate_metric.py +88 -0
  240. blaxel/models/token_rate_metrics.py +120 -0
  241. blaxel/models/token_total_metric.py +106 -0
  242. blaxel/models/trace_ids_response.py +45 -0
  243. blaxel/models/update_workspace_service_account_body.py +69 -0
  244. blaxel/models/update_workspace_service_account_response_200.py +96 -0
  245. blaxel/models/update_workspace_user_role_body.py +60 -0
  246. blaxel/models/websocket_channel.py +88 -0
  247. blaxel/models/workspace.py +148 -0
  248. blaxel/models/workspace_labels.py +45 -0
  249. blaxel/models/workspace_user.py +115 -0
  250. blaxel/py.typed +1 -0
  251. blaxel/run.py +108 -0
  252. blaxel/serve/app.py +131 -0
  253. blaxel/serve/middlewares/__init__.py +10 -0
  254. blaxel/serve/middlewares/accesslog.py +32 -0
  255. blaxel/serve/middlewares/processtime.py +28 -0
  256. blaxel/types.py +46 -0
  257. blaxel-0.64.0.dist-info/METADATA +96 -0
  258. blaxel-0.64.0.dist-info/RECORD +261 -0
  259. blaxel-0.64.0.dist-info/WHEEL +4 -0
  260. blaxel-0.64.0.dist-info/entry_points.txt +2 -0
  261. blaxel-0.64.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,151 @@
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.flavor import Flavor
10
+ from ..models.policy_location import PolicyLocation
11
+ from ..models.policy_max_tokens import PolicyMaxTokens
12
+
13
+
14
+ T = TypeVar("T", bound="PolicySpec")
15
+
16
+
17
+ @_attrs_define
18
+ class PolicySpec:
19
+ """Policy specification
20
+
21
+ Attributes:
22
+ flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
23
+ locations (Union[Unset, list['PolicyLocation']]): PolicyLocations is a local type that wraps a slice of Location
24
+ max_tokens (Union[Unset, PolicyMaxTokens]): PolicyMaxTokens is a local type that wraps a slice of
25
+ PolicyMaxTokens
26
+ resource_types (Union[Unset, list[str]]): PolicyResourceTypes is a local type that wraps a slice of
27
+ PolicyResourceType
28
+ sandbox (Union[Unset, bool]): Sandbox mode
29
+ type_ (Union[Unset, str]): Policy type, can be location or flavor
30
+ """
31
+
32
+ flavors: Union[Unset, list["Flavor"]] = UNSET
33
+ locations: Union[Unset, list["PolicyLocation"]] = UNSET
34
+ max_tokens: Union[Unset, "PolicyMaxTokens"] = UNSET
35
+ resource_types: Union[Unset, list[str]] = UNSET
36
+ sandbox: Union[Unset, bool] = UNSET
37
+ type_: Union[Unset, str] = UNSET
38
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
39
+
40
+ def to_dict(self) -> dict[str, Any]:
41
+ flavors: Union[Unset, list[dict[str, Any]]] = UNSET
42
+ if not isinstance(self.flavors, Unset):
43
+ flavors = []
44
+ for componentsschemas_flavors_item_data in self.flavors:
45
+ componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
46
+ flavors.append(componentsschemas_flavors_item)
47
+
48
+ locations: Union[Unset, list[dict[str, Any]]] = UNSET
49
+ if not isinstance(self.locations, Unset):
50
+ locations = []
51
+ for componentsschemas_policy_locations_item_data in self.locations:
52
+ componentsschemas_policy_locations_item = componentsschemas_policy_locations_item_data.to_dict()
53
+ locations.append(componentsschemas_policy_locations_item)
54
+
55
+ max_tokens: Union[Unset, dict[str, Any]] = UNSET
56
+ if self.max_tokens and not isinstance(self.max_tokens, Unset) and not isinstance(self.max_tokens, dict):
57
+ max_tokens = self.max_tokens.to_dict()
58
+ elif self.max_tokens and isinstance(self.max_tokens, dict):
59
+ max_tokens = self.max_tokens
60
+
61
+ resource_types: Union[Unset, list[str]] = UNSET
62
+ if not isinstance(self.resource_types, Unset):
63
+ resource_types = self.resource_types
64
+
65
+ sandbox = self.sandbox
66
+
67
+ type_ = self.type_
68
+
69
+ field_dict: dict[str, Any] = {}
70
+ field_dict.update(self.additional_properties)
71
+ field_dict.update({})
72
+ if flavors is not UNSET:
73
+ field_dict["flavors"] = flavors
74
+ if locations is not UNSET:
75
+ field_dict["locations"] = locations
76
+ if max_tokens is not UNSET:
77
+ field_dict["maxTokens"] = max_tokens
78
+ if resource_types is not UNSET:
79
+ field_dict["resourceTypes"] = resource_types
80
+ if sandbox is not UNSET:
81
+ field_dict["sandbox"] = sandbox
82
+ if type_ is not UNSET:
83
+ field_dict["type"] = type_
84
+
85
+ return field_dict
86
+
87
+ @classmethod
88
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
89
+ from ..models.flavor import Flavor
90
+ from ..models.policy_location import PolicyLocation
91
+ from ..models.policy_max_tokens import PolicyMaxTokens
92
+
93
+ if not src_dict:
94
+ return None
95
+ d = src_dict.copy()
96
+ flavors = []
97
+ _flavors = d.pop("flavors", UNSET)
98
+ for componentsschemas_flavors_item_data in _flavors or []:
99
+ componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
100
+
101
+ flavors.append(componentsschemas_flavors_item)
102
+
103
+ locations = []
104
+ _locations = d.pop("locations", UNSET)
105
+ for componentsschemas_policy_locations_item_data in _locations or []:
106
+ componentsschemas_policy_locations_item = PolicyLocation.from_dict(
107
+ componentsschemas_policy_locations_item_data
108
+ )
109
+
110
+ locations.append(componentsschemas_policy_locations_item)
111
+
112
+ _max_tokens = d.pop("maxTokens", UNSET)
113
+ max_tokens: Union[Unset, PolicyMaxTokens]
114
+ if isinstance(_max_tokens, Unset):
115
+ max_tokens = UNSET
116
+ else:
117
+ max_tokens = PolicyMaxTokens.from_dict(_max_tokens)
118
+
119
+ resource_types = cast(list[str], d.pop("resourceTypes", UNSET))
120
+
121
+ sandbox = d.pop("sandbox", UNSET)
122
+
123
+ type_ = d.pop("type", UNSET)
124
+
125
+ policy_spec = cls(
126
+ flavors=flavors,
127
+ locations=locations,
128
+ max_tokens=max_tokens,
129
+ resource_types=resource_types,
130
+ sandbox=sandbox,
131
+ type_=type_,
132
+ )
133
+
134
+ policy_spec.additional_properties = d
135
+ return policy_spec
136
+
137
+ @property
138
+ def additional_keys(self) -> list[str]:
139
+ return list(self.additional_properties.keys())
140
+
141
+ def __getitem__(self, key: str) -> Any:
142
+ return self.additional_properties[key]
143
+
144
+ def __setitem__(self, key: str, value: Any) -> None:
145
+ self.additional_properties[key] = value
146
+
147
+ def __delitem__(self, key: str) -> None:
148
+ del self.additional_properties[key]
149
+
150
+ def __contains__(self, key: str) -> bool:
151
+ return key in self.additional_properties
@@ -0,0 +1,183 @@
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="PrivateCluster")
9
+
10
+
11
+ @_attrs_define
12
+ class PrivateCluster:
13
+ """A private cluster where models can be located on.
14
+
15
+ Attributes:
16
+ created_at (Union[Unset, str]): The date and time when the resource was created
17
+ updated_at (Union[Unset, str]): The date and time when the resource was updated
18
+ created_by (Union[Unset, str]): The user or service account who created the resource
19
+ updated_by (Union[Unset, str]): The user or service account who updated the resource
20
+ continent (Union[Unset, str]): The private cluster's continent, used to determine the closest private cluster to
21
+ serve inference requests based on the user's location
22
+ country (Union[Unset, str]): The country where the private cluster is located, used to determine the closest
23
+ private cluster to serve inference requests based on the user's location
24
+ display_name (Union[Unset, str]): The private cluster's display Name
25
+ healthy (Union[Unset, bool]): Whether the private cluster is healthy or not, used to determine if the private
26
+ cluster is ready to run inference
27
+ last_health_check_time (Union[Unset, str]): The private cluster's unique name
28
+ latitude (Union[Unset, str]): The private cluster's latitude, used to determine the closest private cluster to
29
+ serve inference requests based on the user's location
30
+ longitude (Union[Unset, str]): The private cluster's longitude, used to determine the closest private cluster to
31
+ serve inference requests based on the user's location
32
+ name (Union[Unset, str]): The name of the private cluster, it must be unique
33
+ owned_by (Union[Unset, str]): The service account (operator) that owns the cluster
34
+ workspace (Union[Unset, str]): The workspace the private cluster belongs to
35
+ """
36
+
37
+ created_at: Union[Unset, str] = UNSET
38
+ updated_at: Union[Unset, str] = UNSET
39
+ created_by: Union[Unset, str] = UNSET
40
+ updated_by: Union[Unset, str] = UNSET
41
+ continent: Union[Unset, str] = UNSET
42
+ country: Union[Unset, str] = UNSET
43
+ display_name: Union[Unset, str] = UNSET
44
+ healthy: Union[Unset, bool] = UNSET
45
+ last_health_check_time: Union[Unset, str] = UNSET
46
+ latitude: Union[Unset, str] = UNSET
47
+ longitude: Union[Unset, str] = UNSET
48
+ name: Union[Unset, str] = UNSET
49
+ owned_by: Union[Unset, str] = UNSET
50
+ workspace: Union[Unset, str] = UNSET
51
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
52
+
53
+ def to_dict(self) -> dict[str, Any]:
54
+ created_at = self.created_at
55
+
56
+ updated_at = self.updated_at
57
+
58
+ created_by = self.created_by
59
+
60
+ updated_by = self.updated_by
61
+
62
+ continent = self.continent
63
+
64
+ country = self.country
65
+
66
+ display_name = self.display_name
67
+
68
+ healthy = self.healthy
69
+
70
+ last_health_check_time = self.last_health_check_time
71
+
72
+ latitude = self.latitude
73
+
74
+ longitude = self.longitude
75
+
76
+ name = self.name
77
+
78
+ owned_by = self.owned_by
79
+
80
+ workspace = self.workspace
81
+
82
+ field_dict: dict[str, Any] = {}
83
+ field_dict.update(self.additional_properties)
84
+ field_dict.update({})
85
+ if created_at is not UNSET:
86
+ field_dict["createdAt"] = created_at
87
+ if updated_at is not UNSET:
88
+ field_dict["updatedAt"] = updated_at
89
+ if created_by is not UNSET:
90
+ field_dict["createdBy"] = created_by
91
+ if updated_by is not UNSET:
92
+ field_dict["updatedBy"] = updated_by
93
+ if continent is not UNSET:
94
+ field_dict["continent"] = continent
95
+ if country is not UNSET:
96
+ field_dict["country"] = country
97
+ if display_name is not UNSET:
98
+ field_dict["displayName"] = display_name
99
+ if healthy is not UNSET:
100
+ field_dict["healthy"] = healthy
101
+ if last_health_check_time is not UNSET:
102
+ field_dict["lastHealthCheckTime"] = last_health_check_time
103
+ if latitude is not UNSET:
104
+ field_dict["latitude"] = latitude
105
+ if longitude is not UNSET:
106
+ field_dict["longitude"] = longitude
107
+ if name is not UNSET:
108
+ field_dict["name"] = name
109
+ if owned_by is not UNSET:
110
+ field_dict["ownedBy"] = owned_by
111
+ if workspace is not UNSET:
112
+ field_dict["workspace"] = workspace
113
+
114
+ return field_dict
115
+
116
+ @classmethod
117
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
118
+ if not src_dict:
119
+ return None
120
+ d = src_dict.copy()
121
+ created_at = d.pop("createdAt", UNSET)
122
+
123
+ updated_at = d.pop("updatedAt", UNSET)
124
+
125
+ created_by = d.pop("createdBy", UNSET)
126
+
127
+ updated_by = d.pop("updatedBy", UNSET)
128
+
129
+ continent = d.pop("continent", UNSET)
130
+
131
+ country = d.pop("country", UNSET)
132
+
133
+ display_name = d.pop("displayName", UNSET)
134
+
135
+ healthy = d.pop("healthy", UNSET)
136
+
137
+ last_health_check_time = d.pop("lastHealthCheckTime", UNSET)
138
+
139
+ latitude = d.pop("latitude", UNSET)
140
+
141
+ longitude = d.pop("longitude", UNSET)
142
+
143
+ name = d.pop("name", UNSET)
144
+
145
+ owned_by = d.pop("ownedBy", UNSET)
146
+
147
+ workspace = d.pop("workspace", UNSET)
148
+
149
+ private_cluster = cls(
150
+ created_at=created_at,
151
+ updated_at=updated_at,
152
+ created_by=created_by,
153
+ updated_by=updated_by,
154
+ continent=continent,
155
+ country=country,
156
+ display_name=display_name,
157
+ healthy=healthy,
158
+ last_health_check_time=last_health_check_time,
159
+ latitude=latitude,
160
+ longitude=longitude,
161
+ name=name,
162
+ owned_by=owned_by,
163
+ workspace=workspace,
164
+ )
165
+
166
+ private_cluster.additional_properties = d
167
+ return private_cluster
168
+
169
+ @property
170
+ def additional_keys(self) -> list[str]:
171
+ return list(self.additional_properties.keys())
172
+
173
+ def __getitem__(self, key: str) -> Any:
174
+ return self.additional_properties[key]
175
+
176
+ def __setitem__(self, key: str, value: Any) -> None:
177
+ self.additional_properties[key] = value
178
+
179
+ def __delitem__(self, key: str) -> None:
180
+ del self.additional_properties[key]
181
+
182
+ def __contains__(self, key: str) -> bool:
183
+ return key in self.additional_properties
@@ -0,0 +1,61 @@
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="PrivateLocation")
9
+
10
+
11
+ @_attrs_define
12
+ class PrivateLocation:
13
+ """Private location available for policies
14
+
15
+ Attributes:
16
+ name (Union[Unset, str]): Location name
17
+ """
18
+
19
+ name: 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
+ name = self.name
24
+
25
+ field_dict: dict[str, Any] = {}
26
+ field_dict.update(self.additional_properties)
27
+ field_dict.update({})
28
+ if name is not UNSET:
29
+ field_dict["name"] = name
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
+ name = d.pop("name", UNSET)
39
+
40
+ private_location = cls(
41
+ name=name,
42
+ )
43
+
44
+ private_location.additional_properties = d
45
+ return private_location
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
@@ -0,0 +1,70 @@
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="Repository")
9
+
10
+
11
+ @_attrs_define
12
+ class Repository:
13
+ """Repository
14
+
15
+ Attributes:
16
+ type_ (Union[Unset, str]): Repository type
17
+ url (Union[Unset, str]): Repository URL
18
+ """
19
+
20
+ type_: Union[Unset, str] = UNSET
21
+ url: 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
+ type_ = self.type_
26
+
27
+ url = self.url
28
+
29
+ field_dict: dict[str, Any] = {}
30
+ field_dict.update(self.additional_properties)
31
+ field_dict.update({})
32
+ if type_ is not UNSET:
33
+ field_dict["type"] = type_
34
+ if url is not UNSET:
35
+ field_dict["url"] = url
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
+ type_ = d.pop("type", UNSET)
45
+
46
+ url = d.pop("url", UNSET)
47
+
48
+ repository = cls(
49
+ type_=type_,
50
+ url=url,
51
+ )
52
+
53
+ repository.additional_properties = d
54
+ return repository
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
@@ -0,0 +1,97 @@
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="RequestDurationOverTimeMetric")
9
+
10
+
11
+ @_attrs_define
12
+ class RequestDurationOverTimeMetric:
13
+ """Request duration over time metric
14
+
15
+ Attributes:
16
+ average (Union[Unset, float]): Average request duration
17
+ p50 (Union[Unset, float]): P50 request duration
18
+ p90 (Union[Unset, float]): P90 request duration
19
+ p99 (Union[Unset, float]): P99 request duration
20
+ timestamp (Union[Unset, str]): Timestamp
21
+ """
22
+
23
+ average: Union[Unset, float] = UNSET
24
+ p50: Union[Unset, float] = UNSET
25
+ p90: Union[Unset, float] = UNSET
26
+ p99: Union[Unset, float] = UNSET
27
+ timestamp: Union[Unset, str] = UNSET
28
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
29
+
30
+ def to_dict(self) -> dict[str, Any]:
31
+ average = self.average
32
+
33
+ p50 = self.p50
34
+
35
+ p90 = self.p90
36
+
37
+ p99 = self.p99
38
+
39
+ timestamp = self.timestamp
40
+
41
+ field_dict: dict[str, Any] = {}
42
+ field_dict.update(self.additional_properties)
43
+ field_dict.update({})
44
+ if average is not UNSET:
45
+ field_dict["average"] = average
46
+ if p50 is not UNSET:
47
+ field_dict["p50"] = p50
48
+ if p90 is not UNSET:
49
+ field_dict["p90"] = p90
50
+ if p99 is not UNSET:
51
+ field_dict["p99"] = p99
52
+ if timestamp is not UNSET:
53
+ field_dict["timestamp"] = timestamp
54
+
55
+ return field_dict
56
+
57
+ @classmethod
58
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
59
+ if not src_dict:
60
+ return None
61
+ d = src_dict.copy()
62
+ average = d.pop("average", UNSET)
63
+
64
+ p50 = d.pop("p50", UNSET)
65
+
66
+ p90 = d.pop("p90", UNSET)
67
+
68
+ p99 = d.pop("p99", UNSET)
69
+
70
+ timestamp = d.pop("timestamp", UNSET)
71
+
72
+ request_duration_over_time_metric = cls(
73
+ average=average,
74
+ p50=p50,
75
+ p90=p90,
76
+ p99=p99,
77
+ timestamp=timestamp,
78
+ )
79
+
80
+ request_duration_over_time_metric.additional_properties = d
81
+ return request_duration_over_time_metric
82
+
83
+ @property
84
+ def additional_keys(self) -> list[str]:
85
+ return list(self.additional_properties.keys())
86
+
87
+ def __getitem__(self, key: str) -> Any:
88
+ return self.additional_properties[key]
89
+
90
+ def __setitem__(self, key: str, value: Any) -> None:
91
+ self.additional_properties[key] = value
92
+
93
+ def __delitem__(self, key: str) -> None:
94
+ del self.additional_properties[key]
95
+
96
+ def __contains__(self, key: str) -> bool:
97
+ return key in self.additional_properties
@@ -0,0 +1,80 @@
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.request_duration_over_time_metric import RequestDurationOverTimeMetric
10
+
11
+
12
+ T = TypeVar("T", bound="RequestDurationOverTimeMetrics")
13
+
14
+
15
+ @_attrs_define
16
+ class RequestDurationOverTimeMetrics:
17
+ """Request duration over time metrics
18
+
19
+ Attributes:
20
+ request_duration_over_time (Union[Unset, RequestDurationOverTimeMetric]): Request duration over time metric
21
+ """
22
+
23
+ request_duration_over_time: Union[Unset, "RequestDurationOverTimeMetric"] = UNSET
24
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
+
26
+ def to_dict(self) -> dict[str, Any]:
27
+ request_duration_over_time: Union[Unset, dict[str, Any]] = UNSET
28
+ if (
29
+ self.request_duration_over_time
30
+ and not isinstance(self.request_duration_over_time, Unset)
31
+ and not isinstance(self.request_duration_over_time, dict)
32
+ ):
33
+ request_duration_over_time = self.request_duration_over_time.to_dict()
34
+ elif self.request_duration_over_time and isinstance(self.request_duration_over_time, dict):
35
+ request_duration_over_time = self.request_duration_over_time
36
+
37
+ field_dict: dict[str, Any] = {}
38
+ field_dict.update(self.additional_properties)
39
+ field_dict.update({})
40
+ if request_duration_over_time is not UNSET:
41
+ field_dict["requestDurationOverTime"] = request_duration_over_time
42
+
43
+ return field_dict
44
+
45
+ @classmethod
46
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
47
+ from ..models.request_duration_over_time_metric import RequestDurationOverTimeMetric
48
+
49
+ if not src_dict:
50
+ return None
51
+ d = src_dict.copy()
52
+ _request_duration_over_time = d.pop("requestDurationOverTime", UNSET)
53
+ request_duration_over_time: Union[Unset, RequestDurationOverTimeMetric]
54
+ if isinstance(_request_duration_over_time, Unset):
55
+ request_duration_over_time = UNSET
56
+ else:
57
+ request_duration_over_time = RequestDurationOverTimeMetric.from_dict(_request_duration_over_time)
58
+
59
+ request_duration_over_time_metrics = cls(
60
+ request_duration_over_time=request_duration_over_time,
61
+ )
62
+
63
+ request_duration_over_time_metrics.additional_properties = d
64
+ return request_duration_over_time_metrics
65
+
66
+ @property
67
+ def additional_keys(self) -> list[str]:
68
+ return list(self.additional_properties.keys())
69
+
70
+ def __getitem__(self, key: str) -> Any:
71
+ return self.additional_properties[key]
72
+
73
+ def __setitem__(self, key: str, value: Any) -> None:
74
+ self.additional_properties[key] = value
75
+
76
+ def __delitem__(self, key: str) -> None:
77
+ del self.additional_properties[key]
78
+
79
+ def __contains__(self, key: str) -> bool:
80
+ return key in self.additional_properties