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,252 @@
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 AirtimeData:
12
+ """Sync resource methods for the AirtimeData group."""
13
+
14
+ def __init__(self, client: NombaClient) -> None:
15
+ self._client = client
16
+
17
+ def fetch_data_plans_available_on_a_telco_network_provider(self, telco: str, **extra: object) -> _models.FetchDataPlansAvailableOnATelcoNetworkProviderResponse:
18
+ """
19
+ Fetch data plans available on a telco (network provider)
20
+
21
+ You can use this endpoint to fetch data plans available on a telco (network provider)
22
+ """
23
+ path = f"/v1/bill/data-plan/{telco}"
24
+ params = None
25
+ return self._client.get(path, params=params) # type: ignore[return-value]
26
+
27
+ def make_airtime_purchases_via_parent_account(self, amount, phone_number, network, merchant_tx_ref, *, sender_name: object | None = None, **extra: object) -> _models.MakeAirtimePurchasesViaParentAccountResponse:
28
+ """
29
+ Make airtime purchases via parent account
30
+
31
+ You can use this endpoint to make airtime purchases via parent account
32
+
33
+ Body fields:
34
+ amount (required): The airtime amount to be purchased
35
+ phoneNumber (required): Recipient phone number
36
+ network (required): Recipient network (telco). It can also come as lowercased values e.g. glo, mtn etc.
37
+ merchantTxRef (required): Merchant Transaction Identifier reference (Unique to merchant)
38
+ senderName: A name to describe the sender of the airtime
39
+ """
40
+ path = "/v1/bill/topup"
41
+ params = None
42
+ body: dict[str, object] = {}
43
+ body["amount"] = amount
44
+ body["phoneNumber"] = phone_number
45
+ body["network"] = network
46
+ body["merchantTxRef"] = merchant_tx_ref
47
+ if sender_name is not None:
48
+ body["senderName"] = sender_name
49
+ body.update(extra)
50
+ validate_body("post", "/v1/bill/topup", body)
51
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
52
+
53
+ def make_airtime_purchases_via_specific_or_sub_account(self, sub_account_id: str, amount, phone_number, network, merchant_tx_ref, *, sender_name: object | None = None, **extra: object) -> _models.MakeAirtimePurchasesViaSpecificOrSubAccountResponse:
54
+ """
55
+ Make airtime purchases via a sub account
56
+
57
+ You can use this endpoint to make airtime purchases via a sub account
58
+
59
+ Body fields:
60
+ amount (required): The airtime amount to be purchased
61
+ phoneNumber (required): Recipient phone number
62
+ network (required): Recipient network (telco). It can also come as lowercased values e.g. glo, mtn etc.
63
+ merchantTxRef (required): Merchant Transaction Identifier reference (Unique to merchant)
64
+ senderName: A name to describe the sender of the airtime
65
+ """
66
+ path = f"/v1/bill/topup/{sub_account_id}"
67
+ params = None
68
+ body: dict[str, object] = {}
69
+ body["amount"] = amount
70
+ body["phoneNumber"] = phone_number
71
+ body["network"] = network
72
+ body["merchantTxRef"] = merchant_tx_ref
73
+ if sender_name is not None:
74
+ body["senderName"] = sender_name
75
+ body.update(extra)
76
+ validate_body("post", "/v1/bill/topup/{subAccountId}", body)
77
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
78
+
79
+ def vend_data_bundles_via_parent_account(self, amount, phone_number, network, merchant_tx_ref, *, sender_name: object | None = None, **extra: object) -> _models.VendDataBundlesViaParentAccountResponse:
80
+ """
81
+ Vend data bundles via parent account
82
+
83
+ You can use this endpoint to vend data via parent account
84
+
85
+ Body fields:
86
+ amount (required): The data amount to be vended
87
+ phoneNumber (required): Recipient phone number
88
+ network (required): Recipient network (telco). It can also come as lowercased values e.g. glo, mtn etc.
89
+ merchantTxRef (required): Merchant Transaction Identifier reference (Unique to merchant)
90
+ senderName: A name to describe the sender of the data
91
+ """
92
+ path = "/v1/bill/data"
93
+ params = None
94
+ body: dict[str, object] = {}
95
+ body["amount"] = amount
96
+ body["phoneNumber"] = phone_number
97
+ body["network"] = network
98
+ body["merchantTxRef"] = merchant_tx_ref
99
+ if sender_name is not None:
100
+ body["senderName"] = sender_name
101
+ body.update(extra)
102
+ validate_body("post", "/v1/bill/data", body)
103
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
104
+
105
+ def vend_data_bundles_via_specific_or_sub_account(self, sub_account_id: str, amount, phone_number, network, merchant_tx_ref, *, sender_name: object | None = None, **extra: object) -> _models.VendDataBundlesViaSpecificOrSubAccountResponse:
106
+ """
107
+ Vend data bundles via a sub account
108
+
109
+ You can use this endpoint to vend data via a sub account
110
+
111
+ Body fields:
112
+ amount (required): The data amount to be vended
113
+ phoneNumber (required): Recipient phone number
114
+ network (required): Recipient network (telco). It can also come as lowercased values e.g. glo, mtn etc.
115
+ merchantTxRef (required): Merchant Transaction Identifier reference (Unique to merchant)
116
+ senderName: A name to describe the sender of the data
117
+ """
118
+ path = f"/v1/bill/data/{sub_account_id}"
119
+ params = None
120
+ body: dict[str, object] = {}
121
+ body["amount"] = amount
122
+ body["phoneNumber"] = phone_number
123
+ body["network"] = network
124
+ body["merchantTxRef"] = merchant_tx_ref
125
+ if sender_name is not None:
126
+ body["senderName"] = sender_name
127
+ body.update(extra)
128
+ validate_body("post", "/v1/bill/data/{subAccountId}", body)
129
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
130
+
131
+
132
+
133
+ class AsyncAirtimeData:
134
+ """Async resource methods for the AirtimeData group."""
135
+
136
+ def __init__(self, client: AsyncNombaClient) -> None:
137
+ self._client = client
138
+
139
+ async def fetch_data_plans_available_on_a_telco_network_provider(self, telco: str, **extra: object) -> _models.FetchDataPlansAvailableOnATelcoNetworkProviderResponse:
140
+ """
141
+ Fetch data plans available on a telco (network provider)
142
+
143
+ You can use this endpoint to fetch data plans available on a telco (network provider)
144
+ """
145
+ path = f"/v1/bill/data-plan/{telco}"
146
+ params = None
147
+ return await self._client.get(path, params=params) # type: ignore[return-value]
148
+
149
+ async def make_airtime_purchases_via_parent_account(self, amount, phone_number, network, merchant_tx_ref, *, sender_name: object | None = None, **extra: object) -> _models.MakeAirtimePurchasesViaParentAccountResponse:
150
+ """
151
+ Make airtime purchases via parent account
152
+
153
+ You can use this endpoint to make airtime purchases via parent account
154
+
155
+ Body fields:
156
+ amount (required): The airtime amount to be purchased
157
+ phoneNumber (required): Recipient phone number
158
+ network (required): Recipient network (telco). It can also come as lowercased values e.g. glo, mtn etc.
159
+ merchantTxRef (required): Merchant Transaction Identifier reference (Unique to merchant)
160
+ senderName: A name to describe the sender of the airtime
161
+ """
162
+ path = "/v1/bill/topup"
163
+ params = None
164
+ body: dict[str, object] = {}
165
+ body["amount"] = amount
166
+ body["phoneNumber"] = phone_number
167
+ body["network"] = network
168
+ body["merchantTxRef"] = merchant_tx_ref
169
+ if sender_name is not None:
170
+ body["senderName"] = sender_name
171
+ body.update(extra)
172
+ validate_body("post", "/v1/bill/topup", body)
173
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
174
+
175
+ async def make_airtime_purchases_via_specific_or_sub_account(self, sub_account_id: str, amount, phone_number, network, merchant_tx_ref, *, sender_name: object | None = None, **extra: object) -> _models.MakeAirtimePurchasesViaSpecificOrSubAccountResponse:
176
+ """
177
+ Make airtime purchases via a sub account
178
+
179
+ You can use this endpoint to make airtime purchases via a sub account
180
+
181
+ Body fields:
182
+ amount (required): The airtime amount to be purchased
183
+ phoneNumber (required): Recipient phone number
184
+ network (required): Recipient network (telco). It can also come as lowercased values e.g. glo, mtn etc.
185
+ merchantTxRef (required): Merchant Transaction Identifier reference (Unique to merchant)
186
+ senderName: A name to describe the sender of the airtime
187
+ """
188
+ path = f"/v1/bill/topup/{sub_account_id}"
189
+ params = None
190
+ body: dict[str, object] = {}
191
+ body["amount"] = amount
192
+ body["phoneNumber"] = phone_number
193
+ body["network"] = network
194
+ body["merchantTxRef"] = merchant_tx_ref
195
+ if sender_name is not None:
196
+ body["senderName"] = sender_name
197
+ body.update(extra)
198
+ validate_body("post", "/v1/bill/topup/{subAccountId}", body)
199
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
200
+
201
+ async def vend_data_bundles_via_parent_account(self, amount, phone_number, network, merchant_tx_ref, *, sender_name: object | None = None, **extra: object) -> _models.VendDataBundlesViaParentAccountResponse:
202
+ """
203
+ Vend data bundles via parent account
204
+
205
+ You can use this endpoint to vend data via parent account
206
+
207
+ Body fields:
208
+ amount (required): The data amount to be vended
209
+ phoneNumber (required): Recipient phone number
210
+ network (required): Recipient network (telco). It can also come as lowercased values e.g. glo, mtn etc.
211
+ merchantTxRef (required): Merchant Transaction Identifier reference (Unique to merchant)
212
+ senderName: A name to describe the sender of the data
213
+ """
214
+ path = "/v1/bill/data"
215
+ params = None
216
+ body: dict[str, object] = {}
217
+ body["amount"] = amount
218
+ body["phoneNumber"] = phone_number
219
+ body["network"] = network
220
+ body["merchantTxRef"] = merchant_tx_ref
221
+ if sender_name is not None:
222
+ body["senderName"] = sender_name
223
+ body.update(extra)
224
+ validate_body("post", "/v1/bill/data", body)
225
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
226
+
227
+ async def vend_data_bundles_via_specific_or_sub_account(self, sub_account_id: str, amount, phone_number, network, merchant_tx_ref, *, sender_name: object | None = None, **extra: object) -> _models.VendDataBundlesViaSpecificOrSubAccountResponse:
228
+ """
229
+ Vend data bundles via a sub account
230
+
231
+ You can use this endpoint to vend data via a sub account
232
+
233
+ Body fields:
234
+ amount (required): The data amount to be vended
235
+ phoneNumber (required): Recipient phone number
236
+ network (required): Recipient network (telco). It can also come as lowercased values e.g. glo, mtn etc.
237
+ merchantTxRef (required): Merchant Transaction Identifier reference (Unique to merchant)
238
+ senderName: A name to describe the sender of the data
239
+ """
240
+ path = f"/v1/bill/data/{sub_account_id}"
241
+ params = None
242
+ body: dict[str, object] = {}
243
+ body["amount"] = amount
244
+ body["phoneNumber"] = phone_number
245
+ body["network"] = network
246
+ body["merchantTxRef"] = merchant_tx_ref
247
+ if sender_name is not None:
248
+ body["senderName"] = sender_name
249
+ body.update(extra)
250
+ validate_body("post", "/v1/bill/data/{subAccountId}", body)
251
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
252
+
@@ -0,0 +1,173 @@
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
+ from typing import Any
6
+
7
+ from ..http import AsyncNombaClient, NombaClient
8
+ from ..validation import validate_body
9
+ from .. import models as _models
10
+
11
+
12
+ class CableTv:
13
+ """Sync resource methods for the CableTv group."""
14
+
15
+ def __init__(self, client: NombaClient) -> None:
16
+ self._client = client
17
+
18
+ def cabletv_lookup(self, *, customer_id: str | None = None, cable_tv_type: str | None = None, **extra: object) -> _models.CabletvLookupResponse:
19
+ """
20
+ Fetch customer information from a cable tv provider
21
+
22
+ This endpoint is for fetching customer information data
23
+ """
24
+ path = f"/v1/bill/cabletv/lookup"
25
+ params: dict[str, object] = {}
26
+ if customer_id is not None:
27
+ params["customerId"] = customer_id
28
+ if cable_tv_type is not None:
29
+ params["cableTvType"] = cable_tv_type
30
+ return self._client.get(path, params=params) # type: ignore[return-value]
31
+
32
+ def cable_tv_subscription_via_parent_account(self, *, cable_tv_type: object | None = None, merchant_tx_ref: object | None = None, payer_name: object | None = None, amount: object | None = None, customer_id: object | None = None, **extra: object) -> _models.CableTvSubscriptionViaParentAccountResponse:
33
+ """
34
+ CableTv subscription via parent account
35
+
36
+ You can use this endpoint to make cable tv subscription via parent account
37
+
38
+ Body fields:
39
+ cableTvType:
40
+ merchantTxRef:
41
+ payerName:
42
+ amount:
43
+ customerId:
44
+ """
45
+ path = f"/v1/bill/cabletv"
46
+ params = None
47
+ body: dict[str, object] = {}
48
+ if cable_tv_type is not None:
49
+ body["cableTvType"] = cable_tv_type
50
+ if merchant_tx_ref is not None:
51
+ body["merchantTxRef"] = merchant_tx_ref
52
+ if payer_name is not None:
53
+ body["payerName"] = payer_name
54
+ if amount is not None:
55
+ body["amount"] = amount
56
+ if customer_id is not None:
57
+ body["customerId"] = customer_id
58
+ body.update(extra)
59
+ validate_body("post", "/v1/bill/cabletv", body)
60
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
61
+
62
+ def cable_tv_subscription_via_a_sub_account(self, sub_account_id: str, *, cable_tv_type: object | None = None, merchant_tx_ref: object | None = None, payer_name: object | None = None, amount: object | None = None, customer_id: object | None = None, **extra: object) -> _models.CableTvSubscriptionViaASubAccountResponse:
63
+ """
64
+ CableTv subscription via a sub account
65
+
66
+ You can use this endpoint to make cable tv subscription via a sub account
67
+
68
+ Body fields:
69
+ cableTvType:
70
+ merchantTxRef:
71
+ payerName:
72
+ amount:
73
+ customerId:
74
+ """
75
+ path = f"/v1/bill/cabletv/{sub_account_id}"
76
+ params = None
77
+ body: dict[str, object] = {}
78
+ if cable_tv_type is not None:
79
+ body["cableTvType"] = cable_tv_type
80
+ if merchant_tx_ref is not None:
81
+ body["merchantTxRef"] = merchant_tx_ref
82
+ if payer_name is not None:
83
+ body["payerName"] = payer_name
84
+ if amount is not None:
85
+ body["amount"] = amount
86
+ if customer_id is not None:
87
+ body["customerId"] = customer_id
88
+ body.update(extra)
89
+ validate_body("post", "/v1/bill/cabletv/{subAccountId}", body)
90
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
91
+
92
+
93
+
94
+ class AsyncCableTv:
95
+ """Async resource methods for the CableTv group."""
96
+
97
+ def __init__(self, client: AsyncNombaClient) -> None:
98
+ self._client = client
99
+
100
+ async def cabletv_lookup(self, *, customer_id: str | None = None, cable_tv_type: str | None = None, **extra: object) -> _models.CabletvLookupResponse:
101
+ """
102
+ Fetch customer information from a cable tv provider
103
+
104
+ This endpoint is for fetching customer information data
105
+ """
106
+ path = f"/v1/bill/cabletv/lookup"
107
+ params: dict[str, object] = {}
108
+ if customer_id is not None:
109
+ params["customerId"] = customer_id
110
+ if cable_tv_type is not None:
111
+ params["cableTvType"] = cable_tv_type
112
+ return await self._client.get(path, params=params) # type: ignore[return-value]
113
+
114
+ async def cable_tv_subscription_via_parent_account(self, *, cable_tv_type: object | None = None, merchant_tx_ref: object | None = None, payer_name: object | None = None, amount: object | None = None, customer_id: object | None = None, **extra: object) -> _models.CableTvSubscriptionViaParentAccountResponse:
115
+ """
116
+ CableTv subscription via parent account
117
+
118
+ You can use this endpoint to make cable tv subscription via parent account
119
+
120
+ Body fields:
121
+ cableTvType:
122
+ merchantTxRef:
123
+ payerName:
124
+ amount:
125
+ customerId:
126
+ """
127
+ path = f"/v1/bill/cabletv"
128
+ params = None
129
+ body: dict[str, object] = {}
130
+ if cable_tv_type is not None:
131
+ body["cableTvType"] = cable_tv_type
132
+ if merchant_tx_ref is not None:
133
+ body["merchantTxRef"] = merchant_tx_ref
134
+ if payer_name is not None:
135
+ body["payerName"] = payer_name
136
+ if amount is not None:
137
+ body["amount"] = amount
138
+ if customer_id is not None:
139
+ body["customerId"] = customer_id
140
+ body.update(extra)
141
+ validate_body("post", "/v1/bill/cabletv", body)
142
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
143
+
144
+ async def cable_tv_subscription_via_a_sub_account(self, sub_account_id: str, *, cable_tv_type: object | None = None, merchant_tx_ref: object | None = None, payer_name: object | None = None, amount: object | None = None, customer_id: object | None = None, **extra: object) -> _models.CableTvSubscriptionViaASubAccountResponse:
145
+ """
146
+ CableTv subscription via a sub account
147
+
148
+ You can use this endpoint to make cable tv subscription via a sub account
149
+
150
+ Body fields:
151
+ cableTvType:
152
+ merchantTxRef:
153
+ payerName:
154
+ amount:
155
+ customerId:
156
+ """
157
+ path = f"/v1/bill/cabletv/{sub_account_id}"
158
+ params = None
159
+ body: dict[str, object] = {}
160
+ if cable_tv_type is not None:
161
+ body["cableTvType"] = cable_tv_type
162
+ if merchant_tx_ref is not None:
163
+ body["merchantTxRef"] = merchant_tx_ref
164
+ if payer_name is not None:
165
+ body["payerName"] = payer_name
166
+ if amount is not None:
167
+ body["amount"] = amount
168
+ if customer_id is not None:
169
+ body["customerId"] = customer_id
170
+ body.update(extra)
171
+ validate_body("post", "/v1/bill/cabletv/{subAccountId}", body)
172
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
173
+