nomba-python 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,460 @@
1
+ # This file is auto-generated from Nomba's OpenAPI spec. Do not edit by hand;
2
+ # regenerate via scripts/generate_resources.py instead.
3
+ from __future__ import annotations
4
+
5
+
6
+ from ..http import AsyncNombaClient, NombaClient
7
+ from ..validation import validate_body
8
+ from .. import models as _models
9
+
10
+
11
+ class Transactions:
12
+ """Sync resource methods for the Transactions group."""
13
+
14
+ def __init__(self, client: NombaClient) -> None:
15
+ self._client = client
16
+
17
+ def fetch_credit_debit_transactions_on_a_sub_account(self, sub_account_id: str, *, limit: str | None = None, cursor: str | None = None, date_from: str | None = None, date_to: str | None = None, **extra: object) -> _models.FetchCreditDebitTransactionsOnASubAccountResponse:
18
+ """
19
+ Fetch credit/debit transactions on a sub account
20
+
21
+ You can use this endpoint to fetch credit/debit transactions on a sub account.
22
+ """
23
+ path = f"/v1/transactions/bank/{sub_account_id}"
24
+ params: dict[str, object] = {}
25
+ if limit is not None:
26
+ params["limit"] = limit
27
+ if cursor is not None:
28
+ params["cursor"] = cursor
29
+ if date_from is not None:
30
+ params["dateFrom"] = date_from
31
+ if date_to is not None:
32
+ params["dateTo"] = date_to
33
+ return self._client.get(path, params=params) # type: ignore[return-value]
34
+
35
+ def fetch_credit_debit_transactions_on_the_parent_account(self, *, limit: str | None = None, cursor: str | None = None, date_from: str | None = None, date_to: str | None = None, **extra: object) -> _models.FetchCreditDebitTransactionsOnTheParentAccountResponse:
36
+ """
37
+ Fetch credit/debit transactions on the parent account
38
+
39
+ You can use this endpoint to fetch credit/debit transactions on the parent account.
40
+ """
41
+ path = "/v1/transactions/bank"
42
+ params: dict[str, object] = {}
43
+ if limit is not None:
44
+ params["limit"] = limit
45
+ if cursor is not None:
46
+ params["cursor"] = cursor
47
+ if date_from is not None:
48
+ params["dateFrom"] = date_from
49
+ if date_to is not None:
50
+ params["dateTo"] = date_to
51
+ return self._client.get(path, params=params) # type: ignore[return-value]
52
+
53
+ def fetch_transactions_on_a_sub_account(self, sub_account_id: str, *, limit: str | None = None, cursor: str | None = None, date_from: str | None = None, date_to: str | None = None, **extra: object) -> _models.FetchTransactionsOnASubAccountResponse:
54
+ """
55
+ Fetch transactions on a sub account
56
+
57
+ You can use this endpoint to fetch transactions on a sub account.
58
+ """
59
+ path = f"/v1/transactions/accounts/{sub_account_id}"
60
+ params: dict[str, object] = {}
61
+ if limit is not None:
62
+ params["limit"] = limit
63
+ if cursor is not None:
64
+ params["cursor"] = cursor
65
+ if date_from is not None:
66
+ params["dateFrom"] = date_from
67
+ if date_to is not None:
68
+ params["dateTo"] = date_to
69
+ return self._client.get(path, params=params) # type: ignore[return-value]
70
+
71
+ def filter_account_transactions(self, account_id: str, *, limit: str | None = None, cursor: str | None = None, date_from: str | None = None, date_to: str | None = None, transaction_ref: object | None = None, status: object | None = None, source: object | None = None, type_: object | None = None, terminal_id: object | None = None, rrn: object | None = None, merchant_tx_ref: object | None = None, order_reference: object | None = None, order_id: object | None = None, **extra: object) -> _models.FilterAccountTransactionsResponse:
72
+ """
73
+ Filter account transactions
74
+
75
+ You can use this endpoint to filter transactions on an account.
76
+
77
+ Body fields:
78
+ transactionRef: Transaction ID/Reference
79
+ status: Transaction status
80
+ source: Transaction source
81
+ type: Transaction type
82
+ terminalId: Terminal ID
83
+ rrn: RRN (Retrieval Reference Number)
84
+ merchantTxRef: Merchant transaction reference
85
+ orderReference: Online checkout order reference
86
+ orderId: Online checkout order id
87
+ """
88
+ path = f"/v1/transactions/accounts/{account_id}"
89
+ params: dict[str, object] = {}
90
+ if limit is not None:
91
+ params["limit"] = limit
92
+ if cursor is not None:
93
+ params["cursor"] = cursor
94
+ if date_from is not None:
95
+ params["dateFrom"] = date_from
96
+ if date_to is not None:
97
+ params["dateTo"] = date_to
98
+ body: dict[str, object] = {}
99
+ if transaction_ref is not None:
100
+ body["transactionRef"] = transaction_ref
101
+ if status is not None:
102
+ body["status"] = status
103
+ if source is not None:
104
+ body["source"] = source
105
+ if type_ is not None:
106
+ body["type"] = type_
107
+ if terminal_id is not None:
108
+ body["terminalId"] = terminal_id
109
+ if rrn is not None:
110
+ body["rrn"] = rrn
111
+ if merchant_tx_ref is not None:
112
+ body["merchantTxRef"] = merchant_tx_ref
113
+ if order_reference is not None:
114
+ body["orderReference"] = order_reference
115
+ if order_id is not None:
116
+ body["orderId"] = order_id
117
+ body.update(extra)
118
+ validate_body("post", "/v1/transactions/accounts/{subAccountId}", body)
119
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
120
+
121
+ def fetch_transactions_on_the_parent_account(self, *, limit: str | None = None, cursor: str | None = None, date_from: str | None = None, date_to: str | None = None, **extra: object) -> _models.FetchTransactionsOnTheParentAccountResponse:
122
+ """
123
+ Fetch transactions on the parent account
124
+
125
+ You can use this endpoint to fetch transactions on the parent account.
126
+ """
127
+ path = "/v1/transactions/accounts"
128
+ params: dict[str, object] = {}
129
+ if limit is not None:
130
+ params["limit"] = limit
131
+ if cursor is not None:
132
+ params["cursor"] = cursor
133
+ if date_from is not None:
134
+ params["dateFrom"] = date_from
135
+ if date_to is not None:
136
+ params["dateTo"] = date_to
137
+ return self._client.get(path, params=params) # type: ignore[return-value]
138
+
139
+ def filter_parent_account_transactions(self, *, limit: str | None = None, cursor: str | None = None, date_from: str | None = None, date_to: str | None = None, transaction_ref: object | None = None, status: object | None = None, source: object | None = None, type_: object | None = None, terminal_id: object | None = None, rrn: object | None = None, merchant_tx_ref: object | None = None, order_reference: object | None = None, order_id: object | None = None, **extra: object) -> _models.FilterParentAccountTransactionsResponse:
140
+ """
141
+ Filter parent account transactions
142
+
143
+ You can use this endpoint to filter transactions on the parent account.
144
+
145
+ Body fields:
146
+ transactionRef: Transaction ID/Reference
147
+ status: Transaction status
148
+ source: Transaction source
149
+ type: Transaction type
150
+ terminalId: Terminal ID
151
+ rrn: RRN (Retrieval Reference Number)
152
+ merchantTxRef: Merchant transaction reference
153
+ orderReference: Online checkout order reference
154
+ orderId: Online checkout order id
155
+ """
156
+ path = "/v1/transactions/accounts"
157
+ params: dict[str, object] = {}
158
+ if limit is not None:
159
+ params["limit"] = limit
160
+ if cursor is not None:
161
+ params["cursor"] = cursor
162
+ if date_from is not None:
163
+ params["dateFrom"] = date_from
164
+ if date_to is not None:
165
+ params["dateTo"] = date_to
166
+ body: dict[str, object] = {}
167
+ if transaction_ref is not None:
168
+ body["transactionRef"] = transaction_ref
169
+ if status is not None:
170
+ body["status"] = status
171
+ if source is not None:
172
+ body["source"] = source
173
+ if type_ is not None:
174
+ body["type"] = type_
175
+ if terminal_id is not None:
176
+ body["terminalId"] = terminal_id
177
+ if rrn is not None:
178
+ body["rrn"] = rrn
179
+ if merchant_tx_ref is not None:
180
+ body["merchantTxRef"] = merchant_tx_ref
181
+ if order_reference is not None:
182
+ body["orderReference"] = order_reference
183
+ if order_id is not None:
184
+ body["orderId"] = order_id
185
+ body.update(extra)
186
+ validate_body("post", "/v1/transactions/accounts", body)
187
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
188
+
189
+ def fetch_a_single_transaction_on_a_sub_account(self, sub_account_id: str, *, transaction_ref: str | None = None, merchant_tx_ref: str | None = None, order_reference: str | None = None, order_id: str | None = None, **extra: object) -> _models.FetchASingleTransactionOnASubAccountResponse:
190
+ """
191
+ Fetch a single transaction on a sub account
192
+
193
+ You can use this endpoint to fetch a single transaction on a sub account
194
+ """
195
+ path = f"/v1/transactions/accounts/{sub_account_id}/single"
196
+ params: dict[str, object] = {}
197
+ if transaction_ref is not None:
198
+ params["transactionRef"] = transaction_ref
199
+ if merchant_tx_ref is not None:
200
+ params["merchantTxRef"] = merchant_tx_ref
201
+ if order_reference is not None:
202
+ params["orderReference"] = order_reference
203
+ if order_id is not None:
204
+ params["orderId"] = order_id
205
+ return self._client.get(path, params=params) # type: ignore[return-value]
206
+
207
+ def fetch_a_single_transaction_on_the_parent_account(self, *, transaction_ref: str | None = None, merchant_tx_ref: str | None = None, order_reference: str | None = None, order_id: str | None = None, **extra: object) -> _models.FetchASingleTransactionOnTheParentAccountResponse:
208
+ """
209
+ Fetch a single transaction on the parent account
210
+
211
+ You can use this endpoint to fetch a single transaction on the parent account.
212
+ """
213
+ path = "/v1/transactions/accounts/single"
214
+ params: dict[str, object] = {}
215
+ if transaction_ref is not None:
216
+ params["transactionRef"] = transaction_ref
217
+ if merchant_tx_ref is not None:
218
+ params["merchantTxRef"] = merchant_tx_ref
219
+ if order_reference is not None:
220
+ params["orderReference"] = order_reference
221
+ if order_id is not None:
222
+ params["orderId"] = order_id
223
+ return self._client.get(path, params=params) # type: ignore[return-value]
224
+
225
+ def confirm_a_transaction_s_status_by_session_id(self, session_id: str, **extra: object) -> _models.ConfirmATransactionSStatusBySessionIdResponse:
226
+ """
227
+ Fetch a single transaction on the parent account
228
+
229
+ This endpoint is for fetching (requerying) a transaction status.
230
+ """
231
+ path = f"/v1/transactions/requery/{session_id}"
232
+ params = None
233
+ return self._client.get(path, params=params) # type: ignore[return-value]
234
+
235
+
236
+
237
+ class AsyncTransactions:
238
+ """Async resource methods for the Transactions group."""
239
+
240
+ def __init__(self, client: AsyncNombaClient) -> None:
241
+ self._client = client
242
+
243
+ async def fetch_credit_debit_transactions_on_a_sub_account(self, sub_account_id: str, *, limit: str | None = None, cursor: str | None = None, date_from: str | None = None, date_to: str | None = None, **extra: object) -> _models.FetchCreditDebitTransactionsOnASubAccountResponse:
244
+ """
245
+ Fetch credit/debit transactions on a sub account
246
+
247
+ You can use this endpoint to fetch credit/debit transactions on a sub account.
248
+ """
249
+ path = f"/v1/transactions/bank/{sub_account_id}"
250
+ params: dict[str, object] = {}
251
+ if limit is not None:
252
+ params["limit"] = limit
253
+ if cursor is not None:
254
+ params["cursor"] = cursor
255
+ if date_from is not None:
256
+ params["dateFrom"] = date_from
257
+ if date_to is not None:
258
+ params["dateTo"] = date_to
259
+ return await self._client.get(path, params=params) # type: ignore[return-value]
260
+
261
+ async def fetch_credit_debit_transactions_on_the_parent_account(self, *, limit: str | None = None, cursor: str | None = None, date_from: str | None = None, date_to: str | None = None, **extra: object) -> _models.FetchCreditDebitTransactionsOnTheParentAccountResponse:
262
+ """
263
+ Fetch credit/debit transactions on the parent account
264
+
265
+ You can use this endpoint to fetch credit/debit transactions on the parent account.
266
+ """
267
+ path = "/v1/transactions/bank"
268
+ params: dict[str, object] = {}
269
+ if limit is not None:
270
+ params["limit"] = limit
271
+ if cursor is not None:
272
+ params["cursor"] = cursor
273
+ if date_from is not None:
274
+ params["dateFrom"] = date_from
275
+ if date_to is not None:
276
+ params["dateTo"] = date_to
277
+ return await self._client.get(path, params=params) # type: ignore[return-value]
278
+
279
+ async def fetch_transactions_on_a_sub_account(self, sub_account_id: str, *, limit: str | None = None, cursor: str | None = None, date_from: str | None = None, date_to: str | None = None, **extra: object) -> _models.FetchTransactionsOnASubAccountResponse:
280
+ """
281
+ Fetch transactions on a sub account
282
+
283
+ You can use this endpoint to fetch transactions on a sub account.
284
+ """
285
+ path = f"/v1/transactions/accounts/{sub_account_id}"
286
+ params: dict[str, object] = {}
287
+ if limit is not None:
288
+ params["limit"] = limit
289
+ if cursor is not None:
290
+ params["cursor"] = cursor
291
+ if date_from is not None:
292
+ params["dateFrom"] = date_from
293
+ if date_to is not None:
294
+ params["dateTo"] = date_to
295
+ return await self._client.get(path, params=params) # type: ignore[return-value]
296
+
297
+ async def filter_account_transactions(self, account_id: str, *, limit: str | None = None, cursor: str | None = None, date_from: str | None = None, date_to: str | None = None, transaction_ref: object | None = None, status: object | None = None, source: object | None = None, type_: object | None = None, terminal_id: object | None = None, rrn: object | None = None, merchant_tx_ref: object | None = None, order_reference: object | None = None, order_id: object | None = None, **extra: object) -> _models.FilterAccountTransactionsResponse:
298
+ """
299
+ Filter account transactions
300
+
301
+ You can use this endpoint to filter transactions on an account.
302
+
303
+ Body fields:
304
+ transactionRef: Transaction ID/Reference
305
+ status: Transaction status
306
+ source: Transaction source
307
+ type: Transaction type
308
+ terminalId: Terminal ID
309
+ rrn: RRN (Retrieval Reference Number)
310
+ merchantTxRef: Merchant transaction reference
311
+ orderReference: Online checkout order reference
312
+ orderId: Online checkout order id
313
+ """
314
+ path = f"/v1/transactions/accounts/{account_id}"
315
+ params: dict[str, object] = {}
316
+ if limit is not None:
317
+ params["limit"] = limit
318
+ if cursor is not None:
319
+ params["cursor"] = cursor
320
+ if date_from is not None:
321
+ params["dateFrom"] = date_from
322
+ if date_to is not None:
323
+ params["dateTo"] = date_to
324
+ body: dict[str, object] = {}
325
+ if transaction_ref is not None:
326
+ body["transactionRef"] = transaction_ref
327
+ if status is not None:
328
+ body["status"] = status
329
+ if source is not None:
330
+ body["source"] = source
331
+ if type_ is not None:
332
+ body["type"] = type_
333
+ if terminal_id is not None:
334
+ body["terminalId"] = terminal_id
335
+ if rrn is not None:
336
+ body["rrn"] = rrn
337
+ if merchant_tx_ref is not None:
338
+ body["merchantTxRef"] = merchant_tx_ref
339
+ if order_reference is not None:
340
+ body["orderReference"] = order_reference
341
+ if order_id is not None:
342
+ body["orderId"] = order_id
343
+ body.update(extra)
344
+ validate_body("post", "/v1/transactions/accounts/{subAccountId}", body)
345
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
346
+
347
+ async def fetch_transactions_on_the_parent_account(self, *, limit: str | None = None, cursor: str | None = None, date_from: str | None = None, date_to: str | None = None, **extra: object) -> _models.FetchTransactionsOnTheParentAccountResponse:
348
+ """
349
+ Fetch transactions on the parent account
350
+
351
+ You can use this endpoint to fetch transactions on the parent account.
352
+ """
353
+ path = "/v1/transactions/accounts"
354
+ params: dict[str, object] = {}
355
+ if limit is not None:
356
+ params["limit"] = limit
357
+ if cursor is not None:
358
+ params["cursor"] = cursor
359
+ if date_from is not None:
360
+ params["dateFrom"] = date_from
361
+ if date_to is not None:
362
+ params["dateTo"] = date_to
363
+ return await self._client.get(path, params=params) # type: ignore[return-value]
364
+
365
+ async def filter_parent_account_transactions(self, *, limit: str | None = None, cursor: str | None = None, date_from: str | None = None, date_to: str | None = None, transaction_ref: object | None = None, status: object | None = None, source: object | None = None, type_: object | None = None, terminal_id: object | None = None, rrn: object | None = None, merchant_tx_ref: object | None = None, order_reference: object | None = None, order_id: object | None = None, **extra: object) -> _models.FilterParentAccountTransactionsResponse:
366
+ """
367
+ Filter parent account transactions
368
+
369
+ You can use this endpoint to filter transactions on the parent account.
370
+
371
+ Body fields:
372
+ transactionRef: Transaction ID/Reference
373
+ status: Transaction status
374
+ source: Transaction source
375
+ type: Transaction type
376
+ terminalId: Terminal ID
377
+ rrn: RRN (Retrieval Reference Number)
378
+ merchantTxRef: Merchant transaction reference
379
+ orderReference: Online checkout order reference
380
+ orderId: Online checkout order id
381
+ """
382
+ path = "/v1/transactions/accounts"
383
+ params: dict[str, object] = {}
384
+ if limit is not None:
385
+ params["limit"] = limit
386
+ if cursor is not None:
387
+ params["cursor"] = cursor
388
+ if date_from is not None:
389
+ params["dateFrom"] = date_from
390
+ if date_to is not None:
391
+ params["dateTo"] = date_to
392
+ body: dict[str, object] = {}
393
+ if transaction_ref is not None:
394
+ body["transactionRef"] = transaction_ref
395
+ if status is not None:
396
+ body["status"] = status
397
+ if source is not None:
398
+ body["source"] = source
399
+ if type_ is not None:
400
+ body["type"] = type_
401
+ if terminal_id is not None:
402
+ body["terminalId"] = terminal_id
403
+ if rrn is not None:
404
+ body["rrn"] = rrn
405
+ if merchant_tx_ref is not None:
406
+ body["merchantTxRef"] = merchant_tx_ref
407
+ if order_reference is not None:
408
+ body["orderReference"] = order_reference
409
+ if order_id is not None:
410
+ body["orderId"] = order_id
411
+ body.update(extra)
412
+ validate_body("post", "/v1/transactions/accounts", body)
413
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
414
+
415
+ async def fetch_a_single_transaction_on_a_sub_account(self, sub_account_id: str, *, transaction_ref: str | None = None, merchant_tx_ref: str | None = None, order_reference: str | None = None, order_id: str | None = None, **extra: object) -> _models.FetchASingleTransactionOnASubAccountResponse:
416
+ """
417
+ Fetch a single transaction on a sub account
418
+
419
+ You can use this endpoint to fetch a single transaction on a sub account
420
+ """
421
+ path = f"/v1/transactions/accounts/{sub_account_id}/single"
422
+ params: dict[str, object] = {}
423
+ if transaction_ref is not None:
424
+ params["transactionRef"] = transaction_ref
425
+ if merchant_tx_ref is not None:
426
+ params["merchantTxRef"] = merchant_tx_ref
427
+ if order_reference is not None:
428
+ params["orderReference"] = order_reference
429
+ if order_id is not None:
430
+ params["orderId"] = order_id
431
+ return await self._client.get(path, params=params) # type: ignore[return-value]
432
+
433
+ async def fetch_a_single_transaction_on_the_parent_account(self, *, transaction_ref: str | None = None, merchant_tx_ref: str | None = None, order_reference: str | None = None, order_id: str | None = None, **extra: object) -> _models.FetchASingleTransactionOnTheParentAccountResponse:
434
+ """
435
+ Fetch a single transaction on the parent account
436
+
437
+ You can use this endpoint to fetch a single transaction on the parent account.
438
+ """
439
+ path = "/v1/transactions/accounts/single"
440
+ params: dict[str, object] = {}
441
+ if transaction_ref is not None:
442
+ params["transactionRef"] = transaction_ref
443
+ if merchant_tx_ref is not None:
444
+ params["merchantTxRef"] = merchant_tx_ref
445
+ if order_reference is not None:
446
+ params["orderReference"] = order_reference
447
+ if order_id is not None:
448
+ params["orderId"] = order_id
449
+ return await self._client.get(path, params=params) # type: ignore[return-value]
450
+
451
+ async def confirm_a_transaction_s_status_by_session_id(self, session_id: str, **extra: object) -> _models.ConfirmATransactionSStatusBySessionIdResponse:
452
+ """
453
+ Fetch a single transaction on the parent account
454
+
455
+ This endpoint is for fetching (requerying) a transaction status.
456
+ """
457
+ path = f"/v1/transactions/requery/{session_id}"
458
+ params = None
459
+ return await self._client.get(path, params=params) # type: ignore[return-value]
460
+