beamlit 0.0.19__py3-none-any.whl → 0.0.20__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (221) hide show
  1. beamlit/agents/__init__.py +4 -0
  2. beamlit/agents/chat.py +87 -0
  3. beamlit/agents/decorator.py +147 -0
  4. beamlit/api/agents/create_agent.py +14 -9
  5. beamlit/api/agents/delete_agent_history.py +159 -0
  6. beamlit/api/agents/get_agent_deployment_logs.py +11 -11
  7. beamlit/api/{authentication_providers/list_organizations_for_authentication_provider.py → agents/get_agent_environment_logs.py} +30 -42
  8. beamlit/api/{authentication_providers/get_model_with_repo_for_authentication_provider.py → agents/get_agent_history.py} +43 -68
  9. beamlit/api/agents/list_agent_deployment_history.py +11 -11
  10. beamlit/api/agents/list_agent_deployments.py +11 -11
  11. beamlit/api/agents/list_agent_history.py +151 -0
  12. beamlit/api/agents/list_agents.py +11 -11
  13. beamlit/api/agents/put_agent_history.py +185 -0
  14. beamlit/api/agents/update_agent.py +14 -9
  15. beamlit/api/environments/list_environments.py +11 -11
  16. beamlit/api/functions/create_function.py +14 -9
  17. beamlit/api/functions/get_function_deployment_logs.py +11 -11
  18. beamlit/api/functions/get_function_environment_logs.py +151 -0
  19. beamlit/api/functions/list_function_deployments.py +11 -11
  20. beamlit/api/functions/list_functions.py +11 -11
  21. beamlit/api/functions/update_function.py +14 -9
  22. beamlit/api/history/get_agents_history.py +11 -11
  23. beamlit/api/history/list_agents_history.py +11 -11
  24. beamlit/api/integrations/create_integration_connection.py +167 -0
  25. beamlit/api/integrations/delete_integration_connection.py +158 -0
  26. beamlit/api/integrations/get_integration.py +97 -0
  27. beamlit/api/integrations/get_integration_connection.py +154 -0
  28. beamlit/api/integrations/get_integration_connection_model.py +97 -0
  29. beamlit/api/integrations/get_integration_model.py +97 -0
  30. beamlit/api/integrations/list_integration_connection_models.py +97 -0
  31. beamlit/api/integrations/list_integration_connections.py +139 -0
  32. beamlit/api/integrations/list_integration_models.py +97 -0
  33. beamlit/api/integrations/update_integration_connection.py +180 -0
  34. beamlit/api/invitations/list_all_pending_invitations.py +11 -11
  35. beamlit/api/locations/list_locations.py +11 -11
  36. beamlit/api/model_providers/list_model_providers.py +11 -11
  37. beamlit/api/models/get_model_deployment_logs.py +11 -11
  38. beamlit/api/{authentication_providers/list_models_for_authentication_provider.py → models/get_model_environment_logs.py} +30 -38
  39. beamlit/api/models/list_model_deployments.py +11 -11
  40. beamlit/api/models/list_models.py +11 -11
  41. beamlit/api/policies/list_policies.py +11 -11
  42. beamlit/api/service_accounts/get_workspace_service_accounts.py +11 -11
  43. beamlit/api/service_accounts/list_api_keys_for_service_account.py +11 -11
  44. beamlit/api/store/list_store_agents.py +11 -11
  45. beamlit/api/store/list_store_functions.py +11 -11
  46. beamlit/api/workspaces/list_workspace_users.py +11 -11
  47. beamlit/api/workspaces/list_workspaces.py +11 -11
  48. beamlit/authentication/__init__.py +29 -8
  49. beamlit/authentication/apikey.py +8 -2
  50. beamlit/authentication/authentication.py +66 -3
  51. beamlit/authentication/clientcredentials.py +108 -0
  52. beamlit/authentication/credentials.py +22 -8
  53. beamlit/authentication/device_mode.py +23 -13
  54. beamlit/common/__init__.py +13 -0
  55. beamlit/common/generate.py +183 -0
  56. beamlit/common/logger.py +29 -0
  57. beamlit/common/secrets.py +11 -0
  58. beamlit/common/settings.py +156 -0
  59. beamlit/common/utils.py +15 -0
  60. beamlit/functions/__init__.py +5 -0
  61. beamlit/functions/decorator.py +90 -0
  62. beamlit/functions/github/__init__.py +3 -0
  63. beamlit/functions/github/github.py +21 -0
  64. beamlit/functions/github/kit/__init__.py +7 -0
  65. beamlit/functions/github/kit/pull_request.py +51 -0
  66. beamlit/functions/math/__init__.py +3 -0
  67. beamlit/functions/math/math.py +40 -0
  68. beamlit/functions/search/__init__.py +3 -0
  69. beamlit/functions/search/search.py +15 -0
  70. beamlit/models/__init__.py +24 -0
  71. beamlit/models/acl.py +4 -2
  72. beamlit/models/agent.py +5 -3
  73. beamlit/models/agent_chain.py +4 -2
  74. beamlit/models/agent_configuration.py +4 -2
  75. beamlit/models/agent_deployment.py +41 -28
  76. beamlit/models/agent_deployment_configuration.py +4 -2
  77. beamlit/models/agent_deployment_configuration_type_0.py +43 -0
  78. beamlit/models/agent_deployment_history.py +7 -5
  79. beamlit/models/agent_deployment_history_event.py +11 -9
  80. beamlit/models/agent_deployment_pod_template.py +4 -2
  81. beamlit/models/agent_deployment_pod_template_type_0.py +43 -0
  82. beamlit/models/agent_history.py +165 -0
  83. beamlit/models/agent_history_event.py +131 -0
  84. beamlit/models/agent_metadata.py +144 -0
  85. beamlit/models/agent_release.py +4 -2
  86. beamlit/models/agent_spec.py +248 -0
  87. beamlit/models/agent_with_deployments.py +176 -0
  88. beamlit/models/api_key.py +4 -2
  89. beamlit/models/authentication_provider_model.py +8 -6
  90. beamlit/models/authentication_provider_organization.py +4 -2
  91. beamlit/models/configuration.py +12 -10
  92. beamlit/models/continent.py +4 -2
  93. beamlit/models/core_spec.py +185 -0
  94. beamlit/models/country.py +4 -2
  95. beamlit/models/create_api_key_for_service_account_body.py +4 -2
  96. beamlit/models/create_workspace_service_account_body.py +4 -2
  97. beamlit/models/create_workspace_service_account_response_200.py +4 -2
  98. beamlit/models/delete_workspace_service_account_response_200.py +4 -2
  99. beamlit/models/deployment_configuration.py +4 -2
  100. beamlit/models/deployment_configurations.py +22 -7
  101. beamlit/models/deployment_serverless_config.py +4 -2
  102. beamlit/models/deployment_serverless_config_type_0.py +220 -0
  103. beamlit/models/environment.py +9 -7
  104. beamlit/models/environment_metrics.py +26 -5
  105. beamlit/models/environment_spec.py +61 -0
  106. beamlit/models/flavor.py +11 -9
  107. beamlit/models/function.py +5 -3
  108. beamlit/models/function_configuration.py +4 -2
  109. beamlit/models/function_deployment.py +33 -20
  110. beamlit/models/function_deployment_configuration.py +4 -2
  111. beamlit/models/function_deployment_configuration_type_0.py +43 -0
  112. beamlit/models/function_deployment_pod_template.py +4 -2
  113. beamlit/models/function_deployment_pod_template_type_0.py +43 -0
  114. beamlit/models/function_kit.py +7 -5
  115. beamlit/models/function_metadata.py +144 -0
  116. beamlit/models/function_provider_ref.py +4 -2
  117. beamlit/models/function_release.py +4 -2
  118. beamlit/models/function_spec.py +246 -0
  119. beamlit/models/function_with_deployments.py +176 -0
  120. beamlit/models/get_workspace_service_accounts_response_200_item.py +4 -2
  121. beamlit/models/increase_and_rate_metric.py +104 -0
  122. beamlit/models/integration.py +198 -0
  123. beamlit/models/integration_config.py +45 -0
  124. beamlit/models/integration_connection.py +198 -0
  125. beamlit/models/integration_connection_config.py +45 -0
  126. beamlit/models/integration_connection_secret.py +61 -0
  127. beamlit/models/integration_connection_spec.py +99 -0
  128. beamlit/models/integration_model.py +144 -0
  129. beamlit/models/integration_secret.py +61 -0
  130. beamlit/models/invite_workspace_user_body.py +4 -2
  131. beamlit/models/labels_type_0.py +4 -2
  132. beamlit/models/location.py +7 -5
  133. beamlit/models/location_response.py +7 -5
  134. beamlit/models/metadata.py +135 -0
  135. beamlit/models/{labels.py → metadata_labels.py} +5 -5
  136. beamlit/models/metric.py +4 -2
  137. beamlit/models/metrics.py +68 -25
  138. beamlit/models/model.py +5 -3
  139. beamlit/models/model_deployment.py +27 -14
  140. beamlit/models/model_deployment_log.py +4 -2
  141. beamlit/models/model_deployment_metrics.py +11 -9
  142. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +7 -5
  143. beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +5 -3
  144. beamlit/models/model_deployment_pod_template.py +4 -2
  145. beamlit/models/model_deployment_pod_template_type_0.py +43 -0
  146. beamlit/models/model_metadata.py +144 -0
  147. beamlit/models/model_metrics.py +8 -6
  148. beamlit/models/model_provider.py +13 -11
  149. beamlit/models/model_provider_ref.py +4 -2
  150. beamlit/models/model_release.py +4 -2
  151. beamlit/models/model_spec.py +194 -0
  152. beamlit/models/model_with_deployments.py +8 -6
  153. beamlit/models/owner_fields.py +68 -0
  154. beamlit/models/pending_invitation.py +4 -2
  155. beamlit/models/pending_invitation_accept.py +5 -3
  156. beamlit/models/pending_invitation_render.py +7 -5
  157. beamlit/models/pending_invitation_render_invited_by.py +4 -2
  158. beamlit/models/pending_invitation_render_workspace.py +4 -2
  159. beamlit/models/pending_invitation_workspace_details.py +8 -6
  160. beamlit/models/pod_template_spec.py +43 -0
  161. beamlit/models/policy.py +22 -20
  162. beamlit/models/policy_location.py +11 -9
  163. beamlit/models/policy_spec.py +125 -0
  164. beamlit/models/provider_config.py +9 -16
  165. beamlit/models/qps.py +4 -2
  166. beamlit/models/resource_deployment_log.py +4 -2
  167. beamlit/models/resource_deployment_metrics.py +119 -9
  168. beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
  169. beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +79 -0
  170. beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +7 -5
  171. beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +79 -0
  172. beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
  173. beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +73 -0
  174. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +5 -3
  175. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +73 -0
  176. beamlit/models/resource_environment_metrics.py +210 -0
  177. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +79 -0
  178. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
  179. beamlit/models/resource_log.py +68 -0
  180. beamlit/models/resource_metrics.py +44 -6
  181. beamlit/models/runtime.py +25 -23
  182. beamlit/models/runtime_readiness_probe.py +4 -2
  183. beamlit/models/runtime_readiness_probe_type_0.py +43 -0
  184. beamlit/models/runtime_resources.py +4 -2
  185. beamlit/models/runtime_type_0.py +111 -0
  186. beamlit/models/runtime_type_0_readiness_probe.py +43 -0
  187. beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
  188. beamlit/models/runtime_type_0_resources.py +59 -0
  189. beamlit/models/serverless_config.py +4 -2
  190. beamlit/models/spec_configuration.py +68 -0
  191. beamlit/models/standard_fields_dynamo_db.py +4 -2
  192. beamlit/models/store_agent.py +8 -6
  193. beamlit/models/store_agent_configuration.py +4 -2
  194. beamlit/models/store_agent_labels.py +4 -2
  195. beamlit/models/store_agent_labels_type_0.py +43 -0
  196. beamlit/models/store_configuration.py +18 -16
  197. beamlit/models/store_configuration_option.py +4 -2
  198. beamlit/models/store_function.py +14 -12
  199. beamlit/models/store_function_configuration.py +4 -2
  200. beamlit/models/store_function_kit.py +7 -5
  201. beamlit/models/store_function_labels.py +4 -2
  202. beamlit/models/store_function_labels_type_0.py +43 -0
  203. beamlit/models/store_function_parameter.py +11 -9
  204. beamlit/models/time_fields.py +68 -0
  205. beamlit/models/update_workspace_service_account_body.py +4 -2
  206. beamlit/models/update_workspace_service_account_response_200.py +4 -2
  207. beamlit/models/update_workspace_user_role_body.py +4 -2
  208. beamlit/models/websocket_channel.py +86 -0
  209. beamlit/models/workspace.py +5 -3
  210. beamlit/models/workspace_labels.py +4 -2
  211. beamlit/models/workspace_user.py +4 -2
  212. beamlit/run.py +49 -0
  213. beamlit/serve/app.py +78 -0
  214. beamlit/serve/middlewares/__init__.py +4 -0
  215. beamlit/serve/middlewares/accesslog.py +14 -0
  216. beamlit/serve/middlewares/processtime.py +12 -0
  217. {beamlit-0.0.19.dist-info → beamlit-0.0.20.dist-info}/METADATA +11 -2
  218. beamlit-0.0.20.dist-info/RECORD +301 -0
  219. beamlit-0.0.19.dist-info/RECORD +0 -211
  220. /beamlit/api/{authentication_providers → integrations}/__init__.py +0 -0
  221. {beamlit-0.0.19.dist-info → beamlit-0.0.20.dist-info}/WHEEL +0 -0
