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,204 @@
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 Electricity:
12
+ """Sync resource methods for the Electricity group."""
13
+
14
+ def __init__(self, client: NombaClient) -> None:
15
+ self._client = client
16
+
17
+ def fetch_electricity_providers(self, **extra: object) -> _models.FetchElectricityProvidersResponse:
18
+ """
19
+ Fetch discos/electricity providers
20
+
21
+ You can use this endpoint to fetch electricity providers/discos
22
+ """
23
+ path = "/v1/bill/electricity/discos"
24
+ params = None
25
+ return self._client.get(path, params=params) # type: ignore[return-value]
26
+
27
+ def electricity_customer_lookup(self, *, disco: str | None = None, customer_id: str | None = None, **extra: object) -> _models.ElectricityCustomerLookupResponse:
28
+ """
29
+ Fetch customer information from an electricity provider
30
+
31
+ This endpoint is for fetching customer information data from an electricity vending provider
32
+ """
33
+ path = "/v1/bill/electricity/lookup"
34
+ params: dict[str, object] = {}
35
+ if disco is not None:
36
+ params["disco"] = disco
37
+ if customer_id is not None:
38
+ params["customerId"] = customer_id
39
+ return self._client.get(path, params=params) # type: ignore[return-value]
40
+
41
+ def vend_electricity_via_parent_account(self, *, disco: object | None = None, merchant_tx_ref: object | None = None, payer_name: object | None = None, amount: object | None = None, customer_id: object | None = None, meter_type: object | None = None, **extra: object) -> _models.VendElectricityViaParentAccountResponse:
42
+ """
43
+ Vend electricity via parent account
44
+
45
+ You can use this endpoint to vend electricity via parent account
46
+
47
+ Body fields:
48
+ disco:
49
+ merchantTxRef:
50
+ payerName:
51
+ amount:
52
+ customerId:
53
+ meterType:
54
+ """
55
+ path = "/v1/bill/electricity"
56
+ params = None
57
+ body: dict[str, object] = {}
58
+ if disco is not None:
59
+ body["disco"] = disco
60
+ if merchant_tx_ref is not None:
61
+ body["merchantTxRef"] = merchant_tx_ref
62
+ if payer_name is not None:
63
+ body["payerName"] = payer_name
64
+ if amount is not None:
65
+ body["amount"] = amount
66
+ if customer_id is not None:
67
+ body["customerId"] = customer_id
68
+ if meter_type is not None:
69
+ body["meterType"] = meter_type
70
+ body.update(extra)
71
+ validate_body("post", "/v1/bill/electricity", body)
72
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
73
+
74
+ def vend_electricity_via_a_sub_account(self, sub_account_id: str, *, disco: object | None = None, merchant_tx_ref: object | None = None, payer_name: object | None = None, amount: object | None = None, customer_id: object | None = None, meter_type: object | None = None, **extra: object) -> _models.VendElectricityViaASubAccountResponse:
75
+ """
76
+ Vend electricity via a specific account
77
+
78
+ You can use this endpoint to vend electricity via a sub account
79
+
80
+ Body fields:
81
+ disco:
82
+ merchantTxRef:
83
+ payerName:
84
+ amount:
85
+ customerId:
86
+ meterType:
87
+ """
88
+ path = f"/v1/bill/electricity/{sub_account_id}"
89
+ params = None
90
+ body: dict[str, object] = {}
91
+ if disco is not None:
92
+ body["disco"] = disco
93
+ if merchant_tx_ref is not None:
94
+ body["merchantTxRef"] = merchant_tx_ref
95
+ if payer_name is not None:
96
+ body["payerName"] = payer_name
97
+ if amount is not None:
98
+ body["amount"] = amount
99
+ if customer_id is not None:
100
+ body["customerId"] = customer_id
101
+ if meter_type is not None:
102
+ body["meterType"] = meter_type
103
+ body.update(extra)
104
+ validate_body("post", "/v1/bill/electricity/{subAccountId}", body)
105
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
106
+
107
+
108
+
109
+ class AsyncElectricity:
110
+ """Async resource methods for the Electricity group."""
111
+
112
+ def __init__(self, client: AsyncNombaClient) -> None:
113
+ self._client = client
114
+
115
+ async def fetch_electricity_providers(self, **extra: object) -> _models.FetchElectricityProvidersResponse:
116
+ """
117
+ Fetch discos/electricity providers
118
+
119
+ You can use this endpoint to fetch electricity providers/discos
120
+ """
121
+ path = "/v1/bill/electricity/discos"
122
+ params = None
123
+ return await self._client.get(path, params=params) # type: ignore[return-value]
124
+
125
+ async def electricity_customer_lookup(self, *, disco: str | None = None, customer_id: str | None = None, **extra: object) -> _models.ElectricityCustomerLookupResponse:
126
+ """
127
+ Fetch customer information from an electricity provider
128
+
129
+ This endpoint is for fetching customer information data from an electricity vending provider
130
+ """
131
+ path = "/v1/bill/electricity/lookup"
132
+ params: dict[str, object] = {}
133
+ if disco is not None:
134
+ params["disco"] = disco
135
+ if customer_id is not None:
136
+ params["customerId"] = customer_id
137
+ return await self._client.get(path, params=params) # type: ignore[return-value]
138
+
139
+ async def vend_electricity_via_parent_account(self, *, disco: object | None = None, merchant_tx_ref: object | None = None, payer_name: object | None = None, amount: object | None = None, customer_id: object | None = None, meter_type: object | None = None, **extra: object) -> _models.VendElectricityViaParentAccountResponse:
140
+ """
141
+ Vend electricity via parent account
142
+
143
+ You can use this endpoint to vend electricity via parent account
144
+
145
+ Body fields:
146
+ disco:
147
+ merchantTxRef:
148
+ payerName:
149
+ amount:
150
+ customerId:
151
+ meterType:
152
+ """
153
+ path = "/v1/bill/electricity"
154
+ params = None
155
+ body: dict[str, object] = {}
156
+ if disco is not None:
157
+ body["disco"] = disco
158
+ if merchant_tx_ref is not None:
159
+ body["merchantTxRef"] = merchant_tx_ref
160
+ if payer_name is not None:
161
+ body["payerName"] = payer_name
162
+ if amount is not None:
163
+ body["amount"] = amount
164
+ if customer_id is not None:
165
+ body["customerId"] = customer_id
166
+ if meter_type is not None:
167
+ body["meterType"] = meter_type
168
+ body.update(extra)
169
+ validate_body("post", "/v1/bill/electricity", body)
170
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
171
+
172
+ async def vend_electricity_via_a_sub_account(self, sub_account_id: str, *, disco: object | None = None, merchant_tx_ref: object | None = None, payer_name: object | None = None, amount: object | None = None, customer_id: object | None = None, meter_type: object | None = None, **extra: object) -> _models.VendElectricityViaASubAccountResponse:
173
+ """
174
+ Vend electricity via a specific account
175
+
176
+ You can use this endpoint to vend electricity via a sub account
177
+
178
+ Body fields:
179
+ disco:
180
+ merchantTxRef:
181
+ payerName:
182
+ amount:
183
+ customerId:
184
+ meterType:
185
+ """
186
+ path = f"/v1/bill/electricity/{sub_account_id}"
187
+ params = None
188
+ body: dict[str, object] = {}
189
+ if disco is not None:
190
+ body["disco"] = disco
191
+ if merchant_tx_ref is not None:
192
+ body["merchantTxRef"] = merchant_tx_ref
193
+ if payer_name is not None:
194
+ body["payerName"] = payer_name
195
+ if amount is not None:
196
+ body["amount"] = amount
197
+ if customer_id is not None:
198
+ body["customerId"] = customer_id
199
+ if meter_type is not None:
200
+ body["meterType"] = meter_type
201
+ body.update(extra)
202
+ validate_body("post", "/v1/bill/electricity/{subAccountId}", body)
203
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
204
+
@@ -0,0 +1,184 @@
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 Terminals:
12
+ """Sync resource methods for the Terminals group."""
13
+
14
+ def __init__(self, client: NombaClient) -> None:
15
+ self._client = client
16
+
17
+ def assign_a_terminal_to_an_account(self, sub_account_id: str, serial_number, *, terminal_label: object | None = None, **extra: object) -> _models.AssignATerminalToAnAccountResponse:
18
+ """
19
+ Assign a terminal to a sub account
20
+
21
+ You can use this endpoint to assign a terminal to an sub account.
22
+
23
+ Body fields:
24
+ serialNumber (required): Serial number
25
+ terminalLabel: Terminal label
26
+ """
27
+ path = f"/v1/terminals/assign/{sub_account_id}"
28
+ params = None
29
+ body: dict[str, object] = {}
30
+ body["serialNumber"] = serial_number
31
+ if terminal_label is not None:
32
+ body["terminalLabel"] = terminal_label
33
+ body.update(extra)
34
+ validate_body("post", "/v1/terminals/assign/{subAccountId}", body)
35
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
36
+
37
+ def assign_a_terminal_to_the_parent_account(self, serial_number, *, terminal_label: object | None = None, **extra: object) -> _models.AssignATerminalToTheParentAccountResponse:
38
+ """
39
+ Assign a terminal to the parent account
40
+
41
+ You can use this endpoint to assign a terminal to the parent account.
42
+
43
+ Body fields:
44
+ serialNumber (required): Serial number
45
+ terminalLabel: Terminal label
46
+ """
47
+ path = "/v1/terminals/assign"
48
+ params = None
49
+ body: dict[str, object] = {}
50
+ body["serialNumber"] = serial_number
51
+ if terminal_label is not None:
52
+ body["terminalLabel"] = terminal_label
53
+ body.update(extra)
54
+ validate_body("post", "/v1/terminals/assign", body)
55
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
56
+
57
+ def un_assign_terminal_from_an_account(self, sub_account_id: str, serial_number, *, terminal_label: object | None = None, **extra: object) -> _models.UnAssignTerminalFromAnAccountResponse:
58
+ """
59
+ Un-assign terminal from a sub account
60
+
61
+ You can use this endpoint to un-assign a terminal from a sub account.
62
+
63
+ Body fields:
64
+ serialNumber (required): Serial number
65
+ terminalLabel: Terminal label
66
+ """
67
+ path = f"/v1/terminals/unassign/{sub_account_id}"
68
+ params = None
69
+ body: dict[str, object] = {}
70
+ body["serialNumber"] = serial_number
71
+ if terminal_label is not None:
72
+ body["terminalLabel"] = terminal_label
73
+ body.update(extra)
74
+ validate_body("post", "/v1/terminals/unassign/{subAccountId}", body)
75
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
76
+
77
+ def un_assign_a_terminal_from_the_parent_account(self, serial_number, *, terminal_label: object | None = None, **extra: object) -> _models.UnAssignATerminalFromTheParentAccountResponse:
78
+ """
79
+ Un-assign a terminal from the parent account
80
+
81
+ You can use this endpoint to un-assign a terminal from the parent account.
82
+
83
+ Body fields:
84
+ serialNumber (required): Serial number
85
+ terminalLabel: Terminal label
86
+ """
87
+ path = "/v1/terminals/unassign"
88
+ params = None
89
+ body: dict[str, object] = {}
90
+ body["serialNumber"] = serial_number
91
+ if terminal_label is not None:
92
+ body["terminalLabel"] = terminal_label
93
+ body.update(extra)
94
+ validate_body("post", "/v1/terminals/unassign", body)
95
+ return self._client.post(path, json=body, params=params) # type: ignore[return-value]
96
+
97
+
98
+
99
+ class AsyncTerminals:
100
+ """Async resource methods for the Terminals group."""
101
+
102
+ def __init__(self, client: AsyncNombaClient) -> None:
103
+ self._client = client
104
+
105
+ async def assign_a_terminal_to_an_account(self, sub_account_id: str, serial_number, *, terminal_label: object | None = None, **extra: object) -> _models.AssignATerminalToAnAccountResponse:
106
+ """
107
+ Assign a terminal to a sub account
108
+
109
+ You can use this endpoint to assign a terminal to an sub account.
110
+
111
+ Body fields:
112
+ serialNumber (required): Serial number
113
+ terminalLabel: Terminal label
114
+ """
115
+ path = f"/v1/terminals/assign/{sub_account_id}"
116
+ params = None
117
+ body: dict[str, object] = {}
118
+ body["serialNumber"] = serial_number
119
+ if terminal_label is not None:
120
+ body["terminalLabel"] = terminal_label
121
+ body.update(extra)
122
+ validate_body("post", "/v1/terminals/assign/{subAccountId}", body)
123
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
124
+
125
+ async def assign_a_terminal_to_the_parent_account(self, serial_number, *, terminal_label: object | None = None, **extra: object) -> _models.AssignATerminalToTheParentAccountResponse:
126
+ """
127
+ Assign a terminal to the parent account
128
+
129
+ You can use this endpoint to assign a terminal to the parent account.
130
+
131
+ Body fields:
132
+ serialNumber (required): Serial number
133
+ terminalLabel: Terminal label
134
+ """
135
+ path = "/v1/terminals/assign"
136
+ params = None
137
+ body: dict[str, object] = {}
138
+ body["serialNumber"] = serial_number
139
+ if terminal_label is not None:
140
+ body["terminalLabel"] = terminal_label
141
+ body.update(extra)
142
+ validate_body("post", "/v1/terminals/assign", body)
143
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
144
+
145
+ async def un_assign_terminal_from_an_account(self, sub_account_id: str, serial_number, *, terminal_label: object | None = None, **extra: object) -> _models.UnAssignTerminalFromAnAccountResponse:
146
+ """
147
+ Un-assign terminal from a sub account
148
+
149
+ You can use this endpoint to un-assign a terminal from a sub account.
150
+
151
+ Body fields:
152
+ serialNumber (required): Serial number
153
+ terminalLabel: Terminal label
154
+ """
155
+ path = f"/v1/terminals/unassign/{sub_account_id}"
156
+ params = None
157
+ body: dict[str, object] = {}
158
+ body["serialNumber"] = serial_number
159
+ if terminal_label is not None:
160
+ body["terminalLabel"] = terminal_label
161
+ body.update(extra)
162
+ validate_body("post", "/v1/terminals/unassign/{subAccountId}", body)
163
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
164
+
165
+ async def un_assign_a_terminal_from_the_parent_account(self, serial_number, *, terminal_label: object | None = None, **extra: object) -> _models.UnAssignATerminalFromTheParentAccountResponse:
166
+ """
167
+ Un-assign a terminal from the parent account
168
+
169
+ You can use this endpoint to un-assign a terminal from the parent account.
170
+
171
+ Body fields:
172
+ serialNumber (required): Serial number
173
+ terminalLabel: Terminal label
174
+ """
175
+ path = "/v1/terminals/unassign"
176
+ params = None
177
+ body: dict[str, object] = {}
178
+ body["serialNumber"] = serial_number
179
+ if terminal_label is not None:
180
+ body["terminalLabel"] = terminal_label
181
+ body.update(extra)
182
+ validate_body("post", "/v1/terminals/unassign", body)
183
+ return await self._client.post(path, json=body, params=params) # type: ignore[return-value]
184
+