superb-ai-onprem 0.1.6__py3-none-any.whl → 0.3.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 superb-ai-onprem might be problematic. Click here for more details.

Files changed (48) hide show
  1. spb_onprem/__init__.py +26 -3
  2. spb_onprem/_version.py +2 -2
  3. spb_onprem/activities/__init__.py +0 -0
  4. spb_onprem/activities/entities/__init__.py +10 -0
  5. spb_onprem/activities/entities/activity.py +39 -0
  6. spb_onprem/activities/entities/activity_history.py +31 -0
  7. spb_onprem/activities/params/__init__.py +23 -0
  8. spb_onprem/activities/params/activities.py +53 -0
  9. spb_onprem/activities/params/activity.py +42 -0
  10. spb_onprem/activities/params/create_activity.py +80 -0
  11. spb_onprem/activities/params/delete_activity.py +23 -0
  12. spb_onprem/activities/params/start_activity.py +59 -0
  13. spb_onprem/activities/params/update_activity.py +79 -0
  14. spb_onprem/activities/params/update_activity_history.py +54 -0
  15. spb_onprem/activities/queries.py +226 -0
  16. spb_onprem/activities/service.py +315 -0
  17. spb_onprem/base_model.py +2 -3
  18. spb_onprem/data/enums/data_type.py +2 -1
  19. spb_onprem/entities.py +15 -1
  20. spb_onprem/exports/__init__.py +9 -0
  21. spb_onprem/exports/entities/__init__.py +7 -0
  22. spb_onprem/exports/entities/export.py +27 -0
  23. spb_onprem/exports/params/__init__.py +19 -0
  24. spb_onprem/exports/params/create_export.py +85 -0
  25. spb_onprem/exports/params/delete_export.py +30 -0
  26. spb_onprem/exports/params/export.py +30 -0
  27. spb_onprem/exports/params/exports.py +74 -0
  28. spb_onprem/exports/params/update_export.py +98 -0
  29. spb_onprem/exports/queries.py +158 -0
  30. spb_onprem/exports/service.py +224 -0
  31. spb_onprem/searches.py +12 -0
  32. spb_onprem/slices/params/slices.py +1 -1
  33. {superb_ai_onprem-0.1.6.dist-info → superb_ai_onprem-0.3.0.dist-info}/METADATA +1 -1
  34. {superb_ai_onprem-0.1.6.dist-info → superb_ai_onprem-0.3.0.dist-info}/RECORD +48 -12
  35. {superb_ai_onprem-0.1.6.dist-info → superb_ai_onprem-0.3.0.dist-info}/top_level.txt +1 -0
  36. tests/__init__.py +1 -0
  37. tests/activities/__init__.py +1 -0
  38. tests/activities/real_test.py +66 -0
  39. tests/activities/test_params.py +67 -0
  40. tests/activities/test_service.py +139 -0
  41. tests/exports/__init__.py +1 -0
  42. tests/exports/real_test.py +130 -0
  43. tests/exports/test_entities.py +236 -0
  44. tests/exports/test_integration.py +191 -0
  45. tests/exports/test_params.py +332 -0
  46. tests/exports/test_service.py +406 -0
  47. {superb_ai_onprem-0.1.6.dist-info → superb_ai_onprem-0.3.0.dist-info}/WHEEL +0 -0
  48. {superb_ai_onprem-0.1.6.dist-info → superb_ai_onprem-0.3.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,85 @@
1
+ from typing import Union
2
+
3
+ from spb_onprem.base_types import Undefined, UndefinedType
4
+ from spb_onprem.exceptions import BadParameterError
5
+ from spb_onprem.data.params import DataListFilter
6
+
7
+
8
+ def create_export_params(
9
+ dataset_id: str,
10
+ location: Union[
11
+ UndefinedType,
12
+ str
13
+ ] = Undefined,
14
+ name: Union[
15
+ UndefinedType,
16
+ str
17
+ ] = Undefined,
18
+ data_filter: Union[
19
+ UndefinedType,
20
+ DataListFilter,
21
+ dict
22
+ ] = Undefined,
23
+ data_count: Union[
24
+ UndefinedType,
25
+ int
26
+ ] = Undefined,
27
+ frame_count: Union[
28
+ UndefinedType,
29
+ int
30
+ ] = Undefined,
31
+ annotation_count: Union[
32
+ UndefinedType,
33
+ int
34
+ ] = Undefined,
35
+ meta: Union[
36
+ UndefinedType,
37
+ dict
38
+ ] = Undefined,
39
+ ):
40
+ """Create parameters for export creation.
41
+
42
+ Args:
43
+ dataset_id (str): The ID of the dataset to create the export for.
44
+ location (Optional[str]): The location where the export will be stored.
45
+ name (Optional[str]): The name of the export.
46
+ data_filter (Optional[DataListFilter | dict]): The search filter of the data.
47
+ data_count (Optional[int]): The number of data items to export.
48
+ frame_count (Optional[int]): The number of frames to export.
49
+ annotation_count (Optional[int]): The number of annotations to export.
50
+ meta (Optional[dict]): The meta information for the export.
51
+
52
+ Returns:
53
+ dict: Parameters for export creation
54
+
55
+ Raises:
56
+ BadParameterError: If required parameters are missing
57
+ """
58
+ if dataset_id is None:
59
+ raise BadParameterError("Dataset ID is required")
60
+
61
+ params = {
62
+ "dataset_id": dataset_id,
63
+ }
64
+
65
+ if location is not Undefined:
66
+ params["location"] = location
67
+ if name is not Undefined:
68
+ params["name"] = name
69
+ if data_filter is not Undefined and data_filter is not None:
70
+ # Handle both DataListFilter objects and plain dicts
71
+ if isinstance(data_filter, DataListFilter):
72
+ params["data_filter"] = data_filter.model_dump(by_alias=True, exclude_unset=True)
73
+ else:
74
+ # Assume it's a dict and use it directly
75
+ params["data_filter"] = data_filter
76
+ if data_count is not Undefined:
77
+ params["data_count"] = data_count
78
+ if frame_count is not Undefined:
79
+ params["frame_count"] = frame_count
80
+ if annotation_count is not Undefined:
81
+ params["annotation_count"] = annotation_count
82
+ if meta is not Undefined:
83
+ params["meta"] = meta
84
+
85
+ return params
@@ -0,0 +1,30 @@
1
+ from spb_onprem.exceptions import BadParameterError
2
+
3
+
4
+ def delete_export_params(
5
+ dataset_id: str,
6
+ export_id: str,
7
+ ):
8
+ """Create parameters for export deletion.
9
+
10
+ Args:
11
+ export_id (str): The ID of the export to delete.
12
+
13
+ Returns:
14
+ dict: Parameters for export deletion
15
+
16
+ Raises:
17
+ BadParameterError: If export_id is missing
18
+ """
19
+ if dataset_id is None:
20
+ raise BadParameterError("Dataset ID is required")
21
+
22
+ if export_id is None:
23
+ raise BadParameterError("Export ID is required")
24
+
25
+ params = {
26
+ "dataset_id": dataset_id,
27
+ "export_id": export_id,
28
+ }
29
+
30
+ return params
@@ -0,0 +1,30 @@
1
+ from spb_onprem.exceptions import BadParameterError
2
+
3
+
4
+ def get_export_params(
5
+ dataset_id: str,
6
+ export_id: str,
7
+ ):
8
+ """Create parameters for getting an export.
9
+
10
+ Args:
11
+ export_id (str): The ID of the export to get.
12
+ dataset_id (Optional[str]): The ID of the dataset to get the export for.
13
+ slice_id (Optional[str]): The ID of the slice to get the export for.
14
+
15
+ Returns:
16
+ dict: Parameters for getting an export
17
+
18
+ Raises:
19
+ BadParameterError: If export_id is missing
20
+ """
21
+ if dataset_id is None:
22
+ raise BadParameterError("Dataset ID is required")
23
+
24
+ if export_id is None:
25
+ raise BadParameterError("Export ID is required")
26
+
27
+ return {
28
+ "dataset_id": dataset_id,
29
+ "export_id": export_id
30
+ }
@@ -0,0 +1,74 @@
1
+ from typing import Optional, List, Union
2
+ from spb_onprem.base_model import CustomBaseModel, Field
3
+ from spb_onprem.base_types import Undefined, UndefinedType
4
+ from spb_onprem.exceptions import BadParameterError
5
+
6
+
7
+ class ExportFilterOptions(CustomBaseModel):
8
+ """Options for filtering exports.
9
+
10
+ Attributes:
11
+ id_in: Filter exports by list of IDs
12
+ name_contains: Filter exports by name containing this string
13
+ name: Filter exports by exact name match
14
+ location_contains: Filter exports by location containing this string
15
+ location: Filter exports by exact location match
16
+ """
17
+ id_in: Optional[List[str]] = Field(None, alias="idIn")
18
+ name_contains: Optional[str] = Field(None, alias="nameContains")
19
+ name: Optional[str] = Field(None, alias="name")
20
+ location_contains: Optional[str] = Field(None, alias="locationContains")
21
+ location: Optional[str] = Field(None, alias="location")
22
+
23
+
24
+ class ExportFilter(CustomBaseModel):
25
+ """Filter criteria for export queries.
26
+
27
+ Attributes:
28
+ must_filter: Conditions that must be met
29
+ not_filter: Conditions that must not be met
30
+ """
31
+ must_filter: Optional[ExportFilterOptions] = Field(None, alias="must")
32
+ not_filter: Optional[ExportFilterOptions] = Field(None, alias="not")
33
+
34
+
35
+ def get_exports_params(
36
+ dataset_id: str,
37
+ export_filter: Union[
38
+ UndefinedType,
39
+ ExportFilter
40
+ ] = Undefined,
41
+ cursor: Union[
42
+ UndefinedType,
43
+ str
44
+ ] = Undefined,
45
+ length: int = 10,
46
+ ):
47
+ """Create parameters for getting exports.
48
+
49
+ Args:
50
+ dataset_id (str): The ID of the dataset to get exports for.
51
+ export_filter (Optional[ExportFilter]): The filter to apply to the exports.
52
+ cursor (Optional[str]): The cursor to use for pagination.
53
+ length (int): The number of exports to get.
54
+
55
+ Returns:
56
+ dict: Parameters for getting exports
57
+
58
+ Raises:
59
+ BadParameterError: If dataset_id is missing
60
+ """
61
+ if dataset_id is None:
62
+ raise BadParameterError("Dataset ID is required")
63
+
64
+ params = {
65
+ "dataset_id": dataset_id,
66
+ "length": length
67
+ }
68
+
69
+ if export_filter is not Undefined and export_filter is not None:
70
+ params["filter"] = export_filter.model_dump(by_alias=True, exclude_unset=True)
71
+ if cursor is not Undefined:
72
+ params["cursor"] = cursor
73
+
74
+ return params
@@ -0,0 +1,98 @@
1
+ from typing import Union
2
+ from datetime import datetime
3
+
4
+ from spb_onprem.base_types import Undefined, UndefinedType
5
+ from spb_onprem.exceptions import BadParameterError
6
+ from spb_onprem.data.params import DataListFilter
7
+
8
+
9
+ def update_export_params(
10
+ dataset_id: str,
11
+ export_id: str,
12
+ location: Union[
13
+ UndefinedType,
14
+ str
15
+ ] = Undefined,
16
+ name: Union[
17
+ UndefinedType,
18
+ str
19
+ ] = Undefined,
20
+ data_filter: Union[
21
+ UndefinedType,
22
+ DataListFilter,
23
+ dict
24
+ ] = Undefined,
25
+ data_count: Union[
26
+ UndefinedType,
27
+ int
28
+ ] = Undefined,
29
+ frame_count: Union[
30
+ UndefinedType,
31
+ int
32
+ ] = Undefined,
33
+ annotation_count: Union[
34
+ UndefinedType,
35
+ int
36
+ ] = Undefined,
37
+ meta: Union[
38
+ UndefinedType,
39
+ dict
40
+ ] = Undefined,
41
+ completed_at: Union[
42
+ UndefinedType,
43
+ datetime
44
+ ] = Undefined,
45
+ ):
46
+ """Create parameters for export update.
47
+
48
+ Args:
49
+ dataset_id (str): The ID of the dataset to update the export for.
50
+ export_id (str): The ID of the export to update.
51
+ location (Optional[str]): The location where the export will be stored.
52
+ name (Optional[str]): The name of the export.
53
+ data_filter (Optional[DataListFilter | dict]): The search filter of the data.
54
+ data_count (Optional[int]): The number of data items to export.
55
+ frame_count (Optional[int]): The number of frames to export.
56
+ annotation_count (Optional[int]): The number of annotations to export.
57
+ meta (Optional[dict]): The meta information for the export.
58
+ completed_at (Optional[datetime]): The completed time of the export.
59
+
60
+ Returns:
61
+ dict: Parameters for export update
62
+
63
+ Raises:
64
+ BadParameterError: If required parameters are missing
65
+ """
66
+ if dataset_id is None:
67
+ raise BadParameterError("Dataset ID is required")
68
+ if export_id is None:
69
+ raise BadParameterError("Export ID is required")
70
+
71
+ params = {
72
+ "dataset_id": dataset_id,
73
+ "export_id": export_id,
74
+ }
75
+
76
+ if location is not Undefined:
77
+ params["location"] = location
78
+ if name is not Undefined:
79
+ params["name"] = name
80
+ if data_filter is not Undefined and data_filter is not None:
81
+ # Handle both DataListFilter objects and plain dicts
82
+ if isinstance(data_filter, DataListFilter):
83
+ params["data_filter"] = data_filter.model_dump(by_alias=True, exclude_unset=True)
84
+ else:
85
+ # Assume it's a dict and use it directly
86
+ params["data_filter"] = data_filter
87
+ if data_count is not Undefined:
88
+ params["data_count"] = data_count
89
+ if frame_count is not Undefined:
90
+ params["frame_count"] = frame_count
91
+ if annotation_count is not Undefined:
92
+ params["annotation_count"] = annotation_count
93
+ if meta is not Undefined:
94
+ params["meta"] = meta
95
+ if completed_at is not Undefined:
96
+ params["completed_at"] = completed_at
97
+
98
+ return params
@@ -0,0 +1,158 @@
1
+ from spb_onprem.exports.params import (
2
+ get_exports_params,
3
+ get_export_params,
4
+ create_export_params,
5
+ delete_export_params,
6
+ update_export_params,
7
+ )
8
+
9
+
10
+ class Schemas:
11
+ """Schemas for exports queries
12
+ """
13
+ EXPORT = '''
14
+ id
15
+ datasetId
16
+ name
17
+ dataFilter
18
+ location
19
+ dataCount
20
+ annotationCount
21
+ frameCount
22
+ meta
23
+ createdAt
24
+ createdBy
25
+ updatedAt
26
+ updatedBy
27
+ completedAt
28
+ '''
29
+
30
+ EXPORT_PAGE = f'''
31
+ exports {{
32
+ {EXPORT}
33
+ }}
34
+ next
35
+ totalCount
36
+ '''
37
+
38
+
39
+ class Queries:
40
+ '''
41
+ Queries for exports
42
+ '''
43
+
44
+ GET_EXPORTS = {
45
+ "name": "exports",
46
+ "query": f'''
47
+ query exports(
48
+ $dataset_id: ID!,
49
+ $filter: ExportFilter,
50
+ $cursor: String,
51
+ $length: Int
52
+ $orderBy: ExportOrderBy
53
+ ) {{
54
+ exports(
55
+ datasetId: $dataset_id,
56
+ filter: $filter,
57
+ cursor: $cursor,
58
+ length: $length,
59
+ orderBy: $orderBy
60
+ ) {{
61
+ {Schemas.EXPORT_PAGE}
62
+ }}
63
+ }}
64
+ ''',
65
+ "variables": get_exports_params
66
+ }
67
+
68
+ GET_EXPORT = {
69
+ "name": "export",
70
+ "query": f'''
71
+ query export(
72
+ $dataset_id: ID!,
73
+ $export_id: ID!
74
+ ) {{
75
+ export(datasetId: $dataset_id, id: $export_id) {{
76
+ {Schemas.EXPORT}
77
+ }}
78
+ }}
79
+ ''',
80
+ "variables": get_export_params
81
+ }
82
+
83
+ CREATE_EXPORT = {
84
+ "name": "createExport",
85
+ "query": f'''
86
+ mutation createExport(
87
+ $dataset_id: ID!,
88
+ $location: String,
89
+ $name: String,
90
+ $data_filter: JSONObject,
91
+ $data_count: Int,
92
+ $frame_count: Int,
93
+ $annotation_count: Int,
94
+ $meta: JSONObject
95
+ ) {{
96
+ createExport(
97
+ datasetId: $dataset_id,
98
+ location: $location,
99
+ name: $name,
100
+ dataFilter: $data_filter,
101
+ dataCount: $data_count,
102
+ frameCount: $frame_count,
103
+ annotationCount: $annotation_count,
104
+ meta: $meta
105
+ ) {{
106
+ {Schemas.EXPORT}
107
+ }}
108
+ }}
109
+ ''',
110
+ "variables": create_export_params
111
+ }
112
+
113
+ UPDATE_EXPORT = {
114
+ "name": "updateExport",
115
+ "query": f'''
116
+ mutation updateExport(
117
+ $dataset_id: ID!,
118
+ $export_id: ID!,
119
+ $location: String,
120
+ $name: String,
121
+ $data_filter: JSONObject,
122
+ $data_count: Int,
123
+ $frame_count: Int,
124
+ $annotation_count: Int,
125
+ $meta: JSONObject,
126
+ $completed_at: DateTime
127
+ ) {{
128
+ updateExport(
129
+ datasetId: $dataset_id,
130
+ id: $export_id,
131
+ location: $location,
132
+ name: $name,
133
+ dataFilter: $data_filter,
134
+ dataCount: $data_count,
135
+ frameCount: $frame_count,
136
+ annotationCount: $annotation_count,
137
+ meta: $meta,
138
+ completedAt: $completed_at
139
+ ) {{
140
+ {Schemas.EXPORT}
141
+ }}
142
+ }}
143
+ ''',
144
+ "variables": update_export_params
145
+ }
146
+
147
+ DELETE_EXPORT = {
148
+ "name": "deleteExport",
149
+ "query": '''
150
+ mutation deleteExport(
151
+ $dataset_id: ID!,
152
+ $export_id: ID!
153
+ ) {
154
+ deleteExport(datasetId: $dataset_id, id: $export_id)
155
+ }
156
+ ''',
157
+ "variables": delete_export_params
158
+ }
@@ -0,0 +1,224 @@
1
+ from typing import Optional, List, Union
2
+
3
+ from spb_onprem.base_service import BaseService
4
+ from spb_onprem.base_types import (
5
+ Undefined,
6
+ UndefinedType,
7
+ )
8
+ from spb_onprem.data.params import DataListFilter
9
+
10
+ from .entities import Export
11
+ from .params import (
12
+ ExportFilter,
13
+ )
14
+ from .queries import Queries
15
+
16
+
17
+ class ExportService(BaseService):
18
+ """Service class for handling export-related operations."""
19
+
20
+ def create_export(
21
+ self,
22
+ dataset_id: str,
23
+ name: Union[
24
+ UndefinedType,
25
+ str
26
+ ] = Undefined,
27
+ data_filter: Union[
28
+ UndefinedType,
29
+ DataListFilter,
30
+ dict
31
+ ] = Undefined,
32
+ data_count: Union[
33
+ UndefinedType,
34
+ int
35
+ ] = Undefined,
36
+ frame_count: Union[
37
+ UndefinedType,
38
+ int
39
+ ] = Undefined,
40
+ annotation_count: Union[
41
+ UndefinedType,
42
+ int
43
+ ] = Undefined,
44
+ meta: Union[
45
+ UndefinedType,
46
+ dict
47
+ ] = Undefined,
48
+ ) -> Export:
49
+ """Create an export.
50
+
51
+ Args:
52
+ dataset_id (str): The ID of the dataset to create the export for.
53
+ name (Optional[str]): The name of the export.
54
+ data_filter (Optional[DataListFilter | dict]): The search filter of the data.
55
+ data_count (Optional[int]): The number of data items to export.
56
+ frame_count (Optional[int]): The number of frames to export.
57
+ annotation_count (Optional[int]): The number of annotations to export.
58
+ meta (Optional[dict]): The meta information for the export.
59
+ """
60
+ response = self.request_gql(
61
+ Queries.CREATE_EXPORT,
62
+ Queries.CREATE_EXPORT["variables"](
63
+ dataset_id=dataset_id,
64
+ name=name,
65
+ data_filter=data_filter,
66
+ data_count=data_count,
67
+ frame_count=frame_count,
68
+ annotation_count=annotation_count,
69
+ meta=meta,
70
+ )
71
+ )
72
+ return Export.model_validate(response)
73
+
74
+ def get_exports(
75
+ self,
76
+ dataset_id: str,
77
+ export_filter: Optional[ExportFilter] = None,
78
+ cursor: Optional[str] = None,
79
+ length: int = 10
80
+ ) -> tuple[List[Export], Optional[str], int]:
81
+ """Get exports.
82
+
83
+ Args:
84
+ dataset_id (str): The ID of the dataset to get exports for.
85
+ export_filter (Optional[ExportsFilterOptions]): The filter to apply to the exports.
86
+ cursor (Optional[str]): The cursor to use for pagination.
87
+ length (int): The number of exports to get.
88
+
89
+ Returns:
90
+ tuple[List[Export], Optional[str], int]: A tuple containing the exports, the next cursor, and the total count of exports.
91
+ """
92
+ response = self.request_gql(
93
+ Queries.GET_EXPORTS,
94
+ Queries.GET_EXPORTS["variables"](
95
+ dataset_id=dataset_id,
96
+ export_filter=export_filter,
97
+ cursor=cursor,
98
+ length=length,
99
+ )
100
+ )
101
+ exports_dict = response.get("exports", [])
102
+ return (
103
+ [Export.model_validate(export_dict) for export_dict in exports_dict],
104
+ response.get("next"),
105
+ response.get("totalCount"),
106
+ )
107
+
108
+ def get_export(
109
+ self,
110
+ dataset_id: str,
111
+ export_id: str,
112
+ ) -> Export:
113
+ """Get an export.
114
+
115
+ Args:
116
+ dataset_id (str): The ID of the dataset to get the export for.
117
+ export_id (str): The ID of the export to get.
118
+
119
+ Returns:
120
+ Export: The export object.
121
+ """
122
+ response = self.request_gql(
123
+ Queries.GET_EXPORT,
124
+ Queries.GET_EXPORT["variables"](
125
+ dataset_id=dataset_id,
126
+ export_id=export_id,
127
+ )
128
+ )
129
+ return Export.model_validate(response)
130
+
131
+ def update_export(
132
+ self,
133
+ dataset_id: str,
134
+ export_id: str,
135
+ location: Union[
136
+ UndefinedType,
137
+ str
138
+ ] = Undefined,
139
+ name: Union[
140
+ UndefinedType,
141
+ str
142
+ ] = Undefined,
143
+ data_filter: Union[
144
+ UndefinedType,
145
+ DataListFilter,
146
+ dict
147
+ ] = Undefined,
148
+ data_count: Union[
149
+ UndefinedType,
150
+ int
151
+ ] = Undefined,
152
+ frame_count: Union[
153
+ UndefinedType,
154
+ int
155
+ ] = Undefined,
156
+ annotation_count: Union[
157
+ UndefinedType,
158
+ int
159
+ ] = Undefined,
160
+ meta: Union[
161
+ UndefinedType,
162
+ dict
163
+ ] = Undefined,
164
+ completed_at: Union[
165
+ UndefinedType,
166
+ str
167
+ ] = Undefined,
168
+ ) -> Export:
169
+ """Update an export.
170
+
171
+ Args:
172
+ dataset_id (str): The ID of the dataset to update the export for.
173
+ export_id (str): The ID of the export to update.
174
+ location (Optional[str]): The location where the export will be stored.
175
+ name (Optional[str]): The name of the export.
176
+ data_filter (Optional[DataListFilter | dict]): The search filter of the data.
177
+ data_count (Optional[int]): The number of data items to export.
178
+ frame_count (Optional[int]): The number of frames to export.
179
+ annotation_count (Optional[int]): The number of annotations to export.
180
+ meta (Optional[dict]): The meta information for the export.
181
+ completed_at (Optional[str]): The completed time of the export.
182
+
183
+ Returns:
184
+ Export: The updated export object.
185
+ """
186
+ response = self.request_gql(
187
+ Queries.UPDATE_EXPORT,
188
+ Queries.UPDATE_EXPORT["variables"](
189
+ dataset_id=dataset_id,
190
+ export_id=export_id,
191
+ location=location,
192
+ name=name,
193
+ data_filter=data_filter,
194
+ data_count=data_count,
195
+ frame_count=frame_count,
196
+ annotation_count=annotation_count,
197
+ meta=meta,
198
+ completed_at=completed_at,
199
+ )
200
+ )
201
+ return Export.model_validate(response)
202
+
203
+ def delete_export(
204
+ self,
205
+ dataset_id: str,
206
+ export_id: str,
207
+ ) -> bool:
208
+ """Delete an export.
209
+
210
+ Args:
211
+ dataset_id (str): The ID of the dataset to delete the export for.
212
+ export_id (str): The ID of the export to delete.
213
+
214
+ Returns:
215
+ bool: True if the export was deleted, False otherwise.
216
+ """
217
+ response = self.request_gql(
218
+ Queries.DELETE_EXPORT,
219
+ Queries.DELETE_EXPORT["variables"](
220
+ dataset_id=dataset_id,
221
+ export_id=export_id,
222
+ )
223
+ )
224
+ return response