label-studio-sdk 0.0.34__py3-none-any.whl → 1.0.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.
Potentially problematic release.
This version of label-studio-sdk might be problematic. Click here for more details.
- label_studio_sdk/__init__.py +232 -9
- label_studio_sdk/_extensions/label_studio_tools/__init__.py +0 -0
- label_studio_sdk/_extensions/label_studio_tools/core/__init__.py +0 -0
- label_studio_sdk/_extensions/label_studio_tools/core/label_config.py +163 -0
- label_studio_sdk/_extensions/label_studio_tools/core/utils/__init__.py +0 -0
- label_studio_sdk/_extensions/label_studio_tools/core/utils/exceptions.py +2 -0
- label_studio_sdk/_extensions/label_studio_tools/core/utils/io.py +228 -0
- label_studio_sdk/_extensions/label_studio_tools/core/utils/params.py +45 -0
- label_studio_sdk/_extensions/label_studio_tools/etl/__init__.py +1 -0
- label_studio_sdk/_extensions/label_studio_tools/etl/beam.py +34 -0
- label_studio_sdk/_extensions/label_studio_tools/etl/example.py +17 -0
- label_studio_sdk/_extensions/label_studio_tools/etl/registry.py +67 -0
- label_studio_sdk/_extensions/label_studio_tools/postprocessing/__init__.py +0 -0
- label_studio_sdk/_extensions/label_studio_tools/postprocessing/video.py +97 -0
- label_studio_sdk/_extensions/pager_ext.py +49 -0
- label_studio_sdk/_legacy/__init__.py +11 -0
- label_studio_sdk/_legacy/client.py +471 -0
- label_studio_sdk/_legacy/objects.py +74 -0
- label_studio_sdk/{project.py → _legacy/project.py} +2 -2
- label_studio_sdk/{schema → _legacy/schema}/label_config_schema.json +14 -14
- label_studio_sdk/actions/__init__.py +27 -0
- label_studio_sdk/actions/client.py +223 -0
- label_studio_sdk/actions/types/__init__.py +25 -0
- label_studio_sdk/actions/types/actions_create_request_filters.py +43 -0
- label_studio_sdk/actions/types/actions_create_request_filters_conjunction.py +5 -0
- label_studio_sdk/actions/types/actions_create_request_filters_items_item.py +49 -0
- label_studio_sdk/actions/types/actions_create_request_filters_items_item_filter.py +31 -0
- label_studio_sdk/actions/types/actions_create_request_filters_items_item_operator.py +23 -0
- label_studio_sdk/actions/types/actions_create_request_id.py +19 -0
- label_studio_sdk/actions/types/actions_create_request_ordering_item.py +31 -0
- label_studio_sdk/actions/types/actions_create_request_selected_items.py +10 -0
- label_studio_sdk/actions/types/actions_create_request_selected_items_excluded.py +39 -0
- label_studio_sdk/actions/types/actions_create_request_selected_items_included.py +39 -0
- label_studio_sdk/annotations/__init__.py +2 -0
- label_studio_sdk/annotations/client.py +750 -0
- label_studio_sdk/base_client.py +183 -0
- label_studio_sdk/client.py +17 -463
- label_studio_sdk/converter/__init__.py +7 -0
- label_studio_sdk/converter/audio.py +56 -0
- label_studio_sdk/converter/brush.py +452 -0
- label_studio_sdk/converter/converter.py +1175 -0
- label_studio_sdk/converter/exports/__init__.py +0 -0
- label_studio_sdk/converter/exports/csv.py +82 -0
- label_studio_sdk/converter/exports/csv2.py +103 -0
- label_studio_sdk/converter/funsd.py +85 -0
- label_studio_sdk/converter/imports/__init__.py +0 -0
- label_studio_sdk/converter/imports/coco.py +314 -0
- label_studio_sdk/converter/imports/colors.py +198 -0
- label_studio_sdk/converter/imports/label_config.py +45 -0
- label_studio_sdk/converter/imports/pathtrack.py +269 -0
- label_studio_sdk/converter/imports/yolo.py +236 -0
- label_studio_sdk/converter/main.py +202 -0
- label_studio_sdk/converter/utils.py +473 -0
- label_studio_sdk/core/__init__.py +33 -0
- label_studio_sdk/core/api_error.py +15 -0
- label_studio_sdk/core/client_wrapper.py +55 -0
- label_studio_sdk/core/datetime_utils.py +28 -0
- label_studio_sdk/core/file.py +38 -0
- label_studio_sdk/core/http_client.py +447 -0
- label_studio_sdk/core/jsonable_encoder.py +99 -0
- label_studio_sdk/core/pagination.py +87 -0
- label_studio_sdk/core/pydantic_utilities.py +28 -0
- label_studio_sdk/core/query_encoder.py +33 -0
- label_studio_sdk/core/remove_none_from_dict.py +11 -0
- label_studio_sdk/core/request_options.py +32 -0
- label_studio_sdk/environment.py +7 -0
- label_studio_sdk/errors/__init__.py +6 -0
- label_studio_sdk/errors/bad_request_error.py +8 -0
- label_studio_sdk/errors/internal_server_error.py +8 -0
- label_studio_sdk/export_storage/__init__.py +28 -0
- label_studio_sdk/export_storage/azure/__init__.py +5 -0
- label_studio_sdk/export_storage/azure/client.py +888 -0
- label_studio_sdk/export_storage/azure/types/__init__.py +6 -0
- label_studio_sdk/export_storage/azure/types/azure_create_response.py +67 -0
- label_studio_sdk/export_storage/azure/types/azure_update_response.py +67 -0
- label_studio_sdk/export_storage/client.py +107 -0
- label_studio_sdk/export_storage/gcs/__init__.py +5 -0
- label_studio_sdk/export_storage/gcs/client.py +888 -0
- label_studio_sdk/export_storage/gcs/types/__init__.py +6 -0
- label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +67 -0
- label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +67 -0
- label_studio_sdk/export_storage/local/__init__.py +5 -0
- label_studio_sdk/export_storage/local/client.py +834 -0
- label_studio_sdk/export_storage/local/types/__init__.py +6 -0
- label_studio_sdk/export_storage/local/types/local_create_response.py +57 -0
- label_studio_sdk/export_storage/local/types/local_update_response.py +57 -0
- label_studio_sdk/export_storage/redis/__init__.py +5 -0
- label_studio_sdk/export_storage/redis/client.py +918 -0
- label_studio_sdk/export_storage/redis/types/__init__.py +6 -0
- label_studio_sdk/export_storage/redis/types/redis_create_response.py +72 -0
- label_studio_sdk/export_storage/redis/types/redis_update_response.py +72 -0
- label_studio_sdk/export_storage/s3/__init__.py +5 -0
- label_studio_sdk/export_storage/s3/client.py +1008 -0
- label_studio_sdk/export_storage/s3/types/__init__.py +6 -0
- label_studio_sdk/export_storage/s3/types/s3create_response.py +89 -0
- label_studio_sdk/export_storage/s3/types/s3update_response.py +89 -0
- label_studio_sdk/export_storage/types/__init__.py +5 -0
- label_studio_sdk/export_storage/types/export_storage_list_types_response_item.py +30 -0
- label_studio_sdk/files/__init__.py +2 -0
- label_studio_sdk/files/client.py +556 -0
- label_studio_sdk/import_storage/__init__.py +28 -0
- label_studio_sdk/import_storage/azure/__init__.py +5 -0
- label_studio_sdk/import_storage/azure/client.py +988 -0
- label_studio_sdk/import_storage/azure/types/__init__.py +6 -0
- label_studio_sdk/import_storage/azure/types/azure_create_response.py +82 -0
- label_studio_sdk/import_storage/azure/types/azure_update_response.py +82 -0
- label_studio_sdk/import_storage/client.py +107 -0
- label_studio_sdk/import_storage/gcs/__init__.py +5 -0
- label_studio_sdk/import_storage/gcs/client.py +988 -0
- label_studio_sdk/import_storage/gcs/types/__init__.py +6 -0
- label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +82 -0
- label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +82 -0
- label_studio_sdk/import_storage/local/__init__.py +5 -0
- label_studio_sdk/import_storage/local/client.py +836 -0
- label_studio_sdk/import_storage/local/types/__init__.py +6 -0
- label_studio_sdk/import_storage/local/types/local_create_response.py +57 -0
- label_studio_sdk/import_storage/local/types/local_update_response.py +57 -0
- label_studio_sdk/import_storage/redis/__init__.py +5 -0
- label_studio_sdk/import_storage/redis/client.py +924 -0
- label_studio_sdk/import_storage/redis/types/__init__.py +6 -0
- label_studio_sdk/import_storage/redis/types/redis_create_response.py +72 -0
- label_studio_sdk/import_storage/redis/types/redis_update_response.py +72 -0
- label_studio_sdk/import_storage/s3/__init__.py +5 -0
- label_studio_sdk/import_storage/s3/client.py +1138 -0
- label_studio_sdk/import_storage/s3/types/__init__.py +6 -0
- label_studio_sdk/import_storage/s3/types/s3create_response.py +109 -0
- label_studio_sdk/import_storage/s3/types/s3update_response.py +109 -0
- label_studio_sdk/import_storage/types/__init__.py +5 -0
- label_studio_sdk/import_storage/types/import_storage_list_types_response_item.py +30 -0
- label_studio_sdk/label_interface/base.py +10 -0
- label_studio_sdk/label_interface/control_tags.py +109 -71
- label_studio_sdk/label_interface/data_examples.json +96 -0
- label_studio_sdk/label_interface/interface.py +102 -53
- label_studio_sdk/label_interface/object_tags.py +8 -13
- label_studio_sdk/label_interface/region.py +33 -1
- label_studio_sdk/ml/__init__.py +19 -0
- label_studio_sdk/ml/client.py +981 -0
- label_studio_sdk/ml/types/__init__.py +17 -0
- label_studio_sdk/ml/types/ml_create_request_auth_method.py +5 -0
- label_studio_sdk/ml/types/ml_create_response.py +78 -0
- label_studio_sdk/ml/types/ml_create_response_auth_method.py +5 -0
- label_studio_sdk/ml/types/ml_update_request_auth_method.py +5 -0
- label_studio_sdk/ml/types/ml_update_response.py +78 -0
- label_studio_sdk/ml/types/ml_update_response_auth_method.py +5 -0
- label_studio_sdk/predictions/__init__.py +2 -0
- label_studio_sdk/predictions/client.py +638 -0
- label_studio_sdk/projects/__init__.py +6 -0
- label_studio_sdk/projects/client.py +1055 -0
- label_studio_sdk/projects/client_ext.py +19 -0
- label_studio_sdk/projects/exports/__init__.py +2 -0
- label_studio_sdk/projects/exports/client.py +930 -0
- label_studio_sdk/projects/types/__init__.py +7 -0
- label_studio_sdk/projects/types/projects_create_response.py +96 -0
- label_studio_sdk/projects/types/projects_import_tasks_response.py +71 -0
- label_studio_sdk/projects/types/projects_list_response.py +33 -0
- label_studio_sdk/py.typed +0 -0
- label_studio_sdk/tasks/__init__.py +5 -0
- label_studio_sdk/tasks/client.py +835 -0
- label_studio_sdk/tasks/client_ext.py +18 -0
- label_studio_sdk/tasks/types/__init__.py +6 -0
- label_studio_sdk/tasks/types/tasks_list_request_fields.py +5 -0
- label_studio_sdk/tasks/types/tasks_list_response.py +48 -0
- label_studio_sdk/types/__init__.py +115 -0
- label_studio_sdk/types/annotation.py +116 -0
- label_studio_sdk/types/annotation_filter_options.py +42 -0
- label_studio_sdk/types/annotation_last_action.py +19 -0
- label_studio_sdk/types/azure_blob_export_storage.py +112 -0
- label_studio_sdk/types/azure_blob_export_storage_status.py +7 -0
- label_studio_sdk/types/azure_blob_import_storage.py +113 -0
- label_studio_sdk/types/azure_blob_import_storage_status.py +7 -0
- label_studio_sdk/types/base_task.py +113 -0
- label_studio_sdk/types/base_user.py +42 -0
- label_studio_sdk/types/converted_format.py +36 -0
- label_studio_sdk/types/converted_format_status.py +5 -0
- label_studio_sdk/types/export.py +48 -0
- label_studio_sdk/types/export_convert.py +32 -0
- label_studio_sdk/types/export_create.py +54 -0
- label_studio_sdk/types/export_create_status.py +5 -0
- label_studio_sdk/types/export_status.py +5 -0
- label_studio_sdk/types/file_upload.py +30 -0
- label_studio_sdk/types/filter.py +53 -0
- label_studio_sdk/types/filter_group.py +35 -0
- label_studio_sdk/types/gcs_export_storage.py +112 -0
- label_studio_sdk/types/gcs_export_storage_status.py +7 -0
- label_studio_sdk/types/gcs_import_storage.py +113 -0
- label_studio_sdk/types/gcs_import_storage_status.py +7 -0
- label_studio_sdk/types/local_files_export_storage.py +97 -0
- label_studio_sdk/types/local_files_export_storage_status.py +7 -0
- label_studio_sdk/types/local_files_import_storage.py +92 -0
- label_studio_sdk/types/local_files_import_storage_status.py +7 -0
- label_studio_sdk/types/ml_backend.py +89 -0
- label_studio_sdk/types/ml_backend_auth_method.py +5 -0
- label_studio_sdk/types/ml_backend_state.py +5 -0
- label_studio_sdk/types/prediction.py +78 -0
- label_studio_sdk/types/project.py +198 -0
- label_studio_sdk/types/project_import.py +63 -0
- label_studio_sdk/types/project_import_status.py +5 -0
- label_studio_sdk/types/project_label_config.py +32 -0
- label_studio_sdk/types/project_sampling.py +7 -0
- label_studio_sdk/types/project_skip_queue.py +5 -0
- label_studio_sdk/types/redis_export_storage.py +117 -0
- label_studio_sdk/types/redis_export_storage_status.py +7 -0
- label_studio_sdk/types/redis_import_storage.py +112 -0
- label_studio_sdk/types/redis_import_storage_status.py +7 -0
- label_studio_sdk/types/s3export_storage.py +134 -0
- label_studio_sdk/types/s3export_storage_status.py +7 -0
- label_studio_sdk/types/s3import_storage.py +140 -0
- label_studio_sdk/types/s3import_storage_status.py +7 -0
- label_studio_sdk/types/serialization_option.py +36 -0
- label_studio_sdk/types/serialization_options.py +45 -0
- label_studio_sdk/types/task.py +157 -0
- label_studio_sdk/types/task_filter_options.py +49 -0
- label_studio_sdk/types/user_simple.py +37 -0
- label_studio_sdk/types/view.py +55 -0
- label_studio_sdk/types/webhook.py +67 -0
- label_studio_sdk/types/webhook_actions_item.py +21 -0
- label_studio_sdk/types/webhook_serializer_for_update.py +67 -0
- label_studio_sdk/types/webhook_serializer_for_update_actions_item.py +21 -0
- label_studio_sdk/users/__init__.py +5 -0
- label_studio_sdk/users/client.py +830 -0
- label_studio_sdk/users/types/__init__.py +6 -0
- label_studio_sdk/users/types/users_get_token_response.py +36 -0
- label_studio_sdk/users/types/users_reset_token_response.py +36 -0
- label_studio_sdk/version.py +4 -0
- label_studio_sdk/views/__init__.py +35 -0
- label_studio_sdk/views/client.py +564 -0
- label_studio_sdk/views/types/__init__.py +33 -0
- label_studio_sdk/views/types/views_create_request_data.py +43 -0
- label_studio_sdk/views/types/views_create_request_data_filters.py +43 -0
- label_studio_sdk/views/types/views_create_request_data_filters_conjunction.py +5 -0
- label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +49 -0
- label_studio_sdk/views/types/views_create_request_data_filters_items_item_filter.py +31 -0
- label_studio_sdk/views/types/views_create_request_data_filters_items_item_operator.py +23 -0
- label_studio_sdk/views/types/views_create_request_data_ordering_item.py +31 -0
- label_studio_sdk/views/types/views_update_request_data.py +43 -0
- label_studio_sdk/views/types/views_update_request_data_filters.py +43 -0
- label_studio_sdk/views/types/views_update_request_data_filters_conjunction.py +5 -0
- label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +49 -0
- label_studio_sdk/views/types/views_update_request_data_filters_items_item_filter.py +31 -0
- label_studio_sdk/views/types/views_update_request_data_filters_items_item_operator.py +23 -0
- label_studio_sdk/views/types/views_update_request_data_ordering_item.py +31 -0
- label_studio_sdk/webhooks/__init__.py +5 -0
- label_studio_sdk/webhooks/client.py +636 -0
- label_studio_sdk/webhooks/types/__init__.py +5 -0
- label_studio_sdk/webhooks/types/webhooks_update_request_actions_item.py +21 -0
- label_studio_sdk-1.0.1.dist-info/METADATA +163 -0
- label_studio_sdk-1.0.1.dist-info/RECORD +256 -0
- {label_studio_sdk-0.0.34.dist-info → label_studio_sdk-1.0.1.dist-info}/WHEEL +1 -2
- label_studio_sdk/objects.py +0 -35
- label_studio_sdk-0.0.34.dist-info/LICENSE +0 -201
- label_studio_sdk-0.0.34.dist-info/METADATA +0 -24
- label_studio_sdk-0.0.34.dist-info/RECORD +0 -37
- label_studio_sdk-0.0.34.dist-info/top_level.txt +0 -2
- tests/test_client.py +0 -37
- tests/test_export.py +0 -105
- tests/test_interface/__init__.py +0 -1
- tests/test_interface/configs.py +0 -137
- tests/test_interface/mockups.py +0 -22
- tests/test_interface/test_compat.py +0 -64
- tests/test_interface/test_control_tags.py +0 -55
- tests/test_interface/test_data_generation.py +0 -45
- tests/test_interface/test_lpi.py +0 -15
- tests/test_interface/test_main.py +0 -196
- tests/test_interface/test_object_tags.py +0 -36
- tests/test_interface/test_region.py +0 -36
- tests/test_interface/test_validate_summary.py +0 -35
- tests/test_interface/test_validation.py +0 -59
- {tests → label_studio_sdk/_extensions}/__init__.py +0 -0
- /label_studio_sdk/{exceptions.py → _legacy/exceptions.py} +0 -0
- /label_studio_sdk/{users.py → _legacy/users.py} +0 -0
- /label_studio_sdk/{utils.py → _legacy/utils.py} +0 -0
- /label_studio_sdk/{workspaces.py → _legacy/workspaces.py} +0 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ..core.api_error import ApiError
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ..core.request_options import RequestOptions
|
|
9
|
+
from .types.actions_create_request_filters import ActionsCreateRequestFilters
|
|
10
|
+
from .types.actions_create_request_id import ActionsCreateRequestId
|
|
11
|
+
from .types.actions_create_request_ordering_item import ActionsCreateRequestOrderingItem
|
|
12
|
+
from .types.actions_create_request_selected_items import ActionsCreateRequestSelectedItems
|
|
13
|
+
|
|
14
|
+
# this is used as the default value for optional parameters
|
|
15
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ActionsClient:
|
|
19
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
20
|
+
self._client_wrapper = client_wrapper
|
|
21
|
+
|
|
22
|
+
def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
23
|
+
"""
|
|
24
|
+
Retrieve all the registered actions with descriptions that data manager can use.
|
|
25
|
+
|
|
26
|
+
Parameters
|
|
27
|
+
----------
|
|
28
|
+
request_options : typing.Optional[RequestOptions]
|
|
29
|
+
Request-specific configuration.
|
|
30
|
+
|
|
31
|
+
Returns
|
|
32
|
+
-------
|
|
33
|
+
None
|
|
34
|
+
|
|
35
|
+
Examples
|
|
36
|
+
--------
|
|
37
|
+
from label_studio_sdk.client import LabelStudio
|
|
38
|
+
|
|
39
|
+
client = LabelStudio(
|
|
40
|
+
api_key="YOUR_API_KEY",
|
|
41
|
+
)
|
|
42
|
+
client.actions.list()
|
|
43
|
+
"""
|
|
44
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
45
|
+
"api/dm/actions/", method="GET", request_options=request_options
|
|
46
|
+
)
|
|
47
|
+
if 200 <= _response.status_code < 300:
|
|
48
|
+
return
|
|
49
|
+
try:
|
|
50
|
+
_response_json = _response.json()
|
|
51
|
+
except JSONDecodeError:
|
|
52
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
53
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
54
|
+
|
|
55
|
+
def create(
|
|
56
|
+
self,
|
|
57
|
+
*,
|
|
58
|
+
id: typing.Optional[ActionsCreateRequestId] = None,
|
|
59
|
+
project: typing.Optional[int] = None,
|
|
60
|
+
view: typing.Optional[int] = None,
|
|
61
|
+
filters: typing.Optional[ActionsCreateRequestFilters] = OMIT,
|
|
62
|
+
selected_items: typing.Optional[ActionsCreateRequestSelectedItems] = OMIT,
|
|
63
|
+
ordering: typing.Optional[typing.Sequence[ActionsCreateRequestOrderingItem]] = OMIT,
|
|
64
|
+
request_options: typing.Optional[RequestOptions] = None
|
|
65
|
+
) -> None:
|
|
66
|
+
"""
|
|
67
|
+
Perform a Data Manager action with the selected tasks and filters.
|
|
68
|
+
|
|
69
|
+
Parameters
|
|
70
|
+
----------
|
|
71
|
+
id : typing.Optional[ActionsCreateRequestId]
|
|
72
|
+
Action name ID, the full list of actions can be retrieved with a GET request
|
|
73
|
+
|
|
74
|
+
project : typing.Optional[int]
|
|
75
|
+
Project ID
|
|
76
|
+
|
|
77
|
+
view : typing.Optional[int]
|
|
78
|
+
View ID (optional, it has higher priority than filters, selectedItems and ordering from the request body payload)
|
|
79
|
+
|
|
80
|
+
filters : typing.Optional[ActionsCreateRequestFilters]
|
|
81
|
+
Filters to apply on tasks. You can use [the helper class `Filters` from this page](https://labelstud.io/sdk/data_manager.html) to create Data Manager Filters.<br>Example: `{"conjunction": "or", "items": [{"filter": "filter:tasks:completed_at", "operator": "greater", "type": "Datetime", "value": "2021-01-01T00:00:00.000Z"}]}`
|
|
82
|
+
|
|
83
|
+
selected_items : typing.Optional[ActionsCreateRequestSelectedItems]
|
|
84
|
+
Task selection by IDs. If filters are applied, the selection will be applied to the filtered tasks.If "all" is `false`, `"included"` must be used. If "all" is `true`, `"excluded"` must be used.<br>Examples: `{"all": false, "included": [1, 2, 3]}` or `{"all": true, "excluded": [4, 5]}`
|
|
85
|
+
|
|
86
|
+
ordering : typing.Optional[typing.Sequence[ActionsCreateRequestOrderingItem]]
|
|
87
|
+
List of fields to order by. Fields are similar to filters but without the `filter:` prefix. To reverse the order, add a minus sign before the field name, e.g. `-tasks:created_at`.
|
|
88
|
+
|
|
89
|
+
request_options : typing.Optional[RequestOptions]
|
|
90
|
+
Request-specific configuration.
|
|
91
|
+
|
|
92
|
+
Returns
|
|
93
|
+
-------
|
|
94
|
+
None
|
|
95
|
+
|
|
96
|
+
Examples
|
|
97
|
+
--------
|
|
98
|
+
from label_studio_sdk.client import LabelStudio
|
|
99
|
+
|
|
100
|
+
client = LabelStudio(
|
|
101
|
+
api_key="YOUR_API_KEY",
|
|
102
|
+
)
|
|
103
|
+
client.actions.create()
|
|
104
|
+
"""
|
|
105
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
106
|
+
"api/dm/actions/",
|
|
107
|
+
method="POST",
|
|
108
|
+
params={"id": id, "project": project, "view": view},
|
|
109
|
+
json={"filters": filters, "selectedItems": selected_items, "ordering": ordering},
|
|
110
|
+
request_options=request_options,
|
|
111
|
+
omit=OMIT,
|
|
112
|
+
)
|
|
113
|
+
if 200 <= _response.status_code < 300:
|
|
114
|
+
return
|
|
115
|
+
try:
|
|
116
|
+
_response_json = _response.json()
|
|
117
|
+
except JSONDecodeError:
|
|
118
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
119
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class AsyncActionsClient:
|
|
123
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
124
|
+
self._client_wrapper = client_wrapper
|
|
125
|
+
|
|
126
|
+
async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
127
|
+
"""
|
|
128
|
+
Retrieve all the registered actions with descriptions that data manager can use.
|
|
129
|
+
|
|
130
|
+
Parameters
|
|
131
|
+
----------
|
|
132
|
+
request_options : typing.Optional[RequestOptions]
|
|
133
|
+
Request-specific configuration.
|
|
134
|
+
|
|
135
|
+
Returns
|
|
136
|
+
-------
|
|
137
|
+
None
|
|
138
|
+
|
|
139
|
+
Examples
|
|
140
|
+
--------
|
|
141
|
+
from label_studio_sdk.client import AsyncLabelStudio
|
|
142
|
+
|
|
143
|
+
client = AsyncLabelStudio(
|
|
144
|
+
api_key="YOUR_API_KEY",
|
|
145
|
+
)
|
|
146
|
+
await client.actions.list()
|
|
147
|
+
"""
|
|
148
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
149
|
+
"api/dm/actions/", method="GET", request_options=request_options
|
|
150
|
+
)
|
|
151
|
+
if 200 <= _response.status_code < 300:
|
|
152
|
+
return
|
|
153
|
+
try:
|
|
154
|
+
_response_json = _response.json()
|
|
155
|
+
except JSONDecodeError:
|
|
156
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
157
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
158
|
+
|
|
159
|
+
async def create(
|
|
160
|
+
self,
|
|
161
|
+
*,
|
|
162
|
+
id: typing.Optional[ActionsCreateRequestId] = None,
|
|
163
|
+
project: typing.Optional[int] = None,
|
|
164
|
+
view: typing.Optional[int] = None,
|
|
165
|
+
filters: typing.Optional[ActionsCreateRequestFilters] = OMIT,
|
|
166
|
+
selected_items: typing.Optional[ActionsCreateRequestSelectedItems] = OMIT,
|
|
167
|
+
ordering: typing.Optional[typing.Sequence[ActionsCreateRequestOrderingItem]] = OMIT,
|
|
168
|
+
request_options: typing.Optional[RequestOptions] = None
|
|
169
|
+
) -> None:
|
|
170
|
+
"""
|
|
171
|
+
Perform a Data Manager action with the selected tasks and filters.
|
|
172
|
+
|
|
173
|
+
Parameters
|
|
174
|
+
----------
|
|
175
|
+
id : typing.Optional[ActionsCreateRequestId]
|
|
176
|
+
Action name ID, the full list of actions can be retrieved with a GET request
|
|
177
|
+
|
|
178
|
+
project : typing.Optional[int]
|
|
179
|
+
Project ID
|
|
180
|
+
|
|
181
|
+
view : typing.Optional[int]
|
|
182
|
+
View ID (optional, it has higher priority than filters, selectedItems and ordering from the request body payload)
|
|
183
|
+
|
|
184
|
+
filters : typing.Optional[ActionsCreateRequestFilters]
|
|
185
|
+
Filters to apply on tasks. You can use [the helper class `Filters` from this page](https://labelstud.io/sdk/data_manager.html) to create Data Manager Filters.<br>Example: `{"conjunction": "or", "items": [{"filter": "filter:tasks:completed_at", "operator": "greater", "type": "Datetime", "value": "2021-01-01T00:00:00.000Z"}]}`
|
|
186
|
+
|
|
187
|
+
selected_items : typing.Optional[ActionsCreateRequestSelectedItems]
|
|
188
|
+
Task selection by IDs. If filters are applied, the selection will be applied to the filtered tasks.If "all" is `false`, `"included"` must be used. If "all" is `true`, `"excluded"` must be used.<br>Examples: `{"all": false, "included": [1, 2, 3]}` or `{"all": true, "excluded": [4, 5]}`
|
|
189
|
+
|
|
190
|
+
ordering : typing.Optional[typing.Sequence[ActionsCreateRequestOrderingItem]]
|
|
191
|
+
List of fields to order by. Fields are similar to filters but without the `filter:` prefix. To reverse the order, add a minus sign before the field name, e.g. `-tasks:created_at`.
|
|
192
|
+
|
|
193
|
+
request_options : typing.Optional[RequestOptions]
|
|
194
|
+
Request-specific configuration.
|
|
195
|
+
|
|
196
|
+
Returns
|
|
197
|
+
-------
|
|
198
|
+
None
|
|
199
|
+
|
|
200
|
+
Examples
|
|
201
|
+
--------
|
|
202
|
+
from label_studio_sdk.client import AsyncLabelStudio
|
|
203
|
+
|
|
204
|
+
client = AsyncLabelStudio(
|
|
205
|
+
api_key="YOUR_API_KEY",
|
|
206
|
+
)
|
|
207
|
+
await client.actions.create()
|
|
208
|
+
"""
|
|
209
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
210
|
+
"api/dm/actions/",
|
|
211
|
+
method="POST",
|
|
212
|
+
params={"id": id, "project": project, "view": view},
|
|
213
|
+
json={"filters": filters, "selectedItems": selected_items, "ordering": ordering},
|
|
214
|
+
request_options=request_options,
|
|
215
|
+
omit=OMIT,
|
|
216
|
+
)
|
|
217
|
+
if 200 <= _response.status_code < 300:
|
|
218
|
+
return
|
|
219
|
+
try:
|
|
220
|
+
_response_json = _response.json()
|
|
221
|
+
except JSONDecodeError:
|
|
222
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
223
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from .actions_create_request_filters import ActionsCreateRequestFilters
|
|
4
|
+
from .actions_create_request_filters_conjunction import ActionsCreateRequestFiltersConjunction
|
|
5
|
+
from .actions_create_request_filters_items_item import ActionsCreateRequestFiltersItemsItem
|
|
6
|
+
from .actions_create_request_filters_items_item_filter import ActionsCreateRequestFiltersItemsItemFilter
|
|
7
|
+
from .actions_create_request_filters_items_item_operator import ActionsCreateRequestFiltersItemsItemOperator
|
|
8
|
+
from .actions_create_request_id import ActionsCreateRequestId
|
|
9
|
+
from .actions_create_request_ordering_item import ActionsCreateRequestOrderingItem
|
|
10
|
+
from .actions_create_request_selected_items import ActionsCreateRequestSelectedItems
|
|
11
|
+
from .actions_create_request_selected_items_excluded import ActionsCreateRequestSelectedItemsExcluded
|
|
12
|
+
from .actions_create_request_selected_items_included import ActionsCreateRequestSelectedItemsIncluded
|
|
13
|
+
|
|
14
|
+
__all__ = [
|
|
15
|
+
"ActionsCreateRequestFilters",
|
|
16
|
+
"ActionsCreateRequestFiltersConjunction",
|
|
17
|
+
"ActionsCreateRequestFiltersItemsItem",
|
|
18
|
+
"ActionsCreateRequestFiltersItemsItemFilter",
|
|
19
|
+
"ActionsCreateRequestFiltersItemsItemOperator",
|
|
20
|
+
"ActionsCreateRequestId",
|
|
21
|
+
"ActionsCreateRequestOrderingItem",
|
|
22
|
+
"ActionsCreateRequestSelectedItems",
|
|
23
|
+
"ActionsCreateRequestSelectedItemsExcluded",
|
|
24
|
+
"ActionsCreateRequestSelectedItemsIncluded",
|
|
25
|
+
]
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ...core.datetime_utils import serialize_datetime
|
|
7
|
+
from ...core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
|
8
|
+
from .actions_create_request_filters_conjunction import ActionsCreateRequestFiltersConjunction
|
|
9
|
+
from .actions_create_request_filters_items_item import ActionsCreateRequestFiltersItemsItem
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ActionsCreateRequestFilters(pydantic_v1.BaseModel):
|
|
13
|
+
"""
|
|
14
|
+
Filters to apply on tasks. You can use [the helper class `Filters` from this page](https://labelstud.io/sdk/data_manager.html) to create Data Manager Filters.<br>Example: `{"conjunction": "or", "items": [{"filter": "filter:tasks:completed_at", "operator": "greater", "type": "Datetime", "value": "2021-01-01T00:00:00.000Z"}]}`
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
conjunction: ActionsCreateRequestFiltersConjunction = pydantic_v1.Field()
|
|
18
|
+
"""
|
|
19
|
+
Logical conjunction for the filters. This conjunction (either "or" or "and") will be applied to all items in the filters list. It is not possible to combine "or" and "and" within one list of filters. All filters will be either combined with "or" or with "and", but not a mix of both.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
items: typing.List[ActionsCreateRequestFiltersItemsItem] = pydantic_v1.Field()
|
|
23
|
+
"""
|
|
24
|
+
List of filter items
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
28
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
29
|
+
return super().json(**kwargs_with_defaults)
|
|
30
|
+
|
|
31
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
32
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
33
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
34
|
+
|
|
35
|
+
return deep_union_pydantic_dicts(
|
|
36
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
class Config:
|
|
40
|
+
frozen = True
|
|
41
|
+
smart_union = True
|
|
42
|
+
extra = pydantic_v1.Extra.allow
|
|
43
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ...core.datetime_utils import serialize_datetime
|
|
7
|
+
from ...core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
|
8
|
+
from .actions_create_request_filters_items_item_filter import ActionsCreateRequestFiltersItemsItemFilter
|
|
9
|
+
from .actions_create_request_filters_items_item_operator import ActionsCreateRequestFiltersItemsItemOperator
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ActionsCreateRequestFiltersItemsItem(pydantic_v1.BaseModel):
|
|
13
|
+
filter: ActionsCreateRequestFiltersItemsItemFilter = pydantic_v1.Field()
|
|
14
|
+
"""
|
|
15
|
+
Filter identifier, it should start with `filter:tasks:` prefix, e.g. `filter:tasks:agreement`. For `task.data` fields it may look like `filter:tasks:data.field_name`. Possible values:<br><li>`filter:tasks:agreement`<br> (Number) Agreement for annotation results for a specific task (Enterprise only)</li><br><li>`filter:tasks:annotations_results`<br> (String) Annotation results for the tasks</li><br><li>`filter:tasks:annotators`<br> (List) Annotators that completed the task (Community). Can include assigned annotators (Enterprise only). Important note: the filter `type` should be List, but the filter `value` is integer</li><br><li>`filter:tasks:cancelled_annotations`<br> (Number) Number of cancelled or skipped annotations for the task</li><br><li>`filter:tasks:comments`<br> (Number) Number of comments in a task</li><br><li>`filter:tasks:completed_at`<br> (Datetime) Time when a task was fully annotated</li><br><li>`filter:tasks:created_at`<br> (Datetime) Time the task was created at</li><br><li>`filter:tasks:file_upload`<br> (String) Name of the file uploaded to create the tasks</li><br><li>`filter:tasks:ground_truth`<br> (Boolean) Ground truth status of the tasks</li><br><li>`filter:tasks:id`<br> (Number) Task ID</li><br><li>`filter:tasks:inner_id`<br> (Number) Task Inner ID, it starts from 1 for all projects</li><br><li>`filter:tasks:predictions_model_versions`<br> (String) Model version used for the predictions</li><br><li>`filter:tasks:predictions_results`<br> (String) Prediction results for the tasks</li><br><li>`filter:tasks:predictions_score`<br> (Number) Prediction score for the task</li><br><li>`filter:tasks:reviewed`<br> (Boolean) Whether the tasks have been reviewed (Enterprise only)</li><br><li>`filter:tasks:reviewers`<br> (String) Reviewers that reviewed the task, or assigned reviewers (Enterprise only). Important note: the filter `type` should be List, but the filter `value` is integer</li><br><li>`filter:tasks:reviews_accepted`<br> (Number) Number of annotations accepted for a task in review (Enterprise only)</li><br><li>`filter:tasks:reviews_rejected`<br> (Number) Number of annotations rejected for a task in review (Enterprise only)</li><br><li>`filter:tasks:total_annotations`<br> (Number) Total number of annotations on a task</li><br><li>`filter:tasks:total_predictions`<br> (Number) Total number of predictions for the task</li><br><li>`filter:tasks:unresolved_comment_count`<br> (Number) Number of unresolved comments in a task</li><br><li>`filter:tasks:updated_at`<br> (Datetime) Time the task was updated at (e.g. new annotation was created, review added, etc)</li>
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
operator: ActionsCreateRequestFiltersItemsItemOperator = pydantic_v1.Field()
|
|
19
|
+
"""
|
|
20
|
+
Filter operator. Possible values:<br><li>`contains`<br> Contains</li><br><li>`ends_with`<br> Ends with</li><br><li>`equal`<br> Equal to</li><br><li>`exists`<br> Exists</li><br><li>`greater`<br> Greater than</li><br><li>`greater_or_equal`<br> Greater than or equal to</li><br><li>`in`<br> Is between min and max values, so the filter `value` should be e.g. `{"min": 1, "max": 7}`</li><br><li>`less`<br> Less than</li><br><li>`less_or_equal`<br> Less than or equal to</li><br><li>`not_contains`<br> Does not contain</li><br><li>`not_equal`<br> Not equal to</li><br><li>`not_exists`<br> Does not exist</li><br><li>`not_in`<br> Is not between min and max values, so the filter `value` should be e.g. `{"min": 1, "max": 7}`</li><br><li>`starts_with`<br> Starts with</li>
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
type: str = pydantic_v1.Field()
|
|
24
|
+
"""
|
|
25
|
+
Type of the filter value. Possible values:<br><li>`Boolean`<br> Boolean</li><br><li>`Datetime`<br> Datetime string in `strftime('%Y-%m-%dT%H:%M:%S.%fZ')` format</li><br><li>`List`<br> List of items</li><br><li>`Number`<br> Float or Integer</li><br><li>`String`<br> String</li><br><li>`Unknown`<br> Unknown is explicitly converted to string format</li>
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
value: str = pydantic_v1.Field()
|
|
29
|
+
"""
|
|
30
|
+
Value to filter by
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
34
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
35
|
+
return super().json(**kwargs_with_defaults)
|
|
36
|
+
|
|
37
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
38
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
39
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
40
|
+
|
|
41
|
+
return deep_union_pydantic_dicts(
|
|
42
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
class Config:
|
|
46
|
+
frozen = True
|
|
47
|
+
smart_union = True
|
|
48
|
+
extra = pydantic_v1.Extra.allow
|
|
49
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
ActionsCreateRequestFiltersItemsItemFilter = typing.Union[
|
|
6
|
+
typing.Literal[
|
|
7
|
+
"filter:tasks:agreement",
|
|
8
|
+
"filter:tasks:annotations_results",
|
|
9
|
+
"filter:tasks:annotators",
|
|
10
|
+
"filter:tasks:cancelled_annotations",
|
|
11
|
+
"filter:tasks:comments",
|
|
12
|
+
"filter:tasks:completed_at",
|
|
13
|
+
"filter:tasks:created_at",
|
|
14
|
+
"filter:tasks:file_upload",
|
|
15
|
+
"filter:tasks:ground_truth",
|
|
16
|
+
"filter:tasks:id",
|
|
17
|
+
"filter:tasks:inner_id",
|
|
18
|
+
"filter:tasks:predictions_model_versions",
|
|
19
|
+
"filter:tasks:predictions_results",
|
|
20
|
+
"filter:tasks:predictions_score",
|
|
21
|
+
"filter:tasks:reviewed",
|
|
22
|
+
"filter:tasks:reviewers",
|
|
23
|
+
"filter:tasks:reviews_accepted",
|
|
24
|
+
"filter:tasks:reviews_rejected",
|
|
25
|
+
"filter:tasks:total_annotations",
|
|
26
|
+
"filter:tasks:total_predictions",
|
|
27
|
+
"filter:tasks:unresolved_comment_count",
|
|
28
|
+
"filter:tasks:updated_at",
|
|
29
|
+
],
|
|
30
|
+
typing.Any,
|
|
31
|
+
]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
ActionsCreateRequestFiltersItemsItemOperator = typing.Union[
|
|
6
|
+
typing.Literal[
|
|
7
|
+
"contains",
|
|
8
|
+
"ends_with",
|
|
9
|
+
"equal",
|
|
10
|
+
"exists",
|
|
11
|
+
"greater",
|
|
12
|
+
"greater_or_equal",
|
|
13
|
+
"in",
|
|
14
|
+
"less",
|
|
15
|
+
"less_or_equal",
|
|
16
|
+
"not_contains",
|
|
17
|
+
"not_equal",
|
|
18
|
+
"not_exists",
|
|
19
|
+
"not_in",
|
|
20
|
+
"starts_with",
|
|
21
|
+
],
|
|
22
|
+
typing.Any,
|
|
23
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
ActionsCreateRequestId = typing.Union[
|
|
6
|
+
typing.Literal[
|
|
7
|
+
"retrieve_tasks_predictions",
|
|
8
|
+
"predictions_to_annotations",
|
|
9
|
+
"remove_duplicates",
|
|
10
|
+
"delete_tasks",
|
|
11
|
+
"delete_ground_truths",
|
|
12
|
+
"delete_tasks_annotations",
|
|
13
|
+
"delete_tasks_reviews",
|
|
14
|
+
"delete_tasks_predictions",
|
|
15
|
+
"delete_reviewers",
|
|
16
|
+
"delete_annotators",
|
|
17
|
+
],
|
|
18
|
+
typing.Any,
|
|
19
|
+
]
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
ActionsCreateRequestOrderingItem = typing.Union[
|
|
6
|
+
typing.Literal[
|
|
7
|
+
"tasks:agreement",
|
|
8
|
+
"tasks:annotations_results",
|
|
9
|
+
"tasks:annotators",
|
|
10
|
+
"tasks:cancelled_annotations",
|
|
11
|
+
"tasks:comments",
|
|
12
|
+
"tasks:completed_at",
|
|
13
|
+
"tasks:created_at",
|
|
14
|
+
"tasks:file_upload",
|
|
15
|
+
"tasks:ground_truth",
|
|
16
|
+
"tasks:id",
|
|
17
|
+
"tasks:inner_id",
|
|
18
|
+
"tasks:predictions_model_versions",
|
|
19
|
+
"tasks:predictions_results",
|
|
20
|
+
"tasks:predictions_score",
|
|
21
|
+
"tasks:reviewed",
|
|
22
|
+
"tasks:reviewers",
|
|
23
|
+
"tasks:reviews_accepted",
|
|
24
|
+
"tasks:reviews_rejected",
|
|
25
|
+
"tasks:total_annotations",
|
|
26
|
+
"tasks:total_predictions",
|
|
27
|
+
"tasks:unresolved_comment_count",
|
|
28
|
+
"tasks:updated_at",
|
|
29
|
+
],
|
|
30
|
+
typing.Any,
|
|
31
|
+
]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from .actions_create_request_selected_items_excluded import ActionsCreateRequestSelectedItemsExcluded
|
|
6
|
+
from .actions_create_request_selected_items_included import ActionsCreateRequestSelectedItemsIncluded
|
|
7
|
+
|
|
8
|
+
ActionsCreateRequestSelectedItems = typing.Union[
|
|
9
|
+
ActionsCreateRequestSelectedItemsIncluded, ActionsCreateRequestSelectedItemsExcluded
|
|
10
|
+
]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ...core.datetime_utils import serialize_datetime
|
|
7
|
+
from ...core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ActionsCreateRequestSelectedItemsExcluded(pydantic_v1.BaseModel):
|
|
11
|
+
all_: bool = pydantic_v1.Field(alias="all")
|
|
12
|
+
"""
|
|
13
|
+
All tasks are selected
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
excluded: typing.Optional[typing.List[int]] = pydantic_v1.Field(default=None)
|
|
17
|
+
"""
|
|
18
|
+
List of excluded task IDs
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
22
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
23
|
+
return super().json(**kwargs_with_defaults)
|
|
24
|
+
|
|
25
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
26
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
27
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
28
|
+
|
|
29
|
+
return deep_union_pydantic_dicts(
|
|
30
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
class Config:
|
|
34
|
+
frozen = True
|
|
35
|
+
smart_union = True
|
|
36
|
+
allow_population_by_field_name = True
|
|
37
|
+
populate_by_name = True
|
|
38
|
+
extra = pydantic_v1.Extra.allow
|
|
39
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ...core.datetime_utils import serialize_datetime
|
|
7
|
+
from ...core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ActionsCreateRequestSelectedItemsIncluded(pydantic_v1.BaseModel):
|
|
11
|
+
all_: bool = pydantic_v1.Field(alias="all")
|
|
12
|
+
"""
|
|
13
|
+
No tasks are selected
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
included: typing.Optional[typing.List[int]] = pydantic_v1.Field(default=None)
|
|
17
|
+
"""
|
|
18
|
+
List of included task IDs
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
22
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
23
|
+
return super().json(**kwargs_with_defaults)
|
|
24
|
+
|
|
25
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
26
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
27
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
28
|
+
|
|
29
|
+
return deep_union_pydantic_dicts(
|
|
30
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
class Config:
|
|
34
|
+
frozen = True
|
|
35
|
+
smart_union = True
|
|
36
|
+
allow_population_by_field_name = True
|
|
37
|
+
populate_by_name = True
|
|
38
|
+
extra = pydantic_v1.Extra.allow
|
|
39
|
+
json_encoders = {dt.datetime: serialize_datetime}
|