mixpeek 0.12.0__py3-none-any.whl → 0.13.1__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/__init__.py +5 -79
- mixpeek/_hooks/__init__.py +5 -0
- mixpeek/_hooks/registration.py +13 -0
- mixpeek/_hooks/sdkhooks.py +76 -0
- mixpeek/_hooks/types.py +94 -0
- mixpeek/_version.py +11 -3
- mixpeek/assets.py +1561 -0
- mixpeek/basesdk.py +350 -0
- mixpeek/collections.py +1029 -0
- mixpeek/featureextractors.py +205 -0
- mixpeek/features.py +1181 -0
- mixpeek/health.py +167 -0
- mixpeek/httpclient.py +84 -0
- mixpeek/ingest.py +831 -0
- mixpeek/interactions.py +221 -0
- mixpeek/models/__init__.py +751 -0
- mixpeek/models/actionusage.py +16 -0
- mixpeek/models/apierror.py +22 -0
- mixpeek/models/apikey.py +25 -0
- mixpeek/models/apikeyupdate.py +49 -0
- mixpeek/models/assetfeatures.py +55 -0
- mixpeek/models/assetresponse.py +166 -0
- mixpeek/models/assets_model_searchquery.py +21 -0
- mixpeek/models/assetupdate.py +28 -0
- mixpeek/models/availableindexesresponse.py +23 -0
- mixpeek/models/availablemodels.py +12 -0
- mixpeek/models/boolindexparams.py +18 -0
- mixpeek/models/collectionmodel.py +70 -0
- mixpeek/models/collectionresult.py +73 -0
- mixpeek/models/create_api_key_organizations_users_user_email_api_keys_postop.py +23 -0
- mixpeek/models/create_collection_collections_postop.py +62 -0
- mixpeek/models/create_interaction_features_search_interactions_postop.py +59 -0
- mixpeek/models/createcollectionrequest.py +59 -0
- mixpeek/models/createnamespacerequest.py +62 -0
- mixpeek/models/datetimeindexparams.py +18 -0
- mixpeek/models/dateusage.py +22 -0
- mixpeek/models/db_model_paginationresponse.py +59 -0
- mixpeek/models/db_model_taskresponse.py +20 -0
- mixpeek/models/delete_api_key_organizations_users_user_email_api_keys_key_name_deleteop.py +23 -0
- mixpeek/models/delete_asset_assets_asset_id_deleteop.py +57 -0
- mixpeek/models/delete_collection_collections_collection_deleteop.py +59 -0
- mixpeek/models/delete_feature_features_feature_id_deleteop.py +57 -0
- mixpeek/models/delete_interaction_features_search_interactions_interaction_id_deleteop.py +59 -0
- mixpeek/models/delete_namespace_namespaces_namespace_deleteop.py +18 -0
- mixpeek/models/delete_user_organizations_users_user_email_deleteop.py +16 -0
- mixpeek/models/denseembedding.py +16 -0
- mixpeek/models/embeddingrequest.py +59 -0
- mixpeek/models/embeddingresponse.py +64 -0
- mixpeek/models/errormessage.py +13 -0
- mixpeek/models/errorresponse.py +21 -0
- mixpeek/models/facedetectsettings.py +52 -0
- mixpeek/models/featureextractionembeddingrequest.py +54 -0
- mixpeek/models/featureresponse.py +74 -0
- mixpeek/models/features_model_paginationresponse.py +59 -0
- mixpeek/models/featureupdaterequest.py +21 -0
- mixpeek/models/filtercondition.py +74 -0
- mixpeek/models/floatindexparams.py +18 -0
- mixpeek/models/full_asset_update_assets_asset_id_putop.py +69 -0
- mixpeek/models/full_feature_update_features_feature_id_putop.py +69 -0
- mixpeek/models/geoindexparams.py +18 -0
- mixpeek/models/get_asset_assets_asset_id_getop.py +73 -0
- mixpeek/models/get_asset_with_features_assets_asset_id_features_getop.py +73 -0
- mixpeek/models/get_collection_collections_collection_getop.py +59 -0
- mixpeek/models/get_feature_features_feature_id_getop.py +70 -0
- mixpeek/models/get_interaction_features_search_interactions_interaction_id_getop.py +59 -0
- mixpeek/models/get_namespace_namespaces_namespace_getop.py +18 -0
- mixpeek/models/get_task_tasks_task_id_getop.py +57 -0
- mixpeek/models/get_user_organizations_users_user_email_getop.py +16 -0
- mixpeek/models/groupbyoptions.py +71 -0
- mixpeek/models/groupbyoptionsasset.py +71 -0
- mixpeek/models/groupedassetdata.py +18 -0
- mixpeek/models/healthcheckresponse.py +13 -0
- mixpeek/models/httpvalidationerror.py +21 -0
- mixpeek/models/imagedescribesettings.py +82 -0
- mixpeek/models/imagedetectsettings.py +53 -0
- mixpeek/models/imagereadsettings.py +71 -0
- mixpeek/models/imagesettings.py +79 -0
- mixpeek/models/ingest_image_url_ingest_images_url_postop.py +59 -0
- mixpeek/models/ingest_text_ingest_text_postop.py +59 -0
- mixpeek/models/ingest_video_url_ingest_videos_url_postop.py +59 -0
- mixpeek/models/inputtype.py +11 -0
- mixpeek/models/integerindexparams.py +24 -0
- mixpeek/models/interactionresponse.py +87 -0
- mixpeek/models/interactiontype.py +11 -0
- mixpeek/models/jsonimageoutputsettings.py +55 -0
- mixpeek/models/jsontextoutputsettings.py +55 -0
- mixpeek/models/jsonvideooutputsettings.py +55 -0
- mixpeek/models/keywordindexparams.py +21 -0
- mixpeek/models/kill_task_tasks_task_id_deleteop.py +57 -0
- mixpeek/models/list_assets_assets_postop.py +77 -0
- mixpeek/models/list_collections_collections_getop.py +65 -0
- mixpeek/models/list_features_features_postop.py +79 -0
- mixpeek/models/list_interactions_features_search_interactions_getop.py +96 -0
- mixpeek/models/listassetsrequest.py +75 -0
- mixpeek/models/listassetsresponse.py +22 -0
- mixpeek/models/listcollectionsresponse.py +22 -0
- mixpeek/models/listfeaturesrequest.py +77 -0
- mixpeek/models/listfeaturesresponse.py +22 -0
- mixpeek/models/logicaloperator_input.py +88 -0
- mixpeek/models/logicaloperator_output.py +103 -0
- mixpeek/models/logodetectsettings.py +52 -0
- mixpeek/models/modality.py +13 -0
- mixpeek/models/modeldetails.py +57 -0
- mixpeek/models/namespaceresponse.py +54 -0
- mixpeek/models/organizationmodel.py +45 -0
- mixpeek/models/partial_asset_update_assets_asset_id_patchop.py +69 -0
- mixpeek/models/payloadindexconfig.py +94 -0
- mixpeek/models/payloadindextype.py +17 -0
- mixpeek/models/payloadschematype.py +15 -0
- mixpeek/models/percolaterequest.py +57 -0
- mixpeek/models/permission.py +10 -0
- mixpeek/models/processimageurlinput.py +99 -0
- mixpeek/models/processtextinput.py +94 -0
- mixpeek/models/processvideourlinput.py +99 -0
- mixpeek/models/querysettings.py +56 -0
- mixpeek/models/rerankingoptions.py +47 -0
- mixpeek/models/search_assets_assets_search_postop.py +59 -0
- mixpeek/models/search_features_features_search_postop.py +96 -0
- mixpeek/models/search_model_searchquery_input.py +76 -0
- mixpeek/models/searchassetsrequest.py +78 -0
- mixpeek/models/searchinteraction.py +82 -0
- mixpeek/models/searchquery_output.py +79 -0
- mixpeek/models/searchrequestfeatures_input.py +151 -0
- mixpeek/models/searchrequestfeatures_output.py +151 -0
- mixpeek/models/sortoption.py +28 -0
- mixpeek/models/sparseembedding.py +21 -0
- mixpeek/models/tasks_model_taskresponse.py +24 -0
- mixpeek/models/taskstatus.py +16 -0
- mixpeek/models/textindexparams.py +31 -0
- mixpeek/models/textsettings.py +61 -0
- mixpeek/models/tokenizertype.py +11 -0
- mixpeek/models/update_api_key_organizations_users_user_email_api_keys_key_name_patchop.py +30 -0
- mixpeek/models/update_collection_collections_collection_putop.py +74 -0
- mixpeek/models/update_namespace_namespaces_namespace_putop.py +28 -0
- mixpeek/models/updateassetrequest.py +60 -0
- mixpeek/models/updatenamespacerequest.py +26 -0
- mixpeek/models/usage.py +18 -0
- mixpeek/models/usermodel_input.py +36 -0
- mixpeek/models/usermodel_output.py +36 -0
- mixpeek/models/uuidindexparams.py +21 -0
- mixpeek/models/validationerror.py +26 -0
- mixpeek/models/vectormodel.py +11 -0
- mixpeek/models/vectortype.py +9 -0
- mixpeek/models/videodescribesettings.py +82 -0
- mixpeek/models/videodetectsettings.py +53 -0
- mixpeek/models/videoreadsettings.py +71 -0
- mixpeek/models/videosettings.py +101 -0
- mixpeek/models/videotranscriptionsettings.py +69 -0
- mixpeek/namespaces.py +1143 -0
- mixpeek/organizations.py +1508 -0
- mixpeek/py.typed +1 -0
- mixpeek/sdk.py +135 -0
- mixpeek/sdkconfiguration.py +45 -0
- mixpeek/searchinteractions.py +647 -0
- mixpeek/tasks.py +387 -0
- mixpeek/types/__init__.py +19 -29
- mixpeek/types/basemodel.py +39 -0
- mixpeek/utils/__init__.py +97 -0
- mixpeek/utils/annotations.py +55 -0
- mixpeek/utils/enums.py +34 -0
- mixpeek/utils/eventstreaming.py +238 -0
- mixpeek/utils/forms.py +202 -0
- mixpeek/utils/headers.py +136 -0
- mixpeek/utils/logger.py +27 -0
- mixpeek/utils/metadata.py +118 -0
- mixpeek/utils/queryparams.py +205 -0
- mixpeek/utils/requestbodies.py +66 -0
- mixpeek/utils/retries.py +217 -0
- mixpeek/utils/security.py +174 -0
- mixpeek/utils/serializers.py +215 -0
- mixpeek/utils/url.py +155 -0
- mixpeek/utils/values.py +134 -0
- mixpeek-0.13.1.dist-info/METADATA +427 -0
- mixpeek-0.13.1.dist-info/RECORD +176 -0
- {mixpeek-0.12.0.dist-info → mixpeek-0.13.1.dist-info}/WHEEL +1 -1
- py.typed +1 -0
- mixpeek/_base_client.py +0 -2041
- mixpeek/_client.py +0 -444
- mixpeek/_compat.py +0 -221
- mixpeek/_constants.py +0 -14
- mixpeek/_exceptions.py +0 -108
- mixpeek/_files.py +0 -123
- mixpeek/_models.py +0 -788
- mixpeek/_qs.py +0 -150
- mixpeek/_resource.py +0 -43
- mixpeek/_response.py +0 -824
- mixpeek/_streaming.py +0 -333
- mixpeek/_types.py +0 -219
- mixpeek/_utils/__init__.py +0 -56
- mixpeek/_utils/_logs.py +0 -25
- mixpeek/_utils/_proxy.py +0 -62
- mixpeek/_utils/_reflection.py +0 -42
- mixpeek/_utils/_streams.py +0 -12
- mixpeek/_utils/_sync.py +0 -81
- mixpeek/_utils/_transform.py +0 -387
- mixpeek/_utils/_typing.py +0 -120
- mixpeek/_utils/_utils.py +0 -414
- mixpeek/lib/.keep +0 -4
- mixpeek/resources/__init__.py +0 -117
- mixpeek/resources/accounts.py +0 -271
- mixpeek/resources/assets/__init__.py +0 -33
- mixpeek/resources/assets/assets.py +0 -708
- mixpeek/resources/assets/features.py +0 -172
- mixpeek/resources/collections.py +0 -283
- mixpeek/resources/entities/__init__.py +0 -47
- mixpeek/resources/entities/entities.py +0 -134
- mixpeek/resources/entities/faces.py +0 -514
- mixpeek/resources/entities/labels.py +0 -388
- mixpeek/resources/features/__init__.py +0 -33
- mixpeek/resources/features/features.py +0 -562
- mixpeek/resources/features/search.py +0 -731
- mixpeek/resources/healthcheck.py +0 -135
- mixpeek/resources/index/__init__.py +0 -47
- mixpeek/resources/index/images.py +0 -249
- mixpeek/resources/index/index.py +0 -289
- mixpeek/resources/index/videos.py +0 -249
- mixpeek/resources/tasks.py +0 -258
- mixpeek/types/account_update_params.py +0 -28
- mixpeek/types/asset_create_params.py +0 -36
- mixpeek/types/asset_create_response.py +0 -15
- mixpeek/types/asset_response.py +0 -46
- mixpeek/types/asset_search_params.py +0 -43
- mixpeek/types/asset_search_response.py +0 -15
- mixpeek/types/asset_update_params.py +0 -25
- mixpeek/types/asset_update_response.py +0 -11
- mixpeek/types/assets/__init__.py +0 -3
- mixpeek/types/collection_list_params.py +0 -19
- mixpeek/types/collection_list_response.py +0 -14
- mixpeek/types/entities/__init__.py +0 -13
- mixpeek/types/entities/face_create_params.py +0 -21
- mixpeek/types/entities/face_list_params.py +0 -18
- mixpeek/types/entities/face_list_response.py +0 -15
- mixpeek/types/entities/face_response.py +0 -17
- mixpeek/types/entities/face_update_params.py +0 -22
- mixpeek/types/entities/label_list_params.py +0 -18
- mixpeek/types/entities/label_list_response.py +0 -30
- mixpeek/types/entities/label_response.py +0 -30
- mixpeek/types/entities/label_update_params.py +0 -21
- mixpeek/types/feature.py +0 -32
- mixpeek/types/feature_list_params.py +0 -37
- mixpeek/types/feature_list_response.py +0 -28
- mixpeek/types/feature_retrieve_params.py +0 -18
- mixpeek/types/feature_update_params.py +0 -16
- mixpeek/types/features/__init__.py +0 -8
- mixpeek/types/features/search_feedback_params.py +0 -23
- mixpeek/types/features/search_file_params.py +0 -29
- mixpeek/types/features/search_text_params.py +0 -72
- mixpeek/types/features/search_url_params.py +0 -72
- mixpeek/types/grouped_asset_data.py +0 -24
- mixpeek/types/health_check_response.py +0 -10
- mixpeek/types/index/__init__.py +0 -8
- mixpeek/types/index/image_url_params.py +0 -135
- mixpeek/types/index/image_url_response.py +0 -20
- mixpeek/types/index/video_url_params.py +0 -154
- mixpeek/types/index/video_url_response.py +0 -20
- mixpeek/types/index_text_params.py +0 -77
- mixpeek/types/index_text_response.py +0 -14
- mixpeek/types/shared/__init__.py +0 -7
- mixpeek/types/shared/filter_condition.py +0 -19
- mixpeek/types/shared/logical_operator.py +0 -12
- mixpeek/types/shared/model_pagination_response.py +0 -21
- mixpeek/types/shared/sort_option.py +0 -15
- mixpeek/types/shared/task_response.py +0 -15
- mixpeek/types/shared_params/__init__.py +0 -4
- mixpeek/types/shared_params/logical_operator.py +0 -13
- mixpeek/types/shared_params/sort_option.py +0 -15
- mixpeek/types/user.py +0 -34
- mixpeek-0.12.0.dist-info/METADATA +0 -345
- mixpeek-0.12.0.dist-info/RECORD +0 -99
- mixpeek-0.12.0.dist-info/licenses/LICENSE +0 -201
mixpeek/__init__.py
CHANGED
@@ -1,83 +1,9 @@
|
|
1
|
-
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
2
|
|
3
|
-
from . import types
|
4
|
-
from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes
|
5
|
-
from ._utils import file_from_path
|
6
|
-
from ._client import Client, Stream, Mixpeek, Timeout, Transport, AsyncClient, AsyncStream, AsyncMixpeek, RequestOptions
|
7
|
-
from ._models import BaseModel
|
8
3
|
from ._version import __title__, __version__
|
9
|
-
from .
|
10
|
-
from .
|
11
|
-
from .
|
12
|
-
APIError,
|
13
|
-
MixpeekError,
|
14
|
-
ConflictError,
|
15
|
-
NotFoundError,
|
16
|
-
APIStatusError,
|
17
|
-
RateLimitError,
|
18
|
-
APITimeoutError,
|
19
|
-
BadRequestError,
|
20
|
-
APIConnectionError,
|
21
|
-
AuthenticationError,
|
22
|
-
InternalServerError,
|
23
|
-
PermissionDeniedError,
|
24
|
-
UnprocessableEntityError,
|
25
|
-
APIResponseValidationError,
|
26
|
-
)
|
27
|
-
from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient
|
28
|
-
from ._utils._logs import setup_logging as _setup_logging
|
4
|
+
from .sdk import *
|
5
|
+
from .sdkconfiguration import *
|
6
|
+
from .models import *
|
29
7
|
|
30
|
-
__all__ = [
|
31
|
-
"types",
|
32
|
-
"__version__",
|
33
|
-
"__title__",
|
34
|
-
"NoneType",
|
35
|
-
"Transport",
|
36
|
-
"ProxiesTypes",
|
37
|
-
"NotGiven",
|
38
|
-
"NOT_GIVEN",
|
39
|
-
"MixpeekError",
|
40
|
-
"APIError",
|
41
|
-
"APIStatusError",
|
42
|
-
"APITimeoutError",
|
43
|
-
"APIConnectionError",
|
44
|
-
"APIResponseValidationError",
|
45
|
-
"BadRequestError",
|
46
|
-
"AuthenticationError",
|
47
|
-
"PermissionDeniedError",
|
48
|
-
"NotFoundError",
|
49
|
-
"ConflictError",
|
50
|
-
"UnprocessableEntityError",
|
51
|
-
"RateLimitError",
|
52
|
-
"InternalServerError",
|
53
|
-
"Timeout",
|
54
|
-
"RequestOptions",
|
55
|
-
"Client",
|
56
|
-
"AsyncClient",
|
57
|
-
"Stream",
|
58
|
-
"AsyncStream",
|
59
|
-
"Mixpeek",
|
60
|
-
"AsyncMixpeek",
|
61
|
-
"file_from_path",
|
62
|
-
"BaseModel",
|
63
|
-
"DEFAULT_TIMEOUT",
|
64
|
-
"DEFAULT_MAX_RETRIES",
|
65
|
-
"DEFAULT_CONNECTION_LIMITS",
|
66
|
-
"DefaultHttpxClient",
|
67
|
-
"DefaultAsyncHttpxClient",
|
68
|
-
]
|
69
8
|
|
70
|
-
|
71
|
-
|
72
|
-
# Update the __module__ attribute for exported symbols so that
|
73
|
-
# error messages point to this module instead of the module
|
74
|
-
# it was originally defined in, e.g.
|
75
|
-
# mixpeek._exceptions.NotFoundError -> mixpeek.NotFoundError
|
76
|
-
__locals = locals()
|
77
|
-
for __name in __all__:
|
78
|
-
if not __name.startswith("__"):
|
79
|
-
try:
|
80
|
-
__locals[__name].__module__ = "mixpeek"
|
81
|
-
except (TypeError, AttributeError):
|
82
|
-
# Some of our exported symbols are builtins which we can't set attributes for.
|
83
|
-
pass
|
9
|
+
VERSION: str = __version__
|
@@ -0,0 +1,13 @@
|
|
1
|
+
from .types import Hooks
|
2
|
+
|
3
|
+
|
4
|
+
# This file is only ever generated once on the first generation and then is free to be modified.
|
5
|
+
# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them
|
6
|
+
# in this file or in separate files in the hooks folder.
|
7
|
+
|
8
|
+
|
9
|
+
def init_hooks(hooks: Hooks):
|
10
|
+
# pylint: disable=unused-argument
|
11
|
+
"""Add hooks by calling hooks.register{sdk_init/before_request/after_success/after_error}Hook
|
12
|
+
with an instance of a hook that implements that specific Hook interface
|
13
|
+
Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance"""
|
@@ -0,0 +1,76 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
import httpx
|
4
|
+
from .types import (
|
5
|
+
SDKInitHook,
|
6
|
+
BeforeRequestContext,
|
7
|
+
BeforeRequestHook,
|
8
|
+
AfterSuccessContext,
|
9
|
+
AfterSuccessHook,
|
10
|
+
AfterErrorContext,
|
11
|
+
AfterErrorHook,
|
12
|
+
Hooks,
|
13
|
+
)
|
14
|
+
from .registration import init_hooks
|
15
|
+
from typing import List, Optional, Tuple
|
16
|
+
from mixpeek.httpclient import HttpClient
|
17
|
+
|
18
|
+
|
19
|
+
class SDKHooks(Hooks):
|
20
|
+
def __init__(self) -> None:
|
21
|
+
self.sdk_init_hooks: List[SDKInitHook] = []
|
22
|
+
self.before_request_hooks: List[BeforeRequestHook] = []
|
23
|
+
self.after_success_hooks: List[AfterSuccessHook] = []
|
24
|
+
self.after_error_hooks: List[AfterErrorHook] = []
|
25
|
+
init_hooks(self)
|
26
|
+
|
27
|
+
def register_sdk_init_hook(self, hook: SDKInitHook) -> None:
|
28
|
+
self.sdk_init_hooks.append(hook)
|
29
|
+
|
30
|
+
def register_before_request_hook(self, hook: BeforeRequestHook) -> None:
|
31
|
+
self.before_request_hooks.append(hook)
|
32
|
+
|
33
|
+
def register_after_success_hook(self, hook: AfterSuccessHook) -> None:
|
34
|
+
self.after_success_hooks.append(hook)
|
35
|
+
|
36
|
+
def register_after_error_hook(self, hook: AfterErrorHook) -> None:
|
37
|
+
self.after_error_hooks.append(hook)
|
38
|
+
|
39
|
+
def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]:
|
40
|
+
for hook in self.sdk_init_hooks:
|
41
|
+
base_url, client = hook.sdk_init(base_url, client)
|
42
|
+
return base_url, client
|
43
|
+
|
44
|
+
def before_request(
|
45
|
+
self, hook_ctx: BeforeRequestContext, request: httpx.Request
|
46
|
+
) -> httpx.Request:
|
47
|
+
for hook in self.before_request_hooks:
|
48
|
+
out = hook.before_request(hook_ctx, request)
|
49
|
+
if isinstance(out, Exception):
|
50
|
+
raise out
|
51
|
+
request = out
|
52
|
+
|
53
|
+
return request
|
54
|
+
|
55
|
+
def after_success(
|
56
|
+
self, hook_ctx: AfterSuccessContext, response: httpx.Response
|
57
|
+
) -> httpx.Response:
|
58
|
+
for hook in self.after_success_hooks:
|
59
|
+
out = hook.after_success(hook_ctx, response)
|
60
|
+
if isinstance(out, Exception):
|
61
|
+
raise out
|
62
|
+
response = out
|
63
|
+
return response
|
64
|
+
|
65
|
+
def after_error(
|
66
|
+
self,
|
67
|
+
hook_ctx: AfterErrorContext,
|
68
|
+
response: Optional[httpx.Response],
|
69
|
+
error: Optional[Exception],
|
70
|
+
) -> Tuple[Optional[httpx.Response], Optional[Exception]]:
|
71
|
+
for hook in self.after_error_hooks:
|
72
|
+
result = hook.after_error(hook_ctx, response, error)
|
73
|
+
if isinstance(result, Exception):
|
74
|
+
raise result
|
75
|
+
response, error = result
|
76
|
+
return response, error
|
mixpeek/_hooks/types.py
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from abc import ABC, abstractmethod
|
4
|
+
import httpx
|
5
|
+
from mixpeek.httpclient import HttpClient
|
6
|
+
from typing import Any, Callable, List, Optional, Tuple, Union
|
7
|
+
|
8
|
+
|
9
|
+
class HookContext:
|
10
|
+
operation_id: str
|
11
|
+
oauth2_scopes: Optional[List[str]] = None
|
12
|
+
security_source: Optional[Union[Any, Callable[[], Any]]] = None
|
13
|
+
|
14
|
+
def __init__(
|
15
|
+
self,
|
16
|
+
operation_id: str,
|
17
|
+
oauth2_scopes: Optional[List[str]],
|
18
|
+
security_source: Optional[Union[Any, Callable[[], Any]]],
|
19
|
+
):
|
20
|
+
self.operation_id = operation_id
|
21
|
+
self.oauth2_scopes = oauth2_scopes
|
22
|
+
self.security_source = security_source
|
23
|
+
|
24
|
+
|
25
|
+
class BeforeRequestContext(HookContext):
|
26
|
+
def __init__(self, hook_ctx: HookContext):
|
27
|
+
super().__init__(
|
28
|
+
hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source
|
29
|
+
)
|
30
|
+
|
31
|
+
|
32
|
+
class AfterSuccessContext(HookContext):
|
33
|
+
def __init__(self, hook_ctx: HookContext):
|
34
|
+
super().__init__(
|
35
|
+
hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source
|
36
|
+
)
|
37
|
+
|
38
|
+
|
39
|
+
class AfterErrorContext(HookContext):
|
40
|
+
def __init__(self, hook_ctx: HookContext):
|
41
|
+
super().__init__(
|
42
|
+
hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source
|
43
|
+
)
|
44
|
+
|
45
|
+
|
46
|
+
class SDKInitHook(ABC):
|
47
|
+
@abstractmethod
|
48
|
+
def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]:
|
49
|
+
pass
|
50
|
+
|
51
|
+
|
52
|
+
class BeforeRequestHook(ABC):
|
53
|
+
@abstractmethod
|
54
|
+
def before_request(
|
55
|
+
self, hook_ctx: BeforeRequestContext, request: httpx.Request
|
56
|
+
) -> Union[httpx.Request, Exception]:
|
57
|
+
pass
|
58
|
+
|
59
|
+
|
60
|
+
class AfterSuccessHook(ABC):
|
61
|
+
@abstractmethod
|
62
|
+
def after_success(
|
63
|
+
self, hook_ctx: AfterSuccessContext, response: httpx.Response
|
64
|
+
) -> Union[httpx.Response, Exception]:
|
65
|
+
pass
|
66
|
+
|
67
|
+
|
68
|
+
class AfterErrorHook(ABC):
|
69
|
+
@abstractmethod
|
70
|
+
def after_error(
|
71
|
+
self,
|
72
|
+
hook_ctx: AfterErrorContext,
|
73
|
+
response: Optional[httpx.Response],
|
74
|
+
error: Optional[Exception],
|
75
|
+
) -> Union[Tuple[Optional[httpx.Response], Optional[Exception]], Exception]:
|
76
|
+
pass
|
77
|
+
|
78
|
+
|
79
|
+
class Hooks(ABC):
|
80
|
+
@abstractmethod
|
81
|
+
def register_sdk_init_hook(self, hook: SDKInitHook):
|
82
|
+
pass
|
83
|
+
|
84
|
+
@abstractmethod
|
85
|
+
def register_before_request_hook(self, hook: BeforeRequestHook):
|
86
|
+
pass
|
87
|
+
|
88
|
+
@abstractmethod
|
89
|
+
def register_after_success_hook(self, hook: AfterSuccessHook):
|
90
|
+
pass
|
91
|
+
|
92
|
+
@abstractmethod
|
93
|
+
def register_after_error_hook(self, hook: AfterErrorHook):
|
94
|
+
pass
|
mixpeek/_version.py
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
-
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
import importlib.metadata
|
4
|
+
|
5
|
+
__title__: str = "mixpeek"
|
6
|
+
__version__: str = "0.13.1"
|
7
|
+
|
8
|
+
try:
|
9
|
+
if __package__ is not None:
|
10
|
+
__version__ = importlib.metadata.version(__package__)
|
11
|
+
except importlib.metadata.PackageNotFoundError:
|
12
|
+
pass
|