codeset 0.1.0a1__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.
- codeset/__init__.py +90 -0
- codeset/_base_client.py +1985 -0
- codeset/_client.py +430 -0
- codeset/_compat.py +219 -0
- codeset/_constants.py +14 -0
- codeset/_exceptions.py +108 -0
- codeset/_files.py +123 -0
- codeset/_models.py +805 -0
- codeset/_qs.py +150 -0
- codeset/_resource.py +43 -0
- codeset/_response.py +830 -0
- codeset/_streaming.py +333 -0
- codeset/_types.py +219 -0
- codeset/_utils/__init__.py +57 -0
- codeset/_utils/_logs.py +25 -0
- codeset/_utils/_proxy.py +65 -0
- codeset/_utils/_reflection.py +42 -0
- codeset/_utils/_resources_proxy.py +24 -0
- codeset/_utils/_streams.py +12 -0
- codeset/_utils/_sync.py +86 -0
- codeset/_utils/_transform.py +447 -0
- codeset/_utils/_typing.py +151 -0
- codeset/_utils/_utils.py +422 -0
- codeset/_version.py +4 -0
- codeset/lib/.keep +4 -0
- codeset/py.typed +0 -0
- codeset/resources/__init__.py +47 -0
- codeset/resources/health.py +135 -0
- codeset/resources/samples.py +233 -0
- codeset/resources/sessions/__init__.py +33 -0
- codeset/resources/sessions/sessions.py +618 -0
- codeset/resources/sessions/verify.py +248 -0
- codeset/types/__init__.py +19 -0
- codeset/types/container_info.py +30 -0
- codeset/types/error_info.py +13 -0
- codeset/types/health_check_response.py +19 -0
- codeset/types/sample_download_params.py +14 -0
- codeset/types/sample_list_response.py +41 -0
- codeset/types/session.py +37 -0
- codeset/types/session_apply_diff_params.py +12 -0
- codeset/types/session_apply_diff_response.py +13 -0
- codeset/types/session_close_response.py +10 -0
- codeset/types/session_create_params.py +15 -0
- codeset/types/session_create_response.py +19 -0
- codeset/types/session_execute_command_params.py +15 -0
- codeset/types/session_execute_command_response.py +19 -0
- codeset/types/session_list_response.py +18 -0
- codeset/types/session_status.py +7 -0
- codeset/types/sessions/__init__.py +7 -0
- codeset/types/sessions/job_status.py +7 -0
- codeset/types/sessions/verify_start_response.py +19 -0
- codeset/types/sessions/verify_status_response.py +66 -0
- codeset-0.1.0a1.dist-info/METADATA +397 -0
- codeset-0.1.0a1.dist-info/RECORD +56 -0
- codeset-0.1.0a1.dist-info/WHEEL +4 -0
- codeset-0.1.0a1.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,135 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
import httpx
|
6
|
+
|
7
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
8
|
+
from .._compat import cached_property
|
9
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
10
|
+
from .._response import (
|
11
|
+
to_raw_response_wrapper,
|
12
|
+
to_streamed_response_wrapper,
|
13
|
+
async_to_raw_response_wrapper,
|
14
|
+
async_to_streamed_response_wrapper,
|
15
|
+
)
|
16
|
+
from .._base_client import make_request_options
|
17
|
+
from ..types.health_check_response import HealthCheckResponse
|
18
|
+
|
19
|
+
__all__ = ["HealthResource", "AsyncHealthResource"]
|
20
|
+
|
21
|
+
|
22
|
+
class HealthResource(SyncAPIResource):
|
23
|
+
@cached_property
|
24
|
+
def with_raw_response(self) -> HealthResourceWithRawResponse:
|
25
|
+
"""
|
26
|
+
This property can be used as a prefix for any HTTP method call to return
|
27
|
+
the raw response object instead of the parsed content.
|
28
|
+
|
29
|
+
For more information, see https://www.github.com/codeset-ai/codeset-sdk#accessing-raw-response-data-eg-headers
|
30
|
+
"""
|
31
|
+
return HealthResourceWithRawResponse(self)
|
32
|
+
|
33
|
+
@cached_property
|
34
|
+
def with_streaming_response(self) -> HealthResourceWithStreamingResponse:
|
35
|
+
"""
|
36
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
37
|
+
|
38
|
+
For more information, see https://www.github.com/codeset-ai/codeset-sdk#with_streaming_response
|
39
|
+
"""
|
40
|
+
return HealthResourceWithStreamingResponse(self)
|
41
|
+
|
42
|
+
def check(
|
43
|
+
self,
|
44
|
+
*,
|
45
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
46
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
47
|
+
extra_headers: Headers | None = None,
|
48
|
+
extra_query: Query | None = None,
|
49
|
+
extra_body: Body | None = None,
|
50
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
51
|
+
) -> HealthCheckResponse:
|
52
|
+
"""Health check endpoint"""
|
53
|
+
return self._get(
|
54
|
+
"/health",
|
55
|
+
options=make_request_options(
|
56
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
57
|
+
),
|
58
|
+
cast_to=HealthCheckResponse,
|
59
|
+
)
|
60
|
+
|
61
|
+
|
62
|
+
class AsyncHealthResource(AsyncAPIResource):
|
63
|
+
@cached_property
|
64
|
+
def with_raw_response(self) -> AsyncHealthResourceWithRawResponse:
|
65
|
+
"""
|
66
|
+
This property can be used as a prefix for any HTTP method call to return
|
67
|
+
the raw response object instead of the parsed content.
|
68
|
+
|
69
|
+
For more information, see https://www.github.com/codeset-ai/codeset-sdk#accessing-raw-response-data-eg-headers
|
70
|
+
"""
|
71
|
+
return AsyncHealthResourceWithRawResponse(self)
|
72
|
+
|
73
|
+
@cached_property
|
74
|
+
def with_streaming_response(self) -> AsyncHealthResourceWithStreamingResponse:
|
75
|
+
"""
|
76
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
77
|
+
|
78
|
+
For more information, see https://www.github.com/codeset-ai/codeset-sdk#with_streaming_response
|
79
|
+
"""
|
80
|
+
return AsyncHealthResourceWithStreamingResponse(self)
|
81
|
+
|
82
|
+
async def check(
|
83
|
+
self,
|
84
|
+
*,
|
85
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
86
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
87
|
+
extra_headers: Headers | None = None,
|
88
|
+
extra_query: Query | None = None,
|
89
|
+
extra_body: Body | None = None,
|
90
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
91
|
+
) -> HealthCheckResponse:
|
92
|
+
"""Health check endpoint"""
|
93
|
+
return await self._get(
|
94
|
+
"/health",
|
95
|
+
options=make_request_options(
|
96
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
97
|
+
),
|
98
|
+
cast_to=HealthCheckResponse,
|
99
|
+
)
|
100
|
+
|
101
|
+
|
102
|
+
class HealthResourceWithRawResponse:
|
103
|
+
def __init__(self, health: HealthResource) -> None:
|
104
|
+
self._health = health
|
105
|
+
|
106
|
+
self.check = to_raw_response_wrapper(
|
107
|
+
health.check,
|
108
|
+
)
|
109
|
+
|
110
|
+
|
111
|
+
class AsyncHealthResourceWithRawResponse:
|
112
|
+
def __init__(self, health: AsyncHealthResource) -> None:
|
113
|
+
self._health = health
|
114
|
+
|
115
|
+
self.check = async_to_raw_response_wrapper(
|
116
|
+
health.check,
|
117
|
+
)
|
118
|
+
|
119
|
+
|
120
|
+
class HealthResourceWithStreamingResponse:
|
121
|
+
def __init__(self, health: HealthResource) -> None:
|
122
|
+
self._health = health
|
123
|
+
|
124
|
+
self.check = to_streamed_response_wrapper(
|
125
|
+
health.check,
|
126
|
+
)
|
127
|
+
|
128
|
+
|
129
|
+
class AsyncHealthResourceWithStreamingResponse:
|
130
|
+
def __init__(self, health: AsyncHealthResource) -> None:
|
131
|
+
self._health = health
|
132
|
+
|
133
|
+
self.check = async_to_streamed_response_wrapper(
|
134
|
+
health.check,
|
135
|
+
)
|
@@ -0,0 +1,233 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Optional
|
6
|
+
|
7
|
+
import httpx
|
8
|
+
|
9
|
+
from ..types import sample_download_params
|
10
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
11
|
+
from .._utils import maybe_transform, async_maybe_transform
|
12
|
+
from .._compat import cached_property
|
13
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
14
|
+
from .._response import (
|
15
|
+
to_raw_response_wrapper,
|
16
|
+
to_streamed_response_wrapper,
|
17
|
+
async_to_raw_response_wrapper,
|
18
|
+
async_to_streamed_response_wrapper,
|
19
|
+
)
|
20
|
+
from .._base_client import make_request_options
|
21
|
+
from ..types.sample_list_response import SampleListResponse
|
22
|
+
|
23
|
+
__all__ = ["SamplesResource", "AsyncSamplesResource"]
|
24
|
+
|
25
|
+
|
26
|
+
class SamplesResource(SyncAPIResource):
|
27
|
+
@cached_property
|
28
|
+
def with_raw_response(self) -> SamplesResourceWithRawResponse:
|
29
|
+
"""
|
30
|
+
This property can be used as a prefix for any HTTP method call to return
|
31
|
+
the raw response object instead of the parsed content.
|
32
|
+
|
33
|
+
For more information, see https://www.github.com/codeset-ai/codeset-sdk#accessing-raw-response-data-eg-headers
|
34
|
+
"""
|
35
|
+
return SamplesResourceWithRawResponse(self)
|
36
|
+
|
37
|
+
@cached_property
|
38
|
+
def with_streaming_response(self) -> SamplesResourceWithStreamingResponse:
|
39
|
+
"""
|
40
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
41
|
+
|
42
|
+
For more information, see https://www.github.com/codeset-ai/codeset-sdk#with_streaming_response
|
43
|
+
"""
|
44
|
+
return SamplesResourceWithStreamingResponse(self)
|
45
|
+
|
46
|
+
def list(
|
47
|
+
self,
|
48
|
+
*,
|
49
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
50
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
51
|
+
extra_headers: Headers | None = None,
|
52
|
+
extra_query: Query | None = None,
|
53
|
+
extra_body: Body | None = None,
|
54
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
55
|
+
) -> SampleListResponse:
|
56
|
+
"""List available samples"""
|
57
|
+
return self._get(
|
58
|
+
"/samples",
|
59
|
+
options=make_request_options(
|
60
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
61
|
+
),
|
62
|
+
cast_to=SampleListResponse,
|
63
|
+
)
|
64
|
+
|
65
|
+
def download(
|
66
|
+
self,
|
67
|
+
sample_id: str,
|
68
|
+
*,
|
69
|
+
dataset: str,
|
70
|
+
version: Optional[int] | NotGiven = NOT_GIVEN,
|
71
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
72
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
73
|
+
extra_headers: Headers | None = None,
|
74
|
+
extra_query: Query | None = None,
|
75
|
+
extra_body: Body | None = None,
|
76
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
77
|
+
) -> object:
|
78
|
+
"""
|
79
|
+
Download the gz file for a specific sample
|
80
|
+
|
81
|
+
Args:
|
82
|
+
extra_headers: Send extra headers
|
83
|
+
|
84
|
+
extra_query: Add additional query parameters to the request
|
85
|
+
|
86
|
+
extra_body: Add additional JSON properties to the request
|
87
|
+
|
88
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
89
|
+
"""
|
90
|
+
if not dataset:
|
91
|
+
raise ValueError(f"Expected a non-empty value for `dataset` but received {dataset!r}")
|
92
|
+
if not sample_id:
|
93
|
+
raise ValueError(f"Expected a non-empty value for `sample_id` but received {sample_id!r}")
|
94
|
+
return self._get(
|
95
|
+
f"/samples/{dataset}/{sample_id}/download",
|
96
|
+
options=make_request_options(
|
97
|
+
extra_headers=extra_headers,
|
98
|
+
extra_query=extra_query,
|
99
|
+
extra_body=extra_body,
|
100
|
+
timeout=timeout,
|
101
|
+
query=maybe_transform({"version": version}, sample_download_params.SampleDownloadParams),
|
102
|
+
),
|
103
|
+
cast_to=object,
|
104
|
+
)
|
105
|
+
|
106
|
+
|
107
|
+
class AsyncSamplesResource(AsyncAPIResource):
|
108
|
+
@cached_property
|
109
|
+
def with_raw_response(self) -> AsyncSamplesResourceWithRawResponse:
|
110
|
+
"""
|
111
|
+
This property can be used as a prefix for any HTTP method call to return
|
112
|
+
the raw response object instead of the parsed content.
|
113
|
+
|
114
|
+
For more information, see https://www.github.com/codeset-ai/codeset-sdk#accessing-raw-response-data-eg-headers
|
115
|
+
"""
|
116
|
+
return AsyncSamplesResourceWithRawResponse(self)
|
117
|
+
|
118
|
+
@cached_property
|
119
|
+
def with_streaming_response(self) -> AsyncSamplesResourceWithStreamingResponse:
|
120
|
+
"""
|
121
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
122
|
+
|
123
|
+
For more information, see https://www.github.com/codeset-ai/codeset-sdk#with_streaming_response
|
124
|
+
"""
|
125
|
+
return AsyncSamplesResourceWithStreamingResponse(self)
|
126
|
+
|
127
|
+
async def list(
|
128
|
+
self,
|
129
|
+
*,
|
130
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
131
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
132
|
+
extra_headers: Headers | None = None,
|
133
|
+
extra_query: Query | None = None,
|
134
|
+
extra_body: Body | None = None,
|
135
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
136
|
+
) -> SampleListResponse:
|
137
|
+
"""List available samples"""
|
138
|
+
return await self._get(
|
139
|
+
"/samples",
|
140
|
+
options=make_request_options(
|
141
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
142
|
+
),
|
143
|
+
cast_to=SampleListResponse,
|
144
|
+
)
|
145
|
+
|
146
|
+
async def download(
|
147
|
+
self,
|
148
|
+
sample_id: str,
|
149
|
+
*,
|
150
|
+
dataset: str,
|
151
|
+
version: Optional[int] | NotGiven = NOT_GIVEN,
|
152
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
153
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
154
|
+
extra_headers: Headers | None = None,
|
155
|
+
extra_query: Query | None = None,
|
156
|
+
extra_body: Body | None = None,
|
157
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
158
|
+
) -> object:
|
159
|
+
"""
|
160
|
+
Download the gz file for a specific sample
|
161
|
+
|
162
|
+
Args:
|
163
|
+
extra_headers: Send extra headers
|
164
|
+
|
165
|
+
extra_query: Add additional query parameters to the request
|
166
|
+
|
167
|
+
extra_body: Add additional JSON properties to the request
|
168
|
+
|
169
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
170
|
+
"""
|
171
|
+
if not dataset:
|
172
|
+
raise ValueError(f"Expected a non-empty value for `dataset` but received {dataset!r}")
|
173
|
+
if not sample_id:
|
174
|
+
raise ValueError(f"Expected a non-empty value for `sample_id` but received {sample_id!r}")
|
175
|
+
return await self._get(
|
176
|
+
f"/samples/{dataset}/{sample_id}/download",
|
177
|
+
options=make_request_options(
|
178
|
+
extra_headers=extra_headers,
|
179
|
+
extra_query=extra_query,
|
180
|
+
extra_body=extra_body,
|
181
|
+
timeout=timeout,
|
182
|
+
query=await async_maybe_transform({"version": version}, sample_download_params.SampleDownloadParams),
|
183
|
+
),
|
184
|
+
cast_to=object,
|
185
|
+
)
|
186
|
+
|
187
|
+
|
188
|
+
class SamplesResourceWithRawResponse:
|
189
|
+
def __init__(self, samples: SamplesResource) -> None:
|
190
|
+
self._samples = samples
|
191
|
+
|
192
|
+
self.list = to_raw_response_wrapper(
|
193
|
+
samples.list,
|
194
|
+
)
|
195
|
+
self.download = to_raw_response_wrapper(
|
196
|
+
samples.download,
|
197
|
+
)
|
198
|
+
|
199
|
+
|
200
|
+
class AsyncSamplesResourceWithRawResponse:
|
201
|
+
def __init__(self, samples: AsyncSamplesResource) -> None:
|
202
|
+
self._samples = samples
|
203
|
+
|
204
|
+
self.list = async_to_raw_response_wrapper(
|
205
|
+
samples.list,
|
206
|
+
)
|
207
|
+
self.download = async_to_raw_response_wrapper(
|
208
|
+
samples.download,
|
209
|
+
)
|
210
|
+
|
211
|
+
|
212
|
+
class SamplesResourceWithStreamingResponse:
|
213
|
+
def __init__(self, samples: SamplesResource) -> None:
|
214
|
+
self._samples = samples
|
215
|
+
|
216
|
+
self.list = to_streamed_response_wrapper(
|
217
|
+
samples.list,
|
218
|
+
)
|
219
|
+
self.download = to_streamed_response_wrapper(
|
220
|
+
samples.download,
|
221
|
+
)
|
222
|
+
|
223
|
+
|
224
|
+
class AsyncSamplesResourceWithStreamingResponse:
|
225
|
+
def __init__(self, samples: AsyncSamplesResource) -> None:
|
226
|
+
self._samples = samples
|
227
|
+
|
228
|
+
self.list = async_to_streamed_response_wrapper(
|
229
|
+
samples.list,
|
230
|
+
)
|
231
|
+
self.download = async_to_streamed_response_wrapper(
|
232
|
+
samples.download,
|
233
|
+
)
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from .verify import (
|
4
|
+
VerifyResource,
|
5
|
+
AsyncVerifyResource,
|
6
|
+
VerifyResourceWithRawResponse,
|
7
|
+
AsyncVerifyResourceWithRawResponse,
|
8
|
+
VerifyResourceWithStreamingResponse,
|
9
|
+
AsyncVerifyResourceWithStreamingResponse,
|
10
|
+
)
|
11
|
+
from .sessions import (
|
12
|
+
SessionsResource,
|
13
|
+
AsyncSessionsResource,
|
14
|
+
SessionsResourceWithRawResponse,
|
15
|
+
AsyncSessionsResourceWithRawResponse,
|
16
|
+
SessionsResourceWithStreamingResponse,
|
17
|
+
AsyncSessionsResourceWithStreamingResponse,
|
18
|
+
)
|
19
|
+
|
20
|
+
__all__ = [
|
21
|
+
"VerifyResource",
|
22
|
+
"AsyncVerifyResource",
|
23
|
+
"VerifyResourceWithRawResponse",
|
24
|
+
"AsyncVerifyResourceWithRawResponse",
|
25
|
+
"VerifyResourceWithStreamingResponse",
|
26
|
+
"AsyncVerifyResourceWithStreamingResponse",
|
27
|
+
"SessionsResource",
|
28
|
+
"AsyncSessionsResource",
|
29
|
+
"SessionsResourceWithRawResponse",
|
30
|
+
"AsyncSessionsResourceWithRawResponse",
|
31
|
+
"SessionsResourceWithStreamingResponse",
|
32
|
+
"AsyncSessionsResourceWithStreamingResponse",
|
33
|
+
]
|