moovio_sdk 0.11.4__py3-none-any.whl → 0.11.5__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.
- moovio_sdk/_version.py +3 -3
- moovio_sdk/models/operations/__init__.py +20 -0
- moovio_sdk/models/operations/createtransferoptionsforaccount.py +82 -0
- moovio_sdk/transfers.py +328 -2
- moovio_sdk/utils/forms.py +49 -28
- {moovio_sdk-0.11.4.dist-info → moovio_sdk-0.11.5.dist-info}/METADATA +11 -2
- {moovio_sdk-0.11.4.dist-info → moovio_sdk-0.11.5.dist-info}/RECORD +8 -7
- {moovio_sdk-0.11.4.dist-info → moovio_sdk-0.11.5.dist-info}/WHEEL +0 -0
moovio_sdk/_version.py
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
import importlib.metadata
|
4
4
|
|
5
5
|
__title__: str = "moovio_sdk"
|
6
|
-
__version__: str = "0.11.
|
6
|
+
__version__: str = "0.11.5"
|
7
7
|
__openapi_doc_version__: str = "latest"
|
8
|
-
__gen_version__: str = "2.
|
9
|
-
__user_agent__: str = "speakeasy-sdk/python 0.11.
|
8
|
+
__gen_version__: str = "2.632.1"
|
9
|
+
__user_agent__: str = "speakeasy-sdk/python 0.11.5 2.632.1 latest moovio_sdk"
|
10
10
|
|
11
11
|
try:
|
12
12
|
if __package__ is not None:
|
@@ -162,6 +162,14 @@ if TYPE_CHECKING:
|
|
162
162
|
CreateTransferOptionsResponse,
|
163
163
|
CreateTransferOptionsResponseTypedDict,
|
164
164
|
)
|
165
|
+
from .createtransferoptionsforaccount import (
|
166
|
+
CreateTransferOptionsForAccountGlobals,
|
167
|
+
CreateTransferOptionsForAccountGlobalsTypedDict,
|
168
|
+
CreateTransferOptionsForAccountRequest,
|
169
|
+
CreateTransferOptionsForAccountRequestTypedDict,
|
170
|
+
CreateTransferOptionsForAccountResponse,
|
171
|
+
CreateTransferOptionsForAccountResponseTypedDict,
|
172
|
+
)
|
165
173
|
from .deletedisputeevidencefile import (
|
166
174
|
DeleteDisputeEvidenceFileGlobals,
|
167
175
|
DeleteDisputeEvidenceFileGlobalsTypedDict,
|
@@ -1193,6 +1201,12 @@ __all__ = [
|
|
1193
1201
|
"CreateTerminalApplicationResponseTypedDict",
|
1194
1202
|
"CreateTransferGlobals",
|
1195
1203
|
"CreateTransferGlobalsTypedDict",
|
1204
|
+
"CreateTransferOptionsForAccountGlobals",
|
1205
|
+
"CreateTransferOptionsForAccountGlobalsTypedDict",
|
1206
|
+
"CreateTransferOptionsForAccountRequest",
|
1207
|
+
"CreateTransferOptionsForAccountRequestTypedDict",
|
1208
|
+
"CreateTransferOptionsForAccountResponse",
|
1209
|
+
"CreateTransferOptionsForAccountResponseTypedDict",
|
1196
1210
|
"CreateTransferOptionsGlobals",
|
1197
1211
|
"CreateTransferOptionsGlobalsTypedDict",
|
1198
1212
|
"CreateTransferOptionsResponse",
|
@@ -2015,6 +2029,12 @@ _dynamic_imports: dict[str, str] = {
|
|
2015
2029
|
"CreateTransferOptionsGlobalsTypedDict": ".createtransferoptions",
|
2016
2030
|
"CreateTransferOptionsResponse": ".createtransferoptions",
|
2017
2031
|
"CreateTransferOptionsResponseTypedDict": ".createtransferoptions",
|
2032
|
+
"CreateTransferOptionsForAccountGlobals": ".createtransferoptionsforaccount",
|
2033
|
+
"CreateTransferOptionsForAccountGlobalsTypedDict": ".createtransferoptionsforaccount",
|
2034
|
+
"CreateTransferOptionsForAccountRequest": ".createtransferoptionsforaccount",
|
2035
|
+
"CreateTransferOptionsForAccountRequestTypedDict": ".createtransferoptionsforaccount",
|
2036
|
+
"CreateTransferOptionsForAccountResponse": ".createtransferoptionsforaccount",
|
2037
|
+
"CreateTransferOptionsForAccountResponseTypedDict": ".createtransferoptionsforaccount",
|
2018
2038
|
"DeleteDisputeEvidenceFileGlobals": ".deletedisputeevidencefile",
|
2019
2039
|
"DeleteDisputeEvidenceFileGlobalsTypedDict": ".deletedisputeevidencefile",
|
2020
2040
|
"DeleteDisputeEvidenceFileRequest": ".deletedisputeevidencefile",
|
@@ -0,0 +1,82 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
from moovio_sdk.models.components import (
|
5
|
+
createtransferoptions as components_createtransferoptions,
|
6
|
+
transferoptions as components_transferoptions,
|
7
|
+
)
|
8
|
+
from moovio_sdk.types import BaseModel
|
9
|
+
from moovio_sdk.utils import (
|
10
|
+
FieldMetadata,
|
11
|
+
HeaderMetadata,
|
12
|
+
PathParamMetadata,
|
13
|
+
RequestMetadata,
|
14
|
+
)
|
15
|
+
import pydantic
|
16
|
+
from typing import Dict, List, Optional
|
17
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
18
|
+
|
19
|
+
|
20
|
+
class CreateTransferOptionsForAccountGlobalsTypedDict(TypedDict):
|
21
|
+
x_moov_version: NotRequired[str]
|
22
|
+
r"""Specify an API version.
|
23
|
+
|
24
|
+
API versioning follows the format `vYYYY.QQ.BB`, where
|
25
|
+
- `YYYY` is the year
|
26
|
+
- `QQ` is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
|
27
|
+
- `BB` is the build number, starting at `.01`, for subsequent builds in the same quarter.
|
28
|
+
- For example, `v2024.01.00` is the initial release of the first quarter of 2024.
|
29
|
+
|
30
|
+
The `latest` version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
|
31
|
+
"""
|
32
|
+
|
33
|
+
|
34
|
+
class CreateTransferOptionsForAccountGlobals(BaseModel):
|
35
|
+
x_moov_version: Annotated[
|
36
|
+
Optional[str],
|
37
|
+
pydantic.Field(alias="x-moov-version"),
|
38
|
+
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
39
|
+
] = "v2024.01.00"
|
40
|
+
r"""Specify an API version.
|
41
|
+
|
42
|
+
API versioning follows the format `vYYYY.QQ.BB`, where
|
43
|
+
- `YYYY` is the year
|
44
|
+
- `QQ` is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
|
45
|
+
- `BB` is the build number, starting at `.01`, for subsequent builds in the same quarter.
|
46
|
+
- For example, `v2024.01.00` is the initial release of the first quarter of 2024.
|
47
|
+
|
48
|
+
The `latest` version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
|
49
|
+
"""
|
50
|
+
|
51
|
+
|
52
|
+
class CreateTransferOptionsForAccountRequestTypedDict(TypedDict):
|
53
|
+
account_id: str
|
54
|
+
r"""The partner's Moov account ID."""
|
55
|
+
create_transfer_options: (
|
56
|
+
components_createtransferoptions.CreateTransferOptionsTypedDict
|
57
|
+
)
|
58
|
+
|
59
|
+
|
60
|
+
class CreateTransferOptionsForAccountRequest(BaseModel):
|
61
|
+
account_id: Annotated[
|
62
|
+
str,
|
63
|
+
pydantic.Field(alias="accountID"),
|
64
|
+
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
65
|
+
]
|
66
|
+
r"""The partner's Moov account ID."""
|
67
|
+
|
68
|
+
create_transfer_options: Annotated[
|
69
|
+
components_createtransferoptions.CreateTransferOptions,
|
70
|
+
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
71
|
+
]
|
72
|
+
|
73
|
+
|
74
|
+
class CreateTransferOptionsForAccountResponseTypedDict(TypedDict):
|
75
|
+
headers: Dict[str, List[str]]
|
76
|
+
result: components_transferoptions.TransferOptionsTypedDict
|
77
|
+
|
78
|
+
|
79
|
+
class CreateTransferOptionsForAccountResponse(BaseModel):
|
80
|
+
headers: Dict[str, List[str]]
|
81
|
+
|
82
|
+
result: components_transferoptions.TransferOptions
|
moovio_sdk/transfers.py
CHANGED
@@ -11,6 +11,332 @@ from typing import Any, Dict, List, Mapping, Optional, Union
|
|
11
11
|
|
12
12
|
|
13
13
|
class Transfers(BaseSDK):
|
14
|
+
def generate_options_for_account(
|
15
|
+
self,
|
16
|
+
*,
|
17
|
+
account_id: str,
|
18
|
+
source: Union[
|
19
|
+
components.SourceDestinationOptions,
|
20
|
+
components.SourceDestinationOptionsTypedDict,
|
21
|
+
],
|
22
|
+
destination: Union[
|
23
|
+
components.SourceDestinationOptions,
|
24
|
+
components.SourceDestinationOptionsTypedDict,
|
25
|
+
],
|
26
|
+
amount: Union[components.Amount, components.AmountTypedDict],
|
27
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
28
|
+
server_url: Optional[str] = None,
|
29
|
+
timeout_ms: Optional[int] = None,
|
30
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
31
|
+
) -> operations.CreateTransferOptionsForAccountResponse:
|
32
|
+
r"""Generate available payment method options for one or multiple transfer participants depending on the accountID or paymentMethodID you
|
33
|
+
supply in the request body.
|
34
|
+
|
35
|
+
The accountID in the route should the partner's accountID.
|
36
|
+
|
37
|
+
Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
|
38
|
+
|
39
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
40
|
+
you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
41
|
+
|
42
|
+
:param account_id: The partner's Moov account ID.
|
43
|
+
:param source:
|
44
|
+
:param destination:
|
45
|
+
:param amount:
|
46
|
+
:param retries: Override the default retry configuration for this method
|
47
|
+
:param server_url: Override the default server URL for this method
|
48
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
49
|
+
:param http_headers: Additional headers to set or replace on requests.
|
50
|
+
"""
|
51
|
+
base_url = None
|
52
|
+
url_variables = None
|
53
|
+
if timeout_ms is None:
|
54
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
55
|
+
|
56
|
+
if server_url is not None:
|
57
|
+
base_url = server_url
|
58
|
+
else:
|
59
|
+
base_url = self._get_url(base_url, url_variables)
|
60
|
+
|
61
|
+
request = operations.CreateTransferOptionsForAccountRequest(
|
62
|
+
account_id=account_id,
|
63
|
+
create_transfer_options=components.CreateTransferOptions(
|
64
|
+
source=utils.get_pydantic_model(
|
65
|
+
source, components.SourceDestinationOptions
|
66
|
+
),
|
67
|
+
destination=utils.get_pydantic_model(
|
68
|
+
destination, components.SourceDestinationOptions
|
69
|
+
),
|
70
|
+
amount=utils.get_pydantic_model(amount, components.Amount),
|
71
|
+
),
|
72
|
+
)
|
73
|
+
|
74
|
+
req = self._build_request(
|
75
|
+
method="POST",
|
76
|
+
path="/accounts/{accountID}/transfer-options",
|
77
|
+
base_url=base_url,
|
78
|
+
url_variables=url_variables,
|
79
|
+
request=request,
|
80
|
+
request_body_required=True,
|
81
|
+
request_has_path_params=True,
|
82
|
+
request_has_query_params=True,
|
83
|
+
user_agent_header="user-agent",
|
84
|
+
accept_header_value="application/json",
|
85
|
+
http_headers=http_headers,
|
86
|
+
_globals=operations.CreateTransferOptionsForAccountGlobals(
|
87
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
88
|
+
),
|
89
|
+
security=self.sdk_configuration.security,
|
90
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
91
|
+
request.create_transfer_options,
|
92
|
+
False,
|
93
|
+
False,
|
94
|
+
"json",
|
95
|
+
components.CreateTransferOptions,
|
96
|
+
),
|
97
|
+
timeout_ms=timeout_ms,
|
98
|
+
)
|
99
|
+
|
100
|
+
if retries == UNSET:
|
101
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
102
|
+
retries = self.sdk_configuration.retry_config
|
103
|
+
|
104
|
+
retry_config = None
|
105
|
+
if isinstance(retries, utils.RetryConfig):
|
106
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
107
|
+
|
108
|
+
http_res = self.do_request(
|
109
|
+
hook_ctx=HookContext(
|
110
|
+
config=self.sdk_configuration,
|
111
|
+
base_url=base_url or "",
|
112
|
+
operation_id="createTransferOptionsForAccount",
|
113
|
+
oauth2_scopes=[],
|
114
|
+
security_source=get_security_from_env(
|
115
|
+
self.sdk_configuration.security, components.Security
|
116
|
+
),
|
117
|
+
),
|
118
|
+
request=req,
|
119
|
+
error_status_codes=[
|
120
|
+
"400",
|
121
|
+
"401",
|
122
|
+
"403",
|
123
|
+
"422",
|
124
|
+
"429",
|
125
|
+
"4XX",
|
126
|
+
"500",
|
127
|
+
"504",
|
128
|
+
"5XX",
|
129
|
+
],
|
130
|
+
retry_config=retry_config,
|
131
|
+
)
|
132
|
+
|
133
|
+
response_data: Any = None
|
134
|
+
if utils.match_response(http_res, "200", "application/json"):
|
135
|
+
return operations.CreateTransferOptionsForAccountResponse(
|
136
|
+
result=utils.unmarshal_json(http_res.text, components.TransferOptions),
|
137
|
+
headers=utils.get_response_headers(http_res.headers),
|
138
|
+
)
|
139
|
+
if utils.match_response(http_res, "400", "application/json"):
|
140
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
141
|
+
raise errors.GenericError(data=response_data)
|
142
|
+
if utils.match_response(http_res, "422", "application/json"):
|
143
|
+
response_data = utils.unmarshal_json(
|
144
|
+
http_res.text, errors.TransferOptionsValidationErrorData
|
145
|
+
)
|
146
|
+
raise errors.TransferOptionsValidationError(data=response_data)
|
147
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
148
|
+
http_res_text = utils.stream_to_text(http_res)
|
149
|
+
raise errors.APIError(
|
150
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
151
|
+
)
|
152
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
153
|
+
http_res_text = utils.stream_to_text(http_res)
|
154
|
+
raise errors.APIError(
|
155
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
156
|
+
)
|
157
|
+
if utils.match_response(http_res, "4XX", "*"):
|
158
|
+
http_res_text = utils.stream_to_text(http_res)
|
159
|
+
raise errors.APIError(
|
160
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
161
|
+
)
|
162
|
+
if utils.match_response(http_res, "5XX", "*"):
|
163
|
+
http_res_text = utils.stream_to_text(http_res)
|
164
|
+
raise errors.APIError(
|
165
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
166
|
+
)
|
167
|
+
|
168
|
+
content_type = http_res.headers.get("Content-Type")
|
169
|
+
http_res_text = utils.stream_to_text(http_res)
|
170
|
+
raise errors.APIError(
|
171
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
172
|
+
http_res.status_code,
|
173
|
+
http_res_text,
|
174
|
+
http_res,
|
175
|
+
)
|
176
|
+
|
177
|
+
async def generate_options_for_account_async(
|
178
|
+
self,
|
179
|
+
*,
|
180
|
+
account_id: str,
|
181
|
+
source: Union[
|
182
|
+
components.SourceDestinationOptions,
|
183
|
+
components.SourceDestinationOptionsTypedDict,
|
184
|
+
],
|
185
|
+
destination: Union[
|
186
|
+
components.SourceDestinationOptions,
|
187
|
+
components.SourceDestinationOptionsTypedDict,
|
188
|
+
],
|
189
|
+
amount: Union[components.Amount, components.AmountTypedDict],
|
190
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
191
|
+
server_url: Optional[str] = None,
|
192
|
+
timeout_ms: Optional[int] = None,
|
193
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
194
|
+
) -> operations.CreateTransferOptionsForAccountResponse:
|
195
|
+
r"""Generate available payment method options for one or multiple transfer participants depending on the accountID or paymentMethodID you
|
196
|
+
supply in the request body.
|
197
|
+
|
198
|
+
The accountID in the route should the partner's accountID.
|
199
|
+
|
200
|
+
Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
|
201
|
+
|
202
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
203
|
+
you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
204
|
+
|
205
|
+
:param account_id: The partner's Moov account ID.
|
206
|
+
:param source:
|
207
|
+
:param destination:
|
208
|
+
:param amount:
|
209
|
+
:param retries: Override the default retry configuration for this method
|
210
|
+
:param server_url: Override the default server URL for this method
|
211
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
212
|
+
:param http_headers: Additional headers to set or replace on requests.
|
213
|
+
"""
|
214
|
+
base_url = None
|
215
|
+
url_variables = None
|
216
|
+
if timeout_ms is None:
|
217
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
218
|
+
|
219
|
+
if server_url is not None:
|
220
|
+
base_url = server_url
|
221
|
+
else:
|
222
|
+
base_url = self._get_url(base_url, url_variables)
|
223
|
+
|
224
|
+
request = operations.CreateTransferOptionsForAccountRequest(
|
225
|
+
account_id=account_id,
|
226
|
+
create_transfer_options=components.CreateTransferOptions(
|
227
|
+
source=utils.get_pydantic_model(
|
228
|
+
source, components.SourceDestinationOptions
|
229
|
+
),
|
230
|
+
destination=utils.get_pydantic_model(
|
231
|
+
destination, components.SourceDestinationOptions
|
232
|
+
),
|
233
|
+
amount=utils.get_pydantic_model(amount, components.Amount),
|
234
|
+
),
|
235
|
+
)
|
236
|
+
|
237
|
+
req = self._build_request_async(
|
238
|
+
method="POST",
|
239
|
+
path="/accounts/{accountID}/transfer-options",
|
240
|
+
base_url=base_url,
|
241
|
+
url_variables=url_variables,
|
242
|
+
request=request,
|
243
|
+
request_body_required=True,
|
244
|
+
request_has_path_params=True,
|
245
|
+
request_has_query_params=True,
|
246
|
+
user_agent_header="user-agent",
|
247
|
+
accept_header_value="application/json",
|
248
|
+
http_headers=http_headers,
|
249
|
+
_globals=operations.CreateTransferOptionsForAccountGlobals(
|
250
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
251
|
+
),
|
252
|
+
security=self.sdk_configuration.security,
|
253
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
254
|
+
request.create_transfer_options,
|
255
|
+
False,
|
256
|
+
False,
|
257
|
+
"json",
|
258
|
+
components.CreateTransferOptions,
|
259
|
+
),
|
260
|
+
timeout_ms=timeout_ms,
|
261
|
+
)
|
262
|
+
|
263
|
+
if retries == UNSET:
|
264
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
265
|
+
retries = self.sdk_configuration.retry_config
|
266
|
+
|
267
|
+
retry_config = None
|
268
|
+
if isinstance(retries, utils.RetryConfig):
|
269
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
270
|
+
|
271
|
+
http_res = await self.do_request_async(
|
272
|
+
hook_ctx=HookContext(
|
273
|
+
config=self.sdk_configuration,
|
274
|
+
base_url=base_url or "",
|
275
|
+
operation_id="createTransferOptionsForAccount",
|
276
|
+
oauth2_scopes=[],
|
277
|
+
security_source=get_security_from_env(
|
278
|
+
self.sdk_configuration.security, components.Security
|
279
|
+
),
|
280
|
+
),
|
281
|
+
request=req,
|
282
|
+
error_status_codes=[
|
283
|
+
"400",
|
284
|
+
"401",
|
285
|
+
"403",
|
286
|
+
"422",
|
287
|
+
"429",
|
288
|
+
"4XX",
|
289
|
+
"500",
|
290
|
+
"504",
|
291
|
+
"5XX",
|
292
|
+
],
|
293
|
+
retry_config=retry_config,
|
294
|
+
)
|
295
|
+
|
296
|
+
response_data: Any = None
|
297
|
+
if utils.match_response(http_res, "200", "application/json"):
|
298
|
+
return operations.CreateTransferOptionsForAccountResponse(
|
299
|
+
result=utils.unmarshal_json(http_res.text, components.TransferOptions),
|
300
|
+
headers=utils.get_response_headers(http_res.headers),
|
301
|
+
)
|
302
|
+
if utils.match_response(http_res, "400", "application/json"):
|
303
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
304
|
+
raise errors.GenericError(data=response_data)
|
305
|
+
if utils.match_response(http_res, "422", "application/json"):
|
306
|
+
response_data = utils.unmarshal_json(
|
307
|
+
http_res.text, errors.TransferOptionsValidationErrorData
|
308
|
+
)
|
309
|
+
raise errors.TransferOptionsValidationError(data=response_data)
|
310
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
311
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
312
|
+
raise errors.APIError(
|
313
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
314
|
+
)
|
315
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
316
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
317
|
+
raise errors.APIError(
|
318
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
319
|
+
)
|
320
|
+
if utils.match_response(http_res, "4XX", "*"):
|
321
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
322
|
+
raise errors.APIError(
|
323
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
324
|
+
)
|
325
|
+
if utils.match_response(http_res, "5XX", "*"):
|
326
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
327
|
+
raise errors.APIError(
|
328
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
329
|
+
)
|
330
|
+
|
331
|
+
content_type = http_res.headers.get("Content-Type")
|
332
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
333
|
+
raise errors.APIError(
|
334
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
335
|
+
http_res.status_code,
|
336
|
+
http_res_text,
|
337
|
+
http_res,
|
338
|
+
)
|
339
|
+
|
14
340
|
def create(
|
15
341
|
self,
|
16
342
|
*,
|
@@ -2806,7 +3132,7 @@ class Transfers(BaseSDK):
|
|
2806
3132
|
Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
|
2807
3133
|
|
2808
3134
|
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
2809
|
-
you'll need to specify the `/accounts/{accountID}/transfers.
|
3135
|
+
you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
2810
3136
|
|
2811
3137
|
:param source:
|
2812
3138
|
:param destination:
|
@@ -2958,7 +3284,7 @@ class Transfers(BaseSDK):
|
|
2958
3284
|
Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
|
2959
3285
|
|
2960
3286
|
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
2961
|
-
you'll need to specify the `/accounts/{accountID}/transfers.
|
3287
|
+
you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
2962
3288
|
|
2963
3289
|
:param source:
|
2964
3290
|
:param destination:
|
moovio_sdk/utils/forms.py
CHANGED
@@ -86,11 +86,39 @@ def _populate_form(
|
|
86
86
|
return form
|
87
87
|
|
88
88
|
|
89
|
+
def _extract_file_properties(file_obj: Any) -> Tuple[str, Any, Any]:
|
90
|
+
"""Extract file name, content, and content type from a file object."""
|
91
|
+
file_fields: Dict[str, FieldInfo] = file_obj.__class__.model_fields
|
92
|
+
|
93
|
+
file_name = ""
|
94
|
+
content = None
|
95
|
+
content_type = None
|
96
|
+
|
97
|
+
for file_field_name in file_fields:
|
98
|
+
file_field = file_fields[file_field_name]
|
99
|
+
|
100
|
+
file_metadata = find_field_metadata(file_field, MultipartFormMetadata)
|
101
|
+
if file_metadata is None:
|
102
|
+
continue
|
103
|
+
|
104
|
+
if file_metadata.content:
|
105
|
+
content = getattr(file_obj, file_field_name, None)
|
106
|
+
elif file_field_name == "content_type":
|
107
|
+
content_type = getattr(file_obj, file_field_name, None)
|
108
|
+
else:
|
109
|
+
file_name = getattr(file_obj, file_field_name)
|
110
|
+
|
111
|
+
if file_name == "" or content is None:
|
112
|
+
raise ValueError("invalid multipart/form-data file")
|
113
|
+
|
114
|
+
return file_name, content, content_type
|
115
|
+
|
116
|
+
|
89
117
|
def serialize_multipart_form(
|
90
118
|
media_type: str, request: Any
|
91
|
-
) -> Tuple[str, Dict[str, Any],
|
119
|
+
) -> Tuple[str, Dict[str, Any], List[Tuple[str, Any]]]:
|
92
120
|
form: Dict[str, Any] = {}
|
93
|
-
files:
|
121
|
+
files: List[Tuple[str, Any]] = []
|
94
122
|
|
95
123
|
if not isinstance(request, BaseModel):
|
96
124
|
raise TypeError("invalid request body type")
|
@@ -112,39 +140,32 @@ def serialize_multipart_form(
|
|
112
140
|
f_name = field.alias if field.alias else name
|
113
141
|
|
114
142
|
if field_metadata.file:
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
file_field = file_fields[file_field_name]
|
143
|
+
if isinstance(val, List):
|
144
|
+
# Handle array of files
|
145
|
+
for file_obj in val:
|
146
|
+
if not _is_set(file_obj):
|
147
|
+
continue
|
148
|
+
|
149
|
+
file_name, content, content_type = _extract_file_properties(file_obj)
|
123
150
|
|
124
|
-
|
125
|
-
|
126
|
-
|
151
|
+
if content_type is not None:
|
152
|
+
files.append((f_name + "[]", (file_name, content, content_type)))
|
153
|
+
else:
|
154
|
+
files.append((f_name + "[]", (file_name, content)))
|
155
|
+
else:
|
156
|
+
# Handle single file
|
157
|
+
file_name, content, content_type = _extract_file_properties(val)
|
127
158
|
|
128
|
-
if
|
129
|
-
|
130
|
-
elif file_field_name == "content_type":
|
131
|
-
content_type = getattr(val, file_field_name, None)
|
159
|
+
if content_type is not None:
|
160
|
+
files.append((f_name, (file_name, content, content_type)))
|
132
161
|
else:
|
133
|
-
|
134
|
-
|
135
|
-
if file_name == "" or content is None:
|
136
|
-
raise ValueError("invalid multipart/form-data file")
|
137
|
-
|
138
|
-
if content_type is not None:
|
139
|
-
files[f_name] = (file_name, content, content_type)
|
140
|
-
else:
|
141
|
-
files[f_name] = (file_name, content)
|
162
|
+
files.append((f_name, (file_name, content)))
|
142
163
|
elif field_metadata.json:
|
143
|
-
files
|
164
|
+
files.append((f_name, (
|
144
165
|
None,
|
145
166
|
marshal_json(val, request_field_types[name]),
|
146
167
|
"application/json",
|
147
|
-
)
|
168
|
+
)))
|
148
169
|
else:
|
149
170
|
if isinstance(val, List):
|
150
171
|
values = []
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: moovio_sdk
|
3
|
-
Version: 0.11.
|
3
|
+
Version: 0.11.5
|
4
4
|
Summary: Python Client SDK Generated by Speakeasy.
|
5
5
|
Author: Speakeasy
|
6
6
|
Requires-Python: >=3.9.2
|
@@ -1055,6 +1055,15 @@ you'll need to specify the `/terminal-applications.write` scope.
|
|
1055
1055
|
|
1056
1056
|
### [transfers](https://github.com/moovfinancial/moov-python/blob/master/docs/sdks/transfers/README.md)
|
1057
1057
|
|
1058
|
+
* [generate_options_for_account](https://github.com/moovfinancial/moov-python/blob/master/docs/sdks/transfers/README.md#generate_options_for_account) - Generate available payment method options for one or multiple transfer participants depending on the accountID or paymentMethodID you
|
1059
|
+
supply in the request body.
|
1060
|
+
|
1061
|
+
The accountID in the route should the partner's accountID.
|
1062
|
+
|
1063
|
+
Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
|
1064
|
+
|
1065
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1066
|
+
you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
1058
1067
|
* [create](https://github.com/moovfinancial/moov-python/blob/master/docs/sdks/transfers/README.md#create) - Move money by providing the source, destination, and amount in the request body.
|
1059
1068
|
|
1060
1069
|
Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
|
@@ -1120,7 +1129,7 @@ supply in the request.
|
|
1120
1129
|
Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
|
1121
1130
|
|
1122
1131
|
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1123
|
-
you'll need to specify the `/accounts/{accountID}/transfers.
|
1132
|
+
you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
1124
1133
|
|
1125
1134
|
### [underwriting](https://github.com/moovfinancial/moov-python/blob/master/docs/sdks/underwriting/README.md)
|
1126
1135
|
|
@@ -3,7 +3,7 @@ moovio_sdk/_hooks/__init__.py,sha256=9_7W5jAYw8rcO8Kfc-Ty-lB82BHfksAJJpVFb_UeU1c
|
|
3
3
|
moovio_sdk/_hooks/registration.py,sha256=1QZB41w6If7I9dXiOSQx6dhSc6BPWrnI5Q5bMOr4iVA,624
|
4
4
|
moovio_sdk/_hooks/sdkhooks.py,sha256=2XuMgiV2N7UE7lN00Is-c3spxVWigYitXS6xSmS_Qow,2560
|
5
5
|
moovio_sdk/_hooks/types.py,sha256=Yi9LD8_sd4zG7_idzCZY4MTxTXMhDlmCdpQvU4dXFI4,3049
|
6
|
-
moovio_sdk/_version.py,sha256=
|
6
|
+
moovio_sdk/_version.py,sha256=WI5wrvdZMILBk0H1GxdGlY52IxxrBX5HNB6NaGjOTyg,466
|
7
7
|
moovio_sdk/account_terminal_applications.py,sha256=QYvrGYr0btoK5uCZYngGA2qDbwzSb9jDcNULW23qtDA,42239
|
8
8
|
moovio_sdk/accounts.py,sha256=GU155vJqo6C__ll5XcyntnDsuQ20rsdcI5jB57I2g7Y,109095
|
9
9
|
moovio_sdk/adjustments.py,sha256=ZGmgUTm53He6-6lvOMgmx1eLJ5TjCgAvn5ULgHpMgNc,19460
|
@@ -472,7 +472,7 @@ moovio_sdk/models/errors/updatepaymentlinkerror.py,sha256=FrRZvrNFtNBuaKyZKStjEM
|
|
472
472
|
moovio_sdk/models/errors/updateunderwritingerror.py,sha256=A8XDduhlAQo6xcZE29atSa7UsQ9uEg2xbbur-V1yUbg,2409
|
473
473
|
moovio_sdk/models/internal/__init__.py,sha256=7kjDhcmI428H0YHeZHJRcKSXQE1N2dTPHi3FtLVFaMM,1120
|
474
474
|
moovio_sdk/models/internal/globals.py,sha256=uz3scUHVTLawU2bzU4ov4C3bSRwoNolTJ5O27QSMIgA,1701
|
475
|
-
moovio_sdk/models/operations/__init__.py,sha256=
|
475
|
+
moovio_sdk/models/operations/__init__.py,sha256=uDxqKfR5Uu_tETBwEKH7MJ4aZOravYdMT59iGu220v4,118504
|
476
476
|
moovio_sdk/models/operations/acceptdispute.py,sha256=imJTeB7PuXqfKBqA-VkIAFFNpW92U7DMxPx7CEb9eDQ,2544
|
477
477
|
moovio_sdk/models/operations/assignaccountcountries.py,sha256=NIGZ5oNIW7Ei4Y7WNnMVqcYUSQgIq3o_TlR0_ptwLJg,2753
|
478
478
|
moovio_sdk/models/operations/cancelschedule.py,sha256=X0vmSDaW6vyM387Tf02KSBCZNggKxNYm_T0W5zJY494,2394
|
@@ -494,6 +494,7 @@ moovio_sdk/models/operations/createsweepconfig.py,sha256=mC-dbVIizvTJjYTygLrFOO-
|
|
494
494
|
moovio_sdk/models/operations/createterminalapplication.py,sha256=n7mnj-ixVXSV8El7dVhwueNm4Pd8xTiTefI1oayrIGE,2188
|
495
495
|
moovio_sdk/models/operations/createtransfer.py,sha256=UeGpxBVsHy_sES-xLfdAqNFXExQxYgbPIQOOlAItzcU,4706
|
496
496
|
moovio_sdk/models/operations/createtransferoptions.py,sha256=DCrQtu3VPSdEOSt8gFnZHcCtRIN-c6NHBohifMolCzg,2139
|
497
|
+
moovio_sdk/models/operations/createtransferoptionsforaccount.py,sha256=l0rIf6sLKZU4Kq5PvmTJtYYlMRqpvXuhgIn5_P7alT4,3005
|
497
498
|
moovio_sdk/models/operations/deletedisputeevidencefile.py,sha256=NHUuvakVuXiCwqI_gDDgjhFAAfKypztOzasr0S78KQE,2648
|
498
499
|
moovio_sdk/models/operations/deleterepresentative.py,sha256=H3bKQTMMsB9_wCqxfZqwgq-NljV5W-lGWzXIHEnxxv0,2582
|
499
500
|
moovio_sdk/models/operations/deleteterminalapplication.py,sha256=4PWTRg4RR--XoZK-ZZgjNYlMbefs-Diioc8Om1bbHO8,2307
|
@@ -621,7 +622,7 @@ moovio_sdk/sdk.py,sha256=vhhj5348UUYxzqLsr02Kz6uG_dmtuJixW33zawZDPCY,11878
|
|
621
622
|
moovio_sdk/sdkconfiguration.py,sha256=vvZHznUDI2m3Z8ddTKDFUXkQu4mNBGX8Q9Zx7XpR3WY,1665
|
622
623
|
moovio_sdk/sweeps.py,sha256=21hOyOLl9tvoPwxOjVFFuqTobvaNxM14dsX-aK1z3Hc,67275
|
623
624
|
moovio_sdk/terminal_applications.py,sha256=1z4WiRExM7WgGUuDjQW_ew4Ih69DLfYKzslgRpqvJjA,43206
|
624
|
-
moovio_sdk/transfers.py,sha256=
|
625
|
+
moovio_sdk/transfers.py,sha256=VCqVDIVYT9oJWDl2yW5BBw04BBqC0j0PIROfwgF-6qk,148368
|
625
626
|
moovio_sdk/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
|
626
627
|
moovio_sdk/types/basemodel.py,sha256=L79WXvTECbSqaJzs8D3ud_KdIWkU7Cx2wbohDAktE9E,1127
|
627
628
|
moovio_sdk/underwriting.py,sha256=UIAXyd3kdEr2eCIUpE11IB4uD1AelDr3T-qBHweb52s,24541
|
@@ -630,7 +631,7 @@ moovio_sdk/utils/annotations.py,sha256=aR7mZG34FzgRdew7WZPYEu9QGBerpuKxCF4sek5Z_
|
|
630
631
|
moovio_sdk/utils/datetimes.py,sha256=oppAA5e3V35pQov1-FNLKxAaNF1_XWi-bQtyjjql3H8,855
|
631
632
|
moovio_sdk/utils/enums.py,sha256=REU6ydF8gsVL3xaeGX4sMNyiL3q5P9h29-f6Sa6luAE,2633
|
632
633
|
moovio_sdk/utils/eventstreaming.py,sha256=LtcrfJYw4nP2Oe4Wl0-cEURLzRGYReRGWNFY5wYECIE,6186
|
633
|
-
moovio_sdk/utils/forms.py,sha256=
|
634
|
+
moovio_sdk/utils/forms.py,sha256=EJdnrfIkuwpDtekyHutla0HjI_FypTYcmYNyPKEu_W0,6874
|
634
635
|
moovio_sdk/utils/headers.py,sha256=cPxWSmUILrefTGDzTH1Hdj7_Hlsj-EY6K5Tyc4iH4dk,3663
|
635
636
|
moovio_sdk/utils/logger.py,sha256=Q2OOqH956ohxf1tNtC-vJvkEUxoGeP0I43aGEuQJFRQ,673
|
636
637
|
moovio_sdk/utils/metadata.py,sha256=Per2KFXXOqOtoUWXrlIfjrSrBg199KrRW0nKQDgHIBU,3136
|
@@ -643,6 +644,6 @@ moovio_sdk/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
|
|
643
644
|
moovio_sdk/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
|
644
645
|
moovio_sdk/wallet_transactions.py,sha256=WVfhf2iPS5qJ3ZWEYn5e3XXKpc-tNgoKUSsD9Q-8LIM,25131
|
645
646
|
moovio_sdk/wallets.py,sha256=uGrFzCj6wCmdsEleXWF77njq9L185aWNHlRzFekKs98,19438
|
646
|
-
moovio_sdk-0.11.
|
647
|
-
moovio_sdk-0.11.
|
648
|
-
moovio_sdk-0.11.
|
647
|
+
moovio_sdk-0.11.5.dist-info/METADATA,sha256=GxDtj0la1VYjsY0-n-akBels8i3IkvRfleDGzv_u5CM,95312
|
648
|
+
moovio_sdk-0.11.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
649
|
+
moovio_sdk-0.11.5.dist-info/RECORD,,
|
File without changes
|