render_sdk 0.1.3__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- render_sdk/__init__.py +41 -4
- render_sdk/client/__init__.py +25 -0
- render_sdk/client/client.py +5 -0
- render_sdk/client/sse.py +5 -1
- render_sdk/client/tests/test_client.py +6 -4
- render_sdk/client/tests/test_sse.py +1 -0
- render_sdk/client/workflows.py +10 -2
- render_sdk/experimental/__init__.py +31 -0
- render_sdk/experimental/experimental.py +71 -0
- render_sdk/experimental/object/__init__.py +30 -0
- render_sdk/experimental/object/api.py +260 -0
- render_sdk/experimental/object/client.py +475 -0
- render_sdk/experimental/object/types.py +87 -0
- render_sdk/public_api/api/audit_logs/list_organization_audit_logs.py +303 -0
- render_sdk/public_api/api/audit_logs/list_owner_audit_logs.py +303 -0
- render_sdk/public_api/api/blob_storage/delete_blob.py +215 -0
- render_sdk/public_api/api/blob_storage/get_blob.py +221 -0
- render_sdk/public_api/api/{workflows/list_workflow_versions.py → blob_storage/list_blobs.py} +52 -30
- render_sdk/public_api/api/blob_storage/put_blob.py +248 -0
- render_sdk/public_api/api/blueprints/validate_blueprint.py +212 -0
- render_sdk/public_api/api/key_value/resume_key_value.py +203 -0
- render_sdk/public_api/api/key_value/suspend_key_value.py +203 -0
- render_sdk/public_api/api/metrics/get_bandwidth_sources.py +251 -0
- render_sdk/public_api/api/postgres/create_postgres_user.py +229 -0
- render_sdk/public_api/api/postgres/delete_postgres_user.py +201 -0
- render_sdk/public_api/api/postgres/list_postgres_users.py +195 -0
- render_sdk/public_api/api/redis_deprecated/__init__.py +1 -0
- render_sdk/public_api/api/{redis → redis_deprecated}/create_redis.py +4 -4
- render_sdk/public_api/api/{redis → redis_deprecated}/delete_redis.py +4 -4
- render_sdk/public_api/api/{redis → redis_deprecated}/list_redis.py +4 -0
- render_sdk/public_api/api/{redis → redis_deprecated}/retrieve_redis.py +4 -4
- render_sdk/public_api/api/{redis → redis_deprecated}/retrieve_redis_connection_info.py +4 -0
- render_sdk/public_api/api/{redis → redis_deprecated}/update_redis.py +4 -4
- render_sdk/public_api/api/services/create_service.py +4 -4
- render_sdk/public_api/api/workflow_tasks_ea/__init__.py +1 -0
- render_sdk/public_api/api/{workflows → workflow_tasks_ea}/cancel_task_run.py +12 -4
- render_sdk/public_api/api/{workflows → workflow_tasks_ea}/create_task.py +12 -4
- render_sdk/public_api/api/{workflows → workflow_tasks_ea}/get_task.py +12 -4
- render_sdk/public_api/api/{workflows → workflow_tasks_ea}/get_task_run.py +12 -4
- render_sdk/public_api/api/{workflows → workflow_tasks_ea}/list_task_runs.py +12 -0
- render_sdk/public_api/api/{workflows → workflow_tasks_ea}/list_tasks.py +24 -12
- render_sdk/public_api/api/workflows_ea/__init__.py +1 -0
- render_sdk/public_api/api/workflows_ea/create_workflow.py +199 -0
- render_sdk/public_api/api/{workflows/deploy_workflow.py → workflows_ea/create_workflow_version.py} +31 -14
- render_sdk/public_api/api/{workflows → workflows_ea}/delete_workflow.py +12 -4
- render_sdk/public_api/api/{workflows → workflows_ea}/get_workflow.py +32 -14
- render_sdk/public_api/api/{workflows → workflows_ea}/get_workflow_version.py +12 -4
- render_sdk/public_api/api/workflows_ea/list_workflow_versions.py +275 -0
- render_sdk/public_api/api/{workflows → workflows_ea}/list_workflows.py +41 -14
- render_sdk/public_api/api/workflows_ea/update_workflow.py +212 -0
- render_sdk/public_api/api/workspaces/remove_workspace_member.py +206 -0
- render_sdk/public_api/api/workspaces/update_workspace_member.py +235 -0
- render_sdk/public_api/models/__init__.py +82 -4
- render_sdk/public_api/models/audit_log.py +113 -0
- render_sdk/public_api/models/audit_log_actor.py +80 -0
- render_sdk/public_api/models/audit_log_actor_type.py +10 -0
- render_sdk/public_api/models/audit_log_event.py +80 -0
- render_sdk/public_api/models/audit_log_metadata.py +49 -0
- render_sdk/public_api/models/audit_log_status.py +9 -0
- render_sdk/public_api/models/audit_log_with_cursor.py +73 -0
- render_sdk/public_api/models/background_worker_details.py +2 -2
- render_sdk/public_api/models/background_worker_details_patch.py +1 -1
- render_sdk/public_api/models/background_worker_details_post.py +1 -1
- render_sdk/public_api/models/blob_metadata.py +85 -0
- render_sdk/public_api/models/blob_with_cursor.py +73 -0
- render_sdk/public_api/models/cache.py +6 -4
- render_sdk/public_api/models/cache_profile.py +10 -0
- render_sdk/public_api/models/create_deploy_body.py +23 -0
- render_sdk/public_api/models/create_version.py +70 -0
- render_sdk/public_api/models/credential_create_input.py +59 -0
- render_sdk/public_api/models/cron_job_details.py +2 -2
- render_sdk/public_api/models/cron_job_details_patch.py +1 -1
- render_sdk/public_api/models/cron_job_details_post.py +1 -1
- render_sdk/public_api/models/deploy_mode.py +9 -0
- render_sdk/public_api/models/event.py +11 -27
- render_sdk/public_api/models/event_type.py +1 -1
- render_sdk/public_api/models/get_bandwidth_sources_response_200.py +75 -0
- render_sdk/public_api/models/get_bandwidth_sources_response_200_data_item.py +101 -0
- render_sdk/public_api/models/get_bandwidth_sources_response_200_data_item_labels.py +78 -0
- render_sdk/public_api/models/get_bandwidth_sources_response_200_data_item_labels_traffic_source.py +12 -0
- render_sdk/public_api/models/get_bandwidth_sources_response_200_data_item_values_item.py +68 -0
- render_sdk/public_api/models/{server_unhealthy.py → get_bandwidth_sources_response_400.py} +12 -12
- render_sdk/public_api/models/get_blob_output.py +71 -0
- render_sdk/public_api/models/list_postgres_users_response_200_item.py +86 -0
- render_sdk/public_api/models/otel_provider_type.py +2 -0
- render_sdk/public_api/models/postgres.py +8 -0
- render_sdk/public_api/models/postgres_detail.py +26 -0
- render_sdk/public_api/models/postgres_parameter_overrides.py +44 -0
- render_sdk/public_api/models/postgres_patch_input.py +27 -0
- render_sdk/public_api/models/postgres_post_input.py +27 -0
- render_sdk/public_api/models/postgres_version.py +1 -0
- render_sdk/public_api/models/preview_input.py +2 -2
- render_sdk/public_api/models/private_service_details.py +2 -2
- render_sdk/public_api/models/private_service_details_patch.py +1 -1
- render_sdk/public_api/models/private_service_details_post.py +1 -1
- render_sdk/public_api/models/project_post_environment_input.py +26 -1
- render_sdk/public_api/models/put_blob_input.py +59 -0
- render_sdk/public_api/models/put_blob_output.py +79 -0
- render_sdk/public_api/models/read_replica.py +25 -1
- render_sdk/public_api/models/read_replica_input.py +25 -1
- render_sdk/public_api/models/run_task.py +35 -7
- render_sdk/public_api/models/service_event.py +12 -27
- render_sdk/public_api/models/service_event_type.py +0 -1
- render_sdk/public_api/models/service_post.py +9 -6
- render_sdk/public_api/models/task_attempt.py +88 -0
- render_sdk/public_api/models/task_attempt_details.py +108 -0
- render_sdk/public_api/models/task_data_type_1.py +44 -0
- render_sdk/public_api/models/task_run.py +23 -1
- render_sdk/public_api/models/task_run_details.py +50 -5
- render_sdk/public_api/models/task_run_status.py +1 -0
- render_sdk/public_api/models/task_with_cursor.py +73 -0
- render_sdk/public_api/models/team_member.py +5 -4
- render_sdk/public_api/models/team_member_role.py +12 -0
- render_sdk/public_api/models/update_workspace_member_body.py +61 -0
- render_sdk/public_api/models/validate_blueprint_request.py +84 -0
- render_sdk/public_api/models/validate_blueprint_response.py +105 -0
- render_sdk/public_api/models/validation_error.py +88 -0
- render_sdk/public_api/models/validation_plan_summary.py +107 -0
- render_sdk/public_api/models/web_service_details.py +2 -2
- render_sdk/public_api/models/web_service_details_patch.py +6 -5
- render_sdk/public_api/models/web_service_details_post.py +6 -5
- render_sdk/public_api/models/workflow.py +144 -0
- render_sdk/public_api/models/workflow_create.py +99 -0
- render_sdk/public_api/models/workflow_update.py +90 -0
- render_sdk/public_api/models/workflow_version.py +10 -14
- render_sdk/public_api/models/workflow_version_status.py +13 -0
- render_sdk/public_api/models/workflow_version_with_cursor.py +73 -0
- render_sdk/public_api/models/workflow_with_cursor.py +73 -0
- render_sdk/render.py +65 -0
- render_sdk/version.py +27 -0
- render_sdk/workflows/__init__.py +5 -1
- render_sdk/workflows/app.py +262 -0
- render_sdk/workflows/callback_api/models/task_options.py +18 -0
- render_sdk/workflows/cli.py +58 -0
- render_sdk/workflows/client.py +2 -7
- render_sdk/workflows/runner.py +12 -7
- render_sdk/workflows/task.py +11 -2
- render_sdk/workflows/tests/test_app.py +412 -0
- render_sdk/workflows/tests/test_cli.py +134 -0
- render_sdk/workflows/tests/test_end_to_end.py +69 -1
- render_sdk/workflows/tests/test_registration.py +56 -1
- {render_sdk-0.1.3.dist-info → render_sdk-0.2.0.dist-info}/METADATA +1 -1
- {render_sdk-0.1.3.dist-info → render_sdk-0.2.0.dist-info}/RECORD +149 -78
- render_sdk-0.2.0.dist-info/entry_points.txt +3 -0
- render_sdk/public_api/models/image_version.py +0 -79
- /render_sdk/public_api/api/{redis → audit_logs}/__init__.py +0 -0
- /render_sdk/public_api/api/{workflows → blob_storage}/__init__.py +0 -0
- /render_sdk/public_api/api/{workflows → workflow_tasks_ea}/stream_task_runs_events.py +0 -0
- {render_sdk-0.1.3.dist-info → render_sdk-0.2.0.dist-info}/WHEEL +0 -0
- {render_sdk-0.1.3.dist-info → render_sdk-0.2.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from http import HTTPStatus
|
|
3
|
+
from typing import Any, Optional, Union
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.audit_log_with_cursor import AuditLogWithCursor
|
|
10
|
+
from ...models.error import Error
|
|
11
|
+
from ...models.log_direction import LogDirection
|
|
12
|
+
from ...types import UNSET, Response, Unset
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
org_id: str,
|
|
17
|
+
*,
|
|
18
|
+
start_time: Union[Unset, datetime.datetime] = UNSET,
|
|
19
|
+
end_time: Union[Unset, datetime.datetime] = UNSET,
|
|
20
|
+
direction: Union[Unset, LogDirection] = UNSET,
|
|
21
|
+
cursor: Union[Unset, str] = UNSET,
|
|
22
|
+
limit: Union[Unset, int] = 20,
|
|
23
|
+
) -> dict[str, Any]:
|
|
24
|
+
params: dict[str, Any] = {}
|
|
25
|
+
|
|
26
|
+
json_start_time: Union[Unset, str] = UNSET
|
|
27
|
+
if not isinstance(start_time, Unset):
|
|
28
|
+
json_start_time = start_time.isoformat()
|
|
29
|
+
params["startTime"] = json_start_time
|
|
30
|
+
|
|
31
|
+
json_end_time: Union[Unset, str] = UNSET
|
|
32
|
+
if not isinstance(end_time, Unset):
|
|
33
|
+
json_end_time = end_time.isoformat()
|
|
34
|
+
params["endTime"] = json_end_time
|
|
35
|
+
|
|
36
|
+
json_direction: Union[Unset, str] = UNSET
|
|
37
|
+
if not isinstance(direction, Unset):
|
|
38
|
+
json_direction = direction.value
|
|
39
|
+
|
|
40
|
+
params["direction"] = json_direction
|
|
41
|
+
|
|
42
|
+
params["cursor"] = cursor
|
|
43
|
+
|
|
44
|
+
params["limit"] = limit
|
|
45
|
+
|
|
46
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
47
|
+
|
|
48
|
+
_kwargs: dict[str, Any] = {
|
|
49
|
+
"method": "get",
|
|
50
|
+
"url": f"/organizations/{org_id}/audit-logs",
|
|
51
|
+
"params": params,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return _kwargs
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _parse_response(
|
|
58
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
59
|
+
) -> Optional[Union[Error, list["AuditLogWithCursor"]]]:
|
|
60
|
+
if response.status_code == 200:
|
|
61
|
+
response_200 = []
|
|
62
|
+
_response_200 = response.json()
|
|
63
|
+
for response_200_item_data in _response_200:
|
|
64
|
+
response_200_item = AuditLogWithCursor.from_dict(response_200_item_data)
|
|
65
|
+
|
|
66
|
+
response_200.append(response_200_item)
|
|
67
|
+
|
|
68
|
+
return response_200
|
|
69
|
+
|
|
70
|
+
if response.status_code == 400:
|
|
71
|
+
response_400 = Error.from_dict(response.json())
|
|
72
|
+
|
|
73
|
+
return response_400
|
|
74
|
+
|
|
75
|
+
if response.status_code == 401:
|
|
76
|
+
response_401 = Error.from_dict(response.json())
|
|
77
|
+
|
|
78
|
+
return response_401
|
|
79
|
+
|
|
80
|
+
if response.status_code == 403:
|
|
81
|
+
response_403 = Error.from_dict(response.json())
|
|
82
|
+
|
|
83
|
+
return response_403
|
|
84
|
+
|
|
85
|
+
if response.status_code == 404:
|
|
86
|
+
response_404 = Error.from_dict(response.json())
|
|
87
|
+
|
|
88
|
+
return response_404
|
|
89
|
+
|
|
90
|
+
if response.status_code == 406:
|
|
91
|
+
response_406 = Error.from_dict(response.json())
|
|
92
|
+
|
|
93
|
+
return response_406
|
|
94
|
+
|
|
95
|
+
if response.status_code == 410:
|
|
96
|
+
response_410 = Error.from_dict(response.json())
|
|
97
|
+
|
|
98
|
+
return response_410
|
|
99
|
+
|
|
100
|
+
if response.status_code == 429:
|
|
101
|
+
response_429 = Error.from_dict(response.json())
|
|
102
|
+
|
|
103
|
+
return response_429
|
|
104
|
+
|
|
105
|
+
if response.status_code == 500:
|
|
106
|
+
response_500 = Error.from_dict(response.json())
|
|
107
|
+
|
|
108
|
+
return response_500
|
|
109
|
+
|
|
110
|
+
if response.status_code == 503:
|
|
111
|
+
response_503 = Error.from_dict(response.json())
|
|
112
|
+
|
|
113
|
+
return response_503
|
|
114
|
+
|
|
115
|
+
if client.raise_on_unexpected_status:
|
|
116
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
117
|
+
else:
|
|
118
|
+
return None
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def _build_response(
|
|
122
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
123
|
+
) -> Response[Union[Error, list["AuditLogWithCursor"]]]:
|
|
124
|
+
return Response(
|
|
125
|
+
status_code=HTTPStatus(response.status_code),
|
|
126
|
+
content=response.content,
|
|
127
|
+
headers=response.headers,
|
|
128
|
+
parsed=_parse_response(client=client, response=response),
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def sync_detailed(
|
|
133
|
+
org_id: str,
|
|
134
|
+
*,
|
|
135
|
+
client: Union[AuthenticatedClient, Client],
|
|
136
|
+
start_time: Union[Unset, datetime.datetime] = UNSET,
|
|
137
|
+
end_time: Union[Unset, datetime.datetime] = UNSET,
|
|
138
|
+
direction: Union[Unset, LogDirection] = UNSET,
|
|
139
|
+
cursor: Union[Unset, str] = UNSET,
|
|
140
|
+
limit: Union[Unset, int] = 20,
|
|
141
|
+
) -> Response[Union[Error, list["AuditLogWithCursor"]]]:
|
|
142
|
+
"""List organization audit logs
|
|
143
|
+
|
|
144
|
+
Retrieve audit logs for a specific organization with optional filtering and pagination.
|
|
145
|
+
|
|
146
|
+
Args:
|
|
147
|
+
org_id (str):
|
|
148
|
+
start_time (Union[Unset, datetime.datetime]): Example: 2023-01-01T00:00:00Z.
|
|
149
|
+
end_time (Union[Unset, datetime.datetime]): Example: 2023-12-31T23:59:59Z.
|
|
150
|
+
direction (Union[Unset, LogDirection]):
|
|
151
|
+
cursor (Union[Unset, str]):
|
|
152
|
+
limit (Union[Unset, int]): Defaults to 20 Default: 20.
|
|
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
|
+
Response[Union[Error, list['AuditLogWithCursor']]]
|
|
160
|
+
"""
|
|
161
|
+
|
|
162
|
+
kwargs = _get_kwargs(
|
|
163
|
+
org_id=org_id,
|
|
164
|
+
start_time=start_time,
|
|
165
|
+
end_time=end_time,
|
|
166
|
+
direction=direction,
|
|
167
|
+
cursor=cursor,
|
|
168
|
+
limit=limit,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
response = client.get_httpx_client().request(
|
|
172
|
+
**kwargs,
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
return _build_response(client=client, response=response)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def sync(
|
|
179
|
+
org_id: str,
|
|
180
|
+
*,
|
|
181
|
+
client: Union[AuthenticatedClient, Client],
|
|
182
|
+
start_time: Union[Unset, datetime.datetime] = UNSET,
|
|
183
|
+
end_time: Union[Unset, datetime.datetime] = UNSET,
|
|
184
|
+
direction: Union[Unset, LogDirection] = UNSET,
|
|
185
|
+
cursor: Union[Unset, str] = UNSET,
|
|
186
|
+
limit: Union[Unset, int] = 20,
|
|
187
|
+
) -> Optional[Union[Error, list["AuditLogWithCursor"]]]:
|
|
188
|
+
"""List organization audit logs
|
|
189
|
+
|
|
190
|
+
Retrieve audit logs for a specific organization with optional filtering and pagination.
|
|
191
|
+
|
|
192
|
+
Args:
|
|
193
|
+
org_id (str):
|
|
194
|
+
start_time (Union[Unset, datetime.datetime]): Example: 2023-01-01T00:00:00Z.
|
|
195
|
+
end_time (Union[Unset, datetime.datetime]): Example: 2023-12-31T23:59:59Z.
|
|
196
|
+
direction (Union[Unset, LogDirection]):
|
|
197
|
+
cursor (Union[Unset, str]):
|
|
198
|
+
limit (Union[Unset, int]): Defaults to 20 Default: 20.
|
|
199
|
+
|
|
200
|
+
Raises:
|
|
201
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
202
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
203
|
+
|
|
204
|
+
Returns:
|
|
205
|
+
Union[Error, list['AuditLogWithCursor']]
|
|
206
|
+
"""
|
|
207
|
+
|
|
208
|
+
return sync_detailed(
|
|
209
|
+
org_id=org_id,
|
|
210
|
+
client=client,
|
|
211
|
+
start_time=start_time,
|
|
212
|
+
end_time=end_time,
|
|
213
|
+
direction=direction,
|
|
214
|
+
cursor=cursor,
|
|
215
|
+
limit=limit,
|
|
216
|
+
).parsed
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
async def asyncio_detailed(
|
|
220
|
+
org_id: str,
|
|
221
|
+
*,
|
|
222
|
+
client: Union[AuthenticatedClient, Client],
|
|
223
|
+
start_time: Union[Unset, datetime.datetime] = UNSET,
|
|
224
|
+
end_time: Union[Unset, datetime.datetime] = UNSET,
|
|
225
|
+
direction: Union[Unset, LogDirection] = UNSET,
|
|
226
|
+
cursor: Union[Unset, str] = UNSET,
|
|
227
|
+
limit: Union[Unset, int] = 20,
|
|
228
|
+
) -> Response[Union[Error, list["AuditLogWithCursor"]]]:
|
|
229
|
+
"""List organization audit logs
|
|
230
|
+
|
|
231
|
+
Retrieve audit logs for a specific organization with optional filtering and pagination.
|
|
232
|
+
|
|
233
|
+
Args:
|
|
234
|
+
org_id (str):
|
|
235
|
+
start_time (Union[Unset, datetime.datetime]): Example: 2023-01-01T00:00:00Z.
|
|
236
|
+
end_time (Union[Unset, datetime.datetime]): Example: 2023-12-31T23:59:59Z.
|
|
237
|
+
direction (Union[Unset, LogDirection]):
|
|
238
|
+
cursor (Union[Unset, str]):
|
|
239
|
+
limit (Union[Unset, int]): Defaults to 20 Default: 20.
|
|
240
|
+
|
|
241
|
+
Raises:
|
|
242
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
243
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
244
|
+
|
|
245
|
+
Returns:
|
|
246
|
+
Response[Union[Error, list['AuditLogWithCursor']]]
|
|
247
|
+
"""
|
|
248
|
+
|
|
249
|
+
kwargs = _get_kwargs(
|
|
250
|
+
org_id=org_id,
|
|
251
|
+
start_time=start_time,
|
|
252
|
+
end_time=end_time,
|
|
253
|
+
direction=direction,
|
|
254
|
+
cursor=cursor,
|
|
255
|
+
limit=limit,
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
259
|
+
|
|
260
|
+
return _build_response(client=client, response=response)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
async def asyncio(
|
|
264
|
+
org_id: str,
|
|
265
|
+
*,
|
|
266
|
+
client: Union[AuthenticatedClient, Client],
|
|
267
|
+
start_time: Union[Unset, datetime.datetime] = UNSET,
|
|
268
|
+
end_time: Union[Unset, datetime.datetime] = UNSET,
|
|
269
|
+
direction: Union[Unset, LogDirection] = UNSET,
|
|
270
|
+
cursor: Union[Unset, str] = UNSET,
|
|
271
|
+
limit: Union[Unset, int] = 20,
|
|
272
|
+
) -> Optional[Union[Error, list["AuditLogWithCursor"]]]:
|
|
273
|
+
"""List organization audit logs
|
|
274
|
+
|
|
275
|
+
Retrieve audit logs for a specific organization with optional filtering and pagination.
|
|
276
|
+
|
|
277
|
+
Args:
|
|
278
|
+
org_id (str):
|
|
279
|
+
start_time (Union[Unset, datetime.datetime]): Example: 2023-01-01T00:00:00Z.
|
|
280
|
+
end_time (Union[Unset, datetime.datetime]): Example: 2023-12-31T23:59:59Z.
|
|
281
|
+
direction (Union[Unset, LogDirection]):
|
|
282
|
+
cursor (Union[Unset, str]):
|
|
283
|
+
limit (Union[Unset, int]): Defaults to 20 Default: 20.
|
|
284
|
+
|
|
285
|
+
Raises:
|
|
286
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
287
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
288
|
+
|
|
289
|
+
Returns:
|
|
290
|
+
Union[Error, list['AuditLogWithCursor']]
|
|
291
|
+
"""
|
|
292
|
+
|
|
293
|
+
return (
|
|
294
|
+
await asyncio_detailed(
|
|
295
|
+
org_id=org_id,
|
|
296
|
+
client=client,
|
|
297
|
+
start_time=start_time,
|
|
298
|
+
end_time=end_time,
|
|
299
|
+
direction=direction,
|
|
300
|
+
cursor=cursor,
|
|
301
|
+
limit=limit,
|
|
302
|
+
)
|
|
303
|
+
).parsed
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from http import HTTPStatus
|
|
3
|
+
from typing import Any, Optional, Union
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.audit_log_with_cursor import AuditLogWithCursor
|
|
10
|
+
from ...models.error import Error
|
|
11
|
+
from ...models.log_direction import LogDirection
|
|
12
|
+
from ...types import UNSET, Response, Unset
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
owner_id: str,
|
|
17
|
+
*,
|
|
18
|
+
start_time: Union[Unset, datetime.datetime] = UNSET,
|
|
19
|
+
end_time: Union[Unset, datetime.datetime] = UNSET,
|
|
20
|
+
direction: Union[Unset, LogDirection] = UNSET,
|
|
21
|
+
cursor: Union[Unset, str] = UNSET,
|
|
22
|
+
limit: Union[Unset, int] = 20,
|
|
23
|
+
) -> dict[str, Any]:
|
|
24
|
+
params: dict[str, Any] = {}
|
|
25
|
+
|
|
26
|
+
json_start_time: Union[Unset, str] = UNSET
|
|
27
|
+
if not isinstance(start_time, Unset):
|
|
28
|
+
json_start_time = start_time.isoformat()
|
|
29
|
+
params["startTime"] = json_start_time
|
|
30
|
+
|
|
31
|
+
json_end_time: Union[Unset, str] = UNSET
|
|
32
|
+
if not isinstance(end_time, Unset):
|
|
33
|
+
json_end_time = end_time.isoformat()
|
|
34
|
+
params["endTime"] = json_end_time
|
|
35
|
+
|
|
36
|
+
json_direction: Union[Unset, str] = UNSET
|
|
37
|
+
if not isinstance(direction, Unset):
|
|
38
|
+
json_direction = direction.value
|
|
39
|
+
|
|
40
|
+
params["direction"] = json_direction
|
|
41
|
+
|
|
42
|
+
params["cursor"] = cursor
|
|
43
|
+
|
|
44
|
+
params["limit"] = limit
|
|
45
|
+
|
|
46
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
47
|
+
|
|
48
|
+
_kwargs: dict[str, Any] = {
|
|
49
|
+
"method": "get",
|
|
50
|
+
"url": f"/owners/{owner_id}/audit-logs",
|
|
51
|
+
"params": params,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return _kwargs
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _parse_response(
|
|
58
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
59
|
+
) -> Optional[Union[Error, list["AuditLogWithCursor"]]]:
|
|
60
|
+
if response.status_code == 200:
|
|
61
|
+
response_200 = []
|
|
62
|
+
_response_200 = response.json()
|
|
63
|
+
for response_200_item_data in _response_200:
|
|
64
|
+
response_200_item = AuditLogWithCursor.from_dict(response_200_item_data)
|
|
65
|
+
|
|
66
|
+
response_200.append(response_200_item)
|
|
67
|
+
|
|
68
|
+
return response_200
|
|
69
|
+
|
|
70
|
+
if response.status_code == 400:
|
|
71
|
+
response_400 = Error.from_dict(response.json())
|
|
72
|
+
|
|
73
|
+
return response_400
|
|
74
|
+
|
|
75
|
+
if response.status_code == 401:
|
|
76
|
+
response_401 = Error.from_dict(response.json())
|
|
77
|
+
|
|
78
|
+
return response_401
|
|
79
|
+
|
|
80
|
+
if response.status_code == 403:
|
|
81
|
+
response_403 = Error.from_dict(response.json())
|
|
82
|
+
|
|
83
|
+
return response_403
|
|
84
|
+
|
|
85
|
+
if response.status_code == 404:
|
|
86
|
+
response_404 = Error.from_dict(response.json())
|
|
87
|
+
|
|
88
|
+
return response_404
|
|
89
|
+
|
|
90
|
+
if response.status_code == 406:
|
|
91
|
+
response_406 = Error.from_dict(response.json())
|
|
92
|
+
|
|
93
|
+
return response_406
|
|
94
|
+
|
|
95
|
+
if response.status_code == 410:
|
|
96
|
+
response_410 = Error.from_dict(response.json())
|
|
97
|
+
|
|
98
|
+
return response_410
|
|
99
|
+
|
|
100
|
+
if response.status_code == 429:
|
|
101
|
+
response_429 = Error.from_dict(response.json())
|
|
102
|
+
|
|
103
|
+
return response_429
|
|
104
|
+
|
|
105
|
+
if response.status_code == 500:
|
|
106
|
+
response_500 = Error.from_dict(response.json())
|
|
107
|
+
|
|
108
|
+
return response_500
|
|
109
|
+
|
|
110
|
+
if response.status_code == 503:
|
|
111
|
+
response_503 = Error.from_dict(response.json())
|
|
112
|
+
|
|
113
|
+
return response_503
|
|
114
|
+
|
|
115
|
+
if client.raise_on_unexpected_status:
|
|
116
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
117
|
+
else:
|
|
118
|
+
return None
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def _build_response(
|
|
122
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
123
|
+
) -> Response[Union[Error, list["AuditLogWithCursor"]]]:
|
|
124
|
+
return Response(
|
|
125
|
+
status_code=HTTPStatus(response.status_code),
|
|
126
|
+
content=response.content,
|
|
127
|
+
headers=response.headers,
|
|
128
|
+
parsed=_parse_response(client=client, response=response),
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def sync_detailed(
|
|
133
|
+
owner_id: str,
|
|
134
|
+
*,
|
|
135
|
+
client: Union[AuthenticatedClient, Client],
|
|
136
|
+
start_time: Union[Unset, datetime.datetime] = UNSET,
|
|
137
|
+
end_time: Union[Unset, datetime.datetime] = UNSET,
|
|
138
|
+
direction: Union[Unset, LogDirection] = UNSET,
|
|
139
|
+
cursor: Union[Unset, str] = UNSET,
|
|
140
|
+
limit: Union[Unset, int] = 20,
|
|
141
|
+
) -> Response[Union[Error, list["AuditLogWithCursor"]]]:
|
|
142
|
+
"""List workspace audit logs
|
|
143
|
+
|
|
144
|
+
Retrieve audit logs for a specific workspace with optional filtering and pagination.
|
|
145
|
+
|
|
146
|
+
Args:
|
|
147
|
+
owner_id (str):
|
|
148
|
+
start_time (Union[Unset, datetime.datetime]): Example: 2023-01-01T00:00:00Z.
|
|
149
|
+
end_time (Union[Unset, datetime.datetime]): Example: 2023-12-31T23:59:59Z.
|
|
150
|
+
direction (Union[Unset, LogDirection]):
|
|
151
|
+
cursor (Union[Unset, str]):
|
|
152
|
+
limit (Union[Unset, int]): Defaults to 20 Default: 20.
|
|
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
|
+
Response[Union[Error, list['AuditLogWithCursor']]]
|
|
160
|
+
"""
|
|
161
|
+
|
|
162
|
+
kwargs = _get_kwargs(
|
|
163
|
+
owner_id=owner_id,
|
|
164
|
+
start_time=start_time,
|
|
165
|
+
end_time=end_time,
|
|
166
|
+
direction=direction,
|
|
167
|
+
cursor=cursor,
|
|
168
|
+
limit=limit,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
response = client.get_httpx_client().request(
|
|
172
|
+
**kwargs,
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
return _build_response(client=client, response=response)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def sync(
|
|
179
|
+
owner_id: str,
|
|
180
|
+
*,
|
|
181
|
+
client: Union[AuthenticatedClient, Client],
|
|
182
|
+
start_time: Union[Unset, datetime.datetime] = UNSET,
|
|
183
|
+
end_time: Union[Unset, datetime.datetime] = UNSET,
|
|
184
|
+
direction: Union[Unset, LogDirection] = UNSET,
|
|
185
|
+
cursor: Union[Unset, str] = UNSET,
|
|
186
|
+
limit: Union[Unset, int] = 20,
|
|
187
|
+
) -> Optional[Union[Error, list["AuditLogWithCursor"]]]:
|
|
188
|
+
"""List workspace audit logs
|
|
189
|
+
|
|
190
|
+
Retrieve audit logs for a specific workspace with optional filtering and pagination.
|
|
191
|
+
|
|
192
|
+
Args:
|
|
193
|
+
owner_id (str):
|
|
194
|
+
start_time (Union[Unset, datetime.datetime]): Example: 2023-01-01T00:00:00Z.
|
|
195
|
+
end_time (Union[Unset, datetime.datetime]): Example: 2023-12-31T23:59:59Z.
|
|
196
|
+
direction (Union[Unset, LogDirection]):
|
|
197
|
+
cursor (Union[Unset, str]):
|
|
198
|
+
limit (Union[Unset, int]): Defaults to 20 Default: 20.
|
|
199
|
+
|
|
200
|
+
Raises:
|
|
201
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
202
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
203
|
+
|
|
204
|
+
Returns:
|
|
205
|
+
Union[Error, list['AuditLogWithCursor']]
|
|
206
|
+
"""
|
|
207
|
+
|
|
208
|
+
return sync_detailed(
|
|
209
|
+
owner_id=owner_id,
|
|
210
|
+
client=client,
|
|
211
|
+
start_time=start_time,
|
|
212
|
+
end_time=end_time,
|
|
213
|
+
direction=direction,
|
|
214
|
+
cursor=cursor,
|
|
215
|
+
limit=limit,
|
|
216
|
+
).parsed
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
async def asyncio_detailed(
|
|
220
|
+
owner_id: str,
|
|
221
|
+
*,
|
|
222
|
+
client: Union[AuthenticatedClient, Client],
|
|
223
|
+
start_time: Union[Unset, datetime.datetime] = UNSET,
|
|
224
|
+
end_time: Union[Unset, datetime.datetime] = UNSET,
|
|
225
|
+
direction: Union[Unset, LogDirection] = UNSET,
|
|
226
|
+
cursor: Union[Unset, str] = UNSET,
|
|
227
|
+
limit: Union[Unset, int] = 20,
|
|
228
|
+
) -> Response[Union[Error, list["AuditLogWithCursor"]]]:
|
|
229
|
+
"""List workspace audit logs
|
|
230
|
+
|
|
231
|
+
Retrieve audit logs for a specific workspace with optional filtering and pagination.
|
|
232
|
+
|
|
233
|
+
Args:
|
|
234
|
+
owner_id (str):
|
|
235
|
+
start_time (Union[Unset, datetime.datetime]): Example: 2023-01-01T00:00:00Z.
|
|
236
|
+
end_time (Union[Unset, datetime.datetime]): Example: 2023-12-31T23:59:59Z.
|
|
237
|
+
direction (Union[Unset, LogDirection]):
|
|
238
|
+
cursor (Union[Unset, str]):
|
|
239
|
+
limit (Union[Unset, int]): Defaults to 20 Default: 20.
|
|
240
|
+
|
|
241
|
+
Raises:
|
|
242
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
243
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
244
|
+
|
|
245
|
+
Returns:
|
|
246
|
+
Response[Union[Error, list['AuditLogWithCursor']]]
|
|
247
|
+
"""
|
|
248
|
+
|
|
249
|
+
kwargs = _get_kwargs(
|
|
250
|
+
owner_id=owner_id,
|
|
251
|
+
start_time=start_time,
|
|
252
|
+
end_time=end_time,
|
|
253
|
+
direction=direction,
|
|
254
|
+
cursor=cursor,
|
|
255
|
+
limit=limit,
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
259
|
+
|
|
260
|
+
return _build_response(client=client, response=response)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
async def asyncio(
|
|
264
|
+
owner_id: str,
|
|
265
|
+
*,
|
|
266
|
+
client: Union[AuthenticatedClient, Client],
|
|
267
|
+
start_time: Union[Unset, datetime.datetime] = UNSET,
|
|
268
|
+
end_time: Union[Unset, datetime.datetime] = UNSET,
|
|
269
|
+
direction: Union[Unset, LogDirection] = UNSET,
|
|
270
|
+
cursor: Union[Unset, str] = UNSET,
|
|
271
|
+
limit: Union[Unset, int] = 20,
|
|
272
|
+
) -> Optional[Union[Error, list["AuditLogWithCursor"]]]:
|
|
273
|
+
"""List workspace audit logs
|
|
274
|
+
|
|
275
|
+
Retrieve audit logs for a specific workspace with optional filtering and pagination.
|
|
276
|
+
|
|
277
|
+
Args:
|
|
278
|
+
owner_id (str):
|
|
279
|
+
start_time (Union[Unset, datetime.datetime]): Example: 2023-01-01T00:00:00Z.
|
|
280
|
+
end_time (Union[Unset, datetime.datetime]): Example: 2023-12-31T23:59:59Z.
|
|
281
|
+
direction (Union[Unset, LogDirection]):
|
|
282
|
+
cursor (Union[Unset, str]):
|
|
283
|
+
limit (Union[Unset, int]): Defaults to 20 Default: 20.
|
|
284
|
+
|
|
285
|
+
Raises:
|
|
286
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
287
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
288
|
+
|
|
289
|
+
Returns:
|
|
290
|
+
Union[Error, list['AuditLogWithCursor']]
|
|
291
|
+
"""
|
|
292
|
+
|
|
293
|
+
return (
|
|
294
|
+
await asyncio_detailed(
|
|
295
|
+
owner_id=owner_id,
|
|
296
|
+
client=client,
|
|
297
|
+
start_time=start_time,
|
|
298
|
+
end_time=end_time,
|
|
299
|
+
direction=direction,
|
|
300
|
+
cursor=cursor,
|
|
301
|
+
limit=limit,
|
|
302
|
+
)
|
|
303
|
+
).parsed
|