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
@@ -6,14 +6,13 @@ import httpx
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
8
  from ...models.model import Model
9
- from ...models.model_with_deployments import ModelWithDeployments
10
9
  from ...types import Response
11
10
 
12
11
 
13
12
  def _get_kwargs(
14
13
  model_name: str,
15
14
  *,
16
- body: ModelWithDeployments,
15
+ body: Model,
17
16
  ) -> dict[str, Any]:
18
17
  headers: dict[str, Any] = {}
19
18
 
@@ -55,7 +54,7 @@ def sync_detailed(
55
54
  model_name: str,
56
55
  *,
57
56
  client: AuthenticatedClient,
58
- body: ModelWithDeployments,
57
+ body: Model,
59
58
  ) -> Response[Model]:
60
59
  """Create or update model
61
60
 
@@ -63,8 +62,8 @@ def sync_detailed(
63
62
 
64
63
  Args:
65
64
  model_name (str):
66
- body (ModelWithDeployments): Logical object representing a model but with deployment
67
- definition inside
65
+ body (Model): Logical object representing a model, that can be instantiated in multiple
66
+ environments as model deployments
68
67
 
69
68
  Raises:
70
69
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -90,7 +89,7 @@ def sync(
90
89
  model_name: str,
91
90
  *,
92
91
  client: AuthenticatedClient,
93
- body: ModelWithDeployments,
92
+ body: Model,
94
93
  ) -> Optional[Model]:
95
94
  """Create or update model
96
95
 
