dataleon 0.1.0a8__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.
Potentially problematic release.
This version of dataleon might be problematic. Click here for more details.
- dataleon/__init__.py +102 -0
- dataleon/_base_client.py +1995 -0
- dataleon/_client.py +412 -0
- dataleon/_compat.py +219 -0
- dataleon/_constants.py +14 -0
- dataleon/_exceptions.py +108 -0
- dataleon/_files.py +123 -0
- dataleon/_models.py +840 -0
- dataleon/_qs.py +150 -0
- dataleon/_resource.py +43 -0
- dataleon/_response.py +830 -0
- dataleon/_streaming.py +331 -0
- dataleon/_types.py +260 -0
- dataleon/_utils/__init__.py +64 -0
- dataleon/_utils/_compat.py +45 -0
- dataleon/_utils/_datetime_parse.py +136 -0
- dataleon/_utils/_logs.py +25 -0
- dataleon/_utils/_proxy.py +65 -0
- dataleon/_utils/_reflection.py +42 -0
- dataleon/_utils/_resources_proxy.py +24 -0
- dataleon/_utils/_streams.py +12 -0
- dataleon/_utils/_sync.py +58 -0
- dataleon/_utils/_transform.py +457 -0
- dataleon/_utils/_typing.py +156 -0
- dataleon/_utils/_utils.py +421 -0
- dataleon/_version.py +4 -0
- dataleon/lib/.keep +4 -0
- dataleon/py.typed +0 -0
- dataleon/resources/__init__.py +33 -0
- dataleon/resources/companies/__init__.py +33 -0
- dataleon/resources/companies/companies.py +706 -0
- dataleon/resources/companies/documents.py +361 -0
- dataleon/resources/individuals/__init__.py +33 -0
- dataleon/resources/individuals/documents.py +361 -0
- dataleon/resources/individuals/individuals.py +711 -0
- dataleon/types/__init__.py +17 -0
- dataleon/types/companies/__init__.py +5 -0
- dataleon/types/companies/document_upload_params.py +56 -0
- dataleon/types/company_create_params.py +101 -0
- dataleon/types/company_list_params.py +37 -0
- dataleon/types/company_list_response.py +10 -0
- dataleon/types/company_registration.py +439 -0
- dataleon/types/company_retrieve_params.py +15 -0
- dataleon/types/company_update_params.py +101 -0
- dataleon/types/individual.py +336 -0
- dataleon/types/individual_create_params.py +78 -0
- dataleon/types/individual_list_params.py +37 -0
- dataleon/types/individual_list_response.py +10 -0
- dataleon/types/individual_retrieve_params.py +15 -0
- dataleon/types/individual_update_params.py +78 -0
- dataleon/types/individuals/__init__.py +7 -0
- dataleon/types/individuals/document_response.py +41 -0
- dataleon/types/individuals/document_upload_params.py +56 -0
- dataleon/types/individuals/generic_document.py +57 -0
- dataleon/types/shared/__init__.py +3 -0
- dataleon/types/shared/check.py +26 -0
- dataleon-0.1.0a8.dist-info/METADATA +448 -0
- dataleon-0.1.0a8.dist-info/RECORD +60 -0
- dataleon-0.1.0a8.dist-info/WHEEL +4 -0
- dataleon-0.1.0a8.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,706 @@
|
|
|
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 Union
|
|
6
|
+
from datetime import date
|
|
7
|
+
from typing_extensions import Literal
|
|
8
|
+
|
|
9
|
+
import httpx
|
|
10
|
+
|
|
11
|
+
from ...types import company_list_params, company_create_params, company_update_params, company_retrieve_params
|
|
12
|
+
from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
|
|
13
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
14
|
+
from ..._compat import cached_property
|
|
15
|
+
from .documents import (
|
|
16
|
+
DocumentsResource,
|
|
17
|
+
AsyncDocumentsResource,
|
|
18
|
+
DocumentsResourceWithRawResponse,
|
|
19
|
+
AsyncDocumentsResourceWithRawResponse,
|
|
20
|
+
DocumentsResourceWithStreamingResponse,
|
|
21
|
+
AsyncDocumentsResourceWithStreamingResponse,
|
|
22
|
+
)
|
|
23
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
24
|
+
from ..._response import (
|
|
25
|
+
to_raw_response_wrapper,
|
|
26
|
+
to_streamed_response_wrapper,
|
|
27
|
+
async_to_raw_response_wrapper,
|
|
28
|
+
async_to_streamed_response_wrapper,
|
|
29
|
+
)
|
|
30
|
+
from ..._base_client import make_request_options
|
|
31
|
+
from ...types.company_registration import CompanyRegistration
|
|
32
|
+
from ...types.company_list_response import CompanyListResponse
|
|
33
|
+
|
|
34
|
+
__all__ = ["CompaniesResource", "AsyncCompaniesResource"]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class CompaniesResource(SyncAPIResource):
|
|
38
|
+
@cached_property
|
|
39
|
+
def documents(self) -> DocumentsResource:
|
|
40
|
+
return DocumentsResource(self._client)
|
|
41
|
+
|
|
42
|
+
@cached_property
|
|
43
|
+
def with_raw_response(self) -> CompaniesResourceWithRawResponse:
|
|
44
|
+
"""
|
|
45
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
46
|
+
the raw response object instead of the parsed content.
|
|
47
|
+
|
|
48
|
+
For more information, see https://www.github.com/dataleonlabs/dataleon-python#accessing-raw-response-data-eg-headers
|
|
49
|
+
"""
|
|
50
|
+
return CompaniesResourceWithRawResponse(self)
|
|
51
|
+
|
|
52
|
+
@cached_property
|
|
53
|
+
def with_streaming_response(self) -> CompaniesResourceWithStreamingResponse:
|
|
54
|
+
"""
|
|
55
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
56
|
+
|
|
57
|
+
For more information, see https://www.github.com/dataleonlabs/dataleon-python#with_streaming_response
|
|
58
|
+
"""
|
|
59
|
+
return CompaniesResourceWithStreamingResponse(self)
|
|
60
|
+
|
|
61
|
+
def create(
|
|
62
|
+
self,
|
|
63
|
+
*,
|
|
64
|
+
company: company_create_params.Company,
|
|
65
|
+
workspace_id: str,
|
|
66
|
+
source_id: str | Omit = omit,
|
|
67
|
+
technical_data: company_create_params.TechnicalData | Omit = omit,
|
|
68
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
69
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
70
|
+
extra_headers: Headers | None = None,
|
|
71
|
+
extra_query: Query | None = None,
|
|
72
|
+
extra_body: Body | None = None,
|
|
73
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
74
|
+
) -> CompanyRegistration:
|
|
75
|
+
"""
|
|
76
|
+
Create a new company
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
company: Main information about the company being registered.
|
|
80
|
+
|
|
81
|
+
workspace_id: Unique identifier of the workspace in which the company is being created.
|
|
82
|
+
|
|
83
|
+
source_id: Optional identifier to track the origin of the request or integration from your
|
|
84
|
+
system.
|
|
85
|
+
|
|
86
|
+
technical_data: Technical metadata and callback configuration.
|
|
87
|
+
|
|
88
|
+
extra_headers: Send extra headers
|
|
89
|
+
|
|
90
|
+
extra_query: Add additional query parameters to the request
|
|
91
|
+
|
|
92
|
+
extra_body: Add additional JSON properties to the request
|
|
93
|
+
|
|
94
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
95
|
+
"""
|
|
96
|
+
return self._post(
|
|
97
|
+
"/companies",
|
|
98
|
+
body=maybe_transform(
|
|
99
|
+
{
|
|
100
|
+
"company": company,
|
|
101
|
+
"workspace_id": workspace_id,
|
|
102
|
+
"source_id": source_id,
|
|
103
|
+
"technical_data": technical_data,
|
|
104
|
+
},
|
|
105
|
+
company_create_params.CompanyCreateParams,
|
|
106
|
+
),
|
|
107
|
+
options=make_request_options(
|
|
108
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
109
|
+
),
|
|
110
|
+
cast_to=CompanyRegistration,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
def retrieve(
|
|
114
|
+
self,
|
|
115
|
+
company_id: str,
|
|
116
|
+
*,
|
|
117
|
+
document: bool | Omit = omit,
|
|
118
|
+
scope: str | Omit = omit,
|
|
119
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
120
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
121
|
+
extra_headers: Headers | None = None,
|
|
122
|
+
extra_query: Query | None = None,
|
|
123
|
+
extra_body: Body | None = None,
|
|
124
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
125
|
+
) -> CompanyRegistration:
|
|
126
|
+
"""
|
|
127
|
+
Get a company by ID
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
document: Include document signed url
|
|
131
|
+
|
|
132
|
+
scope: Scope filter (id or scope)
|
|
133
|
+
|
|
134
|
+
extra_headers: Send extra headers
|
|
135
|
+
|
|
136
|
+
extra_query: Add additional query parameters to the request
|
|
137
|
+
|
|
138
|
+
extra_body: Add additional JSON properties to the request
|
|
139
|
+
|
|
140
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
141
|
+
"""
|
|
142
|
+
if not company_id:
|
|
143
|
+
raise ValueError(f"Expected a non-empty value for `company_id` but received {company_id!r}")
|
|
144
|
+
return self._get(
|
|
145
|
+
f"/companies/{company_id}",
|
|
146
|
+
options=make_request_options(
|
|
147
|
+
extra_headers=extra_headers,
|
|
148
|
+
extra_query=extra_query,
|
|
149
|
+
extra_body=extra_body,
|
|
150
|
+
timeout=timeout,
|
|
151
|
+
query=maybe_transform(
|
|
152
|
+
{
|
|
153
|
+
"document": document,
|
|
154
|
+
"scope": scope,
|
|
155
|
+
},
|
|
156
|
+
company_retrieve_params.CompanyRetrieveParams,
|
|
157
|
+
),
|
|
158
|
+
),
|
|
159
|
+
cast_to=CompanyRegistration,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
def update(
|
|
163
|
+
self,
|
|
164
|
+
company_id: str,
|
|
165
|
+
*,
|
|
166
|
+
company: company_update_params.Company,
|
|
167
|
+
workspace_id: str,
|
|
168
|
+
source_id: str | Omit = omit,
|
|
169
|
+
technical_data: company_update_params.TechnicalData | Omit = omit,
|
|
170
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
171
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
172
|
+
extra_headers: Headers | None = None,
|
|
173
|
+
extra_query: Query | None = None,
|
|
174
|
+
extra_body: Body | None = None,
|
|
175
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
176
|
+
) -> CompanyRegistration:
|
|
177
|
+
"""
|
|
178
|
+
Update a company by ID
|
|
179
|
+
|
|
180
|
+
Args:
|
|
181
|
+
company: Main information about the company being registered.
|
|
182
|
+
|
|
183
|
+
workspace_id: Unique identifier of the workspace in which the company is being created.
|
|
184
|
+
|
|
185
|
+
source_id: Optional identifier to track the origin of the request or integration from your
|
|
186
|
+
system.
|
|
187
|
+
|
|
188
|
+
technical_data: Technical metadata and callback configuration.
|
|
189
|
+
|
|
190
|
+
extra_headers: Send extra headers
|
|
191
|
+
|
|
192
|
+
extra_query: Add additional query parameters to the request
|
|
193
|
+
|
|
194
|
+
extra_body: Add additional JSON properties to the request
|
|
195
|
+
|
|
196
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
197
|
+
"""
|
|
198
|
+
if not company_id:
|
|
199
|
+
raise ValueError(f"Expected a non-empty value for `company_id` but received {company_id!r}")
|
|
200
|
+
return self._put(
|
|
201
|
+
f"/companies/{company_id}",
|
|
202
|
+
body=maybe_transform(
|
|
203
|
+
{
|
|
204
|
+
"company": company,
|
|
205
|
+
"workspace_id": workspace_id,
|
|
206
|
+
"source_id": source_id,
|
|
207
|
+
"technical_data": technical_data,
|
|
208
|
+
},
|
|
209
|
+
company_update_params.CompanyUpdateParams,
|
|
210
|
+
),
|
|
211
|
+
options=make_request_options(
|
|
212
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
213
|
+
),
|
|
214
|
+
cast_to=CompanyRegistration,
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
def list(
|
|
218
|
+
self,
|
|
219
|
+
*,
|
|
220
|
+
end_date: Union[str, date] | Omit = omit,
|
|
221
|
+
limit: int | Omit = omit,
|
|
222
|
+
offset: int | Omit = omit,
|
|
223
|
+
source_id: str | Omit = omit,
|
|
224
|
+
start_date: Union[str, date] | Omit = omit,
|
|
225
|
+
state: Literal["VOID", "WAITING", "STARTED", "RUNNING", "PROCESSED", "FAILED", "ABORTED", "EXPIRED", "DELETED"]
|
|
226
|
+
| Omit = omit,
|
|
227
|
+
status: Literal["rejected", "need_review", "approved"] | Omit = omit,
|
|
228
|
+
workspace_id: str | Omit = omit,
|
|
229
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
230
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
231
|
+
extra_headers: Headers | None = None,
|
|
232
|
+
extra_query: Query | None = None,
|
|
233
|
+
extra_body: Body | None = None,
|
|
234
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
235
|
+
) -> CompanyListResponse:
|
|
236
|
+
"""
|
|
237
|
+
Get all companies
|
|
238
|
+
|
|
239
|
+
Args:
|
|
240
|
+
end_date: Filter companies created before this date (format YYYY-MM-DD)
|
|
241
|
+
|
|
242
|
+
limit: Number of results to return (between 1 and 100)
|
|
243
|
+
|
|
244
|
+
offset: Number of results to skip (must be ≥ 0)
|
|
245
|
+
|
|
246
|
+
source_id: Filter by source ID
|
|
247
|
+
|
|
248
|
+
start_date: Filter companies created after this date (format YYYY-MM-DD)
|
|
249
|
+
|
|
250
|
+
state: Filter by company state (must be one of the allowed values)
|
|
251
|
+
|
|
252
|
+
status: Filter by individual status (must be one of the allowed values)
|
|
253
|
+
|
|
254
|
+
workspace_id: Filter by workspace ID
|
|
255
|
+
|
|
256
|
+
extra_headers: Send extra headers
|
|
257
|
+
|
|
258
|
+
extra_query: Add additional query parameters to the request
|
|
259
|
+
|
|
260
|
+
extra_body: Add additional JSON properties to the request
|
|
261
|
+
|
|
262
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
263
|
+
"""
|
|
264
|
+
return self._get(
|
|
265
|
+
"/companies",
|
|
266
|
+
options=make_request_options(
|
|
267
|
+
extra_headers=extra_headers,
|
|
268
|
+
extra_query=extra_query,
|
|
269
|
+
extra_body=extra_body,
|
|
270
|
+
timeout=timeout,
|
|
271
|
+
query=maybe_transform(
|
|
272
|
+
{
|
|
273
|
+
"end_date": end_date,
|
|
274
|
+
"limit": limit,
|
|
275
|
+
"offset": offset,
|
|
276
|
+
"source_id": source_id,
|
|
277
|
+
"start_date": start_date,
|
|
278
|
+
"state": state,
|
|
279
|
+
"status": status,
|
|
280
|
+
"workspace_id": workspace_id,
|
|
281
|
+
},
|
|
282
|
+
company_list_params.CompanyListParams,
|
|
283
|
+
),
|
|
284
|
+
),
|
|
285
|
+
cast_to=CompanyListResponse,
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
def delete(
|
|
289
|
+
self,
|
|
290
|
+
company_id: str,
|
|
291
|
+
*,
|
|
292
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
293
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
294
|
+
extra_headers: Headers | None = None,
|
|
295
|
+
extra_query: Query | None = None,
|
|
296
|
+
extra_body: Body | None = None,
|
|
297
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
298
|
+
) -> None:
|
|
299
|
+
"""
|
|
300
|
+
Delete a company by ID
|
|
301
|
+
|
|
302
|
+
Args:
|
|
303
|
+
extra_headers: Send extra headers
|
|
304
|
+
|
|
305
|
+
extra_query: Add additional query parameters to the request
|
|
306
|
+
|
|
307
|
+
extra_body: Add additional JSON properties to the request
|
|
308
|
+
|
|
309
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
310
|
+
"""
|
|
311
|
+
if not company_id:
|
|
312
|
+
raise ValueError(f"Expected a non-empty value for `company_id` but received {company_id!r}")
|
|
313
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
314
|
+
return self._delete(
|
|
315
|
+
f"/companies/{company_id}",
|
|
316
|
+
options=make_request_options(
|
|
317
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
318
|
+
),
|
|
319
|
+
cast_to=NoneType,
|
|
320
|
+
)
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
class AsyncCompaniesResource(AsyncAPIResource):
|
|
324
|
+
@cached_property
|
|
325
|
+
def documents(self) -> AsyncDocumentsResource:
|
|
326
|
+
return AsyncDocumentsResource(self._client)
|
|
327
|
+
|
|
328
|
+
@cached_property
|
|
329
|
+
def with_raw_response(self) -> AsyncCompaniesResourceWithRawResponse:
|
|
330
|
+
"""
|
|
331
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
332
|
+
the raw response object instead of the parsed content.
|
|
333
|
+
|
|
334
|
+
For more information, see https://www.github.com/dataleonlabs/dataleon-python#accessing-raw-response-data-eg-headers
|
|
335
|
+
"""
|
|
336
|
+
return AsyncCompaniesResourceWithRawResponse(self)
|
|
337
|
+
|
|
338
|
+
@cached_property
|
|
339
|
+
def with_streaming_response(self) -> AsyncCompaniesResourceWithStreamingResponse:
|
|
340
|
+
"""
|
|
341
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
342
|
+
|
|
343
|
+
For more information, see https://www.github.com/dataleonlabs/dataleon-python#with_streaming_response
|
|
344
|
+
"""
|
|
345
|
+
return AsyncCompaniesResourceWithStreamingResponse(self)
|
|
346
|
+
|
|
347
|
+
async def create(
|
|
348
|
+
self,
|
|
349
|
+
*,
|
|
350
|
+
company: company_create_params.Company,
|
|
351
|
+
workspace_id: str,
|
|
352
|
+
source_id: str | Omit = omit,
|
|
353
|
+
technical_data: company_create_params.TechnicalData | Omit = omit,
|
|
354
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
355
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
356
|
+
extra_headers: Headers | None = None,
|
|
357
|
+
extra_query: Query | None = None,
|
|
358
|
+
extra_body: Body | None = None,
|
|
359
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
360
|
+
) -> CompanyRegistration:
|
|
361
|
+
"""
|
|
362
|
+
Create a new company
|
|
363
|
+
|
|
364
|
+
Args:
|
|
365
|
+
company: Main information about the company being registered.
|
|
366
|
+
|
|
367
|
+
workspace_id: Unique identifier of the workspace in which the company is being created.
|
|
368
|
+
|
|
369
|
+
source_id: Optional identifier to track the origin of the request or integration from your
|
|
370
|
+
system.
|
|
371
|
+
|
|
372
|
+
technical_data: Technical metadata and callback configuration.
|
|
373
|
+
|
|
374
|
+
extra_headers: Send extra headers
|
|
375
|
+
|
|
376
|
+
extra_query: Add additional query parameters to the request
|
|
377
|
+
|
|
378
|
+
extra_body: Add additional JSON properties to the request
|
|
379
|
+
|
|
380
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
381
|
+
"""
|
|
382
|
+
return await self._post(
|
|
383
|
+
"/companies",
|
|
384
|
+
body=await async_maybe_transform(
|
|
385
|
+
{
|
|
386
|
+
"company": company,
|
|
387
|
+
"workspace_id": workspace_id,
|
|
388
|
+
"source_id": source_id,
|
|
389
|
+
"technical_data": technical_data,
|
|
390
|
+
},
|
|
391
|
+
company_create_params.CompanyCreateParams,
|
|
392
|
+
),
|
|
393
|
+
options=make_request_options(
|
|
394
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
395
|
+
),
|
|
396
|
+
cast_to=CompanyRegistration,
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
async def retrieve(
|
|
400
|
+
self,
|
|
401
|
+
company_id: str,
|
|
402
|
+
*,
|
|
403
|
+
document: bool | Omit = omit,
|
|
404
|
+
scope: str | Omit = omit,
|
|
405
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
406
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
407
|
+
extra_headers: Headers | None = None,
|
|
408
|
+
extra_query: Query | None = None,
|
|
409
|
+
extra_body: Body | None = None,
|
|
410
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
411
|
+
) -> CompanyRegistration:
|
|
412
|
+
"""
|
|
413
|
+
Get a company by ID
|
|
414
|
+
|
|
415
|
+
Args:
|
|
416
|
+
document: Include document signed url
|
|
417
|
+
|
|
418
|
+
scope: Scope filter (id or scope)
|
|
419
|
+
|
|
420
|
+
extra_headers: Send extra headers
|
|
421
|
+
|
|
422
|
+
extra_query: Add additional query parameters to the request
|
|
423
|
+
|
|
424
|
+
extra_body: Add additional JSON properties to the request
|
|
425
|
+
|
|
426
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
427
|
+
"""
|
|
428
|
+
if not company_id:
|
|
429
|
+
raise ValueError(f"Expected a non-empty value for `company_id` but received {company_id!r}")
|
|
430
|
+
return await self._get(
|
|
431
|
+
f"/companies/{company_id}",
|
|
432
|
+
options=make_request_options(
|
|
433
|
+
extra_headers=extra_headers,
|
|
434
|
+
extra_query=extra_query,
|
|
435
|
+
extra_body=extra_body,
|
|
436
|
+
timeout=timeout,
|
|
437
|
+
query=await async_maybe_transform(
|
|
438
|
+
{
|
|
439
|
+
"document": document,
|
|
440
|
+
"scope": scope,
|
|
441
|
+
},
|
|
442
|
+
company_retrieve_params.CompanyRetrieveParams,
|
|
443
|
+
),
|
|
444
|
+
),
|
|
445
|
+
cast_to=CompanyRegistration,
|
|
446
|
+
)
|
|
447
|
+
|
|
448
|
+
async def update(
|
|
449
|
+
self,
|
|
450
|
+
company_id: str,
|
|
451
|
+
*,
|
|
452
|
+
company: company_update_params.Company,
|
|
453
|
+
workspace_id: str,
|
|
454
|
+
source_id: str | Omit = omit,
|
|
455
|
+
technical_data: company_update_params.TechnicalData | Omit = omit,
|
|
456
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
457
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
458
|
+
extra_headers: Headers | None = None,
|
|
459
|
+
extra_query: Query | None = None,
|
|
460
|
+
extra_body: Body | None = None,
|
|
461
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
462
|
+
) -> CompanyRegistration:
|
|
463
|
+
"""
|
|
464
|
+
Update a company by ID
|
|
465
|
+
|
|
466
|
+
Args:
|
|
467
|
+
company: Main information about the company being registered.
|
|
468
|
+
|
|
469
|
+
workspace_id: Unique identifier of the workspace in which the company is being created.
|
|
470
|
+
|
|
471
|
+
source_id: Optional identifier to track the origin of the request or integration from your
|
|
472
|
+
system.
|
|
473
|
+
|
|
474
|
+
technical_data: Technical metadata and callback configuration.
|
|
475
|
+
|
|
476
|
+
extra_headers: Send extra headers
|
|
477
|
+
|
|
478
|
+
extra_query: Add additional query parameters to the request
|
|
479
|
+
|
|
480
|
+
extra_body: Add additional JSON properties to the request
|
|
481
|
+
|
|
482
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
483
|
+
"""
|
|
484
|
+
if not company_id:
|
|
485
|
+
raise ValueError(f"Expected a non-empty value for `company_id` but received {company_id!r}")
|
|
486
|
+
return await self._put(
|
|
487
|
+
f"/companies/{company_id}",
|
|
488
|
+
body=await async_maybe_transform(
|
|
489
|
+
{
|
|
490
|
+
"company": company,
|
|
491
|
+
"workspace_id": workspace_id,
|
|
492
|
+
"source_id": source_id,
|
|
493
|
+
"technical_data": technical_data,
|
|
494
|
+
},
|
|
495
|
+
company_update_params.CompanyUpdateParams,
|
|
496
|
+
),
|
|
497
|
+
options=make_request_options(
|
|
498
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
499
|
+
),
|
|
500
|
+
cast_to=CompanyRegistration,
|
|
501
|
+
)
|
|
502
|
+
|
|
503
|
+
async def list(
|
|
504
|
+
self,
|
|
505
|
+
*,
|
|
506
|
+
end_date: Union[str, date] | Omit = omit,
|
|
507
|
+
limit: int | Omit = omit,
|
|
508
|
+
offset: int | Omit = omit,
|
|
509
|
+
source_id: str | Omit = omit,
|
|
510
|
+
start_date: Union[str, date] | Omit = omit,
|
|
511
|
+
state: Literal["VOID", "WAITING", "STARTED", "RUNNING", "PROCESSED", "FAILED", "ABORTED", "EXPIRED", "DELETED"]
|
|
512
|
+
| Omit = omit,
|
|
513
|
+
status: Literal["rejected", "need_review", "approved"] | Omit = omit,
|
|
514
|
+
workspace_id: str | Omit = omit,
|
|
515
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
516
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
517
|
+
extra_headers: Headers | None = None,
|
|
518
|
+
extra_query: Query | None = None,
|
|
519
|
+
extra_body: Body | None = None,
|
|
520
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
521
|
+
) -> CompanyListResponse:
|
|
522
|
+
"""
|
|
523
|
+
Get all companies
|
|
524
|
+
|
|
525
|
+
Args:
|
|
526
|
+
end_date: Filter companies created before this date (format YYYY-MM-DD)
|
|
527
|
+
|
|
528
|
+
limit: Number of results to return (between 1 and 100)
|
|
529
|
+
|
|
530
|
+
offset: Number of results to skip (must be ≥ 0)
|
|
531
|
+
|
|
532
|
+
source_id: Filter by source ID
|
|
533
|
+
|
|
534
|
+
start_date: Filter companies created after this date (format YYYY-MM-DD)
|
|
535
|
+
|
|
536
|
+
state: Filter by company state (must be one of the allowed values)
|
|
537
|
+
|
|
538
|
+
status: Filter by individual status (must be one of the allowed values)
|
|
539
|
+
|
|
540
|
+
workspace_id: Filter by workspace ID
|
|
541
|
+
|
|
542
|
+
extra_headers: Send extra headers
|
|
543
|
+
|
|
544
|
+
extra_query: Add additional query parameters to the request
|
|
545
|
+
|
|
546
|
+
extra_body: Add additional JSON properties to the request
|
|
547
|
+
|
|
548
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
549
|
+
"""
|
|
550
|
+
return await self._get(
|
|
551
|
+
"/companies",
|
|
552
|
+
options=make_request_options(
|
|
553
|
+
extra_headers=extra_headers,
|
|
554
|
+
extra_query=extra_query,
|
|
555
|
+
extra_body=extra_body,
|
|
556
|
+
timeout=timeout,
|
|
557
|
+
query=await async_maybe_transform(
|
|
558
|
+
{
|
|
559
|
+
"end_date": end_date,
|
|
560
|
+
"limit": limit,
|
|
561
|
+
"offset": offset,
|
|
562
|
+
"source_id": source_id,
|
|
563
|
+
"start_date": start_date,
|
|
564
|
+
"state": state,
|
|
565
|
+
"status": status,
|
|
566
|
+
"workspace_id": workspace_id,
|
|
567
|
+
},
|
|
568
|
+
company_list_params.CompanyListParams,
|
|
569
|
+
),
|
|
570
|
+
),
|
|
571
|
+
cast_to=CompanyListResponse,
|
|
572
|
+
)
|
|
573
|
+
|
|
574
|
+
async def delete(
|
|
575
|
+
self,
|
|
576
|
+
company_id: str,
|
|
577
|
+
*,
|
|
578
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
579
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
580
|
+
extra_headers: Headers | None = None,
|
|
581
|
+
extra_query: Query | None = None,
|
|
582
|
+
extra_body: Body | None = None,
|
|
583
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
584
|
+
) -> None:
|
|
585
|
+
"""
|
|
586
|
+
Delete a company by ID
|
|
587
|
+
|
|
588
|
+
Args:
|
|
589
|
+
extra_headers: Send extra headers
|
|
590
|
+
|
|
591
|
+
extra_query: Add additional query parameters to the request
|
|
592
|
+
|
|
593
|
+
extra_body: Add additional JSON properties to the request
|
|
594
|
+
|
|
595
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
596
|
+
"""
|
|
597
|
+
if not company_id:
|
|
598
|
+
raise ValueError(f"Expected a non-empty value for `company_id` but received {company_id!r}")
|
|
599
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
600
|
+
return await self._delete(
|
|
601
|
+
f"/companies/{company_id}",
|
|
602
|
+
options=make_request_options(
|
|
603
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
604
|
+
),
|
|
605
|
+
cast_to=NoneType,
|
|
606
|
+
)
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
class CompaniesResourceWithRawResponse:
|
|
610
|
+
def __init__(self, companies: CompaniesResource) -> None:
|
|
611
|
+
self._companies = companies
|
|
612
|
+
|
|
613
|
+
self.create = to_raw_response_wrapper(
|
|
614
|
+
companies.create,
|
|
615
|
+
)
|
|
616
|
+
self.retrieve = to_raw_response_wrapper(
|
|
617
|
+
companies.retrieve,
|
|
618
|
+
)
|
|
619
|
+
self.update = to_raw_response_wrapper(
|
|
620
|
+
companies.update,
|
|
621
|
+
)
|
|
622
|
+
self.list = to_raw_response_wrapper(
|
|
623
|
+
companies.list,
|
|
624
|
+
)
|
|
625
|
+
self.delete = to_raw_response_wrapper(
|
|
626
|
+
companies.delete,
|
|
627
|
+
)
|
|
628
|
+
|
|
629
|
+
@cached_property
|
|
630
|
+
def documents(self) -> DocumentsResourceWithRawResponse:
|
|
631
|
+
return DocumentsResourceWithRawResponse(self._companies.documents)
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
class AsyncCompaniesResourceWithRawResponse:
|
|
635
|
+
def __init__(self, companies: AsyncCompaniesResource) -> None:
|
|
636
|
+
self._companies = companies
|
|
637
|
+
|
|
638
|
+
self.create = async_to_raw_response_wrapper(
|
|
639
|
+
companies.create,
|
|
640
|
+
)
|
|
641
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
642
|
+
companies.retrieve,
|
|
643
|
+
)
|
|
644
|
+
self.update = async_to_raw_response_wrapper(
|
|
645
|
+
companies.update,
|
|
646
|
+
)
|
|
647
|
+
self.list = async_to_raw_response_wrapper(
|
|
648
|
+
companies.list,
|
|
649
|
+
)
|
|
650
|
+
self.delete = async_to_raw_response_wrapper(
|
|
651
|
+
companies.delete,
|
|
652
|
+
)
|
|
653
|
+
|
|
654
|
+
@cached_property
|
|
655
|
+
def documents(self) -> AsyncDocumentsResourceWithRawResponse:
|
|
656
|
+
return AsyncDocumentsResourceWithRawResponse(self._companies.documents)
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
class CompaniesResourceWithStreamingResponse:
|
|
660
|
+
def __init__(self, companies: CompaniesResource) -> None:
|
|
661
|
+
self._companies = companies
|
|
662
|
+
|
|
663
|
+
self.create = to_streamed_response_wrapper(
|
|
664
|
+
companies.create,
|
|
665
|
+
)
|
|
666
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
667
|
+
companies.retrieve,
|
|
668
|
+
)
|
|
669
|
+
self.update = to_streamed_response_wrapper(
|
|
670
|
+
companies.update,
|
|
671
|
+
)
|
|
672
|
+
self.list = to_streamed_response_wrapper(
|
|
673
|
+
companies.list,
|
|
674
|
+
)
|
|
675
|
+
self.delete = to_streamed_response_wrapper(
|
|
676
|
+
companies.delete,
|
|
677
|
+
)
|
|
678
|
+
|
|
679
|
+
@cached_property
|
|
680
|
+
def documents(self) -> DocumentsResourceWithStreamingResponse:
|
|
681
|
+
return DocumentsResourceWithStreamingResponse(self._companies.documents)
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
class AsyncCompaniesResourceWithStreamingResponse:
|
|
685
|
+
def __init__(self, companies: AsyncCompaniesResource) -> None:
|
|
686
|
+
self._companies = companies
|
|
687
|
+
|
|
688
|
+
self.create = async_to_streamed_response_wrapper(
|
|
689
|
+
companies.create,
|
|
690
|
+
)
|
|
691
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
692
|
+
companies.retrieve,
|
|
693
|
+
)
|
|
694
|
+
self.update = async_to_streamed_response_wrapper(
|
|
695
|
+
companies.update,
|
|
696
|
+
)
|
|
697
|
+
self.list = async_to_streamed_response_wrapper(
|
|
698
|
+
companies.list,
|
|
699
|
+
)
|
|
700
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
701
|
+
companies.delete,
|
|
702
|
+
)
|
|
703
|
+
|
|
704
|
+
@cached_property
|
|
705
|
+
def documents(self) -> AsyncDocumentsResourceWithStreamingResponse:
|
|
706
|
+
return AsyncDocumentsResourceWithStreamingResponse(self._companies.documents)
|