hatchet-sdk 1.11.0__py3-none-any.whl → 1.12.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.
Potentially problematic release.
This version of hatchet-sdk might be problematic. Click here for more details.
- hatchet_sdk/__init__.py +2 -0
- hatchet_sdk/client.py +2 -0
- hatchet_sdk/clients/admin.py +4 -2
- hatchet_sdk/clients/events.py +10 -2
- hatchet_sdk/clients/rest/__init__.py +4 -0
- hatchet_sdk/clients/rest/api/event_api.py +67 -0
- hatchet_sdk/clients/rest/api/filter_api.py +339 -0
- hatchet_sdk/clients/rest/api/tenant_api.py +275 -0
- hatchet_sdk/clients/rest/api/workflow_runs_api.py +310 -0
- hatchet_sdk/clients/rest/models/__init__.py +4 -0
- hatchet_sdk/clients/rest/models/create_tenant_request.py +15 -2
- hatchet_sdk/clients/rest/models/tenant.py +6 -0
- hatchet_sdk/clients/rest/models/tenant_ui_version.py +37 -0
- hatchet_sdk/clients/rest/models/update_tenant_request.py +6 -0
- hatchet_sdk/clients/rest/models/v1_update_filter_request.py +98 -0
- hatchet_sdk/contracts/v1/workflows_pb2.py +26 -24
- hatchet_sdk/contracts/v1/workflows_pb2.pyi +14 -2
- hatchet_sdk/features/filters.py +36 -0
- hatchet_sdk/features/runs.py +22 -3
- hatchet_sdk/features/tenant.py +32 -0
- hatchet_sdk/hatchet.py +51 -8
- hatchet_sdk/runnables/action.py +1 -1
- hatchet_sdk/runnables/types.py +22 -4
- hatchet_sdk/runnables/workflow.py +413 -188
- hatchet_sdk/waits.py +2 -2
- {hatchet_sdk-1.11.0.dist-info → hatchet_sdk-1.12.0.dist-info}/METADATA +1 -1
- {hatchet_sdk-1.11.0.dist-info → hatchet_sdk-1.12.0.dist-info}/RECORD +29 -27
- hatchet_sdk/runnables/standalone.py +0 -391
- {hatchet_sdk-1.11.0.dist-info → hatchet_sdk-1.12.0.dist-info}/WHEEL +0 -0
- {hatchet_sdk-1.11.0.dist-info → hatchet_sdk-1.12.0.dist-info}/entry_points.txt +0 -0
hatchet_sdk/__init__.py
CHANGED
|
@@ -144,6 +144,7 @@ from hatchet_sdk.runnables.task import Task
|
|
|
144
144
|
from hatchet_sdk.runnables.types import (
|
|
145
145
|
ConcurrencyExpression,
|
|
146
146
|
ConcurrencyLimitStrategy,
|
|
147
|
+
DefaultFilter,
|
|
147
148
|
EmptyModel,
|
|
148
149
|
StickyStrategy,
|
|
149
150
|
TaskDefaults,
|
|
@@ -275,4 +276,5 @@ __all__ = [
|
|
|
275
276
|
"OTelAttribute",
|
|
276
277
|
"OpenTelemetryConfig",
|
|
277
278
|
"ClientTLSConfig",
|
|
279
|
+
"DefaultFilter",
|
|
278
280
|
]
|
hatchet_sdk/client.py
CHANGED
|
@@ -11,6 +11,7 @@ from hatchet_sdk.features.metrics import MetricsClient
|
|
|
11
11
|
from hatchet_sdk.features.rate_limits import RateLimitsClient
|
|
12
12
|
from hatchet_sdk.features.runs import RunsClient
|
|
13
13
|
from hatchet_sdk.features.scheduled import ScheduledClient
|
|
14
|
+
from hatchet_sdk.features.tenant import TenantClient
|
|
14
15
|
from hatchet_sdk.features.workers import WorkersClient
|
|
15
16
|
from hatchet_sdk.features.workflows import WorkflowsClient
|
|
16
17
|
|
|
@@ -45,6 +46,7 @@ class Client:
|
|
|
45
46
|
workflow_run_listener=self.workflow_listener,
|
|
46
47
|
)
|
|
47
48
|
self.scheduled = ScheduledClient(self.config)
|
|
49
|
+
self.tenant = TenantClient(self.config)
|
|
48
50
|
self.workers = WorkersClient(self.config)
|
|
49
51
|
self.workflows = WorkflowsClient(self.config)
|
|
50
52
|
|
hatchet_sdk/clients/admin.py
CHANGED
|
@@ -361,7 +361,8 @@ class AdminClient:
|
|
|
361
361
|
try:
|
|
362
362
|
resp = cast(
|
|
363
363
|
v0_workflow_protos.TriggerWorkflowResponse,
|
|
364
|
-
|
|
364
|
+
await asyncio.to_thread(
|
|
365
|
+
client.TriggerWorkflow,
|
|
365
366
|
request,
|
|
366
367
|
metadata=get_metadata(self.token),
|
|
367
368
|
),
|
|
@@ -450,7 +451,8 @@ class AdminClient:
|
|
|
450
451
|
|
|
451
452
|
resp = cast(
|
|
452
453
|
v0_workflow_protos.BulkTriggerWorkflowResponse,
|
|
453
|
-
|
|
454
|
+
await asyncio.to_thread(
|
|
455
|
+
client.BulkTriggerWorkflow,
|
|
454
456
|
bulk_request,
|
|
455
457
|
metadata=get_metadata(self.token),
|
|
456
458
|
),
|
hatchet_sdk/clients/events.py
CHANGED
|
@@ -28,7 +28,7 @@ from hatchet_sdk.utils.typing import JSONSerializableMapping
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
def proto_timestamp_now() -> timestamp_pb2.Timestamp:
|
|
31
|
-
t = datetime.datetime.now().timestamp()
|
|
31
|
+
t = datetime.datetime.now(tz=datetime.timezone.utc).timestamp()
|
|
32
32
|
seconds = int(t)
|
|
33
33
|
nanos = int(t % 1 * 1e9)
|
|
34
34
|
|
|
@@ -209,14 +209,20 @@ class EventClient(BaseRestClient):
|
|
|
209
209
|
offset: int | None = None,
|
|
210
210
|
limit: int | None = None,
|
|
211
211
|
keys: list[str] | None = None,
|
|
212
|
+
since: datetime.datetime | None = None,
|
|
213
|
+
until: datetime.datetime | None = None,
|
|
212
214
|
) -> V1EventList:
|
|
213
|
-
return await asyncio.to_thread(
|
|
215
|
+
return await asyncio.to_thread(
|
|
216
|
+
self.list, offset=offset, limit=limit, keys=keys, since=since, until=until
|
|
217
|
+
)
|
|
214
218
|
|
|
215
219
|
def list(
|
|
216
220
|
self,
|
|
217
221
|
offset: int | None = None,
|
|
218
222
|
limit: int | None = None,
|
|
219
223
|
keys: list[str] | None = None,
|
|
224
|
+
since: datetime.datetime | None = None,
|
|
225
|
+
until: datetime.datetime | None = None,
|
|
220
226
|
) -> V1EventList:
|
|
221
227
|
with self.client() as client:
|
|
222
228
|
return self._ea(client).v1_event_list(
|
|
@@ -224,4 +230,6 @@ class EventClient(BaseRestClient):
|
|
|
224
230
|
offset=offset,
|
|
225
231
|
limit=limit,
|
|
226
232
|
keys=keys,
|
|
233
|
+
since=since,
|
|
234
|
+
until=until,
|
|
227
235
|
)
|
|
@@ -207,6 +207,7 @@ from hatchet_sdk.clients.rest.models.tenant_resource_policy import TenantResourc
|
|
|
207
207
|
from hatchet_sdk.clients.rest.models.tenant_step_run_queue_metrics import (
|
|
208
208
|
TenantStepRunQueueMetrics,
|
|
209
209
|
)
|
|
210
|
+
from hatchet_sdk.clients.rest.models.tenant_ui_version import TenantUIVersion
|
|
210
211
|
from hatchet_sdk.clients.rest.models.tenant_version import TenantVersion
|
|
211
212
|
from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import (
|
|
212
213
|
TriggerWorkflowRunRequest,
|
|
@@ -261,6 +262,9 @@ from hatchet_sdk.clients.rest.models.v1_task_timing_list import V1TaskTimingList
|
|
|
261
262
|
from hatchet_sdk.clients.rest.models.v1_trigger_workflow_run_request import (
|
|
262
263
|
V1TriggerWorkflowRunRequest,
|
|
263
264
|
)
|
|
265
|
+
from hatchet_sdk.clients.rest.models.v1_update_filter_request import (
|
|
266
|
+
V1UpdateFilterRequest,
|
|
267
|
+
)
|
|
264
268
|
from hatchet_sdk.clients.rest.models.v1_workflow_run import V1WorkflowRun
|
|
265
269
|
from hatchet_sdk.clients.rest.models.v1_workflow_run_details import V1WorkflowRunDetails
|
|
266
270
|
from hatchet_sdk.clients.rest.models.v1_workflow_run_display_name import (
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
""" # noqa: E501
|
|
13
13
|
|
|
14
14
|
import warnings
|
|
15
|
+
from datetime import datetime
|
|
15
16
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
16
17
|
|
|
17
18
|
from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
|
|
@@ -2566,6 +2567,14 @@ class EventApi:
|
|
|
2566
2567
|
keys: Annotated[
|
|
2567
2568
|
Optional[List[StrictStr]], Field(description="A list of keys to filter by")
|
|
2568
2569
|
] = None,
|
|
2570
|
+
since: Annotated[
|
|
2571
|
+
Optional[datetime],
|
|
2572
|
+
Field(description="Consider events that occurred after this time"),
|
|
2573
|
+
] = None,
|
|
2574
|
+
until: Annotated[
|
|
2575
|
+
Optional[datetime],
|
|
2576
|
+
Field(description="Consider events that occurred before this time"),
|
|
2577
|
+
] = None,
|
|
2569
2578
|
_request_timeout: Union[
|
|
2570
2579
|
None,
|
|
2571
2580
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -2590,6 +2599,10 @@ class EventApi:
|
|
|
2590
2599
|
:type limit: int
|
|
2591
2600
|
:param keys: A list of keys to filter by
|
|
2592
2601
|
:type keys: List[str]
|
|
2602
|
+
:param since: Consider events that occurred after this time
|
|
2603
|
+
:type since: datetime
|
|
2604
|
+
:param until: Consider events that occurred before this time
|
|
2605
|
+
:type until: datetime
|
|
2593
2606
|
:param _request_timeout: timeout setting for this request. If one
|
|
2594
2607
|
number provided, it will be total request
|
|
2595
2608
|
timeout. It can also be a pair (tuple) of
|
|
@@ -2617,6 +2630,8 @@ class EventApi:
|
|
|
2617
2630
|
offset=offset,
|
|
2618
2631
|
limit=limit,
|
|
2619
2632
|
keys=keys,
|
|
2633
|
+
since=since,
|
|
2634
|
+
until=until,
|
|
2620
2635
|
_request_auth=_request_auth,
|
|
2621
2636
|
_content_type=_content_type,
|
|
2622
2637
|
_headers=_headers,
|
|
@@ -2655,6 +2670,14 @@ class EventApi:
|
|
|
2655
2670
|
keys: Annotated[
|
|
2656
2671
|
Optional[List[StrictStr]], Field(description="A list of keys to filter by")
|
|
2657
2672
|
] = None,
|
|
2673
|
+
since: Annotated[
|
|
2674
|
+
Optional[datetime],
|
|
2675
|
+
Field(description="Consider events that occurred after this time"),
|
|
2676
|
+
] = None,
|
|
2677
|
+
until: Annotated[
|
|
2678
|
+
Optional[datetime],
|
|
2679
|
+
Field(description="Consider events that occurred before this time"),
|
|
2680
|
+
] = None,
|
|
2658
2681
|
_request_timeout: Union[
|
|
2659
2682
|
None,
|
|
2660
2683
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -2679,6 +2702,10 @@ class EventApi:
|
|
|
2679
2702
|
:type limit: int
|
|
2680
2703
|
:param keys: A list of keys to filter by
|
|
2681
2704
|
:type keys: List[str]
|
|
2705
|
+
:param since: Consider events that occurred after this time
|
|
2706
|
+
:type since: datetime
|
|
2707
|
+
:param until: Consider events that occurred before this time
|
|
2708
|
+
:type until: datetime
|
|
2682
2709
|
:param _request_timeout: timeout setting for this request. If one
|
|
2683
2710
|
number provided, it will be total request
|
|
2684
2711
|
timeout. It can also be a pair (tuple) of
|
|
@@ -2706,6 +2733,8 @@ class EventApi:
|
|
|
2706
2733
|
offset=offset,
|
|
2707
2734
|
limit=limit,
|
|
2708
2735
|
keys=keys,
|
|
2736
|
+
since=since,
|
|
2737
|
+
until=until,
|
|
2709
2738
|
_request_auth=_request_auth,
|
|
2710
2739
|
_content_type=_content_type,
|
|
2711
2740
|
_headers=_headers,
|
|
@@ -2744,6 +2773,14 @@ class EventApi:
|
|
|
2744
2773
|
keys: Annotated[
|
|
2745
2774
|
Optional[List[StrictStr]], Field(description="A list of keys to filter by")
|
|
2746
2775
|
] = None,
|
|
2776
|
+
since: Annotated[
|
|
2777
|
+
Optional[datetime],
|
|
2778
|
+
Field(description="Consider events that occurred after this time"),
|
|
2779
|
+
] = None,
|
|
2780
|
+
until: Annotated[
|
|
2781
|
+
Optional[datetime],
|
|
2782
|
+
Field(description="Consider events that occurred before this time"),
|
|
2783
|
+
] = None,
|
|
2747
2784
|
_request_timeout: Union[
|
|
2748
2785
|
None,
|
|
2749
2786
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -2768,6 +2805,10 @@ class EventApi:
|
|
|
2768
2805
|
:type limit: int
|
|
2769
2806
|
:param keys: A list of keys to filter by
|
|
2770
2807
|
:type keys: List[str]
|
|
2808
|
+
:param since: Consider events that occurred after this time
|
|
2809
|
+
:type since: datetime
|
|
2810
|
+
:param until: Consider events that occurred before this time
|
|
2811
|
+
:type until: datetime
|
|
2771
2812
|
:param _request_timeout: timeout setting for this request. If one
|
|
2772
2813
|
number provided, it will be total request
|
|
2773
2814
|
timeout. It can also be a pair (tuple) of
|
|
@@ -2795,6 +2836,8 @@ class EventApi:
|
|
|
2795
2836
|
offset=offset,
|
|
2796
2837
|
limit=limit,
|
|
2797
2838
|
keys=keys,
|
|
2839
|
+
since=since,
|
|
2840
|
+
until=until,
|
|
2798
2841
|
_request_auth=_request_auth,
|
|
2799
2842
|
_content_type=_content_type,
|
|
2800
2843
|
_headers=_headers,
|
|
@@ -2817,6 +2860,8 @@ class EventApi:
|
|
|
2817
2860
|
offset,
|
|
2818
2861
|
limit,
|
|
2819
2862
|
keys,
|
|
2863
|
+
since,
|
|
2864
|
+
until,
|
|
2820
2865
|
_request_auth,
|
|
2821
2866
|
_content_type,
|
|
2822
2867
|
_headers,
|
|
@@ -2854,6 +2899,28 @@ class EventApi:
|
|
|
2854
2899
|
|
|
2855
2900
|
_query_params.append(("keys", keys))
|
|
2856
2901
|
|
|
2902
|
+
if since is not None:
|
|
2903
|
+
if isinstance(since, datetime):
|
|
2904
|
+
_query_params.append(
|
|
2905
|
+
(
|
|
2906
|
+
"since",
|
|
2907
|
+
since.strftime(self.api_client.configuration.datetime_format),
|
|
2908
|
+
)
|
|
2909
|
+
)
|
|
2910
|
+
else:
|
|
2911
|
+
_query_params.append(("since", since))
|
|
2912
|
+
|
|
2913
|
+
if until is not None:
|
|
2914
|
+
if isinstance(until, datetime):
|
|
2915
|
+
_query_params.append(
|
|
2916
|
+
(
|
|
2917
|
+
"until",
|
|
2918
|
+
until.strftime(self.api_client.configuration.datetime_format),
|
|
2919
|
+
)
|
|
2920
|
+
)
|
|
2921
|
+
else:
|
|
2922
|
+
_query_params.append(("until", until))
|
|
2923
|
+
|
|
2857
2924
|
# process the header parameters
|
|
2858
2925
|
# process the form parameters
|
|
2859
2926
|
# process the body parameter
|
|
@@ -24,6 +24,9 @@ from hatchet_sdk.clients.rest.models.v1_create_filter_request import (
|
|
|
24
24
|
)
|
|
25
25
|
from hatchet_sdk.clients.rest.models.v1_filter import V1Filter
|
|
26
26
|
from hatchet_sdk.clients.rest.models.v1_filter_list import V1FilterList
|
|
27
|
+
from hatchet_sdk.clients.rest.models.v1_update_filter_request import (
|
|
28
|
+
V1UpdateFilterRequest,
|
|
29
|
+
)
|
|
27
30
|
from hatchet_sdk.clients.rest.rest import RESTResponseType
|
|
28
31
|
|
|
29
32
|
|
|
@@ -1303,3 +1306,339 @@ class FilterApi:
|
|
|
1303
1306
|
_host=_host,
|
|
1304
1307
|
_request_auth=_request_auth,
|
|
1305
1308
|
)
|
|
1309
|
+
|
|
1310
|
+
@validate_call
|
|
1311
|
+
def v1_filter_update(
|
|
1312
|
+
self,
|
|
1313
|
+
tenant: Annotated[
|
|
1314
|
+
str,
|
|
1315
|
+
Field(
|
|
1316
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
1317
|
+
),
|
|
1318
|
+
],
|
|
1319
|
+
v1_filter: Annotated[
|
|
1320
|
+
str,
|
|
1321
|
+
Field(
|
|
1322
|
+
min_length=36,
|
|
1323
|
+
strict=True,
|
|
1324
|
+
max_length=36,
|
|
1325
|
+
description="The filter id to update",
|
|
1326
|
+
),
|
|
1327
|
+
],
|
|
1328
|
+
v1_update_filter_request: Annotated[
|
|
1329
|
+
V1UpdateFilterRequest, Field(description="The input to the filter update")
|
|
1330
|
+
],
|
|
1331
|
+
_request_timeout: Union[
|
|
1332
|
+
None,
|
|
1333
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1334
|
+
Tuple[
|
|
1335
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
1336
|
+
],
|
|
1337
|
+
] = None,
|
|
1338
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1339
|
+
_content_type: Optional[StrictStr] = None,
|
|
1340
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1341
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1342
|
+
) -> V1Filter:
|
|
1343
|
+
"""v1_filter_update
|
|
1344
|
+
|
|
1345
|
+
Update a filter
|
|
1346
|
+
|
|
1347
|
+
:param tenant: The tenant id (required)
|
|
1348
|
+
:type tenant: str
|
|
1349
|
+
:param v1_filter: The filter id to update (required)
|
|
1350
|
+
:type v1_filter: str
|
|
1351
|
+
:param v1_update_filter_request: The input to the filter update (required)
|
|
1352
|
+
:type v1_update_filter_request: V1UpdateFilterRequest
|
|
1353
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1354
|
+
number provided, it will be total request
|
|
1355
|
+
timeout. It can also be a pair (tuple) of
|
|
1356
|
+
(connection, read) timeouts.
|
|
1357
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1358
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1359
|
+
request; this effectively ignores the
|
|
1360
|
+
authentication in the spec for a single request.
|
|
1361
|
+
:type _request_auth: dict, optional
|
|
1362
|
+
:param _content_type: force content-type for the request.
|
|
1363
|
+
:type _content_type: str, Optional
|
|
1364
|
+
:param _headers: set to override the headers for a single
|
|
1365
|
+
request; this effectively ignores the headers
|
|
1366
|
+
in the spec for a single request.
|
|
1367
|
+
:type _headers: dict, optional
|
|
1368
|
+
:param _host_index: set to override the host_index for a single
|
|
1369
|
+
request; this effectively ignores the host_index
|
|
1370
|
+
in the spec for a single request.
|
|
1371
|
+
:type _host_index: int, optional
|
|
1372
|
+
:return: Returns the result object.
|
|
1373
|
+
""" # noqa: E501
|
|
1374
|
+
|
|
1375
|
+
_param = self._v1_filter_update_serialize(
|
|
1376
|
+
tenant=tenant,
|
|
1377
|
+
v1_filter=v1_filter,
|
|
1378
|
+
v1_update_filter_request=v1_update_filter_request,
|
|
1379
|
+
_request_auth=_request_auth,
|
|
1380
|
+
_content_type=_content_type,
|
|
1381
|
+
_headers=_headers,
|
|
1382
|
+
_host_index=_host_index,
|
|
1383
|
+
)
|
|
1384
|
+
|
|
1385
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1386
|
+
"200": "V1Filter",
|
|
1387
|
+
"400": "APIErrors",
|
|
1388
|
+
"403": "APIErrors",
|
|
1389
|
+
"404": "APIErrors",
|
|
1390
|
+
}
|
|
1391
|
+
response_data = self.api_client.call_api(
|
|
1392
|
+
*_param, _request_timeout=_request_timeout
|
|
1393
|
+
)
|
|
1394
|
+
response_data.read()
|
|
1395
|
+
return self.api_client.response_deserialize(
|
|
1396
|
+
response_data=response_data,
|
|
1397
|
+
response_types_map=_response_types_map,
|
|
1398
|
+
).data
|
|
1399
|
+
|
|
1400
|
+
@validate_call
|
|
1401
|
+
def v1_filter_update_with_http_info(
|
|
1402
|
+
self,
|
|
1403
|
+
tenant: Annotated[
|
|
1404
|
+
str,
|
|
1405
|
+
Field(
|
|
1406
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
1407
|
+
),
|
|
1408
|
+
],
|
|
1409
|
+
v1_filter: Annotated[
|
|
1410
|
+
str,
|
|
1411
|
+
Field(
|
|
1412
|
+
min_length=36,
|
|
1413
|
+
strict=True,
|
|
1414
|
+
max_length=36,
|
|
1415
|
+
description="The filter id to update",
|
|
1416
|
+
),
|
|
1417
|
+
],
|
|
1418
|
+
v1_update_filter_request: Annotated[
|
|
1419
|
+
V1UpdateFilterRequest, Field(description="The input to the filter update")
|
|
1420
|
+
],
|
|
1421
|
+
_request_timeout: Union[
|
|
1422
|
+
None,
|
|
1423
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1424
|
+
Tuple[
|
|
1425
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
1426
|
+
],
|
|
1427
|
+
] = None,
|
|
1428
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1429
|
+
_content_type: Optional[StrictStr] = None,
|
|
1430
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1431
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1432
|
+
) -> ApiResponse[V1Filter]:
|
|
1433
|
+
"""v1_filter_update
|
|
1434
|
+
|
|
1435
|
+
Update a filter
|
|
1436
|
+
|
|
1437
|
+
:param tenant: The tenant id (required)
|
|
1438
|
+
:type tenant: str
|
|
1439
|
+
:param v1_filter: The filter id to update (required)
|
|
1440
|
+
:type v1_filter: str
|
|
1441
|
+
:param v1_update_filter_request: The input to the filter update (required)
|
|
1442
|
+
:type v1_update_filter_request: V1UpdateFilterRequest
|
|
1443
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1444
|
+
number provided, it will be total request
|
|
1445
|
+
timeout. It can also be a pair (tuple) of
|
|
1446
|
+
(connection, read) timeouts.
|
|
1447
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1448
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1449
|
+
request; this effectively ignores the
|
|
1450
|
+
authentication in the spec for a single request.
|
|
1451
|
+
:type _request_auth: dict, optional
|
|
1452
|
+
:param _content_type: force content-type for the request.
|
|
1453
|
+
:type _content_type: str, Optional
|
|
1454
|
+
:param _headers: set to override the headers for a single
|
|
1455
|
+
request; this effectively ignores the headers
|
|
1456
|
+
in the spec for a single request.
|
|
1457
|
+
:type _headers: dict, optional
|
|
1458
|
+
:param _host_index: set to override the host_index for a single
|
|
1459
|
+
request; this effectively ignores the host_index
|
|
1460
|
+
in the spec for a single request.
|
|
1461
|
+
:type _host_index: int, optional
|
|
1462
|
+
:return: Returns the result object.
|
|
1463
|
+
""" # noqa: E501
|
|
1464
|
+
|
|
1465
|
+
_param = self._v1_filter_update_serialize(
|
|
1466
|
+
tenant=tenant,
|
|
1467
|
+
v1_filter=v1_filter,
|
|
1468
|
+
v1_update_filter_request=v1_update_filter_request,
|
|
1469
|
+
_request_auth=_request_auth,
|
|
1470
|
+
_content_type=_content_type,
|
|
1471
|
+
_headers=_headers,
|
|
1472
|
+
_host_index=_host_index,
|
|
1473
|
+
)
|
|
1474
|
+
|
|
1475
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1476
|
+
"200": "V1Filter",
|
|
1477
|
+
"400": "APIErrors",
|
|
1478
|
+
"403": "APIErrors",
|
|
1479
|
+
"404": "APIErrors",
|
|
1480
|
+
}
|
|
1481
|
+
response_data = self.api_client.call_api(
|
|
1482
|
+
*_param, _request_timeout=_request_timeout
|
|
1483
|
+
)
|
|
1484
|
+
response_data.read()
|
|
1485
|
+
return self.api_client.response_deserialize(
|
|
1486
|
+
response_data=response_data,
|
|
1487
|
+
response_types_map=_response_types_map,
|
|
1488
|
+
)
|
|
1489
|
+
|
|
1490
|
+
@validate_call
|
|
1491
|
+
def v1_filter_update_without_preload_content(
|
|
1492
|
+
self,
|
|
1493
|
+
tenant: Annotated[
|
|
1494
|
+
str,
|
|
1495
|
+
Field(
|
|
1496
|
+
min_length=36, strict=True, max_length=36, description="The tenant id"
|
|
1497
|
+
),
|
|
1498
|
+
],
|
|
1499
|
+
v1_filter: Annotated[
|
|
1500
|
+
str,
|
|
1501
|
+
Field(
|
|
1502
|
+
min_length=36,
|
|
1503
|
+
strict=True,
|
|
1504
|
+
max_length=36,
|
|
1505
|
+
description="The filter id to update",
|
|
1506
|
+
),
|
|
1507
|
+
],
|
|
1508
|
+
v1_update_filter_request: Annotated[
|
|
1509
|
+
V1UpdateFilterRequest, Field(description="The input to the filter update")
|
|
1510
|
+
],
|
|
1511
|
+
_request_timeout: Union[
|
|
1512
|
+
None,
|
|
1513
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1514
|
+
Tuple[
|
|
1515
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
1516
|
+
],
|
|
1517
|
+
] = None,
|
|
1518
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1519
|
+
_content_type: Optional[StrictStr] = None,
|
|
1520
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1521
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1522
|
+
) -> RESTResponseType:
|
|
1523
|
+
"""v1_filter_update
|
|
1524
|
+
|
|
1525
|
+
Update a filter
|
|
1526
|
+
|
|
1527
|
+
:param tenant: The tenant id (required)
|
|
1528
|
+
:type tenant: str
|
|
1529
|
+
:param v1_filter: The filter id to update (required)
|
|
1530
|
+
:type v1_filter: str
|
|
1531
|
+
:param v1_update_filter_request: The input to the filter update (required)
|
|
1532
|
+
:type v1_update_filter_request: V1UpdateFilterRequest
|
|
1533
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1534
|
+
number provided, it will be total request
|
|
1535
|
+
timeout. It can also be a pair (tuple) of
|
|
1536
|
+
(connection, read) timeouts.
|
|
1537
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1538
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1539
|
+
request; this effectively ignores the
|
|
1540
|
+
authentication in the spec for a single request.
|
|
1541
|
+
:type _request_auth: dict, optional
|
|
1542
|
+
:param _content_type: force content-type for the request.
|
|
1543
|
+
:type _content_type: str, Optional
|
|
1544
|
+
:param _headers: set to override the headers for a single
|
|
1545
|
+
request; this effectively ignores the headers
|
|
1546
|
+
in the spec for a single request.
|
|
1547
|
+
:type _headers: dict, optional
|
|
1548
|
+
:param _host_index: set to override the host_index for a single
|
|
1549
|
+
request; this effectively ignores the host_index
|
|
1550
|
+
in the spec for a single request.
|
|
1551
|
+
:type _host_index: int, optional
|
|
1552
|
+
:return: Returns the result object.
|
|
1553
|
+
""" # noqa: E501
|
|
1554
|
+
|
|
1555
|
+
_param = self._v1_filter_update_serialize(
|
|
1556
|
+
tenant=tenant,
|
|
1557
|
+
v1_filter=v1_filter,
|
|
1558
|
+
v1_update_filter_request=v1_update_filter_request,
|
|
1559
|
+
_request_auth=_request_auth,
|
|
1560
|
+
_content_type=_content_type,
|
|
1561
|
+
_headers=_headers,
|
|
1562
|
+
_host_index=_host_index,
|
|
1563
|
+
)
|
|
1564
|
+
|
|
1565
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1566
|
+
"200": "V1Filter",
|
|
1567
|
+
"400": "APIErrors",
|
|
1568
|
+
"403": "APIErrors",
|
|
1569
|
+
"404": "APIErrors",
|
|
1570
|
+
}
|
|
1571
|
+
response_data = self.api_client.call_api(
|
|
1572
|
+
*_param, _request_timeout=_request_timeout
|
|
1573
|
+
)
|
|
1574
|
+
return response_data.response
|
|
1575
|
+
|
|
1576
|
+
def _v1_filter_update_serialize(
|
|
1577
|
+
self,
|
|
1578
|
+
tenant,
|
|
1579
|
+
v1_filter,
|
|
1580
|
+
v1_update_filter_request,
|
|
1581
|
+
_request_auth,
|
|
1582
|
+
_content_type,
|
|
1583
|
+
_headers,
|
|
1584
|
+
_host_index,
|
|
1585
|
+
) -> RequestSerialized:
|
|
1586
|
+
|
|
1587
|
+
_host = None
|
|
1588
|
+
|
|
1589
|
+
_collection_formats: Dict[str, str] = {}
|
|
1590
|
+
|
|
1591
|
+
_path_params: Dict[str, str] = {}
|
|
1592
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1593
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1594
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1595
|
+
_files: Dict[
|
|
1596
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1597
|
+
] = {}
|
|
1598
|
+
_body_params: Optional[bytes] = None
|
|
1599
|
+
|
|
1600
|
+
# process the path parameters
|
|
1601
|
+
if tenant is not None:
|
|
1602
|
+
_path_params["tenant"] = tenant
|
|
1603
|
+
if v1_filter is not None:
|
|
1604
|
+
_path_params["v1-filter"] = v1_filter
|
|
1605
|
+
# process the query parameters
|
|
1606
|
+
# process the header parameters
|
|
1607
|
+
# process the form parameters
|
|
1608
|
+
# process the body parameter
|
|
1609
|
+
if v1_update_filter_request is not None:
|
|
1610
|
+
_body_params = v1_update_filter_request
|
|
1611
|
+
|
|
1612
|
+
# set the HTTP header `Accept`
|
|
1613
|
+
if "Accept" not in _header_params:
|
|
1614
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
|
1615
|
+
["application/json"]
|
|
1616
|
+
)
|
|
1617
|
+
|
|
1618
|
+
# set the HTTP header `Content-Type`
|
|
1619
|
+
if _content_type:
|
|
1620
|
+
_header_params["Content-Type"] = _content_type
|
|
1621
|
+
else:
|
|
1622
|
+
_default_content_type = self.api_client.select_header_content_type(
|
|
1623
|
+
["application/json"]
|
|
1624
|
+
)
|
|
1625
|
+
if _default_content_type is not None:
|
|
1626
|
+
_header_params["Content-Type"] = _default_content_type
|
|
1627
|
+
|
|
1628
|
+
# authentication setting
|
|
1629
|
+
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
|
|
1630
|
+
|
|
1631
|
+
return self.api_client.param_serialize(
|
|
1632
|
+
method="PATCH",
|
|
1633
|
+
resource_path="/api/v1/stable/tenants/{tenant}/filters/{v1-filter}",
|
|
1634
|
+
path_params=_path_params,
|
|
1635
|
+
query_params=_query_params,
|
|
1636
|
+
header_params=_header_params,
|
|
1637
|
+
body=_body_params,
|
|
1638
|
+
post_params=_form_params,
|
|
1639
|
+
files=_files,
|
|
1640
|
+
auth_settings=_auth_settings,
|
|
1641
|
+
collection_formats=_collection_formats,
|
|
1642
|
+
_host=_host,
|
|
1643
|
+
_request_auth=_request_auth,
|
|
1644
|
+
)
|