redblack-python-sdk 0.1.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.
@@ -0,0 +1,260 @@
1
+ """Cash-action reads, writes, and deliberately separated bulk deletion."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from collections.abc import Iterator, Mapping, Sequence
6
+ from typing import Final, Literal, overload
7
+
8
+ from ..models import (
9
+ CashAction,
10
+ CashActionCreate,
11
+ CashActionCreateResult,
12
+ CashActionDeleteResult,
13
+ CashActionDetails,
14
+ CashActionUpdate,
15
+ CashActionUpdateResult,
16
+ )
17
+ from ..odata import DEFAULT_PAGE_SIZE
18
+ from ..pagination import Page
19
+ from ._base import (
20
+ ApiResponseProtocol,
21
+ HttpInfoMode,
22
+ body_value,
23
+ require_positive_identifier,
24
+ )
25
+ from ._collections import CollectionResource
26
+
27
+
28
+ class _DeleteAllCashActionsConfirmation:
29
+ __slots__ = ()
30
+
31
+ def __repr__(self) -> str:
32
+ return "CONFIRM_DELETE_ALL_CASH_ACTIONS"
33
+
34
+
35
+ CONFIRM_DELETE_ALL_CASH_ACTIONS: Final = _DeleteAllCashActionsConfirmation()
36
+ """Identity-checked token required by :meth:`CashActionsResource.delete_all`."""
37
+
38
+
39
+ class CashActionsResource(CollectionResource[HttpInfoMode]):
40
+ LIST_OPERATION_ID = "CashActions_Query"
41
+ OPERATION_IDS = frozenset(
42
+ {
43
+ "CashActions_Add",
44
+ LIST_OPERATION_ID,
45
+ "CashActions_Get",
46
+ "CashActions_Update",
47
+ "CashActions_DeleteCashActions",
48
+ }
49
+ )
50
+
51
+ @overload
52
+ def list(
53
+ self: CashActionsResource[Literal[False]],
54
+ *,
55
+ filter: str | None = None,
56
+ order_by: str | None = None,
57
+ top: int | None = None,
58
+ skip: int | None = None,
59
+ count: bool | None = None,
60
+ ) -> Page[CashAction]: ...
61
+
62
+ @overload
63
+ def list(
64
+ self: CashActionsResource[Literal[True]],
65
+ *,
66
+ filter: str | None = None,
67
+ order_by: str | None = None,
68
+ top: int | None = None,
69
+ skip: int | None = None,
70
+ count: bool | None = None,
71
+ ) -> ApiResponseProtocol[Page[CashAction]]: ...
72
+
73
+ def list(
74
+ self,
75
+ *,
76
+ filter: str | None = None,
77
+ order_by: str | None = None,
78
+ top: int | None = None,
79
+ skip: int | None = None,
80
+ count: bool | None = None,
81
+ ) -> Page[CashAction] | ApiResponseProtocol[Page[CashAction]]:
82
+ return self._list(filter=filter, order_by=order_by, top=top, skip=skip, count=count)
83
+
84
+ def iter_pages(
85
+ self,
86
+ *,
87
+ filter: str | None = None,
88
+ order_by: str | None = None,
89
+ count: bool | None = None,
90
+ start_skip: int = 0,
91
+ page_size: int = DEFAULT_PAGE_SIZE,
92
+ max_items: int | None = None,
93
+ ) -> Iterator[Page[CashAction]]:
94
+ return self._iter_pages(
95
+ filter=filter,
96
+ order_by=order_by,
97
+ count=count,
98
+ start_skip=start_skip,
99
+ page_size=page_size,
100
+ max_items=max_items,
101
+ )
102
+
103
+ def iter_all(
104
+ self,
105
+ *,
106
+ filter: str | None = None,
107
+ order_by: str | None = None,
108
+ count: bool | None = None,
109
+ start_skip: int = 0,
110
+ page_size: int = DEFAULT_PAGE_SIZE,
111
+ max_items: int | None = None,
112
+ ) -> Iterator[CashAction]:
113
+ return self._iter_all(
114
+ filter=filter,
115
+ order_by=order_by,
116
+ count=count,
117
+ start_skip=start_skip,
118
+ page_size=page_size,
119
+ max_items=max_items,
120
+ )
121
+
122
+ @overload
123
+ def create(
124
+ self: CashActionsResource[Literal[False]],
125
+ cash_action: CashActionCreate | Mapping[str, object],
126
+ ) -> CashActionCreateResult: ...
127
+
128
+ @overload
129
+ def create(
130
+ self: CashActionsResource[Literal[True]],
131
+ cash_action: CashActionCreate | Mapping[str, object],
132
+ ) -> ApiResponseProtocol[CashActionCreateResult]: ...
133
+
134
+ def create(
135
+ self, cash_action: CashActionCreate | Mapping[str, object]
136
+ ) -> CashActionCreateResult | ApiResponseProtocol[CashActionCreateResult]:
137
+ response = self._request("CashActions_Add", json=body_value(cash_action))
138
+ return self._finish(response, response.data)
139
+
140
+ @overload
141
+ def get(
142
+ self: CashActionsResource[Literal[False]], cash_action_id: int
143
+ ) -> CashActionDetails: ...
144
+
145
+ @overload
146
+ def get(
147
+ self: CashActionsResource[Literal[True]], cash_action_id: int
148
+ ) -> ApiResponseProtocol[CashActionDetails]: ...
149
+
150
+ def get(
151
+ self, cash_action_id: int
152
+ ) -> CashActionDetails | ApiResponseProtocol[CashActionDetails]:
153
+ require_positive_identifier("cash_action_id", cash_action_id)
154
+ response = self._request("CashActions_Get", path_params={"id": cash_action_id})
155
+ return self._finish(response, response.data)
156
+
157
+ @overload
158
+ def update(
159
+ self: CashActionsResource[Literal[False]],
160
+ cash_action_id: int,
161
+ patch: CashActionUpdate | Mapping[str, object],
162
+ ) -> CashActionUpdateResult: ...
163
+
164
+ @overload
165
+ def update(
166
+ self: CashActionsResource[Literal[True]],
167
+ cash_action_id: int,
168
+ patch: CashActionUpdate | Mapping[str, object],
169
+ ) -> ApiResponseProtocol[CashActionUpdateResult]: ...
170
+
171
+ def update(
172
+ self,
173
+ cash_action_id: int,
174
+ patch: CashActionUpdate | Mapping[str, object],
175
+ ) -> CashActionUpdateResult | ApiResponseProtocol[CashActionUpdateResult]:
176
+ require_positive_identifier("cash_action_id", cash_action_id)
177
+ response = self._request(
178
+ "CashActions_Update",
179
+ path_params={"id": cash_action_id},
180
+ json=body_value(patch),
181
+ )
182
+ return self._finish(response, response.data)
183
+
184
+ @overload
185
+ def delete_specific(
186
+ self: CashActionsResource[Literal[False]], cash_action_ids: Sequence[int]
187
+ ) -> CashActionDeleteResult | None: ...
188
+
189
+ @overload
190
+ def delete_specific(
191
+ self: CashActionsResource[Literal[True]], cash_action_ids: Sequence[int]
192
+ ) -> ApiResponseProtocol[CashActionDeleteResult | None]: ...
193
+
194
+ def delete_specific(
195
+ self, cash_action_ids: Sequence[int]
196
+ ) -> CashActionDeleteResult | None | ApiResponseProtocol[CashActionDeleteResult | None]:
197
+ """Delete only the explicit IDs; an empty sequence is rejected."""
198
+
199
+ ids = list(cash_action_ids)
200
+ if not ids:
201
+ raise ValueError("cash_action_ids must contain at least one id")
202
+ for cash_action_id in ids:
203
+ require_positive_identifier("cash_action_id", cash_action_id)
204
+ response = self._request(
205
+ "CashActions_DeleteCashActions",
206
+ json={"criteria": {"mode": 1, "ids": ids, "filter": None}},
207
+ )
208
+ return self._finish(response, response.data)
209
+
210
+ @overload
211
+ def delete_filtered(
212
+ self: CashActionsResource[Literal[False]], filter: str
213
+ ) -> CashActionDeleteResult | None: ...
214
+
215
+ @overload
216
+ def delete_filtered(
217
+ self: CashActionsResource[Literal[True]], filter: str
218
+ ) -> ApiResponseProtocol[CashActionDeleteResult | None]: ...
219
+
220
+ def delete_filtered(
221
+ self, filter: str
222
+ ) -> CashActionDeleteResult | None | ApiResponseProtocol[CashActionDeleteResult | None]:
223
+ """Delete only cash actions selected by an explicit OData filter."""
224
+
225
+ if not isinstance(filter, str):
226
+ raise TypeError("filter must be a string")
227
+ if not filter.strip():
228
+ raise ValueError("filter must not be empty")
229
+ response = self._request(
230
+ "CashActions_DeleteCashActions",
231
+ json={"criteria": {"mode": 0, "ids": None, "filter": filter}},
232
+ )
233
+ return self._finish(response, response.data)
234
+
235
+ @overload
236
+ def delete_all(
237
+ self: CashActionsResource[Literal[False]],
238
+ *,
239
+ confirmation: _DeleteAllCashActionsConfirmation,
240
+ ) -> CashActionDeleteResult | None: ...
241
+
242
+ @overload
243
+ def delete_all(
244
+ self: CashActionsResource[Literal[True]],
245
+ *,
246
+ confirmation: _DeleteAllCashActionsConfirmation,
247
+ ) -> ApiResponseProtocol[CashActionDeleteResult | None]: ...
248
+
249
+ def delete_all(
250
+ self, *, confirmation: _DeleteAllCashActionsConfirmation
251
+ ) -> CashActionDeleteResult | None | ApiResponseProtocol[CashActionDeleteResult | None]:
252
+ """Delete every visible cash action after identity-checked confirmation."""
253
+
254
+ if confirmation is not CONFIRM_DELETE_ALL_CASH_ACTIONS:
255
+ raise ValueError("delete_all requires confirmation=CONFIRM_DELETE_ALL_CASH_ACTIONS")
256
+ response = self._request(
257
+ "CashActions_DeleteCashActions",
258
+ json={"criteria": {"mode": 2, "ids": None, "filter": None}},
259
+ )
260
+ return self._finish(response, response.data)
@@ -0,0 +1,144 @@
1
+ """Equivalents resource operations."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from collections.abc import Iterator
6
+ from typing import Literal, overload
7
+
8
+ from ..models import Equivalent, EquivalentExportJob
9
+ from ..odata import DEFAULT_PAGE_SIZE
10
+ from ..pagination import Page
11
+ from ._base import ApiResponseProtocol, HttpInfoMode
12
+ from ._collections import CollectionResource
13
+ from ._exports import ExportJobHandle, ExportOperations, ExportResource
14
+
15
+
16
+ class EquivalentsResource(CollectionResource[HttpInfoMode], ExportResource[HttpInfoMode]):
17
+ """Equivalents, including exports present in the operation contract.
18
+
19
+ The narrative export guide is narrower than the normalized operation
20
+ contract. Live support for this export family still needs UAT evidence.
21
+ """
22
+
23
+ LIST_OPERATION_ID = "Equivalent_QueryEquivalents"
24
+ EXPORT_OPERATIONS = ExportOperations(
25
+ create="Equivalents_ExportJob",
26
+ status="Equivalents_GetExportJobStatus",
27
+ file="Equivalents_GetExportFile",
28
+ body_required=True,
29
+ )
30
+ OPERATION_IDS = frozenset(
31
+ {
32
+ LIST_OPERATION_ID,
33
+ EXPORT_OPERATIONS.create,
34
+ EXPORT_OPERATIONS.status,
35
+ EXPORT_OPERATIONS.file,
36
+ }
37
+ )
38
+
39
+ @overload
40
+ def list(
41
+ self: EquivalentsResource[Literal[False]],
42
+ *,
43
+ filter: str | None = None,
44
+ order_by: str | None = None,
45
+ top: int | None = None,
46
+ skip: int | None = None,
47
+ count: bool | None = None,
48
+ ) -> Page[Equivalent]: ...
49
+
50
+ @overload
51
+ def list(
52
+ self: EquivalentsResource[Literal[True]],
53
+ *,
54
+ filter: str | None = None,
55
+ order_by: str | None = None,
56
+ top: int | None = None,
57
+ skip: int | None = None,
58
+ count: bool | None = None,
59
+ ) -> ApiResponseProtocol[Page[Equivalent]]: ...
60
+
61
+ def list(
62
+ self,
63
+ *,
64
+ filter: str | None = None,
65
+ order_by: str | None = None,
66
+ top: int | None = None,
67
+ skip: int | None = None,
68
+ count: bool | None = None,
69
+ ) -> Page[Equivalent] | ApiResponseProtocol[Page[Equivalent]]:
70
+ return self._list(filter=filter, order_by=order_by, top=top, skip=skip, count=count)
71
+
72
+ def iter_pages(
73
+ self,
74
+ *,
75
+ filter: str | None = None,
76
+ order_by: str | None = None,
77
+ count: bool | None = None,
78
+ start_skip: int = 0,
79
+ page_size: int = DEFAULT_PAGE_SIZE,
80
+ max_items: int | None = None,
81
+ ) -> Iterator[Page[Equivalent]]:
82
+ return self._iter_pages(
83
+ filter=filter,
84
+ order_by=order_by,
85
+ count=count,
86
+ start_skip=start_skip,
87
+ page_size=page_size,
88
+ max_items=max_items,
89
+ )
90
+
91
+ def iter_all(
92
+ self,
93
+ *,
94
+ filter: str | None = None,
95
+ order_by: str | None = None,
96
+ count: bool | None = None,
97
+ start_skip: int = 0,
98
+ page_size: int = DEFAULT_PAGE_SIZE,
99
+ max_items: int | None = None,
100
+ ) -> Iterator[Equivalent]:
101
+ return self._iter_all(
102
+ filter=filter,
103
+ order_by=order_by,
104
+ count=count,
105
+ start_skip=start_skip,
106
+ page_size=page_size,
107
+ max_items=max_items,
108
+ )
109
+
110
+ @overload
111
+ def create_export(
112
+ self: EquivalentsResource[Literal[False]], *, filter: str | None = None
113
+ ) -> ExportJobHandle[EquivalentExportJob]: ...
114
+
115
+ @overload
116
+ def create_export(
117
+ self: EquivalentsResource[Literal[True]], *, filter: str | None = None
118
+ ) -> ApiResponseProtocol[ExportJobHandle[EquivalentExportJob]]: ...
119
+
120
+ def create_export(
121
+ self, *, filter: str | None = None
122
+ ) -> (
123
+ ExportJobHandle[EquivalentExportJob]
124
+ | ApiResponseProtocol[ExportJobHandle[EquivalentExportJob]]
125
+ ):
126
+ return self._create_export(filter=filter)
127
+
128
+ @overload
129
+ def get_export(
130
+ self: EquivalentsResource[Literal[False]], job_id: int
131
+ ) -> ExportJobHandle[EquivalentExportJob]: ...
132
+
133
+ @overload
134
+ def get_export(
135
+ self: EquivalentsResource[Literal[True]], job_id: int
136
+ ) -> ApiResponseProtocol[ExportJobHandle[EquivalentExportJob]]: ...
137
+
138
+ def get_export(
139
+ self, job_id: int
140
+ ) -> (
141
+ ExportJobHandle[EquivalentExportJob]
142
+ | ApiResponseProtocol[ExportJobHandle[EquivalentExportJob]]
143
+ ):
144
+ return self._get_export(job_id)
@@ -0,0 +1,138 @@
1
+ """Households resource operations."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from collections.abc import Iterator
6
+ from typing import Literal, overload
7
+
8
+ from ..models import Household, HouseholdExportJob
9
+ from ..odata import DEFAULT_PAGE_SIZE
10
+ from ..pagination import Page
11
+ from ._base import ApiResponseProtocol, HttpInfoMode
12
+ from ._collections import CollectionResource
13
+ from ._exports import ExportJobHandle, ExportOperations, ExportResource
14
+
15
+
16
+ class HouseholdsResource(CollectionResource[HttpInfoMode], ExportResource[HttpInfoMode]):
17
+ LIST_OPERATION_ID = "Households_QueryHouseholds"
18
+ EXPORT_OPERATIONS = ExportOperations(
19
+ create="Households_BulkExport",
20
+ status="Households_GetBulkExportSessionStatus",
21
+ file="Households_GetBulkExportFile",
22
+ body_required=False,
23
+ )
24
+ OPERATION_IDS = frozenset(
25
+ {
26
+ LIST_OPERATION_ID,
27
+ EXPORT_OPERATIONS.create,
28
+ EXPORT_OPERATIONS.status,
29
+ EXPORT_OPERATIONS.file,
30
+ }
31
+ )
32
+
33
+ @overload
34
+ def list(
35
+ self: HouseholdsResource[Literal[False]],
36
+ *,
37
+ filter: str | None = None,
38
+ order_by: str | None = None,
39
+ top: int | None = None,
40
+ skip: int | None = None,
41
+ count: bool | None = None,
42
+ ) -> Page[Household]: ...
43
+
44
+ @overload
45
+ def list(
46
+ self: HouseholdsResource[Literal[True]],
47
+ *,
48
+ filter: str | None = None,
49
+ order_by: str | None = None,
50
+ top: int | None = None,
51
+ skip: int | None = None,
52
+ count: bool | None = None,
53
+ ) -> ApiResponseProtocol[Page[Household]]: ...
54
+
55
+ def list(
56
+ self,
57
+ *,
58
+ filter: str | None = None,
59
+ order_by: str | None = None,
60
+ top: int | None = None,
61
+ skip: int | None = None,
62
+ count: bool | None = None,
63
+ ) -> Page[Household] | ApiResponseProtocol[Page[Household]]:
64
+ return self._list(filter=filter, order_by=order_by, top=top, skip=skip, count=count)
65
+
66
+ def iter_pages(
67
+ self,
68
+ *,
69
+ filter: str | None = None,
70
+ order_by: str | None = None,
71
+ count: bool | None = None,
72
+ start_skip: int = 0,
73
+ page_size: int = DEFAULT_PAGE_SIZE,
74
+ max_items: int | None = None,
75
+ ) -> Iterator[Page[Household]]:
76
+ return self._iter_pages(
77
+ filter=filter,
78
+ order_by=order_by,
79
+ count=count,
80
+ start_skip=start_skip,
81
+ page_size=page_size,
82
+ max_items=max_items,
83
+ )
84
+
85
+ def iter_all(
86
+ self,
87
+ *,
88
+ filter: str | None = None,
89
+ order_by: str | None = None,
90
+ count: bool | None = None,
91
+ start_skip: int = 0,
92
+ page_size: int = DEFAULT_PAGE_SIZE,
93
+ max_items: int | None = None,
94
+ ) -> Iterator[Household]:
95
+ return self._iter_all(
96
+ filter=filter,
97
+ order_by=order_by,
98
+ count=count,
99
+ start_skip=start_skip,
100
+ page_size=page_size,
101
+ max_items=max_items,
102
+ )
103
+
104
+ @overload
105
+ def create_export(
106
+ self: HouseholdsResource[Literal[False]], *, filter: str | None = None
107
+ ) -> ExportJobHandle[HouseholdExportJob]: ...
108
+
109
+ @overload
110
+ def create_export(
111
+ self: HouseholdsResource[Literal[True]], *, filter: str | None = None
112
+ ) -> ApiResponseProtocol[ExportJobHandle[HouseholdExportJob]]: ...
113
+
114
+ def create_export(
115
+ self, *, filter: str | None = None
116
+ ) -> (
117
+ ExportJobHandle[HouseholdExportJob]
118
+ | ApiResponseProtocol[ExportJobHandle[HouseholdExportJob]]
119
+ ):
120
+ return self._create_export(filter=filter)
121
+
122
+ @overload
123
+ def get_export(
124
+ self: HouseholdsResource[Literal[False]], job_id: int
125
+ ) -> ExportJobHandle[HouseholdExportJob]: ...
126
+
127
+ @overload
128
+ def get_export(
129
+ self: HouseholdsResource[Literal[True]], job_id: int
130
+ ) -> ApiResponseProtocol[ExportJobHandle[HouseholdExportJob]]: ...
131
+
132
+ def get_export(
133
+ self, job_id: int
134
+ ) -> (
135
+ ExportJobHandle[HouseholdExportJob]
136
+ | ApiResponseProtocol[ExportJobHandle[HouseholdExportJob]]
137
+ ):
138
+ return self._get_export(job_id)
@@ -0,0 +1,118 @@
1
+ """Trade Blotter and Trade Reconciliation order queries (API 2026.3.0)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from collections.abc import Iterator
6
+ from typing import Literal, overload
7
+
8
+ from ..models import Order, OrderFilterType
9
+ from ..odata import DEFAULT_PAGE_SIZE
10
+ from ..pagination import Page
11
+ from ._base import ApiResponseProtocol, HttpInfoMode
12
+ from ._collections import CollectionResource
13
+
14
+
15
+ class OrdersResource(CollectionResource[HttpInfoMode]):
16
+ """List active/deleted blotter orders or orders in reconciliation.
17
+
18
+ Orders still in review sets use ``review_sets.list_pending_orders()``.
19
+ Omitting ``filter_type`` leaves the server default (active orders) intact.
20
+ """
21
+
22
+ LIST_OPERATION_ID = "Orders_QueryOrders"
23
+ OPERATION_IDS = frozenset({LIST_OPERATION_ID})
24
+
25
+ @overload
26
+ def list(
27
+ self: OrdersResource[Literal[False]],
28
+ *,
29
+ filter_type: OrderFilterType | Literal[0, 1, 2] | None = None,
30
+ filter: str | None = None,
31
+ order_by: str | None = None,
32
+ top: int | None = None,
33
+ skip: int | None = None,
34
+ count: bool | None = None,
35
+ ) -> Page[Order]: ...
36
+
37
+ @overload
38
+ def list(
39
+ self: OrdersResource[Literal[True]],
40
+ *,
41
+ filter_type: OrderFilterType | Literal[0, 1, 2] | None = None,
42
+ filter: str | None = None,
43
+ order_by: str | None = None,
44
+ top: int | None = None,
45
+ skip: int | None = None,
46
+ count: bool | None = None,
47
+ ) -> ApiResponseProtocol[Page[Order]]: ...
48
+
49
+ def list(
50
+ self,
51
+ *,
52
+ filter_type: OrderFilterType | Literal[0, 1, 2] | None = None,
53
+ filter: str | None = None,
54
+ order_by: str | None = None,
55
+ top: int | None = None,
56
+ skip: int | None = None,
57
+ count: bool | None = None,
58
+ ) -> Page[Order] | ApiResponseProtocol[Page[Order]]:
59
+ return self._list(
60
+ filter=filter,
61
+ order_by=order_by,
62
+ top=top,
63
+ skip=skip,
64
+ count=count,
65
+ extra_query=_filter_query(filter_type),
66
+ )
67
+
68
+ def iter_pages(
69
+ self,
70
+ *,
71
+ filter_type: OrderFilterType | Literal[0, 1, 2] | None = None,
72
+ filter: str | None = None,
73
+ order_by: str | None = None,
74
+ count: bool | None = None,
75
+ start_skip: int = 0,
76
+ page_size: int = DEFAULT_PAGE_SIZE,
77
+ max_items: int | None = None,
78
+ ) -> Iterator[Page[Order]]:
79
+ return self._iter_pages(
80
+ filter=filter,
81
+ order_by=order_by,
82
+ count=count,
83
+ start_skip=start_skip,
84
+ page_size=page_size,
85
+ max_items=max_items,
86
+ extra_query=_filter_query(filter_type),
87
+ )
88
+
89
+ def iter_all(
90
+ self,
91
+ *,
92
+ filter_type: OrderFilterType | Literal[0, 1, 2] | None = None,
93
+ filter: str | None = None,
94
+ order_by: str | None = None,
95
+ count: bool | None = None,
96
+ start_skip: int = 0,
97
+ page_size: int = DEFAULT_PAGE_SIZE,
98
+ max_items: int | None = None,
99
+ ) -> Iterator[Order]:
100
+ return self._iter_all(
101
+ filter=filter,
102
+ order_by=order_by,
103
+ count=count,
104
+ start_skip=start_skip,
105
+ page_size=page_size,
106
+ max_items=max_items,
107
+ extra_query=_filter_query(filter_type),
108
+ )
109
+
110
+
111
+ def _filter_query(
112
+ filter_type: OrderFilterType | Literal[0, 1, 2] | None,
113
+ ) -> dict[str, object]:
114
+ if filter_type is None:
115
+ return {}
116
+ if isinstance(filter_type, bool) or not isinstance(filter_type, int):
117
+ raise TypeError("filter_type must be an OrderFilterType or integer 0, 1, or 2")
118
+ return {"filter-type": OrderFilterType(filter_type)}