@@ -0,0 +1,167 @@
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.integration_connection import IntegrationConnection
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ *,
14
+ body: IntegrationConnection,
15
+ ) -> dict[str, Any]:
16
+ headers: dict[str, Any] = {}
17
+
18
+ _kwargs: dict[str, Any] = {
19
+ "method": "post",
20
+ "url": "/integrations/connections",
21
+ }
22
+
23
+ _body = body.to_dict()
24
+
25
+ _kwargs["json"] = _body
26
+ headers["Content-Type"] = "application/json"
27
+
28
+ _kwargs["headers"] = headers
29
+ return _kwargs
30
+
31
+
32
+ def _parse_response(
33
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
34
+ ) -> Optional[IntegrationConnection]:
35
+ if response.status_code == 200:
36
+ response_200 = IntegrationConnection.from_dict(response.json())
37
+
38
+ return response_200
39
+ if client.raise_on_unexpected_status:
40
+ raise errors.UnexpectedStatus(response.status_code, response.content)
41
+ else:
42
+ return None
43
+
44
+
45
+ def _build_response(
46
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
47
+ ) -> Response[IntegrationConnection]:
48
+ return Response(
49
+ status_code=HTTPStatus(response.status_code),
50
+ content=response.content,
51
+ headers=response.headers,
52
+ parsed=_parse_response(client=client, response=response),
53
+ )
54
+
55
+
56
+ def sync_detailed(
57
+ *,
58
+ client: AuthenticatedClient,
59
+ body: IntegrationConnection,
60
+ ) -> Response[IntegrationConnection]:
61
+ """Create integration
62
+
63
+ Create a connection for an integration.
64
+
65
+ Args:
66
+ body (IntegrationConnection): Integration Connection
67
+
68
+ Raises:
69
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
70
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
71
+
72
+ Returns:
73
+ Response[IntegrationConnection]
74
+ """
75
+
76
+ kwargs = _get_kwargs(
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
+ *,
89
+ client: AuthenticatedClient,
90
+ body: IntegrationConnection,
91
+ ) -> Optional[IntegrationConnection]:
92
+ """Create integration
93
+
94
+ Create a connection for an integration.
95
+
96
+ Args:
97
+ body (IntegrationConnection): Integration Connection
98
+
99
+ Raises:
100
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
101
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
102
+
103
+ Returns:
104
+ IntegrationConnection
105
+ """
106
+
107
+ return sync_detailed(
108
+ client=client,
109
+ body=body,
110
+ ).parsed
111
+
112
+
113
+ async def asyncio_detailed(
114
+ *,
115
+ client: AuthenticatedClient,
116
+ body: IntegrationConnection,
117
+ ) -> Response[IntegrationConnection]:
118
+ """Create integration
119
+
120
+ Create a connection for an integration.
121
+
122
+ Args:
123
+ body (IntegrationConnection): Integration Connection
124
+
125
+ Raises:
126
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
127
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
128
+
129
+ Returns:
130
+ Response[IntegrationConnection]
131
+ """
132
+
133
+ kwargs = _get_kwargs(
134
+ body=body,
135
+ )
136
+
137
+ response = await client.get_async_httpx_client().request(**kwargs)
138
+
139
+ return _build_response(client=client, response=response)
140
+
141
+
142
+ async def asyncio(
143
+ *,
144
+ client: AuthenticatedClient,
145
+ body: IntegrationConnection,
146
+ ) -> Optional[IntegrationConnection]:
147
+ """Create integration
148
+
149
+ Create a connection for an integration.
150
+
151
+ Args:
152
+ body (IntegrationConnection): Integration Connection
153
+
154
+ Raises:
155
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
156
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
157
+
158
+ Returns:
159
+ IntegrationConnection
160
+ """
161
+
162
+ return (
163
+ await asyncio_detailed(
164
+ client=client,
165
+ body=body,
166
+ )
167
+ ).parsed
@@ -0,0 +1,158 @@
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.integration_connection import IntegrationConnection
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ connection_name: str,
14
+ ) -> dict[str, Any]:
15
+ _kwargs: dict[str, Any] = {
16
+ "method": "delete",
17
+ "url": f"/integrations/connections/{connection_name}",
18
+ }
19
+
20
+ return _kwargs
21
+
22
+
23
+ def _parse_response(
24
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
25
+ ) -> Optional[IntegrationConnection]:
26
+ if response.status_code == 200:
27
+ response_200 = IntegrationConnection.from_dict(response.json())
28
+
29
+ return response_200
30
+ if client.raise_on_unexpected_status:
31
+ raise errors.UnexpectedStatus(response.status_code, response.content)
32
+ else:
33
+ return None
34
+
35
+
36
+ def _build_response(
37
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
38
+ ) -> Response[IntegrationConnection]:
39
+ return Response(
40
+ status_code=HTTPStatus(response.status_code),
41
+ content=response.content,
42
+ headers=response.headers,
43
+ parsed=_parse_response(client=client, response=response),
44
+ )
45
+
46
+
47
+ def sync_detailed(
48
+ connection_name: str,
49
+ *,
50
+ client: Union[AuthenticatedClient, Client],
51
+ ) -> Response[IntegrationConnection]:
52
+ """Delete integration
53
+
54
+ Deletes an integration connection by integration name and connection name.
55
+
56
+ Args:
57
+ connection_name (str):
58
+
59
+ Raises:
60
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
61
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
62
+
63
+ Returns:
64
+ Response[IntegrationConnection]
65
+ """
66
+
67
+ kwargs = _get_kwargs(
68
+ connection_name=connection_name,
69
+ )
70
+
71
+ response = client.get_httpx_client().request(
72
+ **kwargs,
73
+ )
74
+
75
+ return _build_response(client=client, response=response)
76
+
77
+
78
+ def sync(
79
+ connection_name: str,
80
+ *,
81
+ client: Union[AuthenticatedClient, Client],
82
+ ) -> Optional[IntegrationConnection]:
83
+ """Delete integration
84
+
85
+ Deletes an integration connection by integration name and connection name.
86
+
87
+ Args:
88
+ connection_name (str):
89
+
90
+ Raises:
91
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
92
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
93
+
94
+ Returns:
95
+ IntegrationConnection
96
+ """
97
+
98
+ return sync_detailed(
99
+ connection_name=connection_name,
100
+ client=client,
101
+ ).parsed
102
+
103
+
104
+ async def asyncio_detailed(
105
+ connection_name: str,
106
+ *,
107
+ client: Union[AuthenticatedClient, Client],
108
+ ) -> Response[IntegrationConnection]:
109
+ """Delete integration
110
+
111
+ Deletes an integration connection by integration name and connection name.
112
+
113
+ Args:
114
+ connection_name (str):
115
+
116
+ Raises:
117
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
119
+
120
+ Returns:
121
+ Response[IntegrationConnection]
122
+ """
123
+
124
+ kwargs = _get_kwargs(
125
+ connection_name=connection_name,
126
+ )
127
+
128
+ response = await client.get_async_httpx_client().request(**kwargs)
129
+
130
+ return _build_response(client=client, response=response)
131
+
132
+
133
+ async def asyncio(
134
+ connection_name: str,
135
+ *,
136
+ client: Union[AuthenticatedClient, Client],
137
+ ) -> Optional[IntegrationConnection]:
138
+ """Delete integration
139
+
140
+ Deletes an integration connection by integration name and connection name.
141
+
142
+ Args:
143
+ connection_name (str):
144
+
145
+ Raises:
146
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
147
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
148
+
149
+ Returns:
150
+ IntegrationConnection
151
+ """
152
+
153
+ return (
154
+ await asyncio_detailed(
155
+ connection_name=connection_name,
156
+ client=client,
157
+ )
158
+ ).parsed
@@ -0,0 +1,97 @@
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
+ integration_name: str,
13
+ ) -> dict[str, Any]:
14
+ _kwargs: dict[str, Any] = {
15
+ "method": "get",
16
+ "url": f"/integrations/{integration_name}",
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 client.raise_on_unexpected_status:
26
+ raise errors.UnexpectedStatus(response.status_code, response.content)
27
+ else:
28
+ return None
29
+
30
+
31
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
32
+ return Response(
33
+ status_code=HTTPStatus(response.status_code),
34
+ content=response.content,
35
+ headers=response.headers,
36
+ parsed=_parse_response(client=client, response=response),
37
+ )
38
+
39
+
40
+ def sync_detailed(
41
+ integration_name: str,
42
+ *,
43
+ client: AuthenticatedClient,
44
+ ) -> Response[Any]:
45
+ """List integrations connections
46
+
47
+ Returns integration information by name.
48
+
49
+ Args:
50
+ integration_name (str):
51
+
52
+ Raises:
53
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
54
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
55
+
56
+ Returns:
57
+ Response[Any]
58
+ """
59
+
60
+ kwargs = _get_kwargs(
61
+ integration_name=integration_name,
62
+ )
63
+
64
+ response = client.get_httpx_client().request(
65
+ **kwargs,
66
+ )
67
+
68
+ return _build_response(client=client, response=response)
69
+
70
+
71
+ async def asyncio_detailed(
72
+ integration_name: str,
73
+ *,
74
+ client: AuthenticatedClient,
75
+ ) -> Response[Any]:
76
+ """List integrations connections
77
+
78
+ Returns integration information by name.
79
+
80
+ Args:
81
+ integration_name (str):
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
+ Response[Any]
89
+ """
90
+
91
+ kwargs = _get_kwargs(
92
+ integration_name=integration_name,
93
+ )
94
+
95
+ response = await client.get_async_httpx_client().request(**kwargs)
96
+
97
+ return _build_response(client=client, response=response)
@@ -0,0 +1,154 @@
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.integration import Integration
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ connection_name: str,
14
+ ) -> dict[str, Any]:
15
+ _kwargs: dict[str, Any] = {
16
+ "method": "get",
17
+ "url": f"/integrations/connections/{connection_name}",
18
+ }
19
+
20
+ return _kwargs
21
+
22
+
23
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Integration]:
24
+ if response.status_code == 200:
25
+ response_200 = Integration.from_dict(response.json())
26
+
27
+ return response_200
28
+ if client.raise_on_unexpected_status:
29
+ raise errors.UnexpectedStatus(response.status_code, response.content)
30
+ else:
31
+ return None
32
+
33
+
34
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Integration]:
35
+ return Response(
36
+ status_code=HTTPStatus(response.status_code),
37
+ content=response.content,
38
+ headers=response.headers,
39
+ parsed=_parse_response(client=client, response=response),
40
+ )
41
+
42
+
43
+ def sync_detailed(
44
+ connection_name: str,
45
+ *,
46
+ client: Union[AuthenticatedClient, Client],
47
+ ) -> Response[Integration]:
48
+ """Get integration
49
+
50
+ Returns an integration connection by integration name and connection name.
51
+
52
+ Args:
53
+ connection_name (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[Integration]
61
+ """
62
+
63
+ kwargs = _get_kwargs(
64
+ connection_name=connection_name,
65
+ )
66
+
67
+ response = client.get_httpx_client().request(
68
+ **kwargs,
69
+ )
70
+
71
+ return _build_response(client=client, response=response)
72
+
73
+
74
+ def sync(
75
+ connection_name: str,
76
+ *,
77
+ client: Union[AuthenticatedClient, Client],
78
+ ) -> Optional[Integration]:
79
+ """Get integration
80
+
81
+ Returns an integration connection by integration name and connection name.
82
+
83
+ Args:
84
+ connection_name (str):
85
+
86
+ Raises:
87
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
88
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
89
+
90
+ Returns:
91
+ Integration
92
+ """
93
+
94
+ return sync_detailed(
95
+ connection_name=connection_name,
96
+ client=client,
97
+ ).parsed
98
+
99
+
100
+ async def asyncio_detailed(
101
+ connection_name: str,
102
+ *,
103
+ client: Union[AuthenticatedClient, Client],
104
+ ) -> Response[Integration]:
105
+ """Get integration
106
+
107
+ Returns an integration connection by integration name and connection name.
108
+
109
+ Args:
110
+ connection_name (str):
111
+
112
+ Raises:
113
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
114
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
115
+
116
+ Returns:
117
+ Response[Integration]
118
+ """
119
+
120
+ kwargs = _get_kwargs(
121
+ connection_name=connection_name,
122
+ )
123
+
124
+ response = await client.get_async_httpx_client().request(**kwargs)
125
+
126
+ return _build_response(client=client, response=response)
127
+
128
+
129
+ async def asyncio(
130
+ connection_name: str,
131
+ *,
132
+ client: Union[AuthenticatedClient, Client],
133
+ ) -> Optional[Integration]:
134
+ """Get integration
135
+
136
+ Returns an integration connection by integration name and connection name.
137
+
138
+ Args:
139
+ connection_name (str):
140
+
141
+ Raises:
142
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
143
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
144
+
145
+ Returns:
146
+ Integration
147
+ """
148
+
149
+ return (
150
+ await asyncio_detailed(
151
+ connection_name=connection_name,
152
+ client=client,
153
+ )
154
+ ).parsed
@@ -0,0 +1,97 @@
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
+ connection_name: str,
13
+ ) -> dict[str, Any]:
14
+ _kwargs: dict[str, Any] = {
15
+ "method": "get",
16
+ "url": f"/integrations/connections/{connection_name}/models/*modelId",
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 client.raise_on_unexpected_status:
26
+ raise errors.UnexpectedStatus(response.status_code, response.content)
27
+ else:
28
+ return None
29
+
30
+
31
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
32
+ return Response(
33
+ status_code=HTTPStatus(response.status_code),
34
+ content=response.content,
35
+ headers=response.headers,
36
+ parsed=_parse_response(client=client, response=response),
37
+ )
38
+
39
+
40
+ def sync_detailed(
41
+ connection_name: str,
42
+ *,
43
+ client: AuthenticatedClient,
44
+ ) -> Response[Any]:
45
+ """List integration connection models
46
+
47
+ Returns a model for an integration connection by ID.
48
+
49
+ Args:
50
+ connection_name (str):
51
+
52
+ Raises:
53
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
54
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
55
+
56
+ Returns:
57
+ Response[Any]
58
+ """
59
+
60
+ kwargs = _get_kwargs(
61
+ connection_name=connection_name,
62
+ )
63
+
64
+ response = client.get_httpx_client().request(
65
+ **kwargs,
66
+ )
67
+
68
+ return _build_response(client=client, response=response)
69
+
70
+
71
+ async def asyncio_detailed(
72
+ connection_name: str,
73
+ *,
74
+ client: AuthenticatedClient,
75
+ ) -> Response[Any]:
76
+ """List integration connection models
77
+
78
+ Returns a model for an integration connection by ID.
79
+
80
+ Args:
81
+ connection_name (str):
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
+ Response[Any]
89
+ """
90
+
91
+ kwargs = _get_kwargs(
92
+ connection_name=connection_name,
93
+ )
94
+
95
+ response = await client.get_async_httpx_client().request(**kwargs)
96
+
97
+ return _build_response(client=client, response=response)