@@ -98,8 +97,8 @@ def sync(
98
97
 
99
98
  Args:
100
99
  model_name (str):
101
- body (ModelWithDeployments): Logical object representing a model but with deployment
102
- definition inside
100
+ body (Model): Logical object representing a model, that can be instantiated in multiple
101
+ environments as model deployments
103
102
 
104
103
  Raises:
105
104
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -120,7 +119,7 @@ async def asyncio_detailed(
120
119
  model_name: str,
121
120
  *,
122
121
  client: AuthenticatedClient,
123
- body: ModelWithDeployments,
122
+ body: Model,
124
123
  ) -> Response[Model]:
125
124
  """Create or update model
126
125
 
@@ -128,8 +127,8 @@ async def asyncio_detailed(
128
127
 
129
128
  Args:
130
129
  model_name (str):
131
- body (ModelWithDeployments): Logical object representing a model but with deployment
132
- definition inside
130
+ body (Model): Logical object representing a model, that can be instantiated in multiple
131
+ environments as model deployments
133
132
 
134
133
  Raises:
135
134
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -153,7 +152,7 @@ async def asyncio(
153
152
  model_name: str,
154
153
  *,
155
154
  client: AuthenticatedClient,
156
- body: ModelWithDeployments,
155
+ body: Model,
157
156
  ) -> Optional[Model]:
158
157
  """Create or update model
159
158
 
@@ -161,8 +160,8 @@ async def asyncio(
161
160
 
162
161
  Args:
163
162
  model_name (str):
164
- body (ModelWithDeployments): Logical object representing a model but with deployment
165
- definition inside
163
+ body (Model): Logical object representing a model, that can be instantiated in multiple
164
+ environments as model deployments
166
165
 
167
166
  Raises:
168
167
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
File without changes
@@ -1,21 +1,18 @@
1
1
  from http import HTTPStatus
2
- from typing import Any, Optional, Union
2
+ from typing import Any, Optional, Union, cast
3
3
 
4
4
  import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.resource_deployment_metrics import ResourceDeploymentMetrics
8
+ from ...models.private_cluster import PrivateCluster
9
9
  from ...types import Response
10
10
 
11
11
 
12
- def _get_kwargs(
13
- agent_name: str,
14
- environment_name: str,
15
- ) -> dict[str, Any]:
12
+ def _get_kwargs() -> dict[str, Any]:
16
13
  _kwargs: dict[str, Any] = {
17
- "method": "get",
18
- "url": f"/agents/{agent_name}/deployments/{environment_name}/metrics",
14
+ "method": "post",
15
+ "url": "/privateclusters",
19
16
  }
20
17
 
21
18
  return _kwargs
@@ -23,11 +20,17 @@ def _get_kwargs(
23
20
 
24
21
  def _parse_response(
25
22
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
- ) -> Optional[ResourceDeploymentMetrics]:
23
+ ) -> Optional[Union[Any, PrivateCluster]]:
27
24
  if response.status_code == 200:
28
- response_200 = ResourceDeploymentMetrics.from_dict(response.json())
25
+ response_200 = PrivateCluster.from_dict(response.json())
29
26
 
30
27
  return response_200
28
+ if response.status_code == 401:
29
+ response_401 = cast(Any, None)
30
+ return response_401
31
+ if response.status_code == 403:
32
+ response_403 = cast(Any, None)
33
+ return response_403
31
34
  if client.raise_on_unexpected_status:
32
35
  raise errors.UnexpectedStatus(response.status_code, response.content)
33
36
  else:
@@ -36,7 +39,7 @@ def _parse_response(
36
39
 
37
40
  def _build_response(
38
41
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
39
- ) -> Response[ResourceDeploymentMetrics]:
42
+ ) -> Response[Union[Any, PrivateCluster]]:
40
43
  return Response(
41
44
  status_code=HTTPStatus(response.status_code),
42
45
  content=response.content,
@@ -46,28 +49,20 @@ def _build_response(
46
49
 
47
50
 
48
51
  def sync_detailed(
49
- agent_name: str,
50
- environment_name: str,
51
52
  *,
52
53
  client: AuthenticatedClient,
53
- ) -> Response[ResourceDeploymentMetrics]:
54
- """
55
- Args:
56
- agent_name (str):
57
- environment_name (str):
54
+ ) -> Response[Union[Any, PrivateCluster]]:
55
+ """Create private cluster
58
56
 
59
57
  Raises:
60
58
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
61
59
  httpx.TimeoutException: If the request takes longer than Client.timeout.
62
60
 
63
61
  Returns:
64
- Response[ResourceDeploymentMetrics]
62
+ Response[Union[Any, PrivateCluster]]
65
63
  """
66
64
 
67
- kwargs = _get_kwargs(
68
- agent_name=agent_name,
69
- environment_name=environment_name,
70
- )
65
+ kwargs = _get_kwargs()
71
66
 
72
67
  response = client.get_httpx_client().request(
73
68
  **kwargs,
@@ -77,54 +72,39 @@ def sync_detailed(
77
72
 
78
73
 
79
74
  def sync(
80
- agent_name: str,
81
- environment_name: str,
82
75
  *,
83
76
  client: AuthenticatedClient,
84
- ) -> Optional[ResourceDeploymentMetrics]:
85
- """
86
- Args:
87
- agent_name (str):
88
- environment_name (str):
77
+ ) -> Optional[Union[Any, PrivateCluster]]:
78
+ """Create private cluster
89
79
 
90
80
  Raises:
91
81
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
92
82
  httpx.TimeoutException: If the request takes longer than Client.timeout.
93
83
 
94
84
  Returns:
95
- ResourceDeploymentMetrics
85
+ Union[Any, PrivateCluster]
96
86
  """
97
87
 
98
88
  return sync_detailed(
99
- agent_name=agent_name,
100
- environment_name=environment_name,
101
89
  client=client,
102
90
  ).parsed
103
91
 
104
92
 
105
93
  async def asyncio_detailed(
106
- agent_name: str,
107
- environment_name: str,
108
94
  *,
109
95
  client: AuthenticatedClient,
110
- ) -> Response[ResourceDeploymentMetrics]:
111
- """
112
- Args:
113
- agent_name (str):
114
- environment_name (str):
96
+ ) -> Response[Union[Any, PrivateCluster]]:
97
+ """Create private cluster
115
98
 
116
99
  Raises:
117
100
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
101
  httpx.TimeoutException: If the request takes longer than Client.timeout.
119
102
 
120
103
  Returns:
121
- Response[ResourceDeploymentMetrics]
104
+ Response[Union[Any, PrivateCluster]]
122
105
  """
123
106
 
124
- kwargs = _get_kwargs(
125
- agent_name=agent_name,
126
- environment_name=environment_name,
127
- )
107
+ kwargs = _get_kwargs()
128
108
 
129
109
  response = await client.get_async_httpx_client().request(**kwargs)
130
110
 
@@ -132,28 +112,21 @@ async def asyncio_detailed(
132
112
 
133
113
 
134
114
  async def asyncio(
135
- agent_name: str,
136
- environment_name: str,
137
115
  *,
138
116
  client: AuthenticatedClient,
139
- ) -> Optional[ResourceDeploymentMetrics]:
140
- """
141
- Args:
142
- agent_name (str):
143
- environment_name (str):
117
+ ) -> Optional[Union[Any, PrivateCluster]]:
118
+ """Create private cluster
144
119
 
145
120
  Raises:
146
121
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
147
122
  httpx.TimeoutException: If the request takes longer than Client.timeout.
148
123
 
149
124
  Returns:
150
- ResourceDeploymentMetrics
125
+ Union[Any, PrivateCluster]
151
126
  """
152
127
 
153
128
  return (
154
129
  await asyncio_detailed(
155
- agent_name=agent_name,
156
- environment_name=environment_name,
157
130
  client=client,
158
131
  )
159
132
  ).parsed
@@ -1,20 +1,20 @@
1
1
  from http import HTTPStatus
2
- from typing import Any, Optional, Union
2
+ from typing import Any, Optional, Union, cast
3
3
 
4
4
  import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.function_deployment import FunctionDeployment
8
+ from ...models.private_cluster import PrivateCluster
9
9
  from ...types import Response
10
10
 
11
11
 
12
12
  def _get_kwargs(
13
- function_name: str,
13
+ private_cluster_name: str,
14
14
  ) -> dict[str, Any]:
15
15
  _kwargs: dict[str, Any] = {
16
- "method": "get",
17
- "url": f"/functions/{function_name}/deployments",
16
+ "method": "delete",
17
+ "url": f"/privateclusters/{private_cluster_name}",
18
18
  }
19
19
 
20
20
  return _kwargs
@@ -22,16 +22,17 @@ def _get_kwargs(
22
22
 
23
23
  def _parse_response(
24
24
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
25
- ) -> Optional[list["FunctionDeployment"]]:
25
+ ) -> Optional[Union[Any, PrivateCluster]]:
26
26
  if response.status_code == 200:
27
- response_200 = []
28
- _response_200 = response.json()
29
- for response_200_item_data in _response_200:
30
- response_200_item = FunctionDeployment.from_dict(response_200_item_data)
31
-
32
- response_200.append(response_200_item)
27
+ response_200 = PrivateCluster.from_dict(response.json())
33
28
 
34
29
  return response_200
30
+ if response.status_code == 401:
31
+ response_401 = cast(Any, None)
32
+ return response_401
33
+ if response.status_code == 403:
34
+ response_403 = cast(Any, None)
35
+ return response_403
35
36
  if client.raise_on_unexpected_status:
36
37
  raise errors.UnexpectedStatus(response.status_code, response.content)
37
38
  else:
@@ -40,7 +41,7 @@ def _parse_response(
40
41
 
41
42
  def _build_response(
42
43
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
43
- ) -> Response[list["FunctionDeployment"]]:
44
+ ) -> Response[Union[Any, PrivateCluster]]:
44
45
  return Response(
45
46
  status_code=HTTPStatus(response.status_code),
46
47
  content=response.content,
@@ -50,25 +51,25 @@ def _build_response(
50
51
 
51
52
 
52
53
  def sync_detailed(
53
- function_name: str,
54
+ private_cluster_name: str,
54
55
  *,
55
56
  client: AuthenticatedClient,
56
- ) -> Response[list["FunctionDeployment"]]:
57
- """List all function deployments
57
+ ) -> Response[Union[Any, PrivateCluster]]:
58
+ """Delete private cluster
58
59
 
59
60
  Args:
60
- function_name (str):
61
+ private_cluster_name (str):
61
62
 
62
63
  Raises:
63
64
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
64
65
  httpx.TimeoutException: If the request takes longer than Client.timeout.
65
66
 
66
67
  Returns:
67
- Response[list['FunctionDeployment']]
68
+ Response[Union[Any, PrivateCluster]]
68
69
  """
69
70
 
70
71
  kwargs = _get_kwargs(
71
- function_name=function_name,
72
+ private_cluster_name=private_cluster_name,
72
73
  )
73
74
 
74
75
  response = client.get_httpx_client().request(
@@ -79,49 +80,49 @@ def sync_detailed(
79
80
 
80
81
 
81
82
  def sync(
82
- function_name: str,
83
+ private_cluster_name: str,
83
84
  *,
84
85
  client: AuthenticatedClient,
85
- ) -> Optional[list["FunctionDeployment"]]:
86
- """List all function deployments
86
+ ) -> Optional[Union[Any, PrivateCluster]]:
87
+ """Delete private cluster
87
88
 
88
89
  Args:
89
- function_name (str):
90
+ private_cluster_name (str):
90
91
 
91
92
  Raises:
92
93
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
93
94
  httpx.TimeoutException: If the request takes longer than Client.timeout.
94
95
 
95
96
  Returns:
96
- list['FunctionDeployment']
97
+ Union[Any, PrivateCluster]
97
98
  """
98
99
 
99
100
  return sync_detailed(
100
- function_name=function_name,
101
+ private_cluster_name=private_cluster_name,
101
102
  client=client,
102
103
  ).parsed
103
104
 
104
105
 
105
106
  async def asyncio_detailed(
106
- function_name: str,
107
+ private_cluster_name: str,
107
108
  *,
108
109
  client: AuthenticatedClient,
109
- ) -> Response[list["FunctionDeployment"]]:
110
- """List all function deployments
110
+ ) -> Response[Union[Any, PrivateCluster]]:
111
+ """Delete private cluster
111
112
 
112
113
  Args:
113
- function_name (str):
114
+ private_cluster_name (str):
114
115
 
115
116
  Raises:
116
117
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
117
118
  httpx.TimeoutException: If the request takes longer than Client.timeout.
118
119
 
119
120
  Returns:
120
- Response[list['FunctionDeployment']]
121
+ Response[Union[Any, PrivateCluster]]
121
122
  """
122
123
 
123
124
  kwargs = _get_kwargs(
124
- function_name=function_name,
125
+ private_cluster_name=private_cluster_name,
125
126
  )
126
127
 
127
128
  response = await client.get_async_httpx_client().request(**kwargs)
@@ -130,26 +131,26 @@ async def asyncio_detailed(
130
131
 
131
132
 
132
133
  async def asyncio(
133
- function_name: str,
134
+ private_cluster_name: str,
134
135
  *,
135
136
  client: AuthenticatedClient,
136
- ) -> Optional[list["FunctionDeployment"]]:
137
- """List all function deployments
137
+ ) -> Optional[Union[Any, PrivateCluster]]:
138
+ """Delete private cluster
138
139
 
139
140
  Args:
140
- function_name (str):
141
+ private_cluster_name (str):
141
142
 
142
143
  Raises:
143
144
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
144
145
  httpx.TimeoutException: If the request takes longer than Client.timeout.
145
146
 
146
147
  Returns:
147
- list['FunctionDeployment']
148
+ Union[Any, PrivateCluster]
148
149
  """
149
150
 
150
151
  return (
151
152
  await asyncio_detailed(
152
- function_name=function_name,
153
+ private_cluster_name=private_cluster_name,
153
154
  client=client,
154
155
  )
155
156
  ).parsed
@@ -1,21 +1,20 @@
1
1
  from http import HTTPStatus
2
- from typing import Any, Optional, Union
2
+ from typing import Any, Optional, Union, cast
3
3
 
4
4
  import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.agent_deployment import AgentDeployment
8
+ from ...models.private_cluster import PrivateCluster
9
9
  from ...types import Response
10
10
 
11
11
 
12
12
  def _get_kwargs(
13
- agent_name: str,
14
- environment_name: str,
13
+ private_cluster_name: str,
15
14
  ) -> dict[str, Any]:
16
15
  _kwargs: dict[str, Any] = {
17
16
  "method": "get",
18
- "url": f"/agents/{agent_name}/deployments/{environment_name}",
17
+ "url": f"/privateclusters/{private_cluster_name}",
19
18
  }
20
19
 
21
20
  return _kwargs
@@ -23,11 +22,20 @@ def _get_kwargs(
23
22
 
24
23
  def _parse_response(
25
24
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
- ) -> Optional[AgentDeployment]:
25
+ ) -> Optional[Union[Any, PrivateCluster]]:
27
26
  if response.status_code == 200:
28
- response_200 = AgentDeployment.from_dict(response.json())
27
+ response_200 = PrivateCluster.from_dict(response.json())
29
28
 
30
29
  return response_200
30
+ if response.status_code == 401:
31
+ response_401 = cast(Any, None)
32
+ return response_401
33
+ if response.status_code == 403:
34
+ response_403 = cast(Any, None)
35
+ return response_403
36
+ if response.status_code == 404:
37
+ response_404 = cast(Any, None)
38
+ return response_404
31
39
  if client.raise_on_unexpected_status:
32
40
  raise errors.UnexpectedStatus(response.status_code, response.content)
33
41
  else:
@@ -36,7 +44,7 @@ def _parse_response(
36
44
 
37
45
  def _build_response(
38
46
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
39
- ) -> Response[AgentDeployment]:
47
+ ) -> Response[Union[Any, PrivateCluster]]:
40
48
  return Response(
41
49
  status_code=HTTPStatus(response.status_code),
42
50
  content=response.content,
@@ -46,28 +54,25 @@ def _build_response(
46
54
 
47
55
 
48
56
  def sync_detailed(
49
- agent_name: str,
50
- environment_name: str,
57
+ private_cluster_name: str,
51
58
  *,
52
59
  client: AuthenticatedClient,
53
- ) -> Response[AgentDeployment]:
54
- """Get agent deployment by environment name
60
+ ) -> Response[Union[Any, PrivateCluster]]:
61
+ """Get private cluster by name
55
62
 
56
63
  Args:
57
- agent_name (str):
58
- environment_name (str):
64
+ private_cluster_name (str):
59
65
 
60
66
  Raises:
61
67
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
62
68
  httpx.TimeoutException: If the request takes longer than Client.timeout.
63
69
 
64
70
  Returns:
65
- Response[AgentDeployment]
71
+ Response[Union[Any, PrivateCluster]]
66
72
  """
67
73
 
68
74
  kwargs = _get_kwargs(
69
- agent_name=agent_name,
70
- environment_name=environment_name,
75
+ private_cluster_name=private_cluster_name,
71
76
  )
72
77
 
73
78
  response = client.get_httpx_client().request(
@@ -78,55 +83,49 @@ def sync_detailed(
78
83
 
79
84
 
80
85
  def sync(
81
- agent_name: str,
82
- environment_name: str,
86
+ private_cluster_name: str,
83
87
  *,
84
88
  client: AuthenticatedClient,
85
- ) -> Optional[AgentDeployment]:
86
- """Get agent deployment by environment name
89
+ ) -> Optional[Union[Any, PrivateCluster]]:
90
+ """Get private cluster by name
87
91
 
88
92
  Args:
89
- agent_name (str):
90
- environment_name (str):
93
+ private_cluster_name (str):
91
94
 
92
95
  Raises:
93
96
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
94
97
  httpx.TimeoutException: If the request takes longer than Client.timeout.
95
98
 
96
99
  Returns:
97
- AgentDeployment
100
+ Union[Any, PrivateCluster]
98
101
  """
99
102
 
100
103
  return sync_detailed(
101
- agent_name=agent_name,
102
- environment_name=environment_name,
104
+ private_cluster_name=private_cluster_name,
103
105
  client=client,
104
106
  ).parsed
105
107
 
106
108
 
107
109
  async def asyncio_detailed(
108
- agent_name: str,
109
- environment_name: str,
110
+ private_cluster_name: str,
110
111
  *,
111
112
  client: AuthenticatedClient,
112
- ) -> Response[AgentDeployment]:
113
- """Get agent deployment by environment name
113
+ ) -> Response[Union[Any, PrivateCluster]]:
114
+ """Get private cluster by name
114
115
 
115
116
  Args:
116
- agent_name (str):
117
- environment_name (str):
117
+ private_cluster_name (str):
118
118
 
119
119
  Raises:
120
120
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
121
121
  httpx.TimeoutException: If the request takes longer than Client.timeout.
122
122
 
123
123
  Returns:
124
- Response[AgentDeployment]
124
+ Response[Union[Any, PrivateCluster]]
125
125
  """
126
126
 
127
127
  kwargs = _get_kwargs(
128
- agent_name=agent_name,
129
- environment_name=environment_name,
128
+ private_cluster_name=private_cluster_name,
130
129
  )
131
130
 
132
131
  response = await client.get_async_httpx_client().request(**kwargs)
@@ -135,29 +134,26 @@ async def asyncio_detailed(
135
134
 
136
135
 
137
136
  async def asyncio(
138
- agent_name: str,
139
- environment_name: str,
137
+ private_cluster_name: str,
140
138
  *,
141
139
  client: AuthenticatedClient,
142
- ) -> Optional[AgentDeployment]:
143
- """Get agent deployment by environment name
140
+ ) -> Optional[Union[Any, PrivateCluster]]:
141
+ """Get private cluster by name
144
142
 
145
143
  Args:
146
- agent_name (str):
147
- environment_name (str):
144
+ private_cluster_name (str):
148
145
 
149
146
  Raises:
150
147
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
151
148
  httpx.TimeoutException: If the request takes longer than Client.timeout.
152
149
 
153
150
  Returns:
154
- AgentDeployment
151
+ Union[Any, PrivateCluster]
155
152
  """
156
153
 
157
154
  return (
158
155
  await asyncio_detailed(
159
- agent_name=agent_name,
160
- environment_name=environment_name,
156
+ private_cluster_name=private_cluster_name,
161
157
  client=client,
162
158
  )
163
159
  ).parsed