lightningrod-ai 0.1.6__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.
- lightningrod/__init__.py +66 -0
- lightningrod/_display.py +204 -0
- lightningrod/_errors.py +67 -0
- lightningrod/_generated/__init__.py +8 -0
- lightningrod/_generated/api/__init__.py +1 -0
- lightningrod/_generated/api/datasets/__init__.py +1 -0
- lightningrod/_generated/api/datasets/create_dataset_datasets_post.py +133 -0
- lightningrod/_generated/api/datasets/get_dataset_datasets_dataset_id_get.py +168 -0
- lightningrod/_generated/api/datasets/get_dataset_samples_datasets_dataset_id_samples_get.py +209 -0
- lightningrod/_generated/api/datasets/upload_samples_datasets_dataset_id_samples_post.py +190 -0
- lightningrod/_generated/api/file_sets/__init__.py +1 -0
- lightningrod/_generated/api/file_sets/add_file_to_set_filesets_file_set_id_files_post.py +190 -0
- lightningrod/_generated/api/file_sets/create_file_set_filesets_post.py +174 -0
- lightningrod/_generated/api/file_sets/get_file_set_filesets_file_set_id_get.py +168 -0
- lightningrod/_generated/api/file_sets/list_file_sets_filesets_get.py +173 -0
- lightningrod/_generated/api/file_sets/list_files_in_set_filesets_file_set_id_files_get.py +209 -0
- lightningrod/_generated/api/files/__init__.py +1 -0
- lightningrod/_generated/api/files/create_file_upload_files_post.py +174 -0
- lightningrod/_generated/api/open_ai_compatible/__init__.py +1 -0
- lightningrod/_generated/api/open_ai_compatible/chat_completions_openai_chat_completions_post.py +174 -0
- lightningrod/_generated/api/organizations/__init__.py +1 -0
- lightningrod/_generated/api/organizations/get_balance_organizations_balance_get.py +131 -0
- lightningrod/_generated/api/samples/__init__.py +1 -0
- lightningrod/_generated/api/samples/validate_sample_samples_validate_post.py +174 -0
- lightningrod/_generated/api/transform_jobs/__init__.py +1 -0
- lightningrod/_generated/api/transform_jobs/cost_estimation_transform_jobs_cost_estimation_post.py +174 -0
- lightningrod/_generated/api/transform_jobs/create_transform_job_transform_jobs_post.py +174 -0
- lightningrod/_generated/api/transform_jobs/get_transform_job_metrics_transform_jobs_job_id_metrics_get.py +172 -0
- lightningrod/_generated/api/transform_jobs/get_transform_job_transform_jobs_job_id_get.py +168 -0
- lightningrod/_generated/client.py +268 -0
- lightningrod/_generated/errors.py +16 -0
- lightningrod/_generated/models/__init__.py +147 -0
- lightningrod/_generated/models/answer_type.py +129 -0
- lightningrod/_generated/models/answer_type_enum.py +11 -0
- lightningrod/_generated/models/balance_response.py +61 -0
- lightningrod/_generated/models/chat_completion_request.py +216 -0
- lightningrod/_generated/models/chat_completion_response.py +146 -0
- lightningrod/_generated/models/chat_message.py +69 -0
- lightningrod/_generated/models/choice.py +97 -0
- lightningrod/_generated/models/create_dataset_response.py +61 -0
- lightningrod/_generated/models/create_file_set_file_request.py +101 -0
- lightningrod/_generated/models/create_file_set_file_request_metadata_type_0.py +46 -0
- lightningrod/_generated/models/create_file_set_request.py +83 -0
- lightningrod/_generated/models/create_file_upload_request.py +91 -0
- lightningrod/_generated/models/create_file_upload_response.py +165 -0
- lightningrod/_generated/models/create_file_upload_response_metadata_type_0.py +46 -0
- lightningrod/_generated/models/create_transform_job_request.py +312 -0
- lightningrod/_generated/models/dataset_metadata.py +69 -0
- lightningrod/_generated/models/estimate_cost_request.py +243 -0
- lightningrod/_generated/models/estimate_cost_response.py +117 -0
- lightningrod/_generated/models/event_usage_summary.py +80 -0
- lightningrod/_generated/models/file_set.py +128 -0
- lightningrod/_generated/models/file_set_file.py +203 -0
- lightningrod/_generated/models/file_set_file_metadata_type_0.py +57 -0
- lightningrod/_generated/models/file_set_query_seed_generator.py +136 -0
- lightningrod/_generated/models/file_set_seed_generator.py +126 -0
- lightningrod/_generated/models/filter_criteria.py +83 -0
- lightningrod/_generated/models/forward_looking_question.py +130 -0
- lightningrod/_generated/models/forward_looking_question_generator.py +217 -0
- lightningrod/_generated/models/gdelt_seed_generator.py +103 -0
- lightningrod/_generated/models/http_validation_error.py +79 -0
- lightningrod/_generated/models/job_usage.py +185 -0
- lightningrod/_generated/models/job_usage_by_step_type_0.py +59 -0
- lightningrod/_generated/models/label.py +143 -0
- lightningrod/_generated/models/list_file_set_files_response.py +113 -0
- lightningrod/_generated/models/list_file_sets_response.py +75 -0
- lightningrod/_generated/models/llm_model_usage_summary.py +98 -0
- lightningrod/_generated/models/mock_transform_config.py +243 -0
- lightningrod/_generated/models/mock_transform_config_metadata_additions.py +46 -0
- lightningrod/_generated/models/model_config.py +316 -0
- lightningrod/_generated/models/model_source_type.py +16 -0
- lightningrod/_generated/models/news_context.py +82 -0
- lightningrod/_generated/models/news_context_generator.py +127 -0
- lightningrod/_generated/models/news_seed_generator.py +220 -0
- lightningrod/_generated/models/paginated_samples_response.py +113 -0
- lightningrod/_generated/models/pipeline_metrics_response.py +99 -0
- lightningrod/_generated/models/question.py +74 -0
- lightningrod/_generated/models/question_and_label_generator.py +217 -0
- lightningrod/_generated/models/question_generator.py +217 -0
- lightningrod/_generated/models/question_pipeline.py +417 -0
- lightningrod/_generated/models/question_renderer.py +123 -0
- lightningrod/_generated/models/rag_context.py +82 -0
- lightningrod/_generated/models/response_message.py +69 -0
- lightningrod/_generated/models/rollout.py +130 -0
- lightningrod/_generated/models/rollout_generator.py +139 -0
- lightningrod/_generated/models/rollout_parsed_output_type_0.py +46 -0
- lightningrod/_generated/models/sample.py +323 -0
- lightningrod/_generated/models/sample_meta.py +46 -0
- lightningrod/_generated/models/seed.py +135 -0
- lightningrod/_generated/models/step_cost_breakdown.py +109 -0
- lightningrod/_generated/models/transform_job.py +268 -0
- lightningrod/_generated/models/transform_job_status.py +11 -0
- lightningrod/_generated/models/transform_step_metrics_response.py +131 -0
- lightningrod/_generated/models/transform_type.py +25 -0
- lightningrod/_generated/models/upload_samples_request.py +75 -0
- lightningrod/_generated/models/upload_samples_response.py +69 -0
- lightningrod/_generated/models/usage.py +77 -0
- lightningrod/_generated/models/usage_summary.py +102 -0
- lightningrod/_generated/models/usage_summary_events.py +59 -0
- lightningrod/_generated/models/usage_summary_llm_by_model.py +59 -0
- lightningrod/_generated/models/validate_sample_response.py +69 -0
- lightningrod/_generated/models/validation_error.py +90 -0
- lightningrod/_generated/models/web_search_labeler.py +120 -0
- lightningrod/_generated/py.typed +1 -0
- lightningrod/_generated/types.py +54 -0
- lightningrod/client.py +48 -0
- lightningrod/datasets/__init__.py +4 -0
- lightningrod/datasets/client.py +174 -0
- lightningrod/datasets/dataset.py +255 -0
- lightningrod/files/__init__.py +0 -0
- lightningrod/files/client.py +58 -0
- lightningrod/filesets/__init__.py +0 -0
- lightningrod/filesets/client.py +106 -0
- lightningrod/organization/__init__.py +0 -0
- lightningrod/organization/client.py +17 -0
- lightningrod/py.typed +0 -0
- lightningrod/transforms/__init__.py +0 -0
- lightningrod/transforms/client.py +154 -0
- lightningrod_ai-0.1.6.dist-info/METADATA +122 -0
- lightningrod_ai-0.1.6.dist-info/RECORD +123 -0
- lightningrod_ai-0.1.6.dist-info/WHEEL +5 -0
- lightningrod_ai-0.1.6.dist-info/licenses/LICENSE +23 -0
- lightningrod_ai-0.1.6.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.create_file_set_request import CreateFileSetRequest
|
|
9
|
+
from ...models.file_set import FileSet
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
body: CreateFileSetRequest,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
_kwargs: dict[str, Any] = {
|
|
21
|
+
"method": "post",
|
|
22
|
+
"url": "/filesets/",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_kwargs["json"] = body.to_dict()
|
|
26
|
+
|
|
27
|
+
headers["Content-Type"] = "application/json"
|
|
28
|
+
|
|
29
|
+
_kwargs["headers"] = headers
|
|
30
|
+
return _kwargs
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(
|
|
34
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
35
|
+
) -> FileSet | HTTPValidationError | None:
|
|
36
|
+
if response.status_code == 201:
|
|
37
|
+
response_201 = FileSet.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_201
|
|
40
|
+
|
|
41
|
+
if response.status_code == 422:
|
|
42
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_422
|
|
45
|
+
|
|
46
|
+
if client.raise_on_unexpected_status:
|
|
47
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
48
|
+
else:
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _build_response(
|
|
53
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
54
|
+
) -> Response[FileSet | HTTPValidationError]:
|
|
55
|
+
return Response(
|
|
56
|
+
status_code=HTTPStatus(response.status_code),
|
|
57
|
+
content=response.content,
|
|
58
|
+
headers=response.headers,
|
|
59
|
+
parsed=_parse_response(client=client, response=response),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def sync_detailed(
|
|
64
|
+
*,
|
|
65
|
+
client: AuthenticatedClient,
|
|
66
|
+
body: CreateFileSetRequest,
|
|
67
|
+
) -> Response[FileSet | HTTPValidationError]:
|
|
68
|
+
"""Create File Set
|
|
69
|
+
|
|
70
|
+
Create a new FileSet for the organization.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
body (CreateFileSetRequest):
|
|
74
|
+
|
|
75
|
+
Raises:
|
|
76
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
77
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
Response[FileSet | HTTPValidationError]
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
kwargs = _get_kwargs(
|
|
84
|
+
body=body,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
response = client.get_httpx_client().request(
|
|
88
|
+
**kwargs,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
return _build_response(client=client, response=response)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def sync(
|
|
95
|
+
*,
|
|
96
|
+
client: AuthenticatedClient,
|
|
97
|
+
body: CreateFileSetRequest,
|
|
98
|
+
) -> FileSet | HTTPValidationError | None:
|
|
99
|
+
"""Create File Set
|
|
100
|
+
|
|
101
|
+
Create a new FileSet for the organization.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
body (CreateFileSetRequest):
|
|
105
|
+
|
|
106
|
+
Raises:
|
|
107
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
108
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
FileSet | HTTPValidationError
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
return sync_detailed(
|
|
115
|
+
client=client,
|
|
116
|
+
body=body,
|
|
117
|
+
).parsed
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
async def asyncio_detailed(
|
|
121
|
+
*,
|
|
122
|
+
client: AuthenticatedClient,
|
|
123
|
+
body: CreateFileSetRequest,
|
|
124
|
+
) -> Response[FileSet | HTTPValidationError]:
|
|
125
|
+
"""Create File Set
|
|
126
|
+
|
|
127
|
+
Create a new FileSet for the organization.
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
body (CreateFileSetRequest):
|
|
131
|
+
|
|
132
|
+
Raises:
|
|
133
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
134
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
135
|
+
|
|
136
|
+
Returns:
|
|
137
|
+
Response[FileSet | HTTPValidationError]
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
kwargs = _get_kwargs(
|
|
141
|
+
body=body,
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
145
|
+
|
|
146
|
+
return _build_response(client=client, response=response)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
async def asyncio(
|
|
150
|
+
*,
|
|
151
|
+
client: AuthenticatedClient,
|
|
152
|
+
body: CreateFileSetRequest,
|
|
153
|
+
) -> FileSet | HTTPValidationError | None:
|
|
154
|
+
"""Create File Set
|
|
155
|
+
|
|
156
|
+
Create a new FileSet for the organization.
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
body (CreateFileSetRequest):
|
|
160
|
+
|
|
161
|
+
Raises:
|
|
162
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
163
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
164
|
+
|
|
165
|
+
Returns:
|
|
166
|
+
FileSet | HTTPValidationError
|
|
167
|
+
"""
|
|
168
|
+
|
|
169
|
+
return (
|
|
170
|
+
await asyncio_detailed(
|
|
171
|
+
client=client,
|
|
172
|
+
body=body,
|
|
173
|
+
)
|
|
174
|
+
).parsed
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.file_set import FileSet
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
file_set_id: str,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
_kwargs: dict[str, Any] = {
|
|
18
|
+
"method": "get",
|
|
19
|
+
"url": "/filesets/{file_set_id}".format(
|
|
20
|
+
file_set_id=quote(str(file_set_id), safe=""),
|
|
21
|
+
),
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return _kwargs
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _parse_response(
|
|
28
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
29
|
+
) -> FileSet | HTTPValidationError | None:
|
|
30
|
+
if response.status_code == 200:
|
|
31
|
+
response_200 = FileSet.from_dict(response.json())
|
|
32
|
+
|
|
33
|
+
return response_200
|
|
34
|
+
|
|
35
|
+
if response.status_code == 422:
|
|
36
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
37
|
+
|
|
38
|
+
return response_422
|
|
39
|
+
|
|
40
|
+
if client.raise_on_unexpected_status:
|
|
41
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
42
|
+
else:
|
|
43
|
+
return None
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _build_response(
|
|
47
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
48
|
+
) -> Response[FileSet | HTTPValidationError]:
|
|
49
|
+
return Response(
|
|
50
|
+
status_code=HTTPStatus(response.status_code),
|
|
51
|
+
content=response.content,
|
|
52
|
+
headers=response.headers,
|
|
53
|
+
parsed=_parse_response(client=client, response=response),
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def sync_detailed(
|
|
58
|
+
file_set_id: str,
|
|
59
|
+
*,
|
|
60
|
+
client: AuthenticatedClient,
|
|
61
|
+
) -> Response[FileSet | HTTPValidationError]:
|
|
62
|
+
"""Get File Set
|
|
63
|
+
|
|
64
|
+
Get a specific FileSet by ID.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
file_set_id (str):
|
|
68
|
+
|
|
69
|
+
Raises:
|
|
70
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
71
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
Response[FileSet | HTTPValidationError]
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
kwargs = _get_kwargs(
|
|
78
|
+
file_set_id=file_set_id,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
response = client.get_httpx_client().request(
|
|
82
|
+
**kwargs,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return _build_response(client=client, response=response)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def sync(
|
|
89
|
+
file_set_id: str,
|
|
90
|
+
*,
|
|
91
|
+
client: AuthenticatedClient,
|
|
92
|
+
) -> FileSet | HTTPValidationError | None:
|
|
93
|
+
"""Get File Set
|
|
94
|
+
|
|
95
|
+
Get a specific FileSet by ID.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
file_set_id (str):
|
|
99
|
+
|
|
100
|
+
Raises:
|
|
101
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
102
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
FileSet | HTTPValidationError
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
return sync_detailed(
|
|
109
|
+
file_set_id=file_set_id,
|
|
110
|
+
client=client,
|
|
111
|
+
).parsed
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
async def asyncio_detailed(
|
|
115
|
+
file_set_id: str,
|
|
116
|
+
*,
|
|
117
|
+
client: AuthenticatedClient,
|
|
118
|
+
) -> Response[FileSet | HTTPValidationError]:
|
|
119
|
+
"""Get File Set
|
|
120
|
+
|
|
121
|
+
Get a specific FileSet by ID.
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
file_set_id (str):
|
|
125
|
+
|
|
126
|
+
Raises:
|
|
127
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
128
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
129
|
+
|
|
130
|
+
Returns:
|
|
131
|
+
Response[FileSet | HTTPValidationError]
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
kwargs = _get_kwargs(
|
|
135
|
+
file_set_id=file_set_id,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
139
|
+
|
|
140
|
+
return _build_response(client=client, response=response)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
async def asyncio(
|
|
144
|
+
file_set_id: str,
|
|
145
|
+
*,
|
|
146
|
+
client: AuthenticatedClient,
|
|
147
|
+
) -> FileSet | HTTPValidationError | None:
|
|
148
|
+
"""Get File Set
|
|
149
|
+
|
|
150
|
+
Get a specific FileSet by ID.
|
|
151
|
+
|
|
152
|
+
Args:
|
|
153
|
+
file_set_id (str):
|
|
154
|
+
|
|
155
|
+
Raises:
|
|
156
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
157
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
158
|
+
|
|
159
|
+
Returns:
|
|
160
|
+
FileSet | HTTPValidationError
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
return (
|
|
164
|
+
await asyncio_detailed(
|
|
165
|
+
file_set_id=file_set_id,
|
|
166
|
+
client=client,
|
|
167
|
+
)
|
|
168
|
+
).parsed
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
9
|
+
from ...models.list_file_sets_response import ListFileSetsResponse
|
|
10
|
+
from ...types import UNSET, Response, Unset
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
include_public: bool | Unset = False,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
params: dict[str, Any] = {}
|
|
18
|
+
|
|
19
|
+
params["include_public"] = include_public
|
|
20
|
+
|
|
21
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
22
|
+
|
|
23
|
+
_kwargs: dict[str, Any] = {
|
|
24
|
+
"method": "get",
|
|
25
|
+
"url": "/filesets/",
|
|
26
|
+
"params": params,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return _kwargs
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _parse_response(
|
|
33
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
34
|
+
) -> HTTPValidationError | ListFileSetsResponse | None:
|
|
35
|
+
if response.status_code == 200:
|
|
36
|
+
response_200 = ListFileSetsResponse.from_dict(response.json())
|
|
37
|
+
|
|
38
|
+
return response_200
|
|
39
|
+
|
|
40
|
+
if response.status_code == 422:
|
|
41
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
42
|
+
|
|
43
|
+
return response_422
|
|
44
|
+
|
|
45
|
+
if client.raise_on_unexpected_status:
|
|
46
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
47
|
+
else:
|
|
48
|
+
return None
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _build_response(
|
|
52
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
53
|
+
) -> Response[HTTPValidationError | ListFileSetsResponse]:
|
|
54
|
+
return Response(
|
|
55
|
+
status_code=HTTPStatus(response.status_code),
|
|
56
|
+
content=response.content,
|
|
57
|
+
headers=response.headers,
|
|
58
|
+
parsed=_parse_response(client=client, response=response),
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def sync_detailed(
|
|
63
|
+
*,
|
|
64
|
+
client: AuthenticatedClient,
|
|
65
|
+
include_public: bool | Unset = False,
|
|
66
|
+
) -> Response[HTTPValidationError | ListFileSetsResponse]:
|
|
67
|
+
"""List File Sets
|
|
68
|
+
|
|
69
|
+
List all FileSets for the organization, optionally including public filesets.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
include_public (bool | Unset): Include public filesets Default: False.
|
|
73
|
+
|
|
74
|
+
Raises:
|
|
75
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
76
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
Response[HTTPValidationError | ListFileSetsResponse]
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
kwargs = _get_kwargs(
|
|
83
|
+
include_public=include_public,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
response = client.get_httpx_client().request(
|
|
87
|
+
**kwargs,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
return _build_response(client=client, response=response)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def sync(
|
|
94
|
+
*,
|
|
95
|
+
client: AuthenticatedClient,
|
|
96
|
+
include_public: bool | Unset = False,
|
|
97
|
+
) -> HTTPValidationError | ListFileSetsResponse | None:
|
|
98
|
+
"""List File Sets
|
|
99
|
+
|
|
100
|
+
List all FileSets for the organization, optionally including public filesets.
|
|
101
|
+
|
|
102
|
+
Args:
|
|
103
|
+
include_public (bool | Unset): Include public filesets Default: False.
|
|
104
|
+
|
|
105
|
+
Raises:
|
|
106
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
107
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
HTTPValidationError | ListFileSetsResponse
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
return sync_detailed(
|
|
114
|
+
client=client,
|
|
115
|
+
include_public=include_public,
|
|
116
|
+
).parsed
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
async def asyncio_detailed(
|
|
120
|
+
*,
|
|
121
|
+
client: AuthenticatedClient,
|
|
122
|
+
include_public: bool | Unset = False,
|
|
123
|
+
) -> Response[HTTPValidationError | ListFileSetsResponse]:
|
|
124
|
+
"""List File Sets
|
|
125
|
+
|
|
126
|
+
List all FileSets for the organization, optionally including public filesets.
|
|
127
|
+
|
|
128
|
+
Args:
|
|
129
|
+
include_public (bool | Unset): Include public filesets Default: False.
|
|
130
|
+
|
|
131
|
+
Raises:
|
|
132
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
133
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
134
|
+
|
|
135
|
+
Returns:
|
|
136
|
+
Response[HTTPValidationError | ListFileSetsResponse]
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
kwargs = _get_kwargs(
|
|
140
|
+
include_public=include_public,
|
|
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
|
+
*,
|
|
150
|
+
client: AuthenticatedClient,
|
|
151
|
+
include_public: bool | Unset = False,
|
|
152
|
+
) -> HTTPValidationError | ListFileSetsResponse | None:
|
|
153
|
+
"""List File Sets
|
|
154
|
+
|
|
155
|
+
List all FileSets for the organization, optionally including public filesets.
|
|
156
|
+
|
|
157
|
+
Args:
|
|
158
|
+
include_public (bool | Unset): Include public filesets Default: False.
|
|
159
|
+
|
|
160
|
+
Raises:
|
|
161
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
162
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
163
|
+
|
|
164
|
+
Returns:
|
|
165
|
+
HTTPValidationError | ListFileSetsResponse
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
await asyncio_detailed(
|
|
170
|
+
client=client,
|
|
171
|
+
include_public=include_public,
|
|
172
|
+
)
|
|
173
|
+
).parsed
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...models.list_file_set_files_response import ListFileSetFilesResponse
|
|
11
|
+
from ...types import UNSET, Response, Unset
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
file_set_id: str,
|
|
16
|
+
*,
|
|
17
|
+
limit: int | Unset = 10,
|
|
18
|
+
cursor: None | str | Unset = UNSET,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
params: dict[str, Any] = {}
|
|
21
|
+
|
|
22
|
+
params["limit"] = limit
|
|
23
|
+
|
|
24
|
+
json_cursor: None | str | Unset
|
|
25
|
+
if isinstance(cursor, Unset):
|
|
26
|
+
json_cursor = UNSET
|
|
27
|
+
else:
|
|
28
|
+
json_cursor = cursor
|
|
29
|
+
params["cursor"] = json_cursor
|
|
30
|
+
|
|
31
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
32
|
+
|
|
33
|
+
_kwargs: dict[str, Any] = {
|
|
34
|
+
"method": "get",
|
|
35
|
+
"url": "/filesets/{file_set_id}/files".format(
|
|
36
|
+
file_set_id=quote(str(file_set_id), safe=""),
|
|
37
|
+
),
|
|
38
|
+
"params": params,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return _kwargs
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _parse_response(
|
|
45
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
46
|
+
) -> HTTPValidationError | ListFileSetFilesResponse | None:
|
|
47
|
+
if response.status_code == 200:
|
|
48
|
+
response_200 = ListFileSetFilesResponse.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
return response_200
|
|
51
|
+
|
|
52
|
+
if response.status_code == 422:
|
|
53
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
54
|
+
|
|
55
|
+
return response_422
|
|
56
|
+
|
|
57
|
+
if client.raise_on_unexpected_status:
|
|
58
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
59
|
+
else:
|
|
60
|
+
return None
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def _build_response(
|
|
64
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
65
|
+
) -> Response[HTTPValidationError | ListFileSetFilesResponse]:
|
|
66
|
+
return Response(
|
|
67
|
+
status_code=HTTPStatus(response.status_code),
|
|
68
|
+
content=response.content,
|
|
69
|
+
headers=response.headers,
|
|
70
|
+
parsed=_parse_response(client=client, response=response),
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def sync_detailed(
|
|
75
|
+
file_set_id: str,
|
|
76
|
+
*,
|
|
77
|
+
client: AuthenticatedClient,
|
|
78
|
+
limit: int | Unset = 10,
|
|
79
|
+
cursor: None | str | Unset = UNSET,
|
|
80
|
+
) -> Response[HTTPValidationError | ListFileSetFilesResponse]:
|
|
81
|
+
"""List Files In Set
|
|
82
|
+
|
|
83
|
+
List all files in a FileSet.
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
file_set_id (str):
|
|
87
|
+
limit (int | Unset): Default: 10.
|
|
88
|
+
cursor (None | str | Unset):
|
|
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
|
+
Response[HTTPValidationError | ListFileSetFilesResponse]
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
kwargs = _get_kwargs(
|
|
99
|
+
file_set_id=file_set_id,
|
|
100
|
+
limit=limit,
|
|
101
|
+
cursor=cursor,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
response = client.get_httpx_client().request(
|
|
105
|
+
**kwargs,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
return _build_response(client=client, response=response)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def sync(
|
|
112
|
+
file_set_id: str,
|
|
113
|
+
*,
|
|
114
|
+
client: AuthenticatedClient,
|
|
115
|
+
limit: int | Unset = 10,
|
|
116
|
+
cursor: None | str | Unset = UNSET,
|
|
117
|
+
) -> HTTPValidationError | ListFileSetFilesResponse | None:
|
|
118
|
+
"""List Files In Set
|
|
119
|
+
|
|
120
|
+
List all files in a FileSet.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
file_set_id (str):
|
|
124
|
+
limit (int | Unset): Default: 10.
|
|
125
|
+
cursor (None | str | Unset):
|
|
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
|
+
HTTPValidationError | ListFileSetFilesResponse
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
return sync_detailed(
|
|
136
|
+
file_set_id=file_set_id,
|
|
137
|
+
client=client,
|
|
138
|
+
limit=limit,
|
|
139
|
+
cursor=cursor,
|
|
140
|
+
).parsed
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
async def asyncio_detailed(
|
|
144
|
+
file_set_id: str,
|
|
145
|
+
*,
|
|
146
|
+
client: AuthenticatedClient,
|
|
147
|
+
limit: int | Unset = 10,
|
|
148
|
+
cursor: None | str | Unset = UNSET,
|
|
149
|
+
) -> Response[HTTPValidationError | ListFileSetFilesResponse]:
|
|
150
|
+
"""List Files In Set
|
|
151
|
+
|
|
152
|
+
List all files in a FileSet.
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
file_set_id (str):
|
|
156
|
+
limit (int | Unset): Default: 10.
|
|
157
|
+
cursor (None | str | Unset):
|
|
158
|
+
|
|
159
|
+
Raises:
|
|
160
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
161
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
Response[HTTPValidationError | ListFileSetFilesResponse]
|
|
165
|
+
"""
|
|
166
|
+
|
|
167
|
+
kwargs = _get_kwargs(
|
|
168
|
+
file_set_id=file_set_id,
|
|
169
|
+
limit=limit,
|
|
170
|
+
cursor=cursor,
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
174
|
+
|
|
175
|
+
return _build_response(client=client, response=response)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
async def asyncio(
|
|
179
|
+
file_set_id: str,
|
|
180
|
+
*,
|
|
181
|
+
client: AuthenticatedClient,
|
|
182
|
+
limit: int | Unset = 10,
|
|
183
|
+
cursor: None | str | Unset = UNSET,
|
|
184
|
+
) -> HTTPValidationError | ListFileSetFilesResponse | None:
|
|
185
|
+
"""List Files In Set
|
|
186
|
+
|
|
187
|
+
List all files in a FileSet.
|
|
188
|
+
|
|
189
|
+
Args:
|
|
190
|
+
file_set_id (str):
|
|
191
|
+
limit (int | Unset): Default: 10.
|
|
192
|
+
cursor (None | str | Unset):
|
|
193
|
+
|
|
194
|
+
Raises:
|
|
195
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
196
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
197
|
+
|
|
198
|
+
Returns:
|
|
199
|
+
HTTPValidationError | ListFileSetFilesResponse
|
|
200
|
+
"""
|
|
201
|
+
|
|
202
|
+
return (
|
|
203
|
+
await asyncio_detailed(
|
|
204
|
+
file_set_id=file_set_id,
|
|
205
|
+
client=client,
|
|
206
|
+
limit=limit,
|
|
207
|
+
cursor=cursor,
|
|
208
|
+
)
|
|
209
|
+
).parsed
|