mixpeek 0.13.3__py3-none-any.whl → 0.14.0__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/_version.py +1 -1
- mixpeek/assets.py +65 -22
- mixpeek/basesdk.py +1 -1
- mixpeek/collections.py +49 -18
- mixpeek/featureextractors.py +11 -4
- mixpeek/features.py +45 -14
- mixpeek/health.py +11 -4
- mixpeek/ingest.py +31 -12
- mixpeek/interactions.py +9 -2
- mixpeek/models/__init__.py +3 -0
- mixpeek/models/security.py +25 -0
- mixpeek/namespaces.py +61 -24
- mixpeek/organizations.py +79 -30
- mixpeek/sdk.py +11 -2
- mixpeek/sdkconfiguration.py +6 -4
- mixpeek/searchinteractions.py +31 -12
- mixpeek/tasks.py +21 -8
- mixpeek/utils/__init__.py +3 -1
- mixpeek/utils/security.py +18 -0
- {mixpeek-0.13.3.dist-info → mixpeek-0.14.0.dist-info}/METADATA +50 -5
- {mixpeek-0.13.3.dist-info → mixpeek-0.14.0.dist-info}/RECORD +22 -21
- {mixpeek-0.13.3.dist-info → mixpeek-0.14.0.dist-info}/WHEEL +0 -0
mixpeek/sdk.py
CHANGED
@@ -6,7 +6,7 @@ from .sdkconfiguration import SDKConfiguration
|
|
6
6
|
from .utils.logger import Logger, get_default_logger
|
7
7
|
from .utils.retries import RetryConfig
|
8
8
|
import httpx
|
9
|
-
from mixpeek import utils
|
9
|
+
from mixpeek import models, utils
|
10
10
|
from mixpeek._hooks import SDKHooks
|
11
11
|
from mixpeek.assets import Assets
|
12
12
|
from mixpeek.collections import Collections
|
@@ -20,7 +20,7 @@ from mixpeek.organizations import Organizations
|
|
20
20
|
from mixpeek.searchinteractions import SearchInteractions
|
21
21
|
from mixpeek.tasks import Tasks
|
22
22
|
from mixpeek.types import OptionalNullable, UNSET
|
23
|
-
from typing import Dict, Optional
|
23
|
+
from typing import Any, Callable, Dict, Optional, Union
|
24
24
|
|
25
25
|
|
26
26
|
class Mixpeek(BaseSDK):
|
@@ -40,6 +40,7 @@ class Mixpeek(BaseSDK):
|
|
40
40
|
|
41
41
|
def __init__(
|
42
42
|
self,
|
43
|
+
bearer_auth: Optional[Union[Optional[str], Callable[[], Optional[str]]]] = None,
|
43
44
|
server_idx: Optional[int] = None,
|
44
45
|
server_url: Optional[str] = None,
|
45
46
|
url_params: Optional[Dict[str, str]] = None,
|
@@ -51,6 +52,7 @@ class Mixpeek(BaseSDK):
|
|
51
52
|
) -> None:
|
52
53
|
r"""Instantiates the SDK configuring it with the provided parameters.
|
53
54
|
|
55
|
+
:param bearer_auth: The bearer_auth required for authentication
|
54
56
|
:param server_idx: The index of the server to use for all methods
|
55
57
|
:param server_url: The server URL to use for all methods
|
56
58
|
:param url_params: Parameters to optionally template the server URL with
|
@@ -76,6 +78,12 @@ class Mixpeek(BaseSDK):
|
|
76
78
|
type(async_client), AsyncHttpClient
|
77
79
|
), "The provided async_client must implement the AsyncHttpClient protocol."
|
78
80
|
|
81
|
+
security: Any = None
|
82
|
+
if callable(bearer_auth):
|
83
|
+
security = lambda: models.Security(bearer_auth=bearer_auth()) # pylint: disable=unnecessary-lambda-assignment
|
84
|
+
else:
|
85
|
+
security = models.Security(bearer_auth=bearer_auth)
|
86
|
+
|
79
87
|
if server_url is not None:
|
80
88
|
if url_params is not None:
|
81
89
|
server_url = utils.template_url(server_url, url_params)
|
@@ -85,6 +93,7 @@ class Mixpeek(BaseSDK):
|
|
85
93
|
SDKConfiguration(
|
86
94
|
client=client,
|
87
95
|
async_client=async_client,
|
96
|
+
security=security,
|
88
97
|
server_url=server_url,
|
89
98
|
server_idx=server_idx,
|
90
99
|
retry_config=retry_config,
|
mixpeek/sdkconfiguration.py
CHANGED
@@ -4,9 +4,10 @@ from ._hooks import SDKHooks
|
|
4
4
|
from .httpclient import AsyncHttpClient, HttpClient
|
5
5
|
from .utils import Logger, RetryConfig, remove_suffix
|
6
6
|
from dataclasses import dataclass
|
7
|
+
from mixpeek import models
|
7
8
|
from mixpeek.types import OptionalNullable, UNSET
|
8
9
|
from pydantic import Field
|
9
|
-
from typing import Dict, Optional, Tuple
|
10
|
+
from typing import Callable, Dict, Optional, Tuple, Union
|
10
11
|
|
11
12
|
|
12
13
|
SERVERS = [
|
@@ -20,13 +21,14 @@ class SDKConfiguration:
|
|
20
21
|
client: HttpClient
|
21
22
|
async_client: AsyncHttpClient
|
22
23
|
debug_logger: Logger
|
24
|
+
security: Optional[Union[models.Security, Callable[[], models.Security]]] = None
|
23
25
|
server_url: Optional[str] = ""
|
24
26
|
server_idx: Optional[int] = 0
|
25
27
|
language: str = "python"
|
26
28
|
openapi_doc_version: str = "0.81"
|
27
|
-
sdk_version: str = "0.
|
28
|
-
gen_version: str = "2.
|
29
|
-
user_agent: str = "speakeasy-sdk/python 0.
|
29
|
+
sdk_version: str = "0.14.0"
|
30
|
+
gen_version: str = "2.484.0"
|
31
|
+
user_agent: str = "speakeasy-sdk/python 0.14.0 2.484.0 0.81 mixpeek"
|
30
32
|
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
|
31
33
|
timeout_ms: Optional[int] = None
|
32
34
|
|
mixpeek/searchinteractions.py
CHANGED
@@ -4,6 +4,7 @@ from .basesdk import BaseSDK
|
|
4
4
|
from mixpeek import models, utils
|
5
5
|
from mixpeek._hooks import HookContext
|
6
6
|
from mixpeek.types import OptionalNullable, UNSET
|
7
|
+
from mixpeek.utils import get_security_from_env
|
7
8
|
from typing import Any, Mapping, Optional, Union
|
8
9
|
|
9
10
|
|
@@ -78,10 +79,11 @@ class SearchInteractions(BaseSDK):
|
|
78
79
|
request=request,
|
79
80
|
request_body_required=True,
|
80
81
|
request_has_path_params=False,
|
81
|
-
request_has_query_params=
|
82
|
+
request_has_query_params=True,
|
82
83
|
user_agent_header="user-agent",
|
83
84
|
accept_header_value="application/json",
|
84
85
|
http_headers=http_headers,
|
86
|
+
security=self.sdk_configuration.security,
|
85
87
|
get_serialized_body=lambda: utils.serialize_request_body(
|
86
88
|
request.search_interaction,
|
87
89
|
False,
|
@@ -104,7 +106,9 @@ class SearchInteractions(BaseSDK):
|
|
104
106
|
hook_ctx=HookContext(
|
105
107
|
operation_id="create_interaction_features_search_interactions_post",
|
106
108
|
oauth2_scopes=[],
|
107
|
-
security_source=
|
109
|
+
security_source=get_security_from_env(
|
110
|
+
self.sdk_configuration.security, models.Security
|
111
|
+
),
|
108
112
|
),
|
109
113
|
request=req,
|
110
114
|
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
@@ -207,10 +211,11 @@ class SearchInteractions(BaseSDK):
|
|
207
211
|
request=request,
|
208
212
|
request_body_required=True,
|
209
213
|
request_has_path_params=False,
|
210
|
-
request_has_query_params=
|
214
|
+
request_has_query_params=True,
|
211
215
|
user_agent_header="user-agent",
|
212
216
|
accept_header_value="application/json",
|
213
217
|
http_headers=http_headers,
|
218
|
+
security=self.sdk_configuration.security,
|
214
219
|
get_serialized_body=lambda: utils.serialize_request_body(
|
215
220
|
request.search_interaction,
|
216
221
|
False,
|
@@ -233,7 +238,9 @@ class SearchInteractions(BaseSDK):
|
|
233
238
|
hook_ctx=HookContext(
|
234
239
|
operation_id="create_interaction_features_search_interactions_post",
|
235
240
|
oauth2_scopes=[],
|
236
|
-
security_source=
|
241
|
+
security_source=get_security_from_env(
|
242
|
+
self.sdk_configuration.security, models.Security
|
243
|
+
),
|
237
244
|
),
|
238
245
|
request=req,
|
239
246
|
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
@@ -310,10 +317,11 @@ class SearchInteractions(BaseSDK):
|
|
310
317
|
request=request,
|
311
318
|
request_body_required=False,
|
312
319
|
request_has_path_params=True,
|
313
|
-
request_has_query_params=
|
320
|
+
request_has_query_params=True,
|
314
321
|
user_agent_header="user-agent",
|
315
322
|
accept_header_value="application/json",
|
316
323
|
http_headers=http_headers,
|
324
|
+
security=self.sdk_configuration.security,
|
317
325
|
timeout_ms=timeout_ms,
|
318
326
|
)
|
319
327
|
|
@@ -329,7 +337,9 @@ class SearchInteractions(BaseSDK):
|
|
329
337
|
hook_ctx=HookContext(
|
330
338
|
operation_id="get_interaction_features_search_interactions__interaction_id__get",
|
331
339
|
oauth2_scopes=[],
|
332
|
-
security_source=
|
340
|
+
security_source=get_security_from_env(
|
341
|
+
self.sdk_configuration.security, models.Security
|
342
|
+
),
|
333
343
|
),
|
334
344
|
request=req,
|
335
345
|
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
@@ -406,10 +416,11 @@ class SearchInteractions(BaseSDK):
|
|
406
416
|
request=request,
|
407
417
|
request_body_required=False,
|
408
418
|
request_has_path_params=True,
|
409
|
-
request_has_query_params=
|
419
|
+
request_has_query_params=True,
|
410
420
|
user_agent_header="user-agent",
|
411
421
|
accept_header_value="application/json",
|
412
422
|
http_headers=http_headers,
|
423
|
+
security=self.sdk_configuration.security,
|
413
424
|
timeout_ms=timeout_ms,
|
414
425
|
)
|
415
426
|
|
@@ -425,7 +436,9 @@ class SearchInteractions(BaseSDK):
|
|
425
436
|
hook_ctx=HookContext(
|
426
437
|
operation_id="get_interaction_features_search_interactions__interaction_id__get",
|
427
438
|
oauth2_scopes=[],
|
428
|
-
security_source=
|
439
|
+
security_source=get_security_from_env(
|
440
|
+
self.sdk_configuration.security, models.Security
|
441
|
+
),
|
429
442
|
),
|
430
443
|
request=req,
|
431
444
|
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
@@ -500,10 +513,11 @@ class SearchInteractions(BaseSDK):
|
|
500
513
|
request=request,
|
501
514
|
request_body_required=False,
|
502
515
|
request_has_path_params=True,
|
503
|
-
request_has_query_params=
|
516
|
+
request_has_query_params=True,
|
504
517
|
user_agent_header="user-agent",
|
505
518
|
accept_header_value="application/json",
|
506
519
|
http_headers=http_headers,
|
520
|
+
security=self.sdk_configuration.security,
|
507
521
|
timeout_ms=timeout_ms,
|
508
522
|
)
|
509
523
|
|
@@ -519,7 +533,9 @@ class SearchInteractions(BaseSDK):
|
|
519
533
|
hook_ctx=HookContext(
|
520
534
|
operation_id="delete_interaction_features_search_interactions__interaction_id__delete",
|
521
535
|
oauth2_scopes=[],
|
522
|
-
security_source=
|
536
|
+
security_source=get_security_from_env(
|
537
|
+
self.sdk_configuration.security, models.Security
|
538
|
+
),
|
523
539
|
),
|
524
540
|
request=req,
|
525
541
|
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
@@ -594,10 +610,11 @@ class SearchInteractions(BaseSDK):
|
|
594
610
|
request=request,
|
595
611
|
request_body_required=False,
|
596
612
|
request_has_path_params=True,
|
597
|
-
request_has_query_params=
|
613
|
+
request_has_query_params=True,
|
598
614
|
user_agent_header="user-agent",
|
599
615
|
accept_header_value="application/json",
|
600
616
|
http_headers=http_headers,
|
617
|
+
security=self.sdk_configuration.security,
|
601
618
|
timeout_ms=timeout_ms,
|
602
619
|
)
|
603
620
|
|
@@ -613,7 +630,9 @@ class SearchInteractions(BaseSDK):
|
|
613
630
|
hook_ctx=HookContext(
|
614
631
|
operation_id="delete_interaction_features_search_interactions__interaction_id__delete",
|
615
632
|
oauth2_scopes=[],
|
616
|
-
security_source=
|
633
|
+
security_source=get_security_from_env(
|
634
|
+
self.sdk_configuration.security, models.Security
|
635
|
+
),
|
617
636
|
),
|
618
637
|
request=req,
|
619
638
|
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
mixpeek/tasks.py
CHANGED
@@ -4,6 +4,7 @@ from .basesdk import BaseSDK
|
|
4
4
|
from mixpeek import models, utils
|
5
5
|
from mixpeek._hooks import HookContext
|
6
6
|
from mixpeek.types import OptionalNullable, UNSET
|
7
|
+
from mixpeek.utils import get_security_from_env
|
7
8
|
from typing import Any, Mapping, Optional
|
8
9
|
|
9
10
|
|
@@ -48,10 +49,11 @@ class Tasks(BaseSDK):
|
|
48
49
|
request=request,
|
49
50
|
request_body_required=False,
|
50
51
|
request_has_path_params=True,
|
51
|
-
request_has_query_params=
|
52
|
+
request_has_query_params=True,
|
52
53
|
user_agent_header="user-agent",
|
53
54
|
accept_header_value="application/json",
|
54
55
|
http_headers=http_headers,
|
56
|
+
security=self.sdk_configuration.security,
|
55
57
|
timeout_ms=timeout_ms,
|
56
58
|
)
|
57
59
|
|
@@ -67,7 +69,9 @@ class Tasks(BaseSDK):
|
|
67
69
|
hook_ctx=HookContext(
|
68
70
|
operation_id="kill_task_tasks__task_id__delete",
|
69
71
|
oauth2_scopes=[],
|
70
|
-
security_source=
|
72
|
+
security_source=get_security_from_env(
|
73
|
+
self.sdk_configuration.security, models.Security
|
74
|
+
),
|
71
75
|
),
|
72
76
|
request=req,
|
73
77
|
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
@@ -140,10 +144,11 @@ class Tasks(BaseSDK):
|
|
140
144
|
request=request,
|
141
145
|
request_body_required=False,
|
142
146
|
request_has_path_params=True,
|
143
|
-
request_has_query_params=
|
147
|
+
request_has_query_params=True,
|
144
148
|
user_agent_header="user-agent",
|
145
149
|
accept_header_value="application/json",
|
146
150
|
http_headers=http_headers,
|
151
|
+
security=self.sdk_configuration.security,
|
147
152
|
timeout_ms=timeout_ms,
|
148
153
|
)
|
149
154
|
|
@@ -159,7 +164,9 @@ class Tasks(BaseSDK):
|
|
159
164
|
hook_ctx=HookContext(
|
160
165
|
operation_id="kill_task_tasks__task_id__delete",
|
161
166
|
oauth2_scopes=[],
|
162
|
-
security_source=
|
167
|
+
security_source=get_security_from_env(
|
168
|
+
self.sdk_configuration.security, models.Security
|
169
|
+
),
|
163
170
|
),
|
164
171
|
request=req,
|
165
172
|
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
@@ -237,10 +244,11 @@ class Tasks(BaseSDK):
|
|
237
244
|
request=request,
|
238
245
|
request_body_required=False,
|
239
246
|
request_has_path_params=True,
|
240
|
-
request_has_query_params=
|
247
|
+
request_has_query_params=True,
|
241
248
|
user_agent_header="user-agent",
|
242
249
|
accept_header_value="application/json",
|
243
250
|
http_headers=http_headers,
|
251
|
+
security=self.sdk_configuration.security,
|
244
252
|
timeout_ms=timeout_ms,
|
245
253
|
)
|
246
254
|
|
@@ -256,7 +264,9 @@ class Tasks(BaseSDK):
|
|
256
264
|
hook_ctx=HookContext(
|
257
265
|
operation_id="get_task_tasks__task_id__get",
|
258
266
|
oauth2_scopes=[],
|
259
|
-
security_source=
|
267
|
+
security_source=get_security_from_env(
|
268
|
+
self.sdk_configuration.security, models.Security
|
269
|
+
),
|
260
270
|
),
|
261
271
|
request=req,
|
262
272
|
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
@@ -334,10 +344,11 @@ class Tasks(BaseSDK):
|
|
334
344
|
request=request,
|
335
345
|
request_body_required=False,
|
336
346
|
request_has_path_params=True,
|
337
|
-
request_has_query_params=
|
347
|
+
request_has_query_params=True,
|
338
348
|
user_agent_header="user-agent",
|
339
349
|
accept_header_value="application/json",
|
340
350
|
http_headers=http_headers,
|
351
|
+
security=self.sdk_configuration.security,
|
341
352
|
timeout_ms=timeout_ms,
|
342
353
|
)
|
343
354
|
|
@@ -353,7 +364,9 @@ class Tasks(BaseSDK):
|
|
353
364
|
hook_ctx=HookContext(
|
354
365
|
operation_id="get_task_tasks__task_id__get",
|
355
366
|
oauth2_scopes=[],
|
356
|
-
security_source=
|
367
|
+
security_source=get_security_from_env(
|
368
|
+
self.sdk_configuration.security, models.Security
|
369
|
+
),
|
357
370
|
),
|
358
371
|
request=req,
|
359
372
|
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
mixpeek/utils/__init__.py
CHANGED
@@ -17,7 +17,8 @@ from .metadata import (
|
|
17
17
|
from .queryparams import get_query_params
|
18
18
|
from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig
|
19
19
|
from .requestbodies import serialize_request_body, SerializedRequestBody
|
20
|
-
from .security import get_security
|
20
|
+
from .security import get_security, get_security_from_env
|
21
|
+
|
21
22
|
from .serializers import (
|
22
23
|
get_pydantic_model,
|
23
24
|
marshal_json,
|
@@ -60,6 +61,7 @@ __all__ = [
|
|
60
61
|
"get_query_params",
|
61
62
|
"get_response_headers",
|
62
63
|
"get_security",
|
64
|
+
"get_security_from_env",
|
63
65
|
"HeaderMetadata",
|
64
66
|
"Logger",
|
65
67
|
"marshal_json",
|
mixpeek/utils/security.py
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
2
|
|
3
3
|
import base64
|
4
|
+
|
4
5
|
from typing import (
|
5
6
|
Any,
|
6
7
|
Dict,
|
7
8
|
List,
|
9
|
+
Optional,
|
8
10
|
Tuple,
|
9
11
|
)
|
10
12
|
from pydantic import BaseModel
|
@@ -14,6 +16,7 @@ from .metadata import (
|
|
14
16
|
SecurityMetadata,
|
15
17
|
find_field_metadata,
|
16
18
|
)
|
19
|
+
import os
|
17
20
|
|
18
21
|
|
19
22
|
def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]:
|
@@ -52,6 +55,21 @@ def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]:
|
|
52
55
|
return headers, query_params
|
53
56
|
|
54
57
|
|
58
|
+
def get_security_from_env(security: Any, security_class: Any) -> Optional[BaseModel]:
|
59
|
+
if security is not None:
|
60
|
+
return security
|
61
|
+
|
62
|
+
if not issubclass(security_class, BaseModel):
|
63
|
+
raise TypeError("security_class must be a pydantic model class")
|
64
|
+
|
65
|
+
security_dict: Any = {}
|
66
|
+
|
67
|
+
if os.getenv("MIXPEEK_BEARER_AUTH"):
|
68
|
+
security_dict["bearer_auth"] = os.getenv("MIXPEEK_BEARER_AUTH")
|
69
|
+
|
70
|
+
return security_class(**security_dict) if security_dict else None
|
71
|
+
|
72
|
+
|
55
73
|
def _parse_security_option(
|
56
74
|
headers: Dict[str, str], query_params: Dict[str, List[str]], option: Any
|
57
75
|
):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: mixpeek
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.14.0
|
4
4
|
Summary: Python Client SDK Generated by Speakeasy.
|
5
5
|
Home-page: https://github.com/mixpeek/python-sdk.git
|
6
6
|
Author: Speakeasy
|
@@ -38,6 +38,7 @@ Mixpeek API: This is the Mixpeek API, providing access to various endpoints for
|
|
38
38
|
* [SDK Installation](https://github.com/mixpeek/python-sdk/blob/master/#sdk-installation)
|
39
39
|
* [IDE Support](https://github.com/mixpeek/python-sdk/blob/master/#ide-support)
|
40
40
|
* [SDK Example Usage](https://github.com/mixpeek/python-sdk/blob/master/#sdk-example-usage)
|
41
|
+
* [Authentication](https://github.com/mixpeek/python-sdk/blob/master/#authentication)
|
41
42
|
* [Available Resources and Operations](https://github.com/mixpeek/python-sdk/blob/master/#available-resources-and-operations)
|
42
43
|
* [Retries](https://github.com/mixpeek/python-sdk/blob/master/#retries)
|
43
44
|
* [Error Handling](https://github.com/mixpeek/python-sdk/blob/master/#error-handling)
|
@@ -90,8 +91,11 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
|
|
90
91
|
```python
|
91
92
|
# Synchronous Example
|
92
93
|
from mixpeek import Mixpeek
|
94
|
+
import os
|
93
95
|
|
94
|
-
with Mixpeek(
|
96
|
+
with Mixpeek(
|
97
|
+
bearer_auth=os.getenv("MIXPEEK_BEARER_AUTH", ""),
|
98
|
+
) as mixpeek:
|
95
99
|
|
96
100
|
res = mixpeek.organizations.get()
|
97
101
|
|
@@ -106,9 +110,12 @@ The same SDK client can also be used to make asychronous requests by importing a
|
|
106
110
|
# Asynchronous Example
|
107
111
|
import asyncio
|
108
112
|
from mixpeek import Mixpeek
|
113
|
+
import os
|
109
114
|
|
110
115
|
async def main():
|
111
|
-
async with Mixpeek(
|
116
|
+
async with Mixpeek(
|
117
|
+
bearer_auth=os.getenv("MIXPEEK_BEARER_AUTH", ""),
|
118
|
+
) as mixpeek:
|
112
119
|
|
113
120
|
res = await mixpeek.organizations.get_async()
|
114
121
|
|
@@ -119,6 +126,34 @@ asyncio.run(main())
|
|
119
126
|
```
|
120
127
|
<!-- End SDK Example Usage [usage] -->
|
121
128
|
|
129
|
+
<!-- Start Authentication [security] -->
|
130
|
+
## Authentication
|
131
|
+
|
132
|
+
### Per-Client Security Schemes
|
133
|
+
|
134
|
+
This SDK supports the following security scheme globally:
|
135
|
+
|
136
|
+
| Name | Type | Scheme | Environment Variable |
|
137
|
+
| ------------- | ---- | ----------- | --------------------- |
|
138
|
+
| `bearer_auth` | http | HTTP Bearer | `MIXPEEK_BEARER_AUTH` |
|
139
|
+
|
140
|
+
To authenticate with the API the `bearer_auth` parameter must be set when initializing the SDK client instance. For example:
|
141
|
+
```python
|
142
|
+
from mixpeek import Mixpeek
|
143
|
+
import os
|
144
|
+
|
145
|
+
with Mixpeek(
|
146
|
+
bearer_auth=os.getenv("MIXPEEK_BEARER_AUTH", ""),
|
147
|
+
) as mixpeek:
|
148
|
+
|
149
|
+
res = mixpeek.organizations.get()
|
150
|
+
|
151
|
+
# Handle response
|
152
|
+
print(res)
|
153
|
+
|
154
|
+
```
|
155
|
+
<!-- End Authentication [security] -->
|
156
|
+
|
122
157
|
<!-- Start Available Resources and Operations [operations] -->
|
123
158
|
## Available Resources and Operations
|
124
159
|
|
@@ -213,8 +248,11 @@ To change the default retry strategy for a single API call, simply provide a `Re
|
|
213
248
|
```python
|
214
249
|
from mixpeek import Mixpeek
|
215
250
|
from mixpeek.utils import BackoffStrategy, RetryConfig
|
251
|
+
import os
|
216
252
|
|
217
|
-
with Mixpeek(
|
253
|
+
with Mixpeek(
|
254
|
+
bearer_auth=os.getenv("MIXPEEK_BEARER_AUTH", ""),
|
255
|
+
) as mixpeek:
|
218
256
|
|
219
257
|
res = mixpeek.organizations.get(,
|
220
258
|
RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
|
@@ -228,9 +266,11 @@ If you'd like to override the default retry strategy for all operations that sup
|
|
228
266
|
```python
|
229
267
|
from mixpeek import Mixpeek
|
230
268
|
from mixpeek.utils import BackoffStrategy, RetryConfig
|
269
|
+
import os
|
231
270
|
|
232
271
|
with Mixpeek(
|
233
272
|
retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
|
273
|
+
bearer_auth=os.getenv("MIXPEEK_BEARER_AUTH", ""),
|
234
274
|
) as mixpeek:
|
235
275
|
|
236
276
|
res = mixpeek.organizations.get()
|
@@ -267,8 +307,11 @@ When custom error responses are specified for an operation, the SDK may also rai
|
|
267
307
|
|
268
308
|
```python
|
269
309
|
from mixpeek import Mixpeek, models
|
310
|
+
import os
|
270
311
|
|
271
|
-
with Mixpeek(
|
312
|
+
with Mixpeek(
|
313
|
+
bearer_auth=os.getenv("MIXPEEK_BEARER_AUTH", ""),
|
314
|
+
) as mixpeek:
|
272
315
|
res = None
|
273
316
|
try:
|
274
317
|
|
@@ -297,9 +340,11 @@ with Mixpeek() as mixpeek:
|
|
297
340
|
The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
|
298
341
|
```python
|
299
342
|
from mixpeek import Mixpeek
|
343
|
+
import os
|
300
344
|
|
301
345
|
with Mixpeek(
|
302
346
|
server_url="https://api.mixpeek.com/",
|
347
|
+
bearer_auth=os.getenv("MIXPEEK_BEARER_AUTH", ""),
|
303
348
|
) as mixpeek:
|
304
349
|
|
305
350
|
res = mixpeek.organizations.get()
|
@@ -4,17 +4,17 @@ mixpeek/_hooks/__init__.py,sha256=9_7W5jAYw8rcO8Kfc-Ty-lB82BHfksAJJpVFb_UeU1c,14
|
|
4
4
|
mixpeek/_hooks/registration.py,sha256=1QZB41w6If7I9dXiOSQx6dhSc6BPWrnI5Q5bMOr4iVA,624
|
5
5
|
mixpeek/_hooks/sdkhooks.py,sha256=NMqSNr_PmeJuQgXFEntPJElH9a6yfdyvwEQFH0TrunI,2557
|
6
6
|
mixpeek/_hooks/types.py,sha256=Qh9pO5ndynMrWpMLPkJUsOmAJ1AJHntJAXb5Yxe_a4o,2568
|
7
|
-
mixpeek/_version.py,sha256=
|
8
|
-
mixpeek/assets.py,sha256=
|
9
|
-
mixpeek/basesdk.py,sha256=
|
10
|
-
mixpeek/collections.py,sha256=
|
11
|
-
mixpeek/featureextractors.py,sha256=
|
12
|
-
mixpeek/features.py,sha256=
|
13
|
-
mixpeek/health.py,sha256=
|
7
|
+
mixpeek/_version.py,sha256=2uDSIFYmRDfo5SZ95N0fOJ5UpKgo-Tp7mPg6vnQGvM0,312
|
8
|
+
mixpeek/assets.py,sha256=FxsU6meCiGYKWPwFWT_67UJO4XwSg1vgY2QMSyspNfA,68830
|
9
|
+
mixpeek/basesdk.py,sha256=j_PZqE6WgIfx1cPCK5gAVn-rgPy9iLhUN5ELtefoEU0,11976
|
10
|
+
mixpeek/collections.py,sha256=HXgrieJfXHmdG88t_no0A35Jt66X19hT0zUdGL49XiU,44367
|
11
|
+
mixpeek/featureextractors.py,sha256=vhBNENPiR38RhBsqQqTyE-xpjw5RFaPGbowwRIFUcog,8686
|
12
|
+
mixpeek/features.py,sha256=N-q-YJX9_lw3-jz-fb8_gVyRiyJaguITXv1xEs9Rdek,54022
|
13
|
+
mixpeek/health.py,sha256=77BbCPfMkuuLSJdIG89lual5PhnT_LqXzFVQDKemEi0,6885
|
14
14
|
mixpeek/httpclient.py,sha256=WDbLpMzo7qmWki_ryOJcCAYNI1T4uyWKV08rRuCdNII,2688
|
15
|
-
mixpeek/ingest.py,sha256=
|
16
|
-
mixpeek/interactions.py,sha256=
|
17
|
-
mixpeek/models/__init__.py,sha256=
|
15
|
+
mixpeek/ingest.py,sha256=x0FlcLe7QNIoDaTjh1RJ-4FRzt8KqzzFFUrhPUK763U,39594
|
16
|
+
mixpeek/interactions.py,sha256=LlOUg8PvNkWulit4G9CFe6Rz1H4I4jeHI0p8_qjEY-g,9465
|
17
|
+
mixpeek/models/__init__.py,sha256=GZlLWl-zo4kSoV7H3pR6vXxBmNk_E_D1aJGrFuRTcrc,27780
|
18
18
|
mixpeek/models/actionusage.py,sha256=WAnnBVTeQ9j0dtIrubfyyJQwbBamxManfS8fc2OFNyo,324
|
19
19
|
mixpeek/models/apierror.py,sha256=9mTyJSyvUAOnSfW_1HWt9dGl8IDlpQ68DebwYsDNdug,528
|
20
20
|
mixpeek/models/apikey.py,sha256=P99SWsu6wgc6HStE2MteANIGShUkM2dwQnbQvdg5AOc,654
|
@@ -123,6 +123,7 @@ mixpeek/models/searchinteraction.py,sha256=2X7aVM6Uoknv6mU1rZlUV9oUmDD1rTkDTXCY7
|
|
123
123
|
mixpeek/models/searchquery_output.py,sha256=c7Ar09TanSqoLfLl-PeLcSCXpwUW9G-dm_TS8xPrhPw,2617
|
124
124
|
mixpeek/models/searchrequestfeatures_input.py,sha256=kQE7EPFU3yYXJ6kX2VB7Rz9_Y7eFzgkfooKeFxZvxmA,5769
|
125
125
|
mixpeek/models/searchrequestfeatures_output.py,sha256=s044mekxr7OF68sco7OvRALMt-w6scwbGHIm12wtVXs,5724
|
126
|
+
mixpeek/models/security.py,sha256=KndEoU3C-m7MnQHfXap3lvs4Qp_46e4O-0bzjYcJlx0,690
|
126
127
|
mixpeek/models/sortoption.py,sha256=3_cJW0A9vt8INQowzJ_kZtmYT1mlBNy-__f-tvLiC3Q,639
|
127
128
|
mixpeek/models/sparseembedding.py,sha256=-nXJSRELVSQqTyXAPYA4swPKBscLdljq9vH4N91Yz7A,530
|
128
129
|
mixpeek/models/tasks_model_taskresponse.py,sha256=oyO5jpGPk9UEDS-gyZ6VGqjZrLUcYto_ODMzwvT_Z8o,516
|
@@ -147,16 +148,16 @@ mixpeek/models/videodetectsettings.py,sha256=3l8pOw2USpDQIyPX27yStSPkrgLADPY9wHd
|
|
147
148
|
mixpeek/models/videoreadsettings.py,sha256=3ZmqiQk_SRrylAMHX30PtJuUqgu_u5AwbZEOwfyZ4mM,2409
|
148
149
|
mixpeek/models/videosettings.py,sha256=bQe2vWYyaT0DSyELL49XqrcJIPyD0g8JgBaG7McOwSA,4094
|
149
150
|
mixpeek/models/videotranscriptionsettings.py,sha256=eIrlsSw5AUA9uE98bXvfIoitK5nu6ppq7412YQWQqtk,2453
|
150
|
-
mixpeek/namespaces.py,sha256=
|
151
|
-
mixpeek/organizations.py,sha256=
|
151
|
+
mixpeek/namespaces.py,sha256=V4GZu9ueay3bw_Rlofo0figPDUPfML4XAZudRmYtEjQ,48214
|
152
|
+
mixpeek/organizations.py,sha256=JcnABmWBzvQn8uto9XlNg_NsbzKkFUr3RJoloTY_aXQ,62467
|
152
153
|
mixpeek/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
|
153
|
-
mixpeek/sdk.py,sha256=
|
154
|
-
mixpeek/sdkconfiguration.py,sha256=
|
155
|
-
mixpeek/searchinteractions.py,sha256=
|
156
|
-
mixpeek/tasks.py,sha256=
|
154
|
+
mixpeek/sdk.py,sha256=h1kSnRLMyKciHehOXJHSPrGDv1b7quk_CuR-HglPwMM,5617
|
155
|
+
mixpeek/sdkconfiguration.py,sha256=GQbUnA-vkjh_U-6Q4s3_F6yN1bWj-h01AZjiP0xtNS0,1535
|
156
|
+
mixpeek/searchinteractions.py,sha256=g-0QxU0Wi_IaMvT6n7OM2Cryr_vtQZzZ3HZpBl6AG0I,28152
|
157
|
+
mixpeek/tasks.py,sha256=lvDpvaP_vIpYltWWuXxeAZtOJXC68Sroh9OgYIT6u5A,16532
|
157
158
|
mixpeek/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
|
158
159
|
mixpeek/types/basemodel.py,sha256=PexI39iKiOkIlobB8Ueo0yn8PLHp6_wb-WO-zelNDZY,1170
|
159
|
-
mixpeek/utils/__init__.py,sha256=
|
160
|
+
mixpeek/utils/__init__.py,sha256=8npwwHS-7zjVrbkzBGO-Uk4GkjC240PCleMbgPK1Axs,2418
|
160
161
|
mixpeek/utils/annotations.py,sha256=aR7mZG34FzgRdew7WZPYEu9QGBerpuKxCF4sek5Z_5Y,1699
|
161
162
|
mixpeek/utils/enums.py,sha256=VzjeslROrAr2luZOTJlvu-4UlxgTaGOKlRYtJJ7IfyY,1006
|
162
163
|
mixpeek/utils/eventstreaming.py,sha256=LtcrfJYw4nP2Oe4Wl0-cEURLzRGYReRGWNFY5wYECIE,6186
|
@@ -167,10 +168,10 @@ mixpeek/utils/metadata.py,sha256=Per2KFXXOqOtoUWXrlIfjrSrBg199KrRW0nKQDgHIBU,313
|
|
167
168
|
mixpeek/utils/queryparams.py,sha256=MTK6inMS1_WwjmMJEJmAn67tSHHJyarpdGRlorRHEtI,5899
|
168
169
|
mixpeek/utils/requestbodies.py,sha256=ySjEyjcLi731LNUahWvLOrES2HihuA8VrOJx4eQ7Qzg,2101
|
169
170
|
mixpeek/utils/retries.py,sha256=6yhfZifqIat9i76xF0lTR2jLj1IN9BNGyqqxATlEFPU,6348
|
170
|
-
mixpeek/utils/security.py,sha256=
|
171
|
+
mixpeek/utils/security.py,sha256=3mF13Je002bp6DvX_HTNiw9maMpX-8EY_Eb2s9SYO0U,6020
|
171
172
|
mixpeek/utils/serializers.py,sha256=BSJT7kBOkNBFyP7KREyMoe14JGbgijD1M6AXFMbdmco,4924
|
172
173
|
mixpeek/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
|
173
174
|
mixpeek/utils/values.py,sha256=_89YXPTI_BU6SXJBzFR4pIzTCBPQW9tsOTN1jeBBIDs,3428
|
174
|
-
mixpeek-0.
|
175
|
-
mixpeek-0.
|
176
|
-
mixpeek-0.
|
175
|
+
mixpeek-0.14.0.dist-info/METADATA,sha256=Rh1V10nKcCBhckJXfM0ZLcQAdYMm29xRwU2LUubAQNk,19744
|
176
|
+
mixpeek-0.14.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
177
|
+
mixpeek-0.14.0.dist-info/RECORD,,
|
File without changes
|