beamlit 0.1.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. beamlit/__init__.py +8 -0
  2. beamlit/api/__init__.py +1 -0
  3. beamlit/api/agents/__init__.py +0 -0
  4. beamlit/api/agents/create_agent.py +155 -0
  5. beamlit/api/agents/create_agent_release.py +146 -0
  6. beamlit/api/agents/delete_agent.py +146 -0
  7. beamlit/api/agents/delete_agent_deployment.py +163 -0
  8. beamlit/api/agents/delete_agent_deployment_history.py +172 -0
  9. beamlit/api/agents/get_agent.py +146 -0
  10. beamlit/api/agents/get_agent_deployment.py +163 -0
  11. beamlit/api/agents/get_agent_deployment_history.py +172 -0
  12. beamlit/api/agents/get_agent_deployment_logs.py +164 -0
  13. beamlit/api/agents/get_agent_deployment_metrics.py +159 -0
  14. beamlit/api/agents/get_agent_metrics.py +150 -0
  15. beamlit/api/agents/list_agent_deployment_history.py +164 -0
  16. beamlit/api/agents/list_agent_deployments.py +155 -0
  17. beamlit/api/agents/list_agents.py +127 -0
  18. beamlit/api/agents/put_agent_deployment.py +185 -0
  19. beamlit/api/agents/put_agent_deployment_history.py +198 -0
  20. beamlit/api/agents/update_agent.py +168 -0
  21. beamlit/api/authentication_providers/__init__.py +0 -0
  22. beamlit/api/authentication_providers/get_model_with_repo_for_authentication_provider.py +184 -0
  23. beamlit/api/authentication_providers/list_models_for_authentication_provider.py +163 -0
  24. beamlit/api/authentication_providers/list_organizations_for_authentication_provider.py +163 -0
  25. beamlit/api/configurations/__init__.py +0 -0
  26. beamlit/api/configurations/get_configuration.py +122 -0
  27. beamlit/api/environments/__init__.py +0 -0
  28. beamlit/api/environments/create_environment.py +167 -0
  29. beamlit/api/environments/delete_environment.py +154 -0
  30. beamlit/api/environments/get_environment.py +154 -0
  31. beamlit/api/environments/get_environment_metrics.py +158 -0
  32. beamlit/api/environments/list_environments.py +139 -0
  33. beamlit/api/environments/update_environment.py +180 -0
  34. beamlit/api/functions/__init__.py +0 -0
  35. beamlit/api/functions/create_function.py +155 -0
  36. beamlit/api/functions/create_function_release.py +150 -0
  37. beamlit/api/functions/delete_function.py +146 -0
  38. beamlit/api/functions/delete_function_deployment.py +163 -0
  39. beamlit/api/functions/get_function.py +146 -0
  40. beamlit/api/functions/get_function_deployment.py +163 -0
  41. beamlit/api/functions/get_function_deployment_logs.py +164 -0
  42. beamlit/api/functions/get_function_deployment_metrics.py +159 -0
  43. beamlit/api/functions/get_function_metrics.py +150 -0
  44. beamlit/api/functions/list_function_deployments.py +155 -0
  45. beamlit/api/functions/list_functions.py +131 -0
  46. beamlit/api/functions/put_function_deployment.py +185 -0
  47. beamlit/api/functions/update_function.py +168 -0
  48. beamlit/api/history/__init__.py +0 -0
  49. beamlit/api/history/get_agents_history.py +155 -0
  50. beamlit/api/history/list_agents_history.py +131 -0
  51. beamlit/api/invitations/__init__.py +0 -0
  52. beamlit/api/invitations/list_all_pending_invitations.py +142 -0
  53. beamlit/api/locations/__init__.py +0 -0
  54. beamlit/api/locations/list_locations.py +139 -0
  55. beamlit/api/metrics/__init__.py +0 -0
  56. beamlit/api/metrics/get_metrics.py +130 -0
  57. beamlit/api/model_providers/__init__.py +0 -0
  58. beamlit/api/model_providers/create_model_provider.py +163 -0
  59. beamlit/api/model_providers/delete_model_provider.py +154 -0
  60. beamlit/api/model_providers/get_model_provider.py +154 -0
  61. beamlit/api/model_providers/list_model_providers.py +139 -0
  62. beamlit/api/model_providers/update_model_provider.py +176 -0
  63. beamlit/api/models/__init__.py +0 -0
  64. beamlit/api/models/create_model.py +168 -0
  65. beamlit/api/models/delete_model.py +154 -0
  66. beamlit/api/models/delete_model_deployment.py +171 -0
  67. beamlit/api/models/get_model.py +154 -0
  68. beamlit/api/models/get_model_deployment.py +171 -0
  69. beamlit/api/models/get_model_deployment_logs.py +168 -0
  70. beamlit/api/models/get_model_deployment_metrics.py +163 -0
  71. beamlit/api/models/get_model_metrics.py +154 -0
  72. beamlit/api/models/list_model_deployments.py +163 -0
  73. beamlit/api/models/list_models.py +135 -0
  74. beamlit/api/models/put_model_deployment.py +193 -0
  75. beamlit/api/models/release_model.py +154 -0
  76. beamlit/api/models/update_model.py +181 -0
  77. beamlit/api/policies/__init__.py +0 -0
  78. beamlit/api/policies/create_policy.py +167 -0
  79. beamlit/api/policies/delete_policy.py +154 -0
  80. beamlit/api/policies/get_policy.py +154 -0
  81. beamlit/api/policies/list_policies.py +139 -0
  82. beamlit/api/policies/update_policy.py +180 -0
  83. beamlit/api/service_accounts/__init__.py +0 -0
  84. beamlit/api/service_accounts/create_api_key_for_service_account.py +177 -0
  85. beamlit/api/service_accounts/create_workspace_service_account.py +168 -0
  86. beamlit/api/service_accounts/delete_api_key_for_service_account.py +104 -0
  87. beamlit/api/service_accounts/delete_workspace_service_account.py +158 -0
  88. beamlit/api/service_accounts/get_workspace_service_accounts.py +139 -0
  89. beamlit/api/service_accounts/list_api_keys_for_service_account.py +163 -0
  90. beamlit/api/service_accounts/update_workspace_service_account.py +181 -0
  91. beamlit/api/store/__init__.py +0 -0
  92. beamlit/api/store/get_store_agent.py +146 -0
  93. beamlit/api/store/get_store_function.py +146 -0
  94. beamlit/api/store/list_store_agents.py +131 -0
  95. beamlit/api/store/list_store_functions.py +131 -0
  96. beamlit/api/workspaces/__init__.py +0 -0
  97. beamlit/api/workspaces/accept_workspace_invitation.py +161 -0
  98. beamlit/api/workspaces/create_worspace.py +163 -0
  99. beamlit/api/workspaces/decline_workspace_invitation.py +158 -0
  100. beamlit/api/workspaces/delete_workspace.py +154 -0
  101. beamlit/api/workspaces/get_workspace.py +154 -0
  102. beamlit/api/workspaces/invite_workspace_user.py +174 -0
  103. beamlit/api/workspaces/leave_workspace.py +161 -0
  104. beamlit/api/workspaces/list_workspace_users.py +139 -0
  105. beamlit/api/workspaces/list_workspaces.py +139 -0
  106. beamlit/api/workspaces/remove_workspace_user.py +101 -0
  107. beamlit/api/workspaces/update_workspace.py +176 -0
  108. beamlit/api/workspaces/update_workspace_user_role.py +187 -0
  109. beamlit/authentication/__init__.py +24 -0
  110. beamlit/authentication/apikey.py +14 -0
  111. beamlit/authentication/authentication.py +35 -0
  112. beamlit/authentication/credentials.py +165 -0
  113. beamlit/authentication/device_mode.py +115 -0
  114. beamlit/client.py +270 -0
  115. beamlit/errors.py +16 -0
  116. beamlit/models/__init__.py +189 -0
  117. beamlit/models/acl.py +149 -0
  118. beamlit/models/agent.py +151 -0
  119. beamlit/models/agent_chain.py +77 -0
  120. beamlit/models/agent_configuration.py +68 -0
  121. beamlit/models/agent_deployment.py +327 -0
  122. beamlit/models/agent_deployment_configuration.py +43 -0
  123. beamlit/models/agent_deployment_history.py +183 -0
  124. beamlit/models/agent_deployment_history_event.py +131 -0
  125. beamlit/models/agent_deployment_pod_template.py +43 -0
  126. beamlit/models/agent_release.py +68 -0
  127. beamlit/models/api_key.py +140 -0
  128. beamlit/models/authentication_provider_model.py +142 -0
  129. beamlit/models/authentication_provider_organization.py +86 -0
  130. beamlit/models/configuration.py +72 -0
  131. beamlit/models/continent.py +68 -0
  132. beamlit/models/country.py +68 -0
  133. beamlit/models/create_api_key_for_service_account_body.py +67 -0
  134. beamlit/models/create_workspace_service_account_body.py +69 -0
  135. beamlit/models/create_workspace_service_account_response_200.py +103 -0
  136. beamlit/models/delete_workspace_service_account_response_200.py +94 -0
  137. beamlit/models/deployment_configuration.py +68 -0
  138. beamlit/models/deployment_configurations.py +43 -0
  139. beamlit/models/deployment_serverless_config.py +129 -0
  140. beamlit/models/environment.py +162 -0
  141. beamlit/models/environment_metrics.py +75 -0
  142. beamlit/models/flavor.py +68 -0
  143. beamlit/models/function.py +151 -0
  144. beamlit/models/function_configuration.py +68 -0
  145. beamlit/models/function_deployment.py +327 -0
  146. beamlit/models/function_deployment_configuration.py +43 -0
  147. beamlit/models/function_deployment_pod_template.py +43 -0
  148. beamlit/models/function_kit.py +95 -0
  149. beamlit/models/function_provider_ref.py +68 -0
  150. beamlit/models/function_release.py +68 -0
  151. beamlit/models/get_workspace_service_accounts_response_200_item.py +94 -0
  152. beamlit/models/invite_workspace_user_body.py +58 -0
  153. beamlit/models/labels.py +43 -0
  154. beamlit/models/labels_type_0.py +43 -0
  155. beamlit/models/location.py +120 -0
  156. beamlit/models/location_response.py +111 -0
  157. beamlit/models/metric.py +68 -0
  158. beamlit/models/metrics.py +111 -0
  159. beamlit/models/model.py +151 -0
  160. beamlit/models/model_deployment.py +283 -0
  161. beamlit/models/model_deployment_log.py +68 -0
  162. beamlit/models/model_deployment_metrics.py +170 -0
  163. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +75 -0
  164. beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +73 -0
  165. beamlit/models/model_deployment_pod_template.py +43 -0
  166. beamlit/models/model_metrics.py +94 -0
  167. beamlit/models/model_provider.py +187 -0
  168. beamlit/models/model_provider_ref.py +68 -0
  169. beamlit/models/model_release.py +68 -0
  170. beamlit/models/model_with_deployments.py +174 -0
  171. beamlit/models/pending_invitation.py +122 -0
  172. beamlit/models/pending_invitation_accept.py +81 -0
  173. beamlit/models/pending_invitation_render.py +135 -0
  174. beamlit/models/pending_invitation_render_invited_by.py +86 -0
  175. beamlit/models/pending_invitation_render_workspace.py +68 -0
  176. beamlit/models/pending_invitation_workspace_details.py +70 -0
  177. beamlit/models/policy.py +216 -0
  178. beamlit/models/policy_location.py +68 -0
  179. beamlit/models/provider_config.py +101 -0
  180. beamlit/models/qps.py +59 -0
  181. beamlit/models/resource_deployment_log.py +68 -0
  182. beamlit/models/resource_deployment_metrics.py +172 -0
  183. beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +75 -0
  184. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +73 -0
  185. beamlit/models/resource_metrics.py +94 -0
  186. beamlit/models/runtime.py +152 -0
  187. beamlit/models/runtime_readiness_probe.py +43 -0
  188. beamlit/models/runtime_resources.py +43 -0
  189. beamlit/models/serverless_config.py +122 -0
  190. beamlit/models/standard_fields_dynamo_db.py +86 -0
  191. beamlit/models/store_agent.py +165 -0
  192. beamlit/models/store_agent_configuration.py +95 -0
  193. beamlit/models/store_agent_labels.py +43 -0
  194. beamlit/models/store_configuration.py +149 -0
  195. beamlit/models/store_configuration_option.py +77 -0
  196. beamlit/models/store_function.py +207 -0
  197. beamlit/models/store_function_configuration.py +95 -0
  198. beamlit/models/store_function_kit.py +95 -0
  199. beamlit/models/store_function_labels.py +43 -0
  200. beamlit/models/store_function_parameter.py +86 -0
  201. beamlit/models/update_workspace_service_account_body.py +67 -0
  202. beamlit/models/update_workspace_service_account_response_200.py +94 -0
  203. beamlit/models/update_workspace_user_role_body.py +58 -0
  204. beamlit/models/workspace.py +126 -0
  205. beamlit/models/workspace_labels.py +43 -0
  206. beamlit/models/workspace_user.py +113 -0
  207. beamlit/py.typed +1 -0
  208. beamlit/types.py +46 -0
  209. beamlit-0.1.0.dist-info/METADATA +59 -0
  210. beamlit-0.1.0.dist-info/RECORD +211 -0
  211. beamlit-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,161 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.workspace import Workspace
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ workspace_name: str,
14
+ ) -> dict[str, Any]:
15
+ _kwargs: dict[str, Any] = {
16
+ "method": "delete",
17
+ "url": f"/workspaces/{workspace_name}/leave",
18
+ }
19
+
20
+ return _kwargs
21
+
22
+
23
+ def _parse_response(
24
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
25
+ ) -> Optional[Union[Any, Workspace]]:
26
+ if response.status_code == 200:
27
+ response_200 = Workspace.from_dict(response.json())
28
+
29
+ return response_200
30
+ if response.status_code == 404:
31
+ response_404 = cast(Any, None)
32
+ return response_404
33
+ if client.raise_on_unexpected_status:
34
+ raise errors.UnexpectedStatus(response.status_code, response.content)
35
+ else:
36
+ return None
37
+
38
+
39
+ def _build_response(
40
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
41
+ ) -> Response[Union[Any, Workspace]]:
42
+ return Response(
43
+ status_code=HTTPStatus(response.status_code),
44
+ content=response.content,
45
+ headers=response.headers,
46
+ parsed=_parse_response(client=client, response=response),
47
+ )
48
+
49
+
50
+ def sync_detailed(
51
+ workspace_name: str,
52
+ *,
53
+ client: AuthenticatedClient,
54
+ ) -> Response[Union[Any, Workspace]]:
55
+ """Leave workspace
56
+
57
+ Leaves a workspace.
58
+
59
+ Args:
60
+ workspace_name (str):
61
+
62
+ Raises:
63
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
64
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
65
+
66
+ Returns:
67
+ Response[Union[Any, Workspace]]
68
+ """
69
+
70
+ kwargs = _get_kwargs(
71
+ workspace_name=workspace_name,
72
+ )
73
+
74
+ response = client.get_httpx_client().request(
75
+ **kwargs,
76
+ )
77
+
78
+ return _build_response(client=client, response=response)
79
+
80
+
81
+ def sync(
82
+ workspace_name: str,
83
+ *,
84
+ client: AuthenticatedClient,
85
+ ) -> Optional[Union[Any, Workspace]]:
86
+ """Leave workspace
87
+
88
+ Leaves a workspace.
89
+
90
+ Args:
91
+ workspace_name (str):
92
+
93
+ Raises:
94
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
95
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
96
+
97
+ Returns:
98
+ Union[Any, Workspace]
99
+ """
100
+
101
+ return sync_detailed(
102
+ workspace_name=workspace_name,
103
+ client=client,
104
+ ).parsed
105
+
106
+
107
+ async def asyncio_detailed(
108
+ workspace_name: str,
109
+ *,
110
+ client: AuthenticatedClient,
111
+ ) -> Response[Union[Any, Workspace]]:
112
+ """Leave workspace
113
+
114
+ Leaves a workspace.
115
+
116
+ Args:
117
+ workspace_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[Union[Any, Workspace]]
125
+ """
126
+
127
+ kwargs = _get_kwargs(
128
+ workspace_name=workspace_name,
129
+ )
130
+
131
+ response = await client.get_async_httpx_client().request(**kwargs)
132
+
133
+ return _build_response(client=client, response=response)
134
+
135
+
136
+ async def asyncio(
137
+ workspace_name: str,
138
+ *,
139
+ client: AuthenticatedClient,
140
+ ) -> Optional[Union[Any, Workspace]]:
141
+ """Leave workspace
142
+
143
+ Leaves a workspace.
144
+
145
+ Args:
146
+ workspace_name (str):
147
+
148
+ Raises:
149
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
150
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
151
+
152
+ Returns:
153
+ Union[Any, Workspace]
154
+ """
155
+
156
+ return (
157
+ await asyncio_detailed(
158
+ workspace_name=workspace_name,
159
+ client=client,
160
+ )
161
+ ).parsed
@@ -0,0 +1,139 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, List, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.workspace_user import WorkspaceUser
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs() -> dict[str, Any]:
13
+ _kwargs: dict[str, Any] = {
14
+ "method": "get",
15
+ "url": "/users",
16
+ }
17
+
18
+ return _kwargs
19
+
20
+
21
+ def _parse_response(
22
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
23
+ ) -> Optional[List["WorkspaceUser"]]:
24
+ if response.status_code == 200:
25
+ response_200 = []
26
+ _response_200 = response.json()
27
+ for response_200_item_data in _response_200:
28
+ response_200_item = WorkspaceUser.from_dict(response_200_item_data)
29
+
30
+ response_200.append(response_200_item)
31
+
32
+ return response_200
33
+ if client.raise_on_unexpected_status:
34
+ raise errors.UnexpectedStatus(response.status_code, response.content)
35
+ else:
36
+ return None
37
+
38
+
39
+ def _build_response(
40
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
41
+ ) -> Response[List["WorkspaceUser"]]:
42
+ return Response(
43
+ status_code=HTTPStatus(response.status_code),
44
+ content=response.content,
45
+ headers=response.headers,
46
+ parsed=_parse_response(client=client, response=response),
47
+ )
48
+
49
+
50
+ def sync_detailed(
51
+ *,
52
+ client: AuthenticatedClient,
53
+ ) -> Response[List["WorkspaceUser"]]:
54
+ """List users in workspace
55
+
56
+ Returns a list of all users in the workspace.
57
+
58
+ Raises:
59
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
60
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
61
+
62
+ Returns:
63
+ Response[List['WorkspaceUser']]
64
+ """
65
+
66
+ kwargs = _get_kwargs()
67
+
68
+ response = client.get_httpx_client().request(
69
+ **kwargs,
70
+ )
71
+
72
+ return _build_response(client=client, response=response)
73
+
74
+
75
+ def sync(
76
+ *,
77
+ client: AuthenticatedClient,
78
+ ) -> Optional[List["WorkspaceUser"]]:
79
+ """List users in workspace
80
+
81
+ Returns a list of all users in the workspace.
82
+
83
+ Raises:
84
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
85
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
86
+
87
+ Returns:
88
+ List['WorkspaceUser']
89
+ """
90
+
91
+ return sync_detailed(
92
+ client=client,
93
+ ).parsed
94
+
95
+
96
+ async def asyncio_detailed(
97
+ *,
98
+ client: AuthenticatedClient,
99
+ ) -> Response[List["WorkspaceUser"]]:
100
+ """List users in workspace
101
+
102
+ Returns a list of all users in the workspace.
103
+
104
+ Raises:
105
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
106
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
107
+
108
+ Returns:
109
+ Response[List['WorkspaceUser']]
110
+ """
111
+
112
+ kwargs = _get_kwargs()
113
+
114
+ response = await client.get_async_httpx_client().request(**kwargs)
115
+
116
+ return _build_response(client=client, response=response)
117
+
118
+
119
+ async def asyncio(
120
+ *,
121
+ client: AuthenticatedClient,
122
+ ) -> Optional[List["WorkspaceUser"]]:
123
+ """List users in workspace
124
+
125
+ Returns a list of all users in the workspace.
126
+
127
+ Raises:
128
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
129
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
130
+
131
+ Returns:
132
+ List['WorkspaceUser']
133
+ """
134
+
135
+ return (
136
+ await asyncio_detailed(
137
+ client=client,
138
+ )
139
+ ).parsed
@@ -0,0 +1,139 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, List, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.workspace import Workspace
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs() -> dict[str, Any]:
13
+ _kwargs: dict[str, Any] = {
14
+ "method": "get",
15
+ "url": "/workspaces",
16
+ }
17
+
18
+ return _kwargs
19
+
20
+
21
+ def _parse_response(
22
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
23
+ ) -> Optional[List["Workspace"]]:
24
+ if response.status_code == 200:
25
+ response_200 = []
26
+ _response_200 = response.json()
27
+ for response_200_item_data in _response_200:
28
+ response_200_item = Workspace.from_dict(response_200_item_data)
29
+
30
+ response_200.append(response_200_item)
31
+
32
+ return response_200
33
+ if client.raise_on_unexpected_status:
34
+ raise errors.UnexpectedStatus(response.status_code, response.content)
35
+ else:
36
+ return None
37
+
38
+
39
+ def _build_response(
40
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
41
+ ) -> Response[List["Workspace"]]:
42
+ return Response(
43
+ status_code=HTTPStatus(response.status_code),
44
+ content=response.content,
45
+ headers=response.headers,
46
+ parsed=_parse_response(client=client, response=response),
47
+ )
48
+
49
+
50
+ def sync_detailed(
51
+ *,
52
+ client: AuthenticatedClient,
53
+ ) -> Response[List["Workspace"]]:
54
+ """List workspaces
55
+
56
+ Returns a list of all workspaces.
57
+
58
+ Raises:
59
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
60
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
61
+
62
+ Returns:
63
+ Response[List['Workspace']]
64
+ """
65
+
66
+ kwargs = _get_kwargs()
67
+
68
+ response = client.get_httpx_client().request(
69
+ **kwargs,
70
+ )
71
+
72
+ return _build_response(client=client, response=response)
73
+
74
+
75
+ def sync(
76
+ *,
77
+ client: AuthenticatedClient,
78
+ ) -> Optional[List["Workspace"]]:
79
+ """List workspaces
80
+
81
+ Returns a list of all workspaces.
82
+
83
+ Raises:
84
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
85
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
86
+
87
+ Returns:
88
+ List['Workspace']
89
+ """
90
+
91
+ return sync_detailed(
92
+ client=client,
93
+ ).parsed
94
+
95
+
96
+ async def asyncio_detailed(
97
+ *,
98
+ client: AuthenticatedClient,
99
+ ) -> Response[List["Workspace"]]:
100
+ """List workspaces
101
+
102
+ Returns a list of all workspaces.
103
+
104
+ Raises:
105
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
106
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
107
+
108
+ Returns:
109
+ Response[List['Workspace']]
110
+ """
111
+
112
+ kwargs = _get_kwargs()
113
+
114
+ response = await client.get_async_httpx_client().request(**kwargs)
115
+
116
+ return _build_response(client=client, response=response)
117
+
118
+
119
+ async def asyncio(
120
+ *,
121
+ client: AuthenticatedClient,
122
+ ) -> Optional[List["Workspace"]]:
123
+ """List workspaces
124
+
125
+ Returns a list of all workspaces.
126
+
127
+ Raises:
128
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
129
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
130
+
131
+ Returns:
132
+ List['Workspace']
133
+ """
134
+
135
+ return (
136
+ await asyncio_detailed(
137
+ client=client,
138
+ )
139
+ ).parsed
@@ -0,0 +1,101 @@
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 ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ sub_or_email: str,
13
+ ) -> dict[str, Any]:
14
+ _kwargs: dict[str, Any] = {
15
+ "method": "delete",
16
+ "url": f"/users/{sub_or_email}",
17
+ }
18
+
19
+ return _kwargs
20
+
21
+
22
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
23
+ if response.status_code == 200:
24
+ return None
25
+ if response.status_code == 404:
26
+ return None
27
+ if client.raise_on_unexpected_status:
28
+ raise errors.UnexpectedStatus(response.status_code, response.content)
29
+ else:
30
+ return None
31
+
32
+
33
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
34
+ return Response(
35
+ status_code=HTTPStatus(response.status_code),
36
+ content=response.content,
37
+ headers=response.headers,
38
+ parsed=_parse_response(client=client, response=response),
39
+ )
40
+
41
+
42
+ def sync_detailed(
43
+ sub_or_email: str,
44
+ *,
45
+ client: AuthenticatedClient,
46
+ ) -> Response[Any]:
47
+ """Remove user from workspace or revoke invitation
48
+
49
+ Removes a user from the workspace (or revokes an invitation if the user has not accepted the
50
+ invitation yet).
51
+
52
+ Args:
53
+ sub_or_email (str):
54
+
55
+ Raises:
56
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
57
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
58
+
59
+ Returns:
60
+ Response[Any]
61
+ """
62
+
63
+ kwargs = _get_kwargs(
64
+ sub_or_email=sub_or_email,
65
+ )
66
+
67
+ response = client.get_httpx_client().request(
68
+ **kwargs,
69
+ )
70
+
71
+ return _build_response(client=client, response=response)
72
+
73
+
74
+ async def asyncio_detailed(
75
+ sub_or_email: str,
76
+ *,
77
+ client: AuthenticatedClient,
78
+ ) -> Response[Any]:
79
+ """Remove user from workspace or revoke invitation
80
+
81
+ Removes a user from the workspace (or revokes an invitation if the user has not accepted the
82
+ invitation yet).
83
+
84
+ Args:
85
+ sub_or_email (str):
86
+
87
+ Raises:
88
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
89
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
90
+
91
+ Returns:
92
+ Response[Any]
93
+ """
94
+
95
+ kwargs = _get_kwargs(
96
+ sub_or_email=sub_or_email,
97
+ )
98
+
99
+ response = await client.get_async_httpx_client().request(**kwargs)
100
+
101
+ return _build_response(client=client, response=response)
@@ -0,0 +1,176 @@
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.workspace import Workspace
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ workspace_name: str,
14
+ *,
15
+ body: Workspace,
16
+ ) -> dict[str, Any]:
17
+ headers: dict[str, Any] = {}
18
+
19
+ _kwargs: dict[str, Any] = {
20
+ "method": "put",
21
+ "url": f"/workspaces/{workspace_name}",
22
+ }
23
+
24
+ _body = body.to_dict()
25
+
26
+ _kwargs["json"] = _body
27
+ headers["Content-Type"] = "application/json"
28
+
29
+ _kwargs["headers"] = headers
30
+ return _kwargs
31
+
32
+
33
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Workspace]:
34
+ if response.status_code == 200:
35
+ response_200 = Workspace.from_dict(response.json())
36
+
37
+ return response_200
38
+ if client.raise_on_unexpected_status:
39
+ raise errors.UnexpectedStatus(response.status_code, response.content)
40
+ else:
41
+ return None
42
+
43
+
44
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Workspace]:
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
+ workspace_name: str,
55
+ *,
56
+ client: AuthenticatedClient,
57
+ body: Workspace,
58
+ ) -> Response[Workspace]:
59
+ """Update workspace
60
+
61
+ Updates a workspace by name.
62
+
63
+ Args:
64
+ workspace_name (str):
65
+ body (Workspace): Workspace
66
+
67
+ Raises:
68
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
69
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
70
+
71
+ Returns:
72
+ Response[Workspace]
73
+ """
74
+
75
+ kwargs = _get_kwargs(
76
+ workspace_name=workspace_name,
77
+ body=body,
78
+ )
79
+
80
+ response = client.get_httpx_client().request(
81
+ **kwargs,
82
+ )
83
+
84
+ return _build_response(client=client, response=response)
85
+
86
+
87
+ def sync(
88
+ workspace_name: str,
89
+ *,
90
+ client: AuthenticatedClient,
91
+ body: Workspace,
92
+ ) -> Optional[Workspace]:
93
+ """Update workspace
94
+
95
+ Updates a workspace by name.
96
+
97
+ Args:
98
+ workspace_name (str):
99
+ body (Workspace): Workspace
100
+
101
+ Raises:
102
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
103
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
104
+
105
+ Returns:
106
+ Workspace
107
+ """
108
+
109
+ return sync_detailed(
110
+ workspace_name=workspace_name,
111
+ client=client,
112
+ body=body,
113
+ ).parsed
114
+
115
+
116
+ async def asyncio_detailed(
117
+ workspace_name: str,
118
+ *,
119
+ client: AuthenticatedClient,
120
+ body: Workspace,
121
+ ) -> Response[Workspace]:
122
+ """Update workspace
123
+
124
+ Updates a workspace by name.
125
+
126
+ Args:
127
+ workspace_name (str):
128
+ body (Workspace): Workspace
129
+
130
+ Raises:
131
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
132
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
133
+
134
+ Returns:
135
+ Response[Workspace]
136
+ """
137
+
138
+ kwargs = _get_kwargs(
139
+ workspace_name=workspace_name,
140
+ body=body,
141
+ )
142
+
143
+ response = await client.get_async_httpx_client().request(**kwargs)
144
+
145
+ return _build_response(client=client, response=response)
146
+
147
+
148
+ async def asyncio(
149
+ workspace_name: str,
150
+ *,
151
+ client: AuthenticatedClient,
152
+ body: Workspace,
153
+ ) -> Optional[Workspace]:
154
+ """Update workspace
155
+
156
+ Updates a workspace by name.
157
+
158
+ Args:
159
+ workspace_name (str):
160
+ body (Workspace): Workspace
161
+
162
+ Raises:
163
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
164
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
165
+
166
+ Returns:
167
+ Workspace
168
+ """
169
+
170
+ return (
171
+ await asyncio_detailed(
172
+ workspace_name=workspace_name,
173
+ client=client,
174
+ body=body,
175
+ )
176
+ ).parsed