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.
- redblack/__init__.py +105 -0
- redblack/_generated/__init__.py +39 -0
- redblack/_generated/contract.py +212 -0
- redblack/_generated/operation_specs.py +5115 -0
- redblack/_version.py +4 -0
- redblack/auth.py +352 -0
- redblack/client.py +512 -0
- redblack/config.py +576 -0
- redblack/downloads.py +410 -0
- redblack/errors.py +483 -0
- redblack/models/__init__.py +105 -0
- redblack/models/base.py +150 -0
- redblack/models/generated.py +11736 -0
- redblack/odata.py +75 -0
- redblack/pagination.py +184 -0
- redblack/polling.py +163 -0
- redblack/py.typed +1 -0
- redblack/raw.py +102 -0
- redblack/resources/__init__.py +65 -0
- redblack/resources/_base.py +212 -0
- redblack/resources/_collections.py +80 -0
- redblack/resources/_exports.py +215 -0
- redblack/resources/accounts.py +132 -0
- redblack/resources/cash_actions.py +260 -0
- redblack/resources/equivalents.py +144 -0
- redblack/resources/households.py +138 -0
- redblack/resources/orders.py +118 -0
- redblack/resources/restrictions.py +146 -0
- redblack/resources/review_sets.py +889 -0
- redblack/resources/securities.py +175 -0
- redblack/resources/tasks.py +291 -0
- redblack/resources/users.py +88 -0
- redblack/response.py +118 -0
- redblack/transport.py +606 -0
- redblack_python_sdk-0.1.0.dist-info/METADATA +151 -0
- redblack_python_sdk-0.1.0.dist-info/RECORD +38 -0
- redblack_python_sdk-0.1.0.dist-info/WHEEL +5 -0
- redblack_python_sdk-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"""Restrictions 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 Restriction, RestrictionExportJob
|
|
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 RestrictionsResource(CollectionResource[HttpInfoMode], ExportResource[HttpInfoMode]):
|
|
17
|
+
"""Restrictions, including exports present in the operation contract.
|
|
18
|
+
|
|
19
|
+
The narrative export guide lists only accounts and households, while the
|
|
20
|
+
2026.3.0 operation contract also exposes restrictions. The method is kept
|
|
21
|
+
because it is a real documented operation, but live support remains a UAT
|
|
22
|
+
validation item.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
LIST_OPERATION_ID = "Restriction_QueryRestrictions"
|
|
26
|
+
EXPORT_OPERATIONS = ExportOperations(
|
|
27
|
+
create="Restrictions_ExportJob",
|
|
28
|
+
status="Restrictions_GetExportJobStatus",
|
|
29
|
+
file="Restrictions_GetExportFile",
|
|
30
|
+
body_required=True,
|
|
31
|
+
)
|
|
32
|
+
OPERATION_IDS = frozenset(
|
|
33
|
+
{
|
|
34
|
+
LIST_OPERATION_ID,
|
|
35
|
+
EXPORT_OPERATIONS.create,
|
|
36
|
+
EXPORT_OPERATIONS.status,
|
|
37
|
+
EXPORT_OPERATIONS.file,
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
@overload
|
|
42
|
+
def list(
|
|
43
|
+
self: RestrictionsResource[Literal[False]],
|
|
44
|
+
*,
|
|
45
|
+
filter: str | None = None,
|
|
46
|
+
order_by: str | None = None,
|
|
47
|
+
top: int | None = None,
|
|
48
|
+
skip: int | None = None,
|
|
49
|
+
count: bool | None = None,
|
|
50
|
+
) -> Page[Restriction]: ...
|
|
51
|
+
|
|
52
|
+
@overload
|
|
53
|
+
def list(
|
|
54
|
+
self: RestrictionsResource[Literal[True]],
|
|
55
|
+
*,
|
|
56
|
+
filter: str | None = None,
|
|
57
|
+
order_by: str | None = None,
|
|
58
|
+
top: int | None = None,
|
|
59
|
+
skip: int | None = None,
|
|
60
|
+
count: bool | None = None,
|
|
61
|
+
) -> ApiResponseProtocol[Page[Restriction]]: ...
|
|
62
|
+
|
|
63
|
+
def list(
|
|
64
|
+
self,
|
|
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
|
+
) -> Page[Restriction] | ApiResponseProtocol[Page[Restriction]]:
|
|
72
|
+
return self._list(filter=filter, order_by=order_by, top=top, skip=skip, count=count)
|
|
73
|
+
|
|
74
|
+
def iter_pages(
|
|
75
|
+
self,
|
|
76
|
+
*,
|
|
77
|
+
filter: str | None = None,
|
|
78
|
+
order_by: str | None = None,
|
|
79
|
+
count: bool | None = None,
|
|
80
|
+
start_skip: int = 0,
|
|
81
|
+
page_size: int = DEFAULT_PAGE_SIZE,
|
|
82
|
+
max_items: int | None = None,
|
|
83
|
+
) -> Iterator[Page[Restriction]]:
|
|
84
|
+
return self._iter_pages(
|
|
85
|
+
filter=filter,
|
|
86
|
+
order_by=order_by,
|
|
87
|
+
count=count,
|
|
88
|
+
start_skip=start_skip,
|
|
89
|
+
page_size=page_size,
|
|
90
|
+
max_items=max_items,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
def iter_all(
|
|
94
|
+
self,
|
|
95
|
+
*,
|
|
96
|
+
filter: str | None = None,
|
|
97
|
+
order_by: str | None = None,
|
|
98
|
+
count: bool | None = None,
|
|
99
|
+
start_skip: int = 0,
|
|
100
|
+
page_size: int = DEFAULT_PAGE_SIZE,
|
|
101
|
+
max_items: int | None = None,
|
|
102
|
+
) -> Iterator[Restriction]:
|
|
103
|
+
return self._iter_all(
|
|
104
|
+
filter=filter,
|
|
105
|
+
order_by=order_by,
|
|
106
|
+
count=count,
|
|
107
|
+
start_skip=start_skip,
|
|
108
|
+
page_size=page_size,
|
|
109
|
+
max_items=max_items,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
@overload
|
|
113
|
+
def create_export(
|
|
114
|
+
self: RestrictionsResource[Literal[False]], *, filter: str | None = None
|
|
115
|
+
) -> ExportJobHandle[RestrictionExportJob]: ...
|
|
116
|
+
|
|
117
|
+
@overload
|
|
118
|
+
def create_export(
|
|
119
|
+
self: RestrictionsResource[Literal[True]], *, filter: str | None = None
|
|
120
|
+
) -> ApiResponseProtocol[ExportJobHandle[RestrictionExportJob]]: ...
|
|
121
|
+
|
|
122
|
+
def create_export(
|
|
123
|
+
self, *, filter: str | None = None
|
|
124
|
+
) -> (
|
|
125
|
+
ExportJobHandle[RestrictionExportJob]
|
|
126
|
+
| ApiResponseProtocol[ExportJobHandle[RestrictionExportJob]]
|
|
127
|
+
):
|
|
128
|
+
return self._create_export(filter=filter)
|
|
129
|
+
|
|
130
|
+
@overload
|
|
131
|
+
def get_export(
|
|
132
|
+
self: RestrictionsResource[Literal[False]], job_id: int
|
|
133
|
+
) -> ExportJobHandle[RestrictionExportJob]: ...
|
|
134
|
+
|
|
135
|
+
@overload
|
|
136
|
+
def get_export(
|
|
137
|
+
self: RestrictionsResource[Literal[True]], job_id: int
|
|
138
|
+
) -> ApiResponseProtocol[ExportJobHandle[RestrictionExportJob]]: ...
|
|
139
|
+
|
|
140
|
+
def get_export(
|
|
141
|
+
self, job_id: int
|
|
142
|
+
) -> (
|
|
143
|
+
ExportJobHandle[RestrictionExportJob]
|
|
144
|
+
| ApiResponseProtocol[ExportJobHandle[RestrictionExportJob]]
|
|
145
|
+
):
|
|
146
|
+
return self._get_export(job_id)
|