beamlit 0.0.24rc20__py3-none-any.whl → 0.0.24rc21__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.24rc21.dist-info}/METADATA +1 -1
  101. beamlit-0.0.24rc21.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.24rc21.dist-info}/WHEEL +0 -0
@@ -1,198 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Optional, Union
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import AuthenticatedClient, Client
8
- from ...models.agent_deployment_history import AgentDeploymentHistory
9
- from ...types import Response
10
-
11
-
12
- def _get_kwargs(
13
- agent_name: str,
14
- environment_name: str,
15
- request_id: str,
16
- *,
17
- body: AgentDeploymentHistory,
18
- ) -> dict[str, Any]:
19
- headers: dict[str, Any] = {}
20
-
21
- _kwargs: dict[str, Any] = {
22
- "method": "put",
23
- "url": f"/agents/{agent_name}/deployments/{environment_name}/history/{request_id}",
24
- }
25
-
26
- _body = body.to_dict()
27
-
28
- _kwargs["json"] = _body
29
- headers["Content-Type"] = "application/json"
30
-
31
- _kwargs["headers"] = headers
32
- return _kwargs
33
-
34
-
35
- def _parse_response(
36
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
37
- ) -> Optional[AgentDeploymentHistory]:
38
- if response.status_code == 200:
39
- response_200 = AgentDeploymentHistory.from_dict(response.json())
40
-
41
- return response_200
42
- if client.raise_on_unexpected_status:
43
- raise errors.UnexpectedStatus(response.status_code, response.content)
44
- else:
45
- return None
46
-
47
-
48
- def _build_response(
49
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
50
- ) -> Response[AgentDeploymentHistory]:
51
- return Response(
52
- status_code=HTTPStatus(response.status_code),
53
- content=response.content,
54
- headers=response.headers,
55
- parsed=_parse_response(client=client, response=response),
56
- )
57
-
58
-
59
- def sync_detailed(
60
- agent_name: str,
61
- environment_name: str,
62
- request_id: str,
63
- *,
64
- client: AuthenticatedClient,
65
- body: AgentDeploymentHistory,
66
- ) -> Response[AgentDeploymentHistory]:
67
- """Update agent's history by request ID
68
-
69
- Args:
70
- agent_name (str):
71
- environment_name (str):
72
- request_id (str):
73
- body (AgentDeploymentHistory): Agent deployment history
74
-
75
- Raises:
76
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
77
- httpx.TimeoutException: If the request takes longer than Client.timeout.
78
-
79
- Returns:
80
- Response[AgentDeploymentHistory]
81
- """
82
-
83
- kwargs = _get_kwargs(
84
- agent_name=agent_name,
85
- environment_name=environment_name,
86
- request_id=request_id,
87
- body=body,
88
- )
89
-
90
- response = client.get_httpx_client().request(
91
- **kwargs,
92
- )
93
-
94
- return _build_response(client=client, response=response)
95
-
96
-
97
- def sync(
98
- agent_name: str,
99
- environment_name: str,
100
- request_id: str,
101
- *,
102
- client: AuthenticatedClient,
103
- body: AgentDeploymentHistory,
104
- ) -> Optional[AgentDeploymentHistory]:
105
- """Update agent's history by request ID
106
-
107
- Args:
108
- agent_name (str):
109
- environment_name (str):
110
- request_id (str):
111
- body (AgentDeploymentHistory): Agent deployment history
112
-
113
- Raises:
114
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
115
- httpx.TimeoutException: If the request takes longer than Client.timeout.
116
-
117
- Returns:
118
- AgentDeploymentHistory
119
- """
120
-
121
- return sync_detailed(
122
- agent_name=agent_name,
123
- environment_name=environment_name,
124
- request_id=request_id,
125
- client=client,
126
- body=body,
127
- ).parsed
128
-
129
-
130
- async def asyncio_detailed(
131
- agent_name: str,
132
- environment_name: str,
133
- request_id: str,
134
- *,
135
- client: AuthenticatedClient,
136
- body: AgentDeploymentHistory,
137
- ) -> Response[AgentDeploymentHistory]:
138
- """Update agent's history by request ID
139
-
140
- Args:
141
- agent_name (str):
142
- environment_name (str):
143
- request_id (str):
144
- body (AgentDeploymentHistory): Agent deployment history
145
-
146
- Raises:
147
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
148
- httpx.TimeoutException: If the request takes longer than Client.timeout.
149
-
150
- Returns:
151
- Response[AgentDeploymentHistory]
152
- """
153
-
154
- kwargs = _get_kwargs(
155
- agent_name=agent_name,
156
- environment_name=environment_name,
157
- request_id=request_id,
158
- body=body,
159
- )
160
-
161
- response = await client.get_async_httpx_client().request(**kwargs)
162
-
163
- return _build_response(client=client, response=response)
164
-
165
-
166
- async def asyncio(
167
- agent_name: str,
168
- environment_name: str,
169
- request_id: str,
170
- *,
171
- client: AuthenticatedClient,
172
- body: AgentDeploymentHistory,
173
- ) -> Optional[AgentDeploymentHistory]:
174
- """Update agent's history by request ID
175
-
176
- Args:
177
- agent_name (str):
178
- environment_name (str):
179
- request_id (str):
180
- body (AgentDeploymentHistory): Agent deployment history
181
-
182
- Raises:
183
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
184
- httpx.TimeoutException: If the request takes longer than Client.timeout.
185
-
186
- Returns:
187
- AgentDeploymentHistory
188
- """
189
-
190
- return (
191
- await asyncio_detailed(
192
- agent_name=agent_name,
193
- environment_name=environment_name,
194
- request_id=request_id,
195
- client=client,
196
- body=body,
197
- )
198
- ).parsed
@@ -1,163 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Optional, Union
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import AuthenticatedClient, Client
8
- from ...models.function_deployment import FunctionDeployment
9
- from ...types import Response
10
-
11
-
12
- def _get_kwargs(
13
- function_name: str,
14
- environment_name: str,
15
- ) -> dict[str, Any]:
16
- _kwargs: dict[str, Any] = {
17
- "method": "delete",
18
- "url": f"/functions/{function_name}/deployments/{environment_name}",
19
- }
20
-
21
- return _kwargs
22
-
23
-
24
- def _parse_response(
25
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
- ) -> Optional[FunctionDeployment]:
27
- if response.status_code == 200:
28
- response_200 = FunctionDeployment.from_dict(response.json())
29
-
30
- return response_200
31
- if client.raise_on_unexpected_status:
32
- raise errors.UnexpectedStatus(response.status_code, response.content)
33
- else:
34
- return None
35
-
36
-
37
- def _build_response(
38
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
39
- ) -> Response[FunctionDeployment]:
40
- return Response(
41
- status_code=HTTPStatus(response.status_code),
42
- content=response.content,
43
- headers=response.headers,
44
- parsed=_parse_response(client=client, response=response),
45
- )
46
-
47
-
48
- def sync_detailed(
49
- function_name: str,
50
- environment_name: str,
51
- *,
52
- client: AuthenticatedClient,
53
- ) -> Response[FunctionDeployment]:
54
- """Delete function deployment by environment name
55
-
56
- Args:
57
- function_name (str):
58
- environment_name (str):
59
-
60
- Raises:
61
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
62
- httpx.TimeoutException: If the request takes longer than Client.timeout.
63
-
64
- Returns:
65
- Response[FunctionDeployment]
66
- """
67
-
68
- kwargs = _get_kwargs(
69
- function_name=function_name,
70
- environment_name=environment_name,
71
- )
72
-
73
- response = client.get_httpx_client().request(
74
- **kwargs,
75
- )
76
-
77
- return _build_response(client=client, response=response)
78
-
79
-
80
- def sync(
81
- function_name: str,
82
- environment_name: str,
83
- *,
84
- client: AuthenticatedClient,
85
- ) -> Optional[FunctionDeployment]:
86
- """Delete function deployment by environment name
87
-
88
- Args:
89
- function_name (str):
90
- environment_name (str):
91
-
92
- Raises:
93
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
94
- httpx.TimeoutException: If the request takes longer than Client.timeout.
95
-
96
- Returns:
97
- FunctionDeployment
98
- """
99
-
100
- return sync_detailed(
101
- function_name=function_name,
102
- environment_name=environment_name,
103
- client=client,
104
- ).parsed
105
-
106
-
107
- async def asyncio_detailed(
108
- function_name: str,
109
- environment_name: str,
110
- *,
111
- client: AuthenticatedClient,
112
- ) -> Response[FunctionDeployment]:
113
- """Delete function deployment by environment name
114
-
115
- Args:
116
- function_name (str):
117
- environment_name (str):
118
-
119
- Raises:
120
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
121
- httpx.TimeoutException: If the request takes longer than Client.timeout.
122
-
123
- Returns:
124
- Response[FunctionDeployment]
125
- """
126
-
127
- kwargs = _get_kwargs(
128
- function_name=function_name,
129
- environment_name=environment_name,
130
- )
131
-
132
- response = await client.get_async_httpx_client().request(**kwargs)
133
-
134
- return _build_response(client=client, response=response)
135
-
136
-
137
- async def asyncio(
138
- function_name: str,
139
- environment_name: str,
140
- *,
141
- client: AuthenticatedClient,
142
- ) -> Optional[FunctionDeployment]:
143
- """Delete function deployment by environment name
144
-
145
- Args:
146
- function_name (str):
147
- environment_name (str):
148
-
149
- Raises:
150
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
151
- httpx.TimeoutException: If the request takes longer than Client.timeout.
152
-
153
- Returns:
154
- FunctionDeployment
155
- """
156
-
157
- return (
158
- await asyncio_detailed(
159
- function_name=function_name,
160
- environment_name=environment_name,
161
- client=client,
162
- )
163
- ).parsed
@@ -1,163 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Optional, Union
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import AuthenticatedClient, Client
8
- from ...models.function_deployment import FunctionDeployment
9
- from ...types import Response
10
-
11
-
12
- def _get_kwargs(
13
- function_name: str,
14
- environment_name: str,
15
- ) -> dict[str, Any]:
16
- _kwargs: dict[str, Any] = {
17
- "method": "get",
18
- "url": f"/functions/{function_name}/deployments/{environment_name}",
19
- }
20
-
21
- return _kwargs
22
-
23
-
24
- def _parse_response(
25
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
- ) -> Optional[FunctionDeployment]:
27
- if response.status_code == 200:
28
- response_200 = FunctionDeployment.from_dict(response.json())
29
-
30
- return response_200
31
- if client.raise_on_unexpected_status:
32
- raise errors.UnexpectedStatus(response.status_code, response.content)
33
- else:
34
- return None
35
-
36
-
37
- def _build_response(
38
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
39
- ) -> Response[FunctionDeployment]:
40
- return Response(
41
- status_code=HTTPStatus(response.status_code),
42
- content=response.content,
43
- headers=response.headers,
44
- parsed=_parse_response(client=client, response=response),
45
- )
46
-
47
-
48
- def sync_detailed(
49
- function_name: str,
50
- environment_name: str,
51
- *,
52
- client: AuthenticatedClient,
53
- ) -> Response[FunctionDeployment]:
54
- """Get function deployment by environment name
55
-
56
- Args:
57
- function_name (str):
58
- environment_name (str):
59
-
60
- Raises:
61
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
62
- httpx.TimeoutException: If the request takes longer than Client.timeout.
63
-
64
- Returns:
65
- Response[FunctionDeployment]
66
- """
67
-
68
- kwargs = _get_kwargs(
69
- function_name=function_name,
70
- environment_name=environment_name,
71
- )
72
-
73
- response = client.get_httpx_client().request(
74
- **kwargs,
75
- )
76
-
77
- return _build_response(client=client, response=response)
78
-
79
-
80
- def sync(
81
- function_name: str,
82
- environment_name: str,
83
- *,
84
- client: AuthenticatedClient,
85
- ) -> Optional[FunctionDeployment]:
86
- """Get function deployment by environment name
87
-
88
- Args:
89
- function_name (str):
90
- environment_name (str):
91
-
92
- Raises:
93
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
94
- httpx.TimeoutException: If the request takes longer than Client.timeout.
95
-
96
- Returns:
97
- FunctionDeployment
98
- """
99
-
100
- return sync_detailed(
101
- function_name=function_name,
102
- environment_name=environment_name,
103
- client=client,
104
- ).parsed
105
-
106
-
107
- async def asyncio_detailed(
108
- function_name: str,
109
- environment_name: str,
110
- *,
111
- client: AuthenticatedClient,
112
- ) -> Response[FunctionDeployment]:
113
- """Get function deployment by environment name
114
-
115
- Args:
116
- function_name (str):
117
- environment_name (str):
118
-
119
- Raises:
120
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
121
- httpx.TimeoutException: If the request takes longer than Client.timeout.
122
-
123
- Returns:
124
- Response[FunctionDeployment]
125
- """
126
-
127
- kwargs = _get_kwargs(
128
- function_name=function_name,
129
- environment_name=environment_name,
130
- )
131
-
132
- response = await client.get_async_httpx_client().request(**kwargs)
133
-
134
- return _build_response(client=client, response=response)
135
-
136
-
137
- async def asyncio(
138
- function_name: str,
139
- environment_name: str,
140
- *,
141
- client: AuthenticatedClient,
142
- ) -> Optional[FunctionDeployment]:
143
- """Get function deployment by environment name
144
-
145
- Args:
146
- function_name (str):
147
- environment_name (str):
148
-
149
- Raises:
150
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
151
- httpx.TimeoutException: If the request takes longer than Client.timeout.
152
-
153
- Returns:
154
- FunctionDeployment
155
- """
156
-
157
- return (
158
- await asyncio_detailed(
159
- function_name=function_name,
160
- environment_name=environment_name,
161
- client=client,
162
- )
163
- ).parsed
@@ -1,164 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Optional, Union
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import AuthenticatedClient, Client
8
- from ...models.resource_deployment_log import ResourceDeploymentLog
9
- from ...types import Response
10
-
11
-
12
- def _get_kwargs(
13
- function_name: str,
14
- environment_name: str,
15
- ) -> dict[str, Any]:
16
- _kwargs: dict[str, Any] = {
17
- "method": "get",
18
- "url": f"/functions/{function_name}/deployments/{environment_name}/logs",
19
- }
20
-
21
- return _kwargs
22
-
23
-
24
- def _parse_response(
25
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
- ) -> Optional[list["ResourceDeploymentLog"]]:
27
- if response.status_code == 200:
28
- response_200 = []
29
- _response_200 = response.json()
30
- for response_200_item_data in _response_200:
31
- response_200_item = ResourceDeploymentLog.from_dict(response_200_item_data)
32
-
33
- response_200.append(response_200_item)
34
-
35
- return response_200
36
- if client.raise_on_unexpected_status:
37
- raise errors.UnexpectedStatus(response.status_code, response.content)
38
- else:
39
- return None
40
-
41
-
42
- def _build_response(
43
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
44
- ) -> Response[list["ResourceDeploymentLog"]]:
45
- return Response(
46
- status_code=HTTPStatus(response.status_code),
47
- content=response.content,
48
- headers=response.headers,
49
- parsed=_parse_response(client=client, response=response),
50
- )
51
-
52
-
53
- def sync_detailed(
54
- function_name: str,
55
- environment_name: str,
56
- *,
57
- client: AuthenticatedClient,
58
- ) -> Response[list["ResourceDeploymentLog"]]:
59
- """
60
- Args:
61
- function_name (str):
62
- environment_name (str):
63
-
64
- Raises:
65
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
66
- httpx.TimeoutException: If the request takes longer than Client.timeout.
67
-
68
- Returns:
69
- Response[list['ResourceDeploymentLog']]
70
- """
71
-
72
- kwargs = _get_kwargs(
73
- function_name=function_name,
74
- environment_name=environment_name,
75
- )
76
-
77
- response = client.get_httpx_client().request(
78
- **kwargs,
79
- )
80
-
81
- return _build_response(client=client, response=response)
82
-
83
-
84
- def sync(
85
- function_name: str,
86
- environment_name: str,
87
- *,
88
- client: AuthenticatedClient,
89
- ) -> Optional[list["ResourceDeploymentLog"]]:
90
- """
91
- Args:
92
- function_name (str):
93
- environment_name (str):
94
-
95
- Raises:
96
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
97
- httpx.TimeoutException: If the request takes longer than Client.timeout.
98
-
99
- Returns:
100
- list['ResourceDeploymentLog']
101
- """
102
-
103
- return sync_detailed(
104
- function_name=function_name,
105
- environment_name=environment_name,
106
- client=client,
107
- ).parsed
108
-
109
-
110
- async def asyncio_detailed(
111
- function_name: str,
112
- environment_name: str,
113
- *,
114
- client: AuthenticatedClient,
115
- ) -> Response[list["ResourceDeploymentLog"]]:
116
- """
117
- Args:
118
- function_name (str):
119
- environment_name (str):
120
-
121
- Raises:
122
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
123
- httpx.TimeoutException: If the request takes longer than Client.timeout.
124
-
125
- Returns:
126
- Response[list['ResourceDeploymentLog']]
127
- """
128
-
129
- kwargs = _get_kwargs(
130
- function_name=function_name,
131
- environment_name=environment_name,
132
- )
133
-
134
- response = await client.get_async_httpx_client().request(**kwargs)
135
-
136
- return _build_response(client=client, response=response)
137
-
138
-
139
- async def asyncio(
140
- function_name: str,
141
- environment_name: str,
142
- *,
143
- client: AuthenticatedClient,
144
- ) -> Optional[list["ResourceDeploymentLog"]]:
145
- """
146
- Args:
147
- function_name (str):
148
- environment_name (str):
149
-
150
- Raises:
151
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
152
- httpx.TimeoutException: If the request takes longer than Client.timeout.
153
-
154
- Returns:
155
- list['ResourceDeploymentLog']
156
- """
157
-
158
- return (
159
- await asyncio_detailed(
160
- function_name=function_name,
161
- environment_name=environment_name,
162
- client=client,
163
- )
164
- ).parsed