mixpeek 0.6.7__py3-none-any.whl → 0.6.8__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.
- mixpeek/base_client.py +89 -63
- mixpeek/core/__init__.py +2 -0
- mixpeek/core/client_wrapper.py +1 -1
- mixpeek/core/jsonable_encoder.py +5 -9
- mixpeek/core/pydantic_utilities.py +12 -0
- mixpeek/pipeline/client.py +55 -47
- mixpeek/storage/client.py +19 -19
- mixpeek/storage/sample/client.py +37 -33
- mixpeek/types/api_key.py +3 -7
- mixpeek/types/audio_params.py +3 -7
- mixpeek/types/configs_response.py +6 -10
- mixpeek/types/connection.py +3 -7
- mixpeek/types/csv_params.py +3 -7
- mixpeek/types/destination.py +6 -10
- mixpeek/types/embedding_response.py +4 -8
- mixpeek/types/error_message.py +3 -7
- mixpeek/types/error_response.py +3 -7
- mixpeek/types/extract_response.py +4 -8
- mixpeek/types/generation_response.py +4 -8
- mixpeek/types/html_params.py +3 -7
- mixpeek/types/http_validation_error.py +3 -7
- mixpeek/types/image_params.py +4 -8
- mixpeek/types/message.py +5 -9
- mixpeek/types/metadata.py +3 -7
- mixpeek/types/model.py +5 -9
- mixpeek/types/pdf_params.py +4 -8
- mixpeek/types/pipeline_response.py +6 -10
- mixpeek/types/pipeline_task_response.py +4 -8
- mixpeek/types/ppt_params.py +3 -7
- mixpeek/types/pptx_params.py +3 -7
- mixpeek/types/settings.py +3 -7
- mixpeek/types/source.py +6 -10
- mixpeek/types/source_destination_mapping.py +6 -10
- mixpeek/types/txt_params.py +3 -7
- mixpeek/types/user.py +3 -7
- mixpeek/types/validation_error.py +3 -7
- mixpeek/types/video_params.py +3 -7
- mixpeek/types/workflow_code_response.py +3 -7
- mixpeek/types/workflow_response.py +3 -7
- mixpeek/types/workflow_settings.py +3 -7
- mixpeek/types/xlsx_params.py +3 -7
- mixpeek/user/client.py +37 -33
- mixpeek/workflow/client.py +55 -47
- {mixpeek-0.6.7.dist-info → mixpeek-0.6.8.dist-info}/METADATA +1 -1
- mixpeek-0.6.8.dist-info/RECORD +76 -0
- mixpeek-0.6.7.dist-info/RECORD +0 -75
- {mixpeek-0.6.7.dist-info → mixpeek-0.6.8.dist-info}/LICENSE +0 -0
- {mixpeek-0.6.7.dist-info → mixpeek-0.6.8.dist-info}/WHEEL +0 -0
mixpeek/types/model.py
CHANGED
@@ -4,21 +4,17 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
from .models import Models
|
8
9
|
|
9
|
-
try:
|
10
|
-
import pydantic.v1 as pydantic # type: ignore
|
11
|
-
except ImportError:
|
12
|
-
import pydantic # type: ignore
|
13
10
|
|
14
|
-
|
15
|
-
|
16
|
-
provider: str = pydantic.Field()
|
11
|
+
class Model(pydantic_v1.BaseModel):
|
12
|
+
provider: str = pydantic_v1.Field()
|
17
13
|
"""
|
18
14
|
The provider of the model.
|
19
15
|
"""
|
20
16
|
|
21
|
-
model: Models =
|
17
|
+
model: Models = pydantic_v1.Field()
|
22
18
|
"""
|
23
19
|
The model to be used.
|
24
20
|
"""
|
@@ -34,5 +30,5 @@ class Model(pydantic.BaseModel):
|
|
34
30
|
class Config:
|
35
31
|
frozen = True
|
36
32
|
smart_union = True
|
37
|
-
extra =
|
33
|
+
extra = pydantic_v1.Extra.allow
|
38
34
|
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/types/pdf_params.py
CHANGED
@@ -4,15 +4,11 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
9
|
|
13
|
-
|
14
|
-
|
15
|
-
strategy: typing.Optional[str] = pydantic.Field(default=None)
|
10
|
+
class PdfParams(pydantic_v1.BaseModel):
|
11
|
+
strategy: typing.Optional[str] = pydantic_v1.Field(default=None)
|
16
12
|
"""
|
17
13
|
The strategy to use for partitioning the PDF. Valid strategies are "hi_res",
|
18
14
|
"ocr_only", and "fast". When using the "hi_res" strategy, the function uses
|
@@ -37,5 +33,5 @@ class PdfParams(pydantic.BaseModel):
|
|
37
33
|
class Config:
|
38
34
|
frozen = True
|
39
35
|
smart_union = True
|
40
|
-
extra =
|
36
|
+
extra = pydantic_v1.Extra.allow
|
41
37
|
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -4,30 +4,26 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
from .connection import Connection
|
8
9
|
from .source_destination_mapping import SourceDestinationMapping
|
9
10
|
|
10
|
-
try:
|
11
|
-
import pydantic.v1 as pydantic # type: ignore
|
12
|
-
except ImportError:
|
13
|
-
import pydantic # type: ignore
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
pipeline_id: typing.Optional[str] = pydantic.Field(default=None)
|
12
|
+
class PipelineResponse(pydantic_v1.BaseModel):
|
13
|
+
pipeline_id: typing.Optional[str] = pydantic_v1.Field(default=None)
|
18
14
|
"""
|
19
15
|
The ID of the pipeline
|
20
16
|
"""
|
21
17
|
|
22
18
|
enabled: typing.Optional[bool] = None
|
23
19
|
connection: typing.Optional[Connection] = None
|
24
|
-
source_destination_mappings: typing.List[SourceDestinationMapping] =
|
20
|
+
source_destination_mappings: typing.List[SourceDestinationMapping] = pydantic_v1.Field()
|
25
21
|
"""
|
26
22
|
The source-destination mappings
|
27
23
|
"""
|
28
24
|
|
29
25
|
metadata: typing.Optional[typing.Dict[str, typing.Any]] = None
|
30
|
-
created_at: typing.Optional[dt.datetime] =
|
26
|
+
created_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
|
31
27
|
"""
|
32
28
|
The creation time
|
33
29
|
"""
|
@@ -45,5 +41,5 @@ class PipelineResponse(pydantic.BaseModel):
|
|
45
41
|
class Config:
|
46
42
|
frozen = True
|
47
43
|
smart_union = True
|
48
|
-
extra =
|
44
|
+
extra = pydantic_v1.Extra.allow
|
49
45
|
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -4,15 +4,11 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
9
|
|
13
|
-
|
14
|
-
|
15
|
-
task_id: str = pydantic.Field()
|
10
|
+
class PipelineTaskResponse(pydantic_v1.BaseModel):
|
11
|
+
task_id: str = pydantic_v1.Field()
|
16
12
|
"""
|
17
13
|
The ID of the task
|
18
14
|
"""
|
@@ -28,5 +24,5 @@ class PipelineTaskResponse(pydantic.BaseModel):
|
|
28
24
|
class Config:
|
29
25
|
frozen = True
|
30
26
|
smart_union = True
|
31
|
-
extra =
|
27
|
+
extra = pydantic_v1.Extra.allow
|
32
28
|
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/types/ppt_params.py
CHANGED
@@ -4,14 +4,10 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
9
|
|
13
|
-
|
14
|
-
class PptParams(pydantic.BaseModel):
|
10
|
+
class PptParams(pydantic_v1.BaseModel):
|
15
11
|
def json(self, **kwargs: typing.Any) -> str:
|
16
12
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
17
13
|
return super().json(**kwargs_with_defaults)
|
@@ -23,5 +19,5 @@ class PptParams(pydantic.BaseModel):
|
|
23
19
|
class Config:
|
24
20
|
frozen = True
|
25
21
|
smart_union = True
|
26
|
-
extra =
|
22
|
+
extra = pydantic_v1.Extra.allow
|
27
23
|
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/types/pptx_params.py
CHANGED
@@ -4,14 +4,10 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
9
|
|
13
|
-
|
14
|
-
class PptxParams(pydantic.BaseModel):
|
10
|
+
class PptxParams(pydantic_v1.BaseModel):
|
15
11
|
def json(self, **kwargs: typing.Any) -> str:
|
16
12
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
17
13
|
return super().json(**kwargs_with_defaults)
|
@@ -23,5 +19,5 @@ class PptxParams(pydantic.BaseModel):
|
|
23
19
|
class Config:
|
24
20
|
frozen = True
|
25
21
|
smart_union = True
|
26
|
-
extra =
|
22
|
+
extra = pydantic_v1.Extra.allow
|
27
23
|
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/types/settings.py
CHANGED
@@ -4,14 +4,10 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
9
|
|
13
|
-
|
14
|
-
class Settings(pydantic.BaseModel):
|
10
|
+
class Settings(pydantic_v1.BaseModel):
|
15
11
|
system_prompt: typing.Optional[str] = None
|
16
12
|
temperature: typing.Optional[float] = None
|
17
13
|
max_tokens: typing.Optional[int] = None
|
@@ -31,5 +27,5 @@ class Settings(pydantic.BaseModel):
|
|
31
27
|
class Config:
|
32
28
|
frozen = True
|
33
29
|
smart_union = True
|
34
|
-
extra =
|
30
|
+
extra = pydantic_v1.Extra.allow
|
35
31
|
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/types/source.py
CHANGED
@@ -4,26 +4,22 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
from .field_type import FieldType
|
8
9
|
|
9
|
-
try:
|
10
|
-
import pydantic.v1 as pydantic # type: ignore
|
11
|
-
except ImportError:
|
12
|
-
import pydantic # type: ignore
|
13
10
|
|
14
|
-
|
15
|
-
|
16
|
-
field: str = pydantic.Field()
|
11
|
+
class Source(pydantic_v1.BaseModel):
|
12
|
+
field: str = pydantic_v1.Field()
|
17
13
|
"""
|
18
14
|
The field name
|
19
15
|
"""
|
20
16
|
|
21
|
-
type: FieldType =
|
17
|
+
type: FieldType = pydantic_v1.Field()
|
22
18
|
"""
|
23
19
|
The type of the field
|
24
20
|
"""
|
25
21
|
|
26
|
-
settings: typing.Dict[str, typing.Any] =
|
22
|
+
settings: typing.Dict[str, typing.Any] = pydantic_v1.Field()
|
27
23
|
"""
|
28
24
|
The settings for the field
|
29
25
|
"""
|
@@ -39,5 +35,5 @@ class Source(pydantic.BaseModel):
|
|
39
35
|
class Config:
|
40
36
|
frozen = True
|
41
37
|
smart_union = True
|
42
|
-
extra =
|
38
|
+
extra = pydantic_v1.Extra.allow
|
43
39
|
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -4,27 +4,23 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
from .destination import Destination
|
8
9
|
from .source import Source
|
9
10
|
|
10
|
-
try:
|
11
|
-
import pydantic.v1 as pydantic # type: ignore
|
12
|
-
except ImportError:
|
13
|
-
import pydantic # type: ignore
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
embedding_model: str = pydantic.Field()
|
12
|
+
class SourceDestinationMapping(pydantic_v1.BaseModel):
|
13
|
+
embedding_model: str = pydantic_v1.Field()
|
18
14
|
"""
|
19
15
|
The embedding model
|
20
16
|
"""
|
21
17
|
|
22
|
-
source: Source =
|
18
|
+
source: Source = pydantic_v1.Field()
|
23
19
|
"""
|
24
20
|
The source
|
25
21
|
"""
|
26
22
|
|
27
|
-
destination: Destination =
|
23
|
+
destination: Destination = pydantic_v1.Field()
|
28
24
|
"""
|
29
25
|
The destination
|
30
26
|
"""
|
@@ -40,5 +36,5 @@ class SourceDestinationMapping(pydantic.BaseModel):
|
|
40
36
|
class Config:
|
41
37
|
frozen = True
|
42
38
|
smart_union = True
|
43
|
-
extra =
|
39
|
+
extra = pydantic_v1.Extra.allow
|
44
40
|
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/types/txt_params.py
CHANGED
@@ -4,14 +4,10 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
9
|
|
13
|
-
|
14
|
-
class TxtParams(pydantic.BaseModel):
|
10
|
+
class TxtParams(pydantic_v1.BaseModel):
|
15
11
|
def json(self, **kwargs: typing.Any) -> str:
|
16
12
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
17
13
|
return super().json(**kwargs_with_defaults)
|
@@ -23,5 +19,5 @@ class TxtParams(pydantic.BaseModel):
|
|
23
19
|
class Config:
|
24
20
|
frozen = True
|
25
21
|
smart_union = True
|
26
|
-
extra =
|
22
|
+
extra = pydantic_v1.Extra.allow
|
27
23
|
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/types/user.py
CHANGED
@@ -4,16 +4,12 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
from .api_key import ApiKey
|
8
9
|
from .connection import Connection
|
9
10
|
|
10
|
-
try:
|
11
|
-
import pydantic.v1 as pydantic # type: ignore
|
12
|
-
except ImportError:
|
13
|
-
import pydantic # type: ignore
|
14
11
|
|
15
|
-
|
16
|
-
class User(pydantic.BaseModel):
|
12
|
+
class User(pydantic_v1.BaseModel):
|
17
13
|
user_id: typing.Optional[str] = None
|
18
14
|
email: str
|
19
15
|
api_keys: typing.Optional[typing.List[ApiKey]] = None
|
@@ -32,5 +28,5 @@ class User(pydantic.BaseModel):
|
|
32
28
|
class Config:
|
33
29
|
frozen = True
|
34
30
|
smart_union = True
|
35
|
-
extra =
|
31
|
+
extra = pydantic_v1.Extra.allow
|
36
32
|
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -4,15 +4,11 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
from .validation_error_loc_item import ValidationErrorLocItem
|
8
9
|
|
9
|
-
try:
|
10
|
-
import pydantic.v1 as pydantic # type: ignore
|
11
|
-
except ImportError:
|
12
|
-
import pydantic # type: ignore
|
13
10
|
|
14
|
-
|
15
|
-
class ValidationError(pydantic.BaseModel):
|
11
|
+
class ValidationError(pydantic_v1.BaseModel):
|
16
12
|
loc: typing.List[ValidationErrorLocItem]
|
17
13
|
msg: str
|
18
14
|
type: str
|
@@ -28,5 +24,5 @@ class ValidationError(pydantic.BaseModel):
|
|
28
24
|
class Config:
|
29
25
|
frozen = True
|
30
26
|
smart_union = True
|
31
|
-
extra =
|
27
|
+
extra = pydantic_v1.Extra.allow
|
32
28
|
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/types/video_params.py
CHANGED
@@ -4,14 +4,10 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
9
|
|
13
|
-
|
14
|
-
class VideoParams(pydantic.BaseModel):
|
10
|
+
class VideoParams(pydantic_v1.BaseModel):
|
15
11
|
def json(self, **kwargs: typing.Any) -> str:
|
16
12
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
17
13
|
return super().json(**kwargs_with_defaults)
|
@@ -23,5 +19,5 @@ class VideoParams(pydantic.BaseModel):
|
|
23
19
|
class Config:
|
24
20
|
frozen = True
|
25
21
|
smart_union = True
|
26
|
-
extra =
|
22
|
+
extra = pydantic_v1.Extra.allow
|
27
23
|
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -4,14 +4,10 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
9
|
|
13
|
-
|
14
|
-
class WorkflowCodeResponse(pydantic.BaseModel):
|
10
|
+
class WorkflowCodeResponse(pydantic_v1.BaseModel):
|
15
11
|
code_as_string: str
|
16
12
|
|
17
13
|
def json(self, **kwargs: typing.Any) -> str:
|
@@ -25,5 +21,5 @@ class WorkflowCodeResponse(pydantic.BaseModel):
|
|
25
21
|
class Config:
|
26
22
|
frozen = True
|
27
23
|
smart_union = True
|
28
|
-
extra =
|
24
|
+
extra = pydantic_v1.Extra.allow
|
29
25
|
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -4,14 +4,10 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
9
|
|
13
|
-
|
14
|
-
class WorkflowResponse(pydantic.BaseModel):
|
10
|
+
class WorkflowResponse(pydantic_v1.BaseModel):
|
15
11
|
workflow_id: str
|
16
12
|
workflow_name: typing.Optional[str] = None
|
17
13
|
created_at: dt.datetime
|
@@ -28,5 +24,5 @@ class WorkflowResponse(pydantic.BaseModel):
|
|
28
24
|
class Config:
|
29
25
|
frozen = True
|
30
26
|
smart_union = True
|
31
|
-
extra =
|
27
|
+
extra = pydantic_v1.Extra.allow
|
32
28
|
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -4,14 +4,10 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
9
|
|
13
|
-
|
14
|
-
class WorkflowSettings(pydantic.BaseModel):
|
10
|
+
class WorkflowSettings(pydantic_v1.BaseModel):
|
15
11
|
requirements: typing.Optional[typing.List[str]] = None
|
16
12
|
python_version: typing.Optional[str] = None
|
17
13
|
|
@@ -26,5 +22,5 @@ class WorkflowSettings(pydantic.BaseModel):
|
|
26
22
|
class Config:
|
27
23
|
frozen = True
|
28
24
|
smart_union = True
|
29
|
-
extra =
|
25
|
+
extra = pydantic_v1.Extra.allow
|
30
26
|
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/types/xlsx_params.py
CHANGED
@@ -4,14 +4,10 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
7
8
|
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
9
|
|
13
|
-
|
14
|
-
class XlsxParams(pydantic.BaseModel):
|
10
|
+
class XlsxParams(pydantic_v1.BaseModel):
|
15
11
|
include_header: typing.Optional[bool] = None
|
16
12
|
|
17
13
|
def json(self, **kwargs: typing.Any) -> str:
|
@@ -25,5 +21,5 @@ class XlsxParams(pydantic.BaseModel):
|
|
25
21
|
class Config:
|
26
22
|
frozen = True
|
27
23
|
smart_union = True
|
28
|
-
extra =
|
24
|
+
extra = pydantic_v1.Extra.allow
|
29
25
|
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/user/client.py
CHANGED
@@ -7,6 +7,7 @@ from json.decoder import JSONDecodeError
|
|
7
7
|
from ..core.api_error import ApiError
|
8
8
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
9
|
from ..core.jsonable_encoder import jsonable_encoder
|
10
|
+
from ..core.pydantic_utilities import pydantic_v1
|
10
11
|
from ..core.remove_none_from_dict import remove_none_from_dict
|
11
12
|
from ..core.request_options import RequestOptions
|
12
13
|
from ..errors.bad_request_error import BadRequestError
|
@@ -21,11 +22,6 @@ from ..types.error_response import ErrorResponse
|
|
21
22
|
from ..types.http_validation_error import HttpValidationError
|
22
23
|
from ..types.user import User
|
23
24
|
|
24
|
-
try:
|
25
|
-
import pydantic.v1 as pydantic # type: ignore
|
26
|
-
except ImportError:
|
27
|
-
import pydantic # type: ignore
|
28
|
-
|
29
25
|
# this is used as the default value for optional parameters
|
30
26
|
OMIT = typing.cast(typing.Any, ...)
|
31
27
|
|
@@ -69,19 +65,21 @@ class UserClient:
|
|
69
65
|
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
70
66
|
)
|
71
67
|
if 200 <= _response.status_code < 300:
|
72
|
-
return
|
68
|
+
return pydantic_v1.parse_obj_as(User, _response.json()) # type: ignore
|
73
69
|
if _response.status_code == 400:
|
74
|
-
raise BadRequestError(
|
70
|
+
raise BadRequestError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
75
71
|
if _response.status_code == 401:
|
76
|
-
raise UnauthorizedError(
|
72
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
77
73
|
if _response.status_code == 403:
|
78
|
-
raise ForbiddenError(
|
74
|
+
raise ForbiddenError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
79
75
|
if _response.status_code == 404:
|
80
|
-
raise NotFoundError(
|
76
|
+
raise NotFoundError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
81
77
|
if _response.status_code == 422:
|
82
|
-
raise UnprocessableEntityError(
|
78
|
+
raise UnprocessableEntityError(
|
79
|
+
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
80
|
+
)
|
83
81
|
if _response.status_code == 500:
|
84
|
-
raise InternalServerError(
|
82
|
+
raise InternalServerError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
85
83
|
try:
|
86
84
|
_response_json = _response.json()
|
87
85
|
except JSONDecodeError:
|
@@ -149,19 +147,21 @@ class UserClient:
|
|
149
147
|
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
150
148
|
)
|
151
149
|
if 200 <= _response.status_code < 300:
|
152
|
-
return
|
150
|
+
return pydantic_v1.parse_obj_as(User, _response.json()) # type: ignore
|
153
151
|
if _response.status_code == 400:
|
154
|
-
raise BadRequestError(
|
152
|
+
raise BadRequestError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
155
153
|
if _response.status_code == 401:
|
156
|
-
raise UnauthorizedError(
|
154
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
157
155
|
if _response.status_code == 403:
|
158
|
-
raise ForbiddenError(
|
156
|
+
raise ForbiddenError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
159
157
|
if _response.status_code == 404:
|
160
|
-
raise NotFoundError(
|
158
|
+
raise NotFoundError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
161
159
|
if _response.status_code == 422:
|
162
|
-
raise UnprocessableEntityError(
|
160
|
+
raise UnprocessableEntityError(
|
161
|
+
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
162
|
+
)
|
163
163
|
if _response.status_code == 500:
|
164
|
-
raise InternalServerError(
|
164
|
+
raise InternalServerError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
165
165
|
try:
|
166
166
|
_response_json = _response.json()
|
167
167
|
except JSONDecodeError:
|
@@ -208,19 +208,21 @@ class AsyncUserClient:
|
|
208
208
|
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
209
209
|
)
|
210
210
|
if 200 <= _response.status_code < 300:
|
211
|
-
return
|
211
|
+
return pydantic_v1.parse_obj_as(User, _response.json()) # type: ignore
|
212
212
|
if _response.status_code == 400:
|
213
|
-
raise BadRequestError(
|
213
|
+
raise BadRequestError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
214
214
|
if _response.status_code == 401:
|
215
|
-
raise UnauthorizedError(
|
215
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
216
216
|
if _response.status_code == 403:
|
217
|
-
raise ForbiddenError(
|
217
|
+
raise ForbiddenError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
218
218
|
if _response.status_code == 404:
|
219
|
-
raise NotFoundError(
|
219
|
+
raise NotFoundError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
220
220
|
if _response.status_code == 422:
|
221
|
-
raise UnprocessableEntityError(
|
221
|
+
raise UnprocessableEntityError(
|
222
|
+
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
223
|
+
)
|
222
224
|
if _response.status_code == 500:
|
223
|
-
raise InternalServerError(
|
225
|
+
raise InternalServerError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
224
226
|
try:
|
225
227
|
_response_json = _response.json()
|
226
228
|
except JSONDecodeError:
|
@@ -288,19 +290,21 @@ class AsyncUserClient:
|
|
288
290
|
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
289
291
|
)
|
290
292
|
if 200 <= _response.status_code < 300:
|
291
|
-
return
|
293
|
+
return pydantic_v1.parse_obj_as(User, _response.json()) # type: ignore
|
292
294
|
if _response.status_code == 400:
|
293
|
-
raise BadRequestError(
|
295
|
+
raise BadRequestError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
294
296
|
if _response.status_code == 401:
|
295
|
-
raise UnauthorizedError(
|
297
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
296
298
|
if _response.status_code == 403:
|
297
|
-
raise ForbiddenError(
|
299
|
+
raise ForbiddenError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
298
300
|
if _response.status_code == 404:
|
299
|
-
raise NotFoundError(
|
301
|
+
raise NotFoundError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
300
302
|
if _response.status_code == 422:
|
301
|
-
raise UnprocessableEntityError(
|
303
|
+
raise UnprocessableEntityError(
|
304
|
+
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
305
|
+
)
|
302
306
|
if _response.status_code == 500:
|
303
|
-
raise InternalServerError(
|
307
|
+
raise InternalServerError(pydantic_v1.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
304
308
|
try:
|
305
309
|
_response_json = _response.json()
|
306
310
|
except JSONDecodeError:
|