moovio_sdk 0.12.0__py3-none-any.whl → 0.13.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.
- moovio_sdk/_version.py +3 -3
- moovio_sdk/account_terminal_applications.py +70 -186
- moovio_sdk/accounts.py +168 -408
- moovio_sdk/adjustments.py +28 -84
- moovio_sdk/apple_pay.py +102 -236
- moovio_sdk/authentication.py +50 -102
- moovio_sdk/avatars.py +10 -38
- moovio_sdk/bank_accounts.py +174 -420
- moovio_sdk/basesdk.py +4 -4
- moovio_sdk/branding.py +106 -198
- moovio_sdk/capabilities.py +76 -180
- moovio_sdk/card_issuing.py +94 -228
- moovio_sdk/cards.py +94 -232
- moovio_sdk/disputes.py +204 -500
- moovio_sdk/end_to_end_encryption.py +28 -80
- moovio_sdk/enriched_address.py +14 -44
- moovio_sdk/enriched_profile.py +14 -44
- moovio_sdk/fee_plans.py +116 -314
- moovio_sdk/files.py +52 -138
- moovio_sdk/industries.py +14 -44
- moovio_sdk/institutions.py +36 -92
- moovio_sdk/issuing_transactions.py +70 -220
- moovio_sdk/models/components/__init__.py +39 -0
- moovio_sdk/models/components/createticket.py +24 -0
- moovio_sdk/models/components/createticketcontacterror.py +17 -0
- moovio_sdk/models/components/ticket.py +44 -0
- moovio_sdk/models/components/ticketcontact.py +17 -0
- moovio_sdk/models/components/ticketmessage.py +21 -0
- moovio_sdk/models/components/ticketstatus.py +11 -0
- moovio_sdk/models/components/updateticket.py +19 -0
- moovio_sdk/models/components/updateticketstatus.py +8 -0
- moovio_sdk/models/errors/__init__.py +19 -0
- moovio_sdk/models/errors/accountterminalapplicationerror.py +11 -6
- moovio_sdk/models/errors/addcapabilitieserror.py +11 -6
- moovio_sdk/models/errors/apierror.py +30 -14
- moovio_sdk/models/errors/assigncountrieserror.py +12 -6
- moovio_sdk/models/errors/authtokenrequesterror.py +11 -6
- moovio_sdk/models/errors/bankaccountvalidationerror.py +11 -6
- moovio_sdk/models/errors/brandvalidationerror.py +11 -6
- moovio_sdk/models/errors/cardacquiringrefund.py +11 -6
- moovio_sdk/models/errors/createaccount.py +12 -6
- moovio_sdk/models/errors/createpaymentlinkerror.py +11 -6
- moovio_sdk/models/errors/createsweepconfigerror.py +11 -6
- moovio_sdk/models/errors/createticketerror.py +34 -0
- moovio_sdk/models/errors/feeplanagreementerror.py +11 -6
- moovio_sdk/models/errors/fileuploadvalidationerror.py +11 -6
- moovio_sdk/models/errors/filevalidationerror.py +11 -6
- moovio_sdk/models/errors/genericerror.py +12 -6
- moovio_sdk/models/errors/linkapplepayerror.py +11 -6
- moovio_sdk/models/errors/linkcarderror.py +11 -6
- moovio_sdk/models/errors/microdepositvalidationerror.py +11 -6
- moovio_sdk/models/errors/mooverror.py +26 -0
- moovio_sdk/models/errors/no_response_error.py +13 -0
- moovio_sdk/models/errors/onboardinginviteerror.py +11 -6
- moovio_sdk/models/errors/patchsweepconfigerror.py +11 -6
- moovio_sdk/models/errors/refundvalidationerror.py +11 -6
- moovio_sdk/models/errors/representativevalidationerror.py +11 -6
- moovio_sdk/models/errors/requestcarderror.py +11 -6
- moovio_sdk/models/errors/responsevalidationerror.py +25 -0
- moovio_sdk/models/errors/reversalvalidationerror.py +11 -6
- moovio_sdk/models/errors/revoketokenrequesterror.py +11 -6
- moovio_sdk/models/errors/schedulevalidationerror.py +11 -6
- moovio_sdk/models/errors/terminalapplicationerror.py +11 -6
- moovio_sdk/models/errors/transfer.py +11 -6
- moovio_sdk/models/errors/transferoptionsvalidationerror.py +11 -6
- moovio_sdk/models/errors/transfervalidationerror.py +11 -6
- moovio_sdk/models/errors/updateaccount.py +12 -6
- moovio_sdk/models/errors/updatecarderror.py +11 -6
- moovio_sdk/models/errors/updateissuedcarderror.py +11 -6
- moovio_sdk/models/errors/updatepaymentlinkerror.py +11 -6
- moovio_sdk/models/errors/updateticketerror.py +25 -0
- moovio_sdk/models/errors/updateunderwritingerror.py +11 -6
- moovio_sdk/models/errors/upsertunderwritingerror.py +11 -6
- moovio_sdk/models/operations/__init__.py +100 -0
- moovio_sdk/models/operations/createticket.py +78 -0
- moovio_sdk/models/operations/getticket.py +71 -0
- moovio_sdk/models/operations/listticketmessages.py +88 -0
- moovio_sdk/models/operations/listtickets.py +81 -0
- moovio_sdk/models/operations/updateticket.py +85 -0
- moovio_sdk/onboarding.py +66 -166
- moovio_sdk/payment_links.py +106 -272
- moovio_sdk/payment_methods.py +30 -86
- moovio_sdk/ping.py +10 -40
- moovio_sdk/receipts.py +36 -92
- moovio_sdk/representatives.py +102 -228
- moovio_sdk/scheduling.py +122 -278
- moovio_sdk/sdk.py +3 -0
- moovio_sdk/support.py +1153 -0
- moovio_sdk/sweeps.py +102 -274
- moovio_sdk/terminal_applications.py +74 -186
- moovio_sdk/transfers.py +266 -582
- moovio_sdk/underwriting.py +64 -146
- moovio_sdk/utils/__init__.py +3 -0
- moovio_sdk/utils/serializers.py +21 -3
- moovio_sdk/wallet_transactions.py +28 -88
- moovio_sdk/wallets.py +24 -84
- {moovio_sdk-0.12.0.dist-info → moovio_sdk-0.13.1.dist-info}/METADATA +103 -28
- {moovio_sdk-0.12.0.dist-info → moovio_sdk-0.13.1.dist-info}/RECORD +99 -80
- {moovio_sdk-0.12.0.dist-info → moovio_sdk-0.13.1.dist-info}/WHEEL +0 -0
moovio_sdk/support.py
ADDED
@@ -0,0 +1,1153 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from .basesdk import BaseSDK
|
4
|
+
from moovio_sdk import utils
|
5
|
+
from moovio_sdk._hooks import HookContext
|
6
|
+
from moovio_sdk.models import components, errors, operations
|
7
|
+
from moovio_sdk.types import OptionalNullable, UNSET
|
8
|
+
from moovio_sdk.utils import get_security_from_env
|
9
|
+
from typing import Any, List, Mapping, Optional, Union
|
10
|
+
|
11
|
+
|
12
|
+
class Support(BaseSDK):
|
13
|
+
def create_ticket(
|
14
|
+
self,
|
15
|
+
*,
|
16
|
+
account_id: str,
|
17
|
+
title: str,
|
18
|
+
body: str,
|
19
|
+
contact: Union[components.TicketContact, components.TicketContactTypedDict],
|
20
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
21
|
+
server_url: Optional[str] = None,
|
22
|
+
timeout_ms: Optional[int] = None,
|
23
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
24
|
+
) -> operations.CreateTicketResponse:
|
25
|
+
r"""Create a support ticket for a Moov account.
|
26
|
+
|
27
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
28
|
+
you'll need to specify the `/accounts/{accountID}/support.write` scope.
|
29
|
+
|
30
|
+
:param account_id:
|
31
|
+
:param title:
|
32
|
+
:param body:
|
33
|
+
:param contact:
|
34
|
+
:param retries: Override the default retry configuration for this method
|
35
|
+
:param server_url: Override the default server URL for this method
|
36
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
37
|
+
:param http_headers: Additional headers to set or replace on requests.
|
38
|
+
"""
|
39
|
+
base_url = None
|
40
|
+
url_variables = None
|
41
|
+
if timeout_ms is None:
|
42
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
43
|
+
|
44
|
+
if server_url is not None:
|
45
|
+
base_url = server_url
|
46
|
+
else:
|
47
|
+
base_url = self._get_url(base_url, url_variables)
|
48
|
+
|
49
|
+
request = operations.CreateTicketRequest(
|
50
|
+
account_id=account_id,
|
51
|
+
create_ticket=components.CreateTicket(
|
52
|
+
title=title,
|
53
|
+
body=body,
|
54
|
+
contact=utils.get_pydantic_model(contact, components.TicketContact),
|
55
|
+
),
|
56
|
+
)
|
57
|
+
|
58
|
+
req = self._build_request(
|
59
|
+
method="POST",
|
60
|
+
path="/accounts/{accountID}/tickets",
|
61
|
+
base_url=base_url,
|
62
|
+
url_variables=url_variables,
|
63
|
+
request=request,
|
64
|
+
request_body_required=True,
|
65
|
+
request_has_path_params=True,
|
66
|
+
request_has_query_params=True,
|
67
|
+
user_agent_header="user-agent",
|
68
|
+
accept_header_value="application/json",
|
69
|
+
http_headers=http_headers,
|
70
|
+
_globals=operations.CreateTicketGlobals(
|
71
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
72
|
+
),
|
73
|
+
security=self.sdk_configuration.security,
|
74
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
75
|
+
request.create_ticket, False, False, "json", components.CreateTicket
|
76
|
+
),
|
77
|
+
timeout_ms=timeout_ms,
|
78
|
+
)
|
79
|
+
|
80
|
+
if retries == UNSET:
|
81
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
82
|
+
retries = self.sdk_configuration.retry_config
|
83
|
+
|
84
|
+
retry_config = None
|
85
|
+
if isinstance(retries, utils.RetryConfig):
|
86
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
87
|
+
|
88
|
+
http_res = self.do_request(
|
89
|
+
hook_ctx=HookContext(
|
90
|
+
config=self.sdk_configuration,
|
91
|
+
base_url=base_url or "",
|
92
|
+
operation_id="createTicket",
|
93
|
+
oauth2_scopes=[],
|
94
|
+
security_source=get_security_from_env(
|
95
|
+
self.sdk_configuration.security, components.Security
|
96
|
+
),
|
97
|
+
),
|
98
|
+
request=req,
|
99
|
+
error_status_codes=[
|
100
|
+
"400",
|
101
|
+
"401",
|
102
|
+
"403",
|
103
|
+
"404",
|
104
|
+
"409",
|
105
|
+
"422",
|
106
|
+
"429",
|
107
|
+
"4XX",
|
108
|
+
"500",
|
109
|
+
"504",
|
110
|
+
"5XX",
|
111
|
+
],
|
112
|
+
retry_config=retry_config,
|
113
|
+
)
|
114
|
+
|
115
|
+
response_data: Any = None
|
116
|
+
if utils.match_response(http_res, "200", "application/json"):
|
117
|
+
return operations.CreateTicketResponse(
|
118
|
+
result=utils.unmarshal_json_response(components.Ticket, http_res),
|
119
|
+
headers=utils.get_response_headers(http_res.headers),
|
120
|
+
)
|
121
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
122
|
+
response_data = utils.unmarshal_json_response(
|
123
|
+
errors.GenericErrorData, http_res
|
124
|
+
)
|
125
|
+
raise errors.GenericError(response_data, http_res)
|
126
|
+
if utils.match_response(http_res, "422", "application/json"):
|
127
|
+
response_data = utils.unmarshal_json_response(
|
128
|
+
errors.CreateTicketErrorData, http_res
|
129
|
+
)
|
130
|
+
raise errors.CreateTicketError(response_data, http_res)
|
131
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
132
|
+
http_res_text = utils.stream_to_text(http_res)
|
133
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
134
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
135
|
+
http_res_text = utils.stream_to_text(http_res)
|
136
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
137
|
+
if utils.match_response(http_res, "4XX", "*"):
|
138
|
+
http_res_text = utils.stream_to_text(http_res)
|
139
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
140
|
+
if utils.match_response(http_res, "5XX", "*"):
|
141
|
+
http_res_text = utils.stream_to_text(http_res)
|
142
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
143
|
+
|
144
|
+
raise errors.APIError("Unexpected response received", http_res)
|
145
|
+
|
146
|
+
async def create_ticket_async(
|
147
|
+
self,
|
148
|
+
*,
|
149
|
+
account_id: str,
|
150
|
+
title: str,
|
151
|
+
body: str,
|
152
|
+
contact: Union[components.TicketContact, components.TicketContactTypedDict],
|
153
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
154
|
+
server_url: Optional[str] = None,
|
155
|
+
timeout_ms: Optional[int] = None,
|
156
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
157
|
+
) -> operations.CreateTicketResponse:
|
158
|
+
r"""Create a support ticket for a Moov account.
|
159
|
+
|
160
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
161
|
+
you'll need to specify the `/accounts/{accountID}/support.write` scope.
|
162
|
+
|
163
|
+
:param account_id:
|
164
|
+
:param title:
|
165
|
+
:param body:
|
166
|
+
:param contact:
|
167
|
+
:param retries: Override the default retry configuration for this method
|
168
|
+
:param server_url: Override the default server URL for this method
|
169
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
170
|
+
:param http_headers: Additional headers to set or replace on requests.
|
171
|
+
"""
|
172
|
+
base_url = None
|
173
|
+
url_variables = None
|
174
|
+
if timeout_ms is None:
|
175
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
176
|
+
|
177
|
+
if server_url is not None:
|
178
|
+
base_url = server_url
|
179
|
+
else:
|
180
|
+
base_url = self._get_url(base_url, url_variables)
|
181
|
+
|
182
|
+
request = operations.CreateTicketRequest(
|
183
|
+
account_id=account_id,
|
184
|
+
create_ticket=components.CreateTicket(
|
185
|
+
title=title,
|
186
|
+
body=body,
|
187
|
+
contact=utils.get_pydantic_model(contact, components.TicketContact),
|
188
|
+
),
|
189
|
+
)
|
190
|
+
|
191
|
+
req = self._build_request_async(
|
192
|
+
method="POST",
|
193
|
+
path="/accounts/{accountID}/tickets",
|
194
|
+
base_url=base_url,
|
195
|
+
url_variables=url_variables,
|
196
|
+
request=request,
|
197
|
+
request_body_required=True,
|
198
|
+
request_has_path_params=True,
|
199
|
+
request_has_query_params=True,
|
200
|
+
user_agent_header="user-agent",
|
201
|
+
accept_header_value="application/json",
|
202
|
+
http_headers=http_headers,
|
203
|
+
_globals=operations.CreateTicketGlobals(
|
204
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
205
|
+
),
|
206
|
+
security=self.sdk_configuration.security,
|
207
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
208
|
+
request.create_ticket, False, False, "json", components.CreateTicket
|
209
|
+
),
|
210
|
+
timeout_ms=timeout_ms,
|
211
|
+
)
|
212
|
+
|
213
|
+
if retries == UNSET:
|
214
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
215
|
+
retries = self.sdk_configuration.retry_config
|
216
|
+
|
217
|
+
retry_config = None
|
218
|
+
if isinstance(retries, utils.RetryConfig):
|
219
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
220
|
+
|
221
|
+
http_res = await self.do_request_async(
|
222
|
+
hook_ctx=HookContext(
|
223
|
+
config=self.sdk_configuration,
|
224
|
+
base_url=base_url or "",
|
225
|
+
operation_id="createTicket",
|
226
|
+
oauth2_scopes=[],
|
227
|
+
security_source=get_security_from_env(
|
228
|
+
self.sdk_configuration.security, components.Security
|
229
|
+
),
|
230
|
+
),
|
231
|
+
request=req,
|
232
|
+
error_status_codes=[
|
233
|
+
"400",
|
234
|
+
"401",
|
235
|
+
"403",
|
236
|
+
"404",
|
237
|
+
"409",
|
238
|
+
"422",
|
239
|
+
"429",
|
240
|
+
"4XX",
|
241
|
+
"500",
|
242
|
+
"504",
|
243
|
+
"5XX",
|
244
|
+
],
|
245
|
+
retry_config=retry_config,
|
246
|
+
)
|
247
|
+
|
248
|
+
response_data: Any = None
|
249
|
+
if utils.match_response(http_res, "200", "application/json"):
|
250
|
+
return operations.CreateTicketResponse(
|
251
|
+
result=utils.unmarshal_json_response(components.Ticket, http_res),
|
252
|
+
headers=utils.get_response_headers(http_res.headers),
|
253
|
+
)
|
254
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
255
|
+
response_data = utils.unmarshal_json_response(
|
256
|
+
errors.GenericErrorData, http_res
|
257
|
+
)
|
258
|
+
raise errors.GenericError(response_data, http_res)
|
259
|
+
if utils.match_response(http_res, "422", "application/json"):
|
260
|
+
response_data = utils.unmarshal_json_response(
|
261
|
+
errors.CreateTicketErrorData, http_res
|
262
|
+
)
|
263
|
+
raise errors.CreateTicketError(response_data, http_res)
|
264
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
265
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
266
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
267
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
268
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
269
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
270
|
+
if utils.match_response(http_res, "4XX", "*"):
|
271
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
272
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
273
|
+
if utils.match_response(http_res, "5XX", "*"):
|
274
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
275
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
276
|
+
|
277
|
+
raise errors.APIError("Unexpected response received", http_res)
|
278
|
+
|
279
|
+
def list_tickets(
|
280
|
+
self,
|
281
|
+
*,
|
282
|
+
account_id: str,
|
283
|
+
skip: Optional[int] = None,
|
284
|
+
count: Optional[int] = None,
|
285
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
286
|
+
server_url: Optional[str] = None,
|
287
|
+
timeout_ms: Optional[int] = None,
|
288
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
289
|
+
) -> operations.ListTicketsResponse:
|
290
|
+
r"""List all the support tickets created under a Moov account.
|
291
|
+
|
292
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
293
|
+
you'll need to specify the `/accounts/{accountID}/support.read` scope.
|
294
|
+
|
295
|
+
:param account_id:
|
296
|
+
:param skip:
|
297
|
+
:param count:
|
298
|
+
:param retries: Override the default retry configuration for this method
|
299
|
+
:param server_url: Override the default server URL for this method
|
300
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
301
|
+
:param http_headers: Additional headers to set or replace on requests.
|
302
|
+
"""
|
303
|
+
base_url = None
|
304
|
+
url_variables = None
|
305
|
+
if timeout_ms is None:
|
306
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
307
|
+
|
308
|
+
if server_url is not None:
|
309
|
+
base_url = server_url
|
310
|
+
else:
|
311
|
+
base_url = self._get_url(base_url, url_variables)
|
312
|
+
|
313
|
+
request = operations.ListTicketsRequest(
|
314
|
+
skip=skip,
|
315
|
+
count=count,
|
316
|
+
account_id=account_id,
|
317
|
+
)
|
318
|
+
|
319
|
+
req = self._build_request(
|
320
|
+
method="GET",
|
321
|
+
path="/accounts/{accountID}/tickets",
|
322
|
+
base_url=base_url,
|
323
|
+
url_variables=url_variables,
|
324
|
+
request=request,
|
325
|
+
request_body_required=False,
|
326
|
+
request_has_path_params=True,
|
327
|
+
request_has_query_params=True,
|
328
|
+
user_agent_header="user-agent",
|
329
|
+
accept_header_value="application/json",
|
330
|
+
http_headers=http_headers,
|
331
|
+
_globals=operations.ListTicketsGlobals(
|
332
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
333
|
+
),
|
334
|
+
security=self.sdk_configuration.security,
|
335
|
+
timeout_ms=timeout_ms,
|
336
|
+
)
|
337
|
+
|
338
|
+
if retries == UNSET:
|
339
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
340
|
+
retries = self.sdk_configuration.retry_config
|
341
|
+
|
342
|
+
retry_config = None
|
343
|
+
if isinstance(retries, utils.RetryConfig):
|
344
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
345
|
+
|
346
|
+
http_res = self.do_request(
|
347
|
+
hook_ctx=HookContext(
|
348
|
+
config=self.sdk_configuration,
|
349
|
+
base_url=base_url or "",
|
350
|
+
operation_id="listTickets",
|
351
|
+
oauth2_scopes=[],
|
352
|
+
security_source=get_security_from_env(
|
353
|
+
self.sdk_configuration.security, components.Security
|
354
|
+
),
|
355
|
+
),
|
356
|
+
request=req,
|
357
|
+
error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
|
358
|
+
retry_config=retry_config,
|
359
|
+
)
|
360
|
+
|
361
|
+
if utils.match_response(http_res, "200", "application/json"):
|
362
|
+
return operations.ListTicketsResponse(
|
363
|
+
result=utils.unmarshal_json_response(List[components.Ticket], http_res),
|
364
|
+
headers=utils.get_response_headers(http_res.headers),
|
365
|
+
)
|
366
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
367
|
+
http_res_text = utils.stream_to_text(http_res)
|
368
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
369
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
370
|
+
http_res_text = utils.stream_to_text(http_res)
|
371
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
372
|
+
if utils.match_response(http_res, "4XX", "*"):
|
373
|
+
http_res_text = utils.stream_to_text(http_res)
|
374
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
375
|
+
if utils.match_response(http_res, "5XX", "*"):
|
376
|
+
http_res_text = utils.stream_to_text(http_res)
|
377
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
378
|
+
|
379
|
+
raise errors.APIError("Unexpected response received", http_res)
|
380
|
+
|
381
|
+
async def list_tickets_async(
|
382
|
+
self,
|
383
|
+
*,
|
384
|
+
account_id: str,
|
385
|
+
skip: Optional[int] = None,
|
386
|
+
count: Optional[int] = None,
|
387
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
388
|
+
server_url: Optional[str] = None,
|
389
|
+
timeout_ms: Optional[int] = None,
|
390
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
391
|
+
) -> operations.ListTicketsResponse:
|
392
|
+
r"""List all the support tickets created under a Moov account.
|
393
|
+
|
394
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
395
|
+
you'll need to specify the `/accounts/{accountID}/support.read` scope.
|
396
|
+
|
397
|
+
:param account_id:
|
398
|
+
:param skip:
|
399
|
+
:param count:
|
400
|
+
:param retries: Override the default retry configuration for this method
|
401
|
+
:param server_url: Override the default server URL for this method
|
402
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
403
|
+
:param http_headers: Additional headers to set or replace on requests.
|
404
|
+
"""
|
405
|
+
base_url = None
|
406
|
+
url_variables = None
|
407
|
+
if timeout_ms is None:
|
408
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
409
|
+
|
410
|
+
if server_url is not None:
|
411
|
+
base_url = server_url
|
412
|
+
else:
|
413
|
+
base_url = self._get_url(base_url, url_variables)
|
414
|
+
|
415
|
+
request = operations.ListTicketsRequest(
|
416
|
+
skip=skip,
|
417
|
+
count=count,
|
418
|
+
account_id=account_id,
|
419
|
+
)
|
420
|
+
|
421
|
+
req = self._build_request_async(
|
422
|
+
method="GET",
|
423
|
+
path="/accounts/{accountID}/tickets",
|
424
|
+
base_url=base_url,
|
425
|
+
url_variables=url_variables,
|
426
|
+
request=request,
|
427
|
+
request_body_required=False,
|
428
|
+
request_has_path_params=True,
|
429
|
+
request_has_query_params=True,
|
430
|
+
user_agent_header="user-agent",
|
431
|
+
accept_header_value="application/json",
|
432
|
+
http_headers=http_headers,
|
433
|
+
_globals=operations.ListTicketsGlobals(
|
434
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
435
|
+
),
|
436
|
+
security=self.sdk_configuration.security,
|
437
|
+
timeout_ms=timeout_ms,
|
438
|
+
)
|
439
|
+
|
440
|
+
if retries == UNSET:
|
441
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
442
|
+
retries = self.sdk_configuration.retry_config
|
443
|
+
|
444
|
+
retry_config = None
|
445
|
+
if isinstance(retries, utils.RetryConfig):
|
446
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
447
|
+
|
448
|
+
http_res = await self.do_request_async(
|
449
|
+
hook_ctx=HookContext(
|
450
|
+
config=self.sdk_configuration,
|
451
|
+
base_url=base_url or "",
|
452
|
+
operation_id="listTickets",
|
453
|
+
oauth2_scopes=[],
|
454
|
+
security_source=get_security_from_env(
|
455
|
+
self.sdk_configuration.security, components.Security
|
456
|
+
),
|
457
|
+
),
|
458
|
+
request=req,
|
459
|
+
error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
|
460
|
+
retry_config=retry_config,
|
461
|
+
)
|
462
|
+
|
463
|
+
if utils.match_response(http_res, "200", "application/json"):
|
464
|
+
return operations.ListTicketsResponse(
|
465
|
+
result=utils.unmarshal_json_response(List[components.Ticket], http_res),
|
466
|
+
headers=utils.get_response_headers(http_res.headers),
|
467
|
+
)
|
468
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
469
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
470
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
471
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
472
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
473
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
474
|
+
if utils.match_response(http_res, "4XX", "*"):
|
475
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
476
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
477
|
+
if utils.match_response(http_res, "5XX", "*"):
|
478
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
479
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
480
|
+
|
481
|
+
raise errors.APIError("Unexpected response received", http_res)
|
482
|
+
|
483
|
+
def get_ticket(
|
484
|
+
self,
|
485
|
+
*,
|
486
|
+
account_id: str,
|
487
|
+
ticket_id: str,
|
488
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
489
|
+
server_url: Optional[str] = None,
|
490
|
+
timeout_ms: Optional[int] = None,
|
491
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
492
|
+
) -> operations.GetTicketResponse:
|
493
|
+
r"""Retrieve a support ticket by ID.
|
494
|
+
|
495
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
496
|
+
you'll need to specify the `/accounts/{accountID}/support.read` scope.
|
497
|
+
|
498
|
+
:param account_id:
|
499
|
+
:param ticket_id:
|
500
|
+
:param retries: Override the default retry configuration for this method
|
501
|
+
:param server_url: Override the default server URL for this method
|
502
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
503
|
+
:param http_headers: Additional headers to set or replace on requests.
|
504
|
+
"""
|
505
|
+
base_url = None
|
506
|
+
url_variables = None
|
507
|
+
if timeout_ms is None:
|
508
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
509
|
+
|
510
|
+
if server_url is not None:
|
511
|
+
base_url = server_url
|
512
|
+
else:
|
513
|
+
base_url = self._get_url(base_url, url_variables)
|
514
|
+
|
515
|
+
request = operations.GetTicketRequest(
|
516
|
+
account_id=account_id,
|
517
|
+
ticket_id=ticket_id,
|
518
|
+
)
|
519
|
+
|
520
|
+
req = self._build_request(
|
521
|
+
method="GET",
|
522
|
+
path="/accounts/{accountID}/tickets/{ticketID}",
|
523
|
+
base_url=base_url,
|
524
|
+
url_variables=url_variables,
|
525
|
+
request=request,
|
526
|
+
request_body_required=False,
|
527
|
+
request_has_path_params=True,
|
528
|
+
request_has_query_params=True,
|
529
|
+
user_agent_header="user-agent",
|
530
|
+
accept_header_value="application/json",
|
531
|
+
http_headers=http_headers,
|
532
|
+
_globals=operations.GetTicketGlobals(
|
533
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
534
|
+
),
|
535
|
+
security=self.sdk_configuration.security,
|
536
|
+
timeout_ms=timeout_ms,
|
537
|
+
)
|
538
|
+
|
539
|
+
if retries == UNSET:
|
540
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
541
|
+
retries = self.sdk_configuration.retry_config
|
542
|
+
|
543
|
+
retry_config = None
|
544
|
+
if isinstance(retries, utils.RetryConfig):
|
545
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
546
|
+
|
547
|
+
http_res = self.do_request(
|
548
|
+
hook_ctx=HookContext(
|
549
|
+
config=self.sdk_configuration,
|
550
|
+
base_url=base_url or "",
|
551
|
+
operation_id="getTicket",
|
552
|
+
oauth2_scopes=[],
|
553
|
+
security_source=get_security_from_env(
|
554
|
+
self.sdk_configuration.security, components.Security
|
555
|
+
),
|
556
|
+
),
|
557
|
+
request=req,
|
558
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
559
|
+
retry_config=retry_config,
|
560
|
+
)
|
561
|
+
|
562
|
+
if utils.match_response(http_res, "200", "application/json"):
|
563
|
+
return operations.GetTicketResponse(
|
564
|
+
result=utils.unmarshal_json_response(components.Ticket, http_res),
|
565
|
+
headers=utils.get_response_headers(http_res.headers),
|
566
|
+
)
|
567
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
568
|
+
http_res_text = utils.stream_to_text(http_res)
|
569
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
570
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
571
|
+
http_res_text = utils.stream_to_text(http_res)
|
572
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
573
|
+
if utils.match_response(http_res, "4XX", "*"):
|
574
|
+
http_res_text = utils.stream_to_text(http_res)
|
575
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
576
|
+
if utils.match_response(http_res, "5XX", "*"):
|
577
|
+
http_res_text = utils.stream_to_text(http_res)
|
578
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
579
|
+
|
580
|
+
raise errors.APIError("Unexpected response received", http_res)
|
581
|
+
|
582
|
+
async def get_ticket_async(
|
583
|
+
self,
|
584
|
+
*,
|
585
|
+
account_id: str,
|
586
|
+
ticket_id: str,
|
587
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
588
|
+
server_url: Optional[str] = None,
|
589
|
+
timeout_ms: Optional[int] = None,
|
590
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
591
|
+
) -> operations.GetTicketResponse:
|
592
|
+
r"""Retrieve a support ticket by ID.
|
593
|
+
|
594
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
595
|
+
you'll need to specify the `/accounts/{accountID}/support.read` scope.
|
596
|
+
|
597
|
+
:param account_id:
|
598
|
+
:param ticket_id:
|
599
|
+
:param retries: Override the default retry configuration for this method
|
600
|
+
:param server_url: Override the default server URL for this method
|
601
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
602
|
+
:param http_headers: Additional headers to set or replace on requests.
|
603
|
+
"""
|
604
|
+
base_url = None
|
605
|
+
url_variables = None
|
606
|
+
if timeout_ms is None:
|
607
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
608
|
+
|
609
|
+
if server_url is not None:
|
610
|
+
base_url = server_url
|
611
|
+
else:
|
612
|
+
base_url = self._get_url(base_url, url_variables)
|
613
|
+
|
614
|
+
request = operations.GetTicketRequest(
|
615
|
+
account_id=account_id,
|
616
|
+
ticket_id=ticket_id,
|
617
|
+
)
|
618
|
+
|
619
|
+
req = self._build_request_async(
|
620
|
+
method="GET",
|
621
|
+
path="/accounts/{accountID}/tickets/{ticketID}",
|
622
|
+
base_url=base_url,
|
623
|
+
url_variables=url_variables,
|
624
|
+
request=request,
|
625
|
+
request_body_required=False,
|
626
|
+
request_has_path_params=True,
|
627
|
+
request_has_query_params=True,
|
628
|
+
user_agent_header="user-agent",
|
629
|
+
accept_header_value="application/json",
|
630
|
+
http_headers=http_headers,
|
631
|
+
_globals=operations.GetTicketGlobals(
|
632
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
633
|
+
),
|
634
|
+
security=self.sdk_configuration.security,
|
635
|
+
timeout_ms=timeout_ms,
|
636
|
+
)
|
637
|
+
|
638
|
+
if retries == UNSET:
|
639
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
640
|
+
retries = self.sdk_configuration.retry_config
|
641
|
+
|
642
|
+
retry_config = None
|
643
|
+
if isinstance(retries, utils.RetryConfig):
|
644
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
645
|
+
|
646
|
+
http_res = await self.do_request_async(
|
647
|
+
hook_ctx=HookContext(
|
648
|
+
config=self.sdk_configuration,
|
649
|
+
base_url=base_url or "",
|
650
|
+
operation_id="getTicket",
|
651
|
+
oauth2_scopes=[],
|
652
|
+
security_source=get_security_from_env(
|
653
|
+
self.sdk_configuration.security, components.Security
|
654
|
+
),
|
655
|
+
),
|
656
|
+
request=req,
|
657
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
658
|
+
retry_config=retry_config,
|
659
|
+
)
|
660
|
+
|
661
|
+
if utils.match_response(http_res, "200", "application/json"):
|
662
|
+
return operations.GetTicketResponse(
|
663
|
+
result=utils.unmarshal_json_response(components.Ticket, http_res),
|
664
|
+
headers=utils.get_response_headers(http_res.headers),
|
665
|
+
)
|
666
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
667
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
668
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
669
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
670
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
671
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
672
|
+
if utils.match_response(http_res, "4XX", "*"):
|
673
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
674
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
675
|
+
if utils.match_response(http_res, "5XX", "*"):
|
676
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
677
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
678
|
+
|
679
|
+
raise errors.APIError("Unexpected response received", http_res)
|
680
|
+
|
681
|
+
def update_ticket(
|
682
|
+
self,
|
683
|
+
*,
|
684
|
+
account_id: str,
|
685
|
+
ticket_id: str,
|
686
|
+
status: Optional[components.UpdateTicketStatus] = None,
|
687
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
688
|
+
server_url: Optional[str] = None,
|
689
|
+
timeout_ms: Optional[int] = None,
|
690
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
691
|
+
) -> operations.UpdateTicketResponse:
|
692
|
+
r"""Updates a support ticket.
|
693
|
+
|
694
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
695
|
+
you'll need to specify the `/accounts/{accountID}/support.write` scope.
|
696
|
+
|
697
|
+
:param account_id:
|
698
|
+
:param ticket_id:
|
699
|
+
:param status:
|
700
|
+
:param retries: Override the default retry configuration for this method
|
701
|
+
:param server_url: Override the default server URL for this method
|
702
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
703
|
+
:param http_headers: Additional headers to set or replace on requests.
|
704
|
+
"""
|
705
|
+
base_url = None
|
706
|
+
url_variables = None
|
707
|
+
if timeout_ms is None:
|
708
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
709
|
+
|
710
|
+
if server_url is not None:
|
711
|
+
base_url = server_url
|
712
|
+
else:
|
713
|
+
base_url = self._get_url(base_url, url_variables)
|
714
|
+
|
715
|
+
request = operations.UpdateTicketRequest(
|
716
|
+
account_id=account_id,
|
717
|
+
ticket_id=ticket_id,
|
718
|
+
update_ticket=components.UpdateTicket(
|
719
|
+
status=status,
|
720
|
+
),
|
721
|
+
)
|
722
|
+
|
723
|
+
req = self._build_request(
|
724
|
+
method="PATCH",
|
725
|
+
path="/accounts/{accountID}/tickets/{ticketID}",
|
726
|
+
base_url=base_url,
|
727
|
+
url_variables=url_variables,
|
728
|
+
request=request,
|
729
|
+
request_body_required=True,
|
730
|
+
request_has_path_params=True,
|
731
|
+
request_has_query_params=True,
|
732
|
+
user_agent_header="user-agent",
|
733
|
+
accept_header_value="application/json",
|
734
|
+
http_headers=http_headers,
|
735
|
+
_globals=operations.UpdateTicketGlobals(
|
736
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
737
|
+
),
|
738
|
+
security=self.sdk_configuration.security,
|
739
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
740
|
+
request.update_ticket, False, False, "json", components.UpdateTicket
|
741
|
+
),
|
742
|
+
timeout_ms=timeout_ms,
|
743
|
+
)
|
744
|
+
|
745
|
+
if retries == UNSET:
|
746
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
747
|
+
retries = self.sdk_configuration.retry_config
|
748
|
+
|
749
|
+
retry_config = None
|
750
|
+
if isinstance(retries, utils.RetryConfig):
|
751
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
752
|
+
|
753
|
+
http_res = self.do_request(
|
754
|
+
hook_ctx=HookContext(
|
755
|
+
config=self.sdk_configuration,
|
756
|
+
base_url=base_url or "",
|
757
|
+
operation_id="updateTicket",
|
758
|
+
oauth2_scopes=[],
|
759
|
+
security_source=get_security_from_env(
|
760
|
+
self.sdk_configuration.security, components.Security
|
761
|
+
),
|
762
|
+
),
|
763
|
+
request=req,
|
764
|
+
error_status_codes=[
|
765
|
+
"400",
|
766
|
+
"401",
|
767
|
+
"403",
|
768
|
+
"404",
|
769
|
+
"409",
|
770
|
+
"422",
|
771
|
+
"429",
|
772
|
+
"4XX",
|
773
|
+
"500",
|
774
|
+
"504",
|
775
|
+
"5XX",
|
776
|
+
],
|
777
|
+
retry_config=retry_config,
|
778
|
+
)
|
779
|
+
|
780
|
+
response_data: Any = None
|
781
|
+
if utils.match_response(http_res, "200", "application/json"):
|
782
|
+
return operations.UpdateTicketResponse(
|
783
|
+
result=utils.unmarshal_json_response(components.Ticket, http_res),
|
784
|
+
headers=utils.get_response_headers(http_res.headers),
|
785
|
+
)
|
786
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
787
|
+
response_data = utils.unmarshal_json_response(
|
788
|
+
errors.GenericErrorData, http_res
|
789
|
+
)
|
790
|
+
raise errors.GenericError(response_data, http_res)
|
791
|
+
if utils.match_response(http_res, "422", "application/json"):
|
792
|
+
response_data = utils.unmarshal_json_response(
|
793
|
+
errors.UpdateTicketErrorData, http_res
|
794
|
+
)
|
795
|
+
raise errors.UpdateTicketError(response_data, http_res)
|
796
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
797
|
+
http_res_text = utils.stream_to_text(http_res)
|
798
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
799
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
800
|
+
http_res_text = utils.stream_to_text(http_res)
|
801
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
802
|
+
if utils.match_response(http_res, "4XX", "*"):
|
803
|
+
http_res_text = utils.stream_to_text(http_res)
|
804
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
805
|
+
if utils.match_response(http_res, "5XX", "*"):
|
806
|
+
http_res_text = utils.stream_to_text(http_res)
|
807
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
808
|
+
|
809
|
+
raise errors.APIError("Unexpected response received", http_res)
|
810
|
+
|
811
|
+
async def update_ticket_async(
|
812
|
+
self,
|
813
|
+
*,
|
814
|
+
account_id: str,
|
815
|
+
ticket_id: str,
|
816
|
+
status: Optional[components.UpdateTicketStatus] = None,
|
817
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
818
|
+
server_url: Optional[str] = None,
|
819
|
+
timeout_ms: Optional[int] = None,
|
820
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
821
|
+
) -> operations.UpdateTicketResponse:
|
822
|
+
r"""Updates a support ticket.
|
823
|
+
|
824
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
825
|
+
you'll need to specify the `/accounts/{accountID}/support.write` scope.
|
826
|
+
|
827
|
+
:param account_id:
|
828
|
+
:param ticket_id:
|
829
|
+
:param status:
|
830
|
+
:param retries: Override the default retry configuration for this method
|
831
|
+
:param server_url: Override the default server URL for this method
|
832
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
833
|
+
:param http_headers: Additional headers to set or replace on requests.
|
834
|
+
"""
|
835
|
+
base_url = None
|
836
|
+
url_variables = None
|
837
|
+
if timeout_ms is None:
|
838
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
839
|
+
|
840
|
+
if server_url is not None:
|
841
|
+
base_url = server_url
|
842
|
+
else:
|
843
|
+
base_url = self._get_url(base_url, url_variables)
|
844
|
+
|
845
|
+
request = operations.UpdateTicketRequest(
|
846
|
+
account_id=account_id,
|
847
|
+
ticket_id=ticket_id,
|
848
|
+
update_ticket=components.UpdateTicket(
|
849
|
+
status=status,
|
850
|
+
),
|
851
|
+
)
|
852
|
+
|
853
|
+
req = self._build_request_async(
|
854
|
+
method="PATCH",
|
855
|
+
path="/accounts/{accountID}/tickets/{ticketID}",
|
856
|
+
base_url=base_url,
|
857
|
+
url_variables=url_variables,
|
858
|
+
request=request,
|
859
|
+
request_body_required=True,
|
860
|
+
request_has_path_params=True,
|
861
|
+
request_has_query_params=True,
|
862
|
+
user_agent_header="user-agent",
|
863
|
+
accept_header_value="application/json",
|
864
|
+
http_headers=http_headers,
|
865
|
+
_globals=operations.UpdateTicketGlobals(
|
866
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
867
|
+
),
|
868
|
+
security=self.sdk_configuration.security,
|
869
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
870
|
+
request.update_ticket, False, False, "json", components.UpdateTicket
|
871
|
+
),
|
872
|
+
timeout_ms=timeout_ms,
|
873
|
+
)
|
874
|
+
|
875
|
+
if retries == UNSET:
|
876
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
877
|
+
retries = self.sdk_configuration.retry_config
|
878
|
+
|
879
|
+
retry_config = None
|
880
|
+
if isinstance(retries, utils.RetryConfig):
|
881
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
882
|
+
|
883
|
+
http_res = await self.do_request_async(
|
884
|
+
hook_ctx=HookContext(
|
885
|
+
config=self.sdk_configuration,
|
886
|
+
base_url=base_url or "",
|
887
|
+
operation_id="updateTicket",
|
888
|
+
oauth2_scopes=[],
|
889
|
+
security_source=get_security_from_env(
|
890
|
+
self.sdk_configuration.security, components.Security
|
891
|
+
),
|
892
|
+
),
|
893
|
+
request=req,
|
894
|
+
error_status_codes=[
|
895
|
+
"400",
|
896
|
+
"401",
|
897
|
+
"403",
|
898
|
+
"404",
|
899
|
+
"409",
|
900
|
+
"422",
|
901
|
+
"429",
|
902
|
+
"4XX",
|
903
|
+
"500",
|
904
|
+
"504",
|
905
|
+
"5XX",
|
906
|
+
],
|
907
|
+
retry_config=retry_config,
|
908
|
+
)
|
909
|
+
|
910
|
+
response_data: Any = None
|
911
|
+
if utils.match_response(http_res, "200", "application/json"):
|
912
|
+
return operations.UpdateTicketResponse(
|
913
|
+
result=utils.unmarshal_json_response(components.Ticket, http_res),
|
914
|
+
headers=utils.get_response_headers(http_res.headers),
|
915
|
+
)
|
916
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
917
|
+
response_data = utils.unmarshal_json_response(
|
918
|
+
errors.GenericErrorData, http_res
|
919
|
+
)
|
920
|
+
raise errors.GenericError(response_data, http_res)
|
921
|
+
if utils.match_response(http_res, "422", "application/json"):
|
922
|
+
response_data = utils.unmarshal_json_response(
|
923
|
+
errors.UpdateTicketErrorData, http_res
|
924
|
+
)
|
925
|
+
raise errors.UpdateTicketError(response_data, http_res)
|
926
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
927
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
928
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
929
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
930
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
931
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
932
|
+
if utils.match_response(http_res, "4XX", "*"):
|
933
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
934
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
935
|
+
if utils.match_response(http_res, "5XX", "*"):
|
936
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
937
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
938
|
+
|
939
|
+
raise errors.APIError("Unexpected response received", http_res)
|
940
|
+
|
941
|
+
def list_ticket_messages(
|
942
|
+
self,
|
943
|
+
*,
|
944
|
+
account_id: str,
|
945
|
+
ticket_id: str,
|
946
|
+
skip: Optional[int] = None,
|
947
|
+
count: Optional[int] = None,
|
948
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
949
|
+
server_url: Optional[str] = None,
|
950
|
+
timeout_ms: Optional[int] = None,
|
951
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
952
|
+
) -> operations.ListTicketMessagesResponse:
|
953
|
+
r"""List all the messages for a support ticket.
|
954
|
+
|
955
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
956
|
+
you'll need to specify the `/accounts/{accountID}/support.read` scope.
|
957
|
+
|
958
|
+
:param account_id:
|
959
|
+
:param ticket_id:
|
960
|
+
:param skip:
|
961
|
+
:param count:
|
962
|
+
:param retries: Override the default retry configuration for this method
|
963
|
+
:param server_url: Override the default server URL for this method
|
964
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
965
|
+
:param http_headers: Additional headers to set or replace on requests.
|
966
|
+
"""
|
967
|
+
base_url = None
|
968
|
+
url_variables = None
|
969
|
+
if timeout_ms is None:
|
970
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
971
|
+
|
972
|
+
if server_url is not None:
|
973
|
+
base_url = server_url
|
974
|
+
else:
|
975
|
+
base_url = self._get_url(base_url, url_variables)
|
976
|
+
|
977
|
+
request = operations.ListTicketMessagesRequest(
|
978
|
+
skip=skip,
|
979
|
+
count=count,
|
980
|
+
account_id=account_id,
|
981
|
+
ticket_id=ticket_id,
|
982
|
+
)
|
983
|
+
|
984
|
+
req = self._build_request(
|
985
|
+
method="GET",
|
986
|
+
path="/accounts/{accountID}/tickets/{ticketID}/messages",
|
987
|
+
base_url=base_url,
|
988
|
+
url_variables=url_variables,
|
989
|
+
request=request,
|
990
|
+
request_body_required=False,
|
991
|
+
request_has_path_params=True,
|
992
|
+
request_has_query_params=True,
|
993
|
+
user_agent_header="user-agent",
|
994
|
+
accept_header_value="application/json",
|
995
|
+
http_headers=http_headers,
|
996
|
+
_globals=operations.ListTicketMessagesGlobals(
|
997
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
998
|
+
),
|
999
|
+
security=self.sdk_configuration.security,
|
1000
|
+
timeout_ms=timeout_ms,
|
1001
|
+
)
|
1002
|
+
|
1003
|
+
if retries == UNSET:
|
1004
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1005
|
+
retries = self.sdk_configuration.retry_config
|
1006
|
+
|
1007
|
+
retry_config = None
|
1008
|
+
if isinstance(retries, utils.RetryConfig):
|
1009
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1010
|
+
|
1011
|
+
http_res = self.do_request(
|
1012
|
+
hook_ctx=HookContext(
|
1013
|
+
config=self.sdk_configuration,
|
1014
|
+
base_url=base_url or "",
|
1015
|
+
operation_id="listTicketMessages",
|
1016
|
+
oauth2_scopes=[],
|
1017
|
+
security_source=get_security_from_env(
|
1018
|
+
self.sdk_configuration.security, components.Security
|
1019
|
+
),
|
1020
|
+
),
|
1021
|
+
request=req,
|
1022
|
+
error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
|
1023
|
+
retry_config=retry_config,
|
1024
|
+
)
|
1025
|
+
|
1026
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1027
|
+
return operations.ListTicketMessagesResponse(
|
1028
|
+
result=utils.unmarshal_json_response(
|
1029
|
+
List[components.TicketMessage], http_res
|
1030
|
+
),
|
1031
|
+
headers=utils.get_response_headers(http_res.headers),
|
1032
|
+
)
|
1033
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
1034
|
+
http_res_text = utils.stream_to_text(http_res)
|
1035
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1036
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1037
|
+
http_res_text = utils.stream_to_text(http_res)
|
1038
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1039
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1040
|
+
http_res_text = utils.stream_to_text(http_res)
|
1041
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1042
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1043
|
+
http_res_text = utils.stream_to_text(http_res)
|
1044
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1045
|
+
|
1046
|
+
raise errors.APIError("Unexpected response received", http_res)
|
1047
|
+
|
1048
|
+
async def list_ticket_messages_async(
|
1049
|
+
self,
|
1050
|
+
*,
|
1051
|
+
account_id: str,
|
1052
|
+
ticket_id: str,
|
1053
|
+
skip: Optional[int] = None,
|
1054
|
+
count: Optional[int] = None,
|
1055
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1056
|
+
server_url: Optional[str] = None,
|
1057
|
+
timeout_ms: Optional[int] = None,
|
1058
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1059
|
+
) -> operations.ListTicketMessagesResponse:
|
1060
|
+
r"""List all the messages for a support ticket.
|
1061
|
+
|
1062
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1063
|
+
you'll need to specify the `/accounts/{accountID}/support.read` scope.
|
1064
|
+
|
1065
|
+
:param account_id:
|
1066
|
+
:param ticket_id:
|
1067
|
+
:param skip:
|
1068
|
+
:param count:
|
1069
|
+
:param retries: Override the default retry configuration for this method
|
1070
|
+
:param server_url: Override the default server URL for this method
|
1071
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1072
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1073
|
+
"""
|
1074
|
+
base_url = None
|
1075
|
+
url_variables = None
|
1076
|
+
if timeout_ms is None:
|
1077
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1078
|
+
|
1079
|
+
if server_url is not None:
|
1080
|
+
base_url = server_url
|
1081
|
+
else:
|
1082
|
+
base_url = self._get_url(base_url, url_variables)
|
1083
|
+
|
1084
|
+
request = operations.ListTicketMessagesRequest(
|
1085
|
+
skip=skip,
|
1086
|
+
count=count,
|
1087
|
+
account_id=account_id,
|
1088
|
+
ticket_id=ticket_id,
|
1089
|
+
)
|
1090
|
+
|
1091
|
+
req = self._build_request_async(
|
1092
|
+
method="GET",
|
1093
|
+
path="/accounts/{accountID}/tickets/{ticketID}/messages",
|
1094
|
+
base_url=base_url,
|
1095
|
+
url_variables=url_variables,
|
1096
|
+
request=request,
|
1097
|
+
request_body_required=False,
|
1098
|
+
request_has_path_params=True,
|
1099
|
+
request_has_query_params=True,
|
1100
|
+
user_agent_header="user-agent",
|
1101
|
+
accept_header_value="application/json",
|
1102
|
+
http_headers=http_headers,
|
1103
|
+
_globals=operations.ListTicketMessagesGlobals(
|
1104
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1105
|
+
),
|
1106
|
+
security=self.sdk_configuration.security,
|
1107
|
+
timeout_ms=timeout_ms,
|
1108
|
+
)
|
1109
|
+
|
1110
|
+
if retries == UNSET:
|
1111
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1112
|
+
retries = self.sdk_configuration.retry_config
|
1113
|
+
|
1114
|
+
retry_config = None
|
1115
|
+
if isinstance(retries, utils.RetryConfig):
|
1116
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1117
|
+
|
1118
|
+
http_res = await self.do_request_async(
|
1119
|
+
hook_ctx=HookContext(
|
1120
|
+
config=self.sdk_configuration,
|
1121
|
+
base_url=base_url or "",
|
1122
|
+
operation_id="listTicketMessages",
|
1123
|
+
oauth2_scopes=[],
|
1124
|
+
security_source=get_security_from_env(
|
1125
|
+
self.sdk_configuration.security, components.Security
|
1126
|
+
),
|
1127
|
+
),
|
1128
|
+
request=req,
|
1129
|
+
error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
|
1130
|
+
retry_config=retry_config,
|
1131
|
+
)
|
1132
|
+
|
1133
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1134
|
+
return operations.ListTicketMessagesResponse(
|
1135
|
+
result=utils.unmarshal_json_response(
|
1136
|
+
List[components.TicketMessage], http_res
|
1137
|
+
),
|
1138
|
+
headers=utils.get_response_headers(http_res.headers),
|
1139
|
+
)
|
1140
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
1141
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1142
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1143
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1144
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1145
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1146
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1147
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1148
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1149
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1150
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1151
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1152
|
+
|
1153
|
+
raise errors.APIError("Unexpected response received", http_res)
|