basaltic-sdk-python 0.1.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.
Files changed (47) hide show
  1. basaltic/__init__.py +26 -0
  2. basaltic/_client.py +136 -0
  3. basaltic/_common.py +284 -0
  4. basaltic/_transport.py +196 -0
  5. basaltic/_version.py +3 -0
  6. basaltic/auth.py +231 -0
  7. basaltic/client.py +144 -0
  8. basaltic/config.py +151 -0
  9. basaltic/errors.py +73 -0
  10. basaltic/models/__init__.py +17 -0
  11. basaltic/models/audit.py +85 -0
  12. basaltic/models/billing.py +284 -0
  13. basaltic/models/catalog.py +35 -0
  14. basaltic/models/certificate.py +127 -0
  15. basaltic/models/compute.py +905 -0
  16. basaltic/models/dns.py +256 -0
  17. basaltic/models/iam.py +736 -0
  18. basaltic/models/kms.py +157 -0
  19. basaltic/models/loadbalancer.py +574 -0
  20. basaltic/models/network.py +985 -0
  21. basaltic/models/quota.py +30 -0
  22. basaltic/models/secrets.py +136 -0
  23. basaltic/models/storage.py +789 -0
  24. basaltic/models/telemetry.py +393 -0
  25. basaltic/models/workspace.py +734 -0
  26. basaltic/py.typed +0 -0
  27. basaltic/response.py +152 -0
  28. basaltic/services/__init__.py +1 -0
  29. basaltic/services/audit.py +211 -0
  30. basaltic/services/billing.py +777 -0
  31. basaltic/services/catalog.py +172 -0
  32. basaltic/services/certificate.py +395 -0
  33. basaltic/services/compute.py +2395 -0
  34. basaltic/services/dns.py +1079 -0
  35. basaltic/services/iam.py +3405 -0
  36. basaltic/services/kms.py +742 -0
  37. basaltic/services/loadbalancer.py +1727 -0
  38. basaltic/services/network.py +4691 -0
  39. basaltic/services/quota.py +75 -0
  40. basaltic/services/secrets.py +550 -0
  41. basaltic/services/storage.py +3059 -0
  42. basaltic/services/telemetry.py +1316 -0
  43. basaltic/services/workspace.py +3899 -0
  44. basaltic_sdk_python-0.1.1.dist-info/METADATA +211 -0
  45. basaltic_sdk_python-0.1.1.dist-info/RECORD +47 -0
  46. basaltic_sdk_python-0.1.1.dist-info/WHEEL +4 -0
  47. basaltic_sdk_python-0.1.1.dist-info/licenses/LICENSE +202 -0
@@ -0,0 +1,777 @@
1
+ """Generated typed API methods; do not edit."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from collections.abc import AsyncIterator, Iterator
6
+ from typing import cast
7
+
8
+ import httpx
9
+
10
+ from .._common import UNSET, Operation
11
+ from .._transport import AsyncTransport, SyncTransport
12
+ from ..config import RequestOptions
13
+ from ..models import billing as m
14
+ from ..response import (
15
+ ApiResponse,
16
+ Page,
17
+ aiterate_pages,
18
+ aresolve_reference,
19
+ iterate_pages,
20
+ reference_scope,
21
+ resolve_reference,
22
+ )
23
+
24
+ _OPS = {
25
+ "getBillingProfile": Operation(
26
+ id="getBillingProfile",
27
+ method="GET",
28
+ path="/v1/profile",
29
+ authenticated=True,
30
+ requiredQuery=[],
31
+ requiredHeaders=[],
32
+ queryEncoding={},
33
+ bodyRequired=False,
34
+ contentType="",
35
+ accept="application/json",
36
+ ),
37
+ "getCurrentUsage": Operation(
38
+ id="getCurrentUsage",
39
+ method="GET",
40
+ path="/v1/usage",
41
+ authenticated=True,
42
+ requiredQuery=[],
43
+ requiredHeaders=[],
44
+ queryEncoding={},
45
+ bodyRequired=False,
46
+ contentType="",
47
+ accept="application/json",
48
+ ),
49
+ "getFiscalInvoiceXml": Operation(
50
+ id="getFiscalInvoiceXml",
51
+ method="GET",
52
+ path="/v1/fiscal-invoices/{document_id}/xml",
53
+ authenticated=True,
54
+ requiredQuery=[],
55
+ requiredHeaders=[],
56
+ queryEncoding={},
57
+ bodyRequired=False,
58
+ contentType="",
59
+ accept="*/*",
60
+ ),
61
+ "getInvoice": Operation(
62
+ id="getInvoice",
63
+ method="GET",
64
+ path="/v1/invoices/{invoice_id}",
65
+ authenticated=True,
66
+ requiredQuery=[],
67
+ requiredHeaders=[],
68
+ queryEncoding={},
69
+ bodyRequired=False,
70
+ contentType="",
71
+ accept="application/json",
72
+ ),
73
+ "getInvoicePdf": Operation(
74
+ id="getInvoicePdf",
75
+ method="GET",
76
+ path="/v1/invoices/{invoice_id}/pdf",
77
+ authenticated=True,
78
+ requiredQuery=[],
79
+ requiredHeaders=[],
80
+ queryEncoding={},
81
+ bodyRequired=False,
82
+ contentType="",
83
+ accept="*/*",
84
+ ),
85
+ "listCredits": Operation(
86
+ id="listCredits",
87
+ method="GET",
88
+ path="/v1/credits",
89
+ authenticated=True,
90
+ requiredQuery=[],
91
+ requiredHeaders=[],
92
+ queryEncoding={
93
+ "crn": {"style": "form", "explode": True},
94
+ "marker": {"style": "form", "explode": True},
95
+ "limit": {"style": "form", "explode": True},
96
+ },
97
+ bodyRequired=False,
98
+ contentType="",
99
+ accept="application/json",
100
+ itemsKey="credits",
101
+ ),
102
+ "listFiscalInvoices": Operation(
103
+ id="listFiscalInvoices",
104
+ method="GET",
105
+ path="/v1/fiscal-invoices",
106
+ authenticated=True,
107
+ requiredQuery=[],
108
+ requiredHeaders=[],
109
+ queryEncoding={"invoice": {"style": "form", "explode": True}},
110
+ bodyRequired=False,
111
+ contentType="",
112
+ accept="application/json",
113
+ itemsKey="fiscal_documents",
114
+ ),
115
+ "listInvoices": Operation(
116
+ id="listInvoices",
117
+ method="GET",
118
+ path="/v1/invoices",
119
+ authenticated=True,
120
+ requiredQuery=[],
121
+ requiredHeaders=[],
122
+ queryEncoding={
123
+ "crn": {"style": "form", "explode": True},
124
+ "marker": {"style": "form", "explode": True},
125
+ "limit": {"style": "form", "explode": True},
126
+ },
127
+ bodyRequired=False,
128
+ contentType="",
129
+ accept="application/json",
130
+ itemsKey="invoices",
131
+ ),
132
+ "listPayments": Operation(
133
+ id="listPayments",
134
+ method="GET",
135
+ path="/v1/payments",
136
+ authenticated=True,
137
+ requiredQuery=[],
138
+ requiredHeaders=[],
139
+ queryEncoding={
140
+ "crn": {"style": "form", "explode": True},
141
+ "marker": {"style": "form", "explode": True},
142
+ "limit": {"style": "form", "explode": True},
143
+ },
144
+ bodyRequired=False,
145
+ contentType="",
146
+ accept="application/json",
147
+ itemsKey="payments",
148
+ ),
149
+ "listPrices": Operation(
150
+ id="listPrices",
151
+ method="GET",
152
+ path="/v1/prices",
153
+ authenticated=False,
154
+ requiredQuery=[],
155
+ requiredHeaders=[],
156
+ queryEncoding={
157
+ "service": {"style": "form", "explode": True},
158
+ "resource_type": {"style": "form", "explode": True},
159
+ "sku": {"style": "form", "explode": True},
160
+ "family": {"style": "form", "explode": True},
161
+ "at": {"style": "form", "explode": True},
162
+ },
163
+ bodyRequired=False,
164
+ contentType="",
165
+ accept="application/json",
166
+ itemsKey="prices",
167
+ ),
168
+ "listTransactions": Operation(
169
+ id="listTransactions",
170
+ method="GET",
171
+ path="/v1/transactions",
172
+ authenticated=True,
173
+ requiredQuery=[],
174
+ requiredHeaders=[],
175
+ queryEncoding={
176
+ "crn": {"style": "form", "explode": True},
177
+ "marker": {"style": "form", "explode": True},
178
+ "limit": {"style": "form", "explode": True},
179
+ },
180
+ bodyRequired=False,
181
+ contentType="",
182
+ accept="application/json",
183
+ itemsKey="transactions",
184
+ ),
185
+ "updateBillingProfile": Operation(
186
+ id="updateBillingProfile",
187
+ method="PUT",
188
+ path="/v1/profile",
189
+ authenticated=True,
190
+ requiredQuery=[],
191
+ requiredHeaders=[],
192
+ queryEncoding={},
193
+ bodyRequired=True,
194
+ contentType="application/json",
195
+ accept="application/json",
196
+ ),
197
+ }
198
+
199
+
200
+ class BillingService:
201
+ def __init__(self, transport: SyncTransport) -> None:
202
+ self._transport = transport
203
+
204
+ def get_billing_profile(
205
+ self, *, options: RequestOptions | None = None
206
+ ) -> ApiResponse[m.GetBillingProfileResponse]:
207
+ "Read the organization billing profile"
208
+ return cast(
209
+ ApiResponse[m.GetBillingProfileResponse],
210
+ self._transport.request(
211
+ "billing",
212
+ "https://billing.basaltic.sh",
213
+ _OPS["getBillingProfile"],
214
+ "json",
215
+ {},
216
+ UNSET,
217
+ None,
218
+ options,
219
+ ),
220
+ )
221
+
222
+ def get_current_usage(
223
+ self, *, options: RequestOptions | None = None
224
+ ) -> ApiResponse[m.GetCurrentUsageResponse]:
225
+ "Get month-to-date usage total"
226
+ return cast(
227
+ ApiResponse[m.GetCurrentUsageResponse],
228
+ self._transport.request(
229
+ "billing",
230
+ "https://billing.basaltic.sh",
231
+ _OPS["getCurrentUsage"],
232
+ "json",
233
+ {},
234
+ UNSET,
235
+ None,
236
+ options,
237
+ ),
238
+ )
239
+
240
+ def get_fiscal_invoice_xml(
241
+ self, document_id: str, *, options: RequestOptions | None = None
242
+ ) -> httpx.Response:
243
+ "Download issued NFS-e XML"
244
+ return cast(
245
+ httpx.Response,
246
+ self._transport.request(
247
+ "billing",
248
+ "https://billing.basaltic.sh",
249
+ _OPS["getFiscalInvoiceXml"],
250
+ "binary",
251
+ {"document_id": document_id},
252
+ UNSET,
253
+ None,
254
+ options,
255
+ ),
256
+ )
257
+
258
+ def get_invoice(
259
+ self, invoice_id: str, *, options: RequestOptions | None = None
260
+ ) -> ApiResponse[m.GetInvoiceResponse]:
261
+ "Get an invoice with its line items"
262
+ return cast(
263
+ ApiResponse[m.GetInvoiceResponse],
264
+ self._transport.request(
265
+ "billing",
266
+ "https://billing.basaltic.sh",
267
+ _OPS["getInvoice"],
268
+ "json",
269
+ {"invoice_id": invoice_id},
270
+ UNSET,
271
+ None,
272
+ options,
273
+ ),
274
+ )
275
+
276
+ def get_invoice_by_reference(
277
+ self,
278
+ reference: str,
279
+ *,
280
+ scope: m.GetInvoiceScope | None = None,
281
+ options: RequestOptions | None = None,
282
+ ) -> ApiResponse[m.GetInvoiceResource]:
283
+ return cast(
284
+ ApiResponse[m.GetInvoiceResource],
285
+ resolve_reference(
286
+ reference,
287
+ lambda id: self.get_invoice(id, options=options),
288
+ lambda match: self.list_invoices(
289
+ query=cast(
290
+ m.ListInvoicesQuery, {**reference_scope(scope), **match, "limit": 2}
291
+ ),
292
+ options=options,
293
+ ),
294
+ False,
295
+ None,
296
+ ),
297
+ )
298
+
299
+ def get_invoice_pdf(
300
+ self, invoice_id: str, *, options: RequestOptions | None = None
301
+ ) -> httpx.Response:
302
+ "Download an invoice as a PDF statement"
303
+ return cast(
304
+ httpx.Response,
305
+ self._transport.request(
306
+ "billing",
307
+ "https://billing.basaltic.sh",
308
+ _OPS["getInvoicePdf"],
309
+ "binary",
310
+ {"invoice_id": invoice_id},
311
+ UNSET,
312
+ None,
313
+ options,
314
+ ),
315
+ )
316
+
317
+ def list_credits(
318
+ self, *, query: m.ListCreditsQuery | None = None, options: RequestOptions | None = None
319
+ ) -> Page[m.ListCreditsResponse, m.ListCreditsItem]:
320
+ "List credit grants"
321
+ return cast(
322
+ Page[m.ListCreditsResponse, m.ListCreditsItem],
323
+ self._transport.request(
324
+ "billing",
325
+ "https://billing.basaltic.sh",
326
+ _OPS["listCredits"],
327
+ "page",
328
+ {},
329
+ UNSET,
330
+ query,
331
+ options,
332
+ ),
333
+ )
334
+
335
+ def list_credits_all(
336
+ self, *, query: m.ListCreditsQuery | None = None, options: RequestOptions | None = None
337
+ ) -> Iterator[m.ListCreditsItem]:
338
+ return iterate_pages(
339
+ lambda marker: self.list_credits(
340
+ query=cast(m.ListCreditsQuery, {**(query or {}), "marker": marker}), options=options
341
+ ),
342
+ (query or {}).get("marker", ""),
343
+ )
344
+
345
+ def list_fiscal_invoices(
346
+ self,
347
+ *,
348
+ query: m.ListFiscalInvoicesQuery | None = None,
349
+ options: RequestOptions | None = None,
350
+ ) -> Page[m.ListFiscalInvoicesResponse, m.ListFiscalInvoicesItem]:
351
+ "List fiscal invoice issuance and delivery status"
352
+ return cast(
353
+ Page[m.ListFiscalInvoicesResponse, m.ListFiscalInvoicesItem],
354
+ self._transport.request(
355
+ "billing",
356
+ "https://billing.basaltic.sh",
357
+ _OPS["listFiscalInvoices"],
358
+ "page",
359
+ {},
360
+ UNSET,
361
+ query,
362
+ options,
363
+ ),
364
+ )
365
+
366
+ def list_invoices(
367
+ self, *, query: m.ListInvoicesQuery | None = None, options: RequestOptions | None = None
368
+ ) -> Page[m.ListInvoicesResponse, m.ListInvoicesItem]:
369
+ "List invoices"
370
+ return cast(
371
+ Page[m.ListInvoicesResponse, m.ListInvoicesItem],
372
+ self._transport.request(
373
+ "billing",
374
+ "https://billing.basaltic.sh",
375
+ _OPS["listInvoices"],
376
+ "page",
377
+ {},
378
+ UNSET,
379
+ query,
380
+ options,
381
+ ),
382
+ )
383
+
384
+ def list_invoices_all(
385
+ self, *, query: m.ListInvoicesQuery | None = None, options: RequestOptions | None = None
386
+ ) -> Iterator[m.ListInvoicesItem]:
387
+ return iterate_pages(
388
+ lambda marker: self.list_invoices(
389
+ query=cast(m.ListInvoicesQuery, {**(query or {}), "marker": marker}),
390
+ options=options,
391
+ ),
392
+ (query or {}).get("marker", ""),
393
+ )
394
+
395
+ def list_payments(
396
+ self, *, query: m.ListPaymentsQuery | None = None, options: RequestOptions | None = None
397
+ ) -> Page[m.ListPaymentsResponse, m.ListPaymentsItem]:
398
+ "List invoice payments"
399
+ return cast(
400
+ Page[m.ListPaymentsResponse, m.ListPaymentsItem],
401
+ self._transport.request(
402
+ "billing",
403
+ "https://billing.basaltic.sh",
404
+ _OPS["listPayments"],
405
+ "page",
406
+ {},
407
+ UNSET,
408
+ query,
409
+ options,
410
+ ),
411
+ )
412
+
413
+ def list_payments_all(
414
+ self, *, query: m.ListPaymentsQuery | None = None, options: RequestOptions | None = None
415
+ ) -> Iterator[m.ListPaymentsItem]:
416
+ return iterate_pages(
417
+ lambda marker: self.list_payments(
418
+ query=cast(m.ListPaymentsQuery, {**(query or {}), "marker": marker}),
419
+ options=options,
420
+ ),
421
+ (query or {}).get("marker", ""),
422
+ )
423
+
424
+ def list_prices(
425
+ self, *, query: m.ListPricesQuery | None = None, options: RequestOptions | None = None
426
+ ) -> Page[m.ListPricesResponse, m.ListPricesItem]:
427
+ "List catalog prices"
428
+ return cast(
429
+ Page[m.ListPricesResponse, m.ListPricesItem],
430
+ self._transport.request(
431
+ "billing",
432
+ "https://billing.basaltic.sh",
433
+ _OPS["listPrices"],
434
+ "page",
435
+ {},
436
+ UNSET,
437
+ query,
438
+ options,
439
+ ),
440
+ )
441
+
442
+ def list_transactions(
443
+ self, *, query: m.ListTransactionsQuery | None = None, options: RequestOptions | None = None
444
+ ) -> Page[m.ListTransactionsResponse, m.ListTransactionsItem]:
445
+ "List ledger transactions"
446
+ return cast(
447
+ Page[m.ListTransactionsResponse, m.ListTransactionsItem],
448
+ self._transport.request(
449
+ "billing",
450
+ "https://billing.basaltic.sh",
451
+ _OPS["listTransactions"],
452
+ "page",
453
+ {},
454
+ UNSET,
455
+ query,
456
+ options,
457
+ ),
458
+ )
459
+
460
+ def list_transactions_all(
461
+ self, *, query: m.ListTransactionsQuery | None = None, options: RequestOptions | None = None
462
+ ) -> Iterator[m.ListTransactionsItem]:
463
+ return iterate_pages(
464
+ lambda marker: self.list_transactions(
465
+ query=cast(m.ListTransactionsQuery, {**(query or {}), "marker": marker}),
466
+ options=options,
467
+ ),
468
+ (query or {}).get("marker", ""),
469
+ )
470
+
471
+ def update_billing_profile(
472
+ self, body: m.UpdateBillingProfileBody, *, options: RequestOptions | None = None
473
+ ) -> ApiResponse[m.UpdateBillingProfileResponse]:
474
+ "Save organization billing details"
475
+ return cast(
476
+ ApiResponse[m.UpdateBillingProfileResponse],
477
+ self._transport.request(
478
+ "billing",
479
+ "https://billing.basaltic.sh",
480
+ _OPS["updateBillingProfile"],
481
+ "json",
482
+ {},
483
+ body,
484
+ None,
485
+ options,
486
+ ),
487
+ )
488
+
489
+
490
+ class AsyncBillingService:
491
+ def __init__(self, transport: AsyncTransport) -> None:
492
+ self._transport = transport
493
+
494
+ async def get_billing_profile(
495
+ self, *, options: RequestOptions | None = None
496
+ ) -> ApiResponse[m.GetBillingProfileResponse]:
497
+ "Read the organization billing profile"
498
+ return cast(
499
+ ApiResponse[m.GetBillingProfileResponse],
500
+ await self._transport.request(
501
+ "billing",
502
+ "https://billing.basaltic.sh",
503
+ _OPS["getBillingProfile"],
504
+ "json",
505
+ {},
506
+ UNSET,
507
+ None,
508
+ options,
509
+ ),
510
+ )
511
+
512
+ async def get_current_usage(
513
+ self, *, options: RequestOptions | None = None
514
+ ) -> ApiResponse[m.GetCurrentUsageResponse]:
515
+ "Get month-to-date usage total"
516
+ return cast(
517
+ ApiResponse[m.GetCurrentUsageResponse],
518
+ await self._transport.request(
519
+ "billing",
520
+ "https://billing.basaltic.sh",
521
+ _OPS["getCurrentUsage"],
522
+ "json",
523
+ {},
524
+ UNSET,
525
+ None,
526
+ options,
527
+ ),
528
+ )
529
+
530
+ async def get_fiscal_invoice_xml(
531
+ self, document_id: str, *, options: RequestOptions | None = None
532
+ ) -> httpx.Response:
533
+ "Download issued NFS-e XML"
534
+ return cast(
535
+ httpx.Response,
536
+ await self._transport.request(
537
+ "billing",
538
+ "https://billing.basaltic.sh",
539
+ _OPS["getFiscalInvoiceXml"],
540
+ "binary",
541
+ {"document_id": document_id},
542
+ UNSET,
543
+ None,
544
+ options,
545
+ ),
546
+ )
547
+
548
+ async def get_invoice(
549
+ self, invoice_id: str, *, options: RequestOptions | None = None
550
+ ) -> ApiResponse[m.GetInvoiceResponse]:
551
+ "Get an invoice with its line items"
552
+ return cast(
553
+ ApiResponse[m.GetInvoiceResponse],
554
+ await self._transport.request(
555
+ "billing",
556
+ "https://billing.basaltic.sh",
557
+ _OPS["getInvoice"],
558
+ "json",
559
+ {"invoice_id": invoice_id},
560
+ UNSET,
561
+ None,
562
+ options,
563
+ ),
564
+ )
565
+
566
+ async def get_invoice_by_reference(
567
+ self,
568
+ reference: str,
569
+ *,
570
+ scope: m.GetInvoiceScope | None = None,
571
+ options: RequestOptions | None = None,
572
+ ) -> ApiResponse[m.GetInvoiceResource]:
573
+ return cast(
574
+ ApiResponse[m.GetInvoiceResource],
575
+ await aresolve_reference(
576
+ reference,
577
+ lambda id: self.get_invoice(id, options=options),
578
+ lambda match: self.list_invoices(
579
+ query=cast(
580
+ m.ListInvoicesQuery, {**reference_scope(scope), **match, "limit": 2}
581
+ ),
582
+ options=options,
583
+ ),
584
+ False,
585
+ None,
586
+ ),
587
+ )
588
+
589
+ async def get_invoice_pdf(
590
+ self, invoice_id: str, *, options: RequestOptions | None = None
591
+ ) -> httpx.Response:
592
+ "Download an invoice as a PDF statement"
593
+ return cast(
594
+ httpx.Response,
595
+ await self._transport.request(
596
+ "billing",
597
+ "https://billing.basaltic.sh",
598
+ _OPS["getInvoicePdf"],
599
+ "binary",
600
+ {"invoice_id": invoice_id},
601
+ UNSET,
602
+ None,
603
+ options,
604
+ ),
605
+ )
606
+
607
+ async def list_credits(
608
+ self, *, query: m.ListCreditsQuery | None = None, options: RequestOptions | None = None
609
+ ) -> Page[m.ListCreditsResponse, m.ListCreditsItem]:
610
+ "List credit grants"
611
+ return cast(
612
+ Page[m.ListCreditsResponse, m.ListCreditsItem],
613
+ await self._transport.request(
614
+ "billing",
615
+ "https://billing.basaltic.sh",
616
+ _OPS["listCredits"],
617
+ "page",
618
+ {},
619
+ UNSET,
620
+ query,
621
+ options,
622
+ ),
623
+ )
624
+
625
+ def list_credits_all(
626
+ self, *, query: m.ListCreditsQuery | None = None, options: RequestOptions | None = None
627
+ ) -> AsyncIterator[m.ListCreditsItem]:
628
+ return aiterate_pages(
629
+ lambda marker: self.list_credits(
630
+ query=cast(m.ListCreditsQuery, {**(query or {}), "marker": marker}), options=options
631
+ ),
632
+ (query or {}).get("marker", ""),
633
+ )
634
+
635
+ async def list_fiscal_invoices(
636
+ self,
637
+ *,
638
+ query: m.ListFiscalInvoicesQuery | None = None,
639
+ options: RequestOptions | None = None,
640
+ ) -> Page[m.ListFiscalInvoicesResponse, m.ListFiscalInvoicesItem]:
641
+ "List fiscal invoice issuance and delivery status"
642
+ return cast(
643
+ Page[m.ListFiscalInvoicesResponse, m.ListFiscalInvoicesItem],
644
+ await self._transport.request(
645
+ "billing",
646
+ "https://billing.basaltic.sh",
647
+ _OPS["listFiscalInvoices"],
648
+ "page",
649
+ {},
650
+ UNSET,
651
+ query,
652
+ options,
653
+ ),
654
+ )
655
+
656
+ async def list_invoices(
657
+ self, *, query: m.ListInvoicesQuery | None = None, options: RequestOptions | None = None
658
+ ) -> Page[m.ListInvoicesResponse, m.ListInvoicesItem]:
659
+ "List invoices"
660
+ return cast(
661
+ Page[m.ListInvoicesResponse, m.ListInvoicesItem],
662
+ await self._transport.request(
663
+ "billing",
664
+ "https://billing.basaltic.sh",
665
+ _OPS["listInvoices"],
666
+ "page",
667
+ {},
668
+ UNSET,
669
+ query,
670
+ options,
671
+ ),
672
+ )
673
+
674
+ def list_invoices_all(
675
+ self, *, query: m.ListInvoicesQuery | None = None, options: RequestOptions | None = None
676
+ ) -> AsyncIterator[m.ListInvoicesItem]:
677
+ return aiterate_pages(
678
+ lambda marker: self.list_invoices(
679
+ query=cast(m.ListInvoicesQuery, {**(query or {}), "marker": marker}),
680
+ options=options,
681
+ ),
682
+ (query or {}).get("marker", ""),
683
+ )
684
+
685
+ async def list_payments(
686
+ self, *, query: m.ListPaymentsQuery | None = None, options: RequestOptions | None = None
687
+ ) -> Page[m.ListPaymentsResponse, m.ListPaymentsItem]:
688
+ "List invoice payments"
689
+ return cast(
690
+ Page[m.ListPaymentsResponse, m.ListPaymentsItem],
691
+ await self._transport.request(
692
+ "billing",
693
+ "https://billing.basaltic.sh",
694
+ _OPS["listPayments"],
695
+ "page",
696
+ {},
697
+ UNSET,
698
+ query,
699
+ options,
700
+ ),
701
+ )
702
+
703
+ def list_payments_all(
704
+ self, *, query: m.ListPaymentsQuery | None = None, options: RequestOptions | None = None
705
+ ) -> AsyncIterator[m.ListPaymentsItem]:
706
+ return aiterate_pages(
707
+ lambda marker: self.list_payments(
708
+ query=cast(m.ListPaymentsQuery, {**(query or {}), "marker": marker}),
709
+ options=options,
710
+ ),
711
+ (query or {}).get("marker", ""),
712
+ )
713
+
714
+ async def list_prices(
715
+ self, *, query: m.ListPricesQuery | None = None, options: RequestOptions | None = None
716
+ ) -> Page[m.ListPricesResponse, m.ListPricesItem]:
717
+ "List catalog prices"
718
+ return cast(
719
+ Page[m.ListPricesResponse, m.ListPricesItem],
720
+ await self._transport.request(
721
+ "billing",
722
+ "https://billing.basaltic.sh",
723
+ _OPS["listPrices"],
724
+ "page",
725
+ {},
726
+ UNSET,
727
+ query,
728
+ options,
729
+ ),
730
+ )
731
+
732
+ async def list_transactions(
733
+ self, *, query: m.ListTransactionsQuery | None = None, options: RequestOptions | None = None
734
+ ) -> Page[m.ListTransactionsResponse, m.ListTransactionsItem]:
735
+ "List ledger transactions"
736
+ return cast(
737
+ Page[m.ListTransactionsResponse, m.ListTransactionsItem],
738
+ await self._transport.request(
739
+ "billing",
740
+ "https://billing.basaltic.sh",
741
+ _OPS["listTransactions"],
742
+ "page",
743
+ {},
744
+ UNSET,
745
+ query,
746
+ options,
747
+ ),
748
+ )
749
+
750
+ def list_transactions_all(
751
+ self, *, query: m.ListTransactionsQuery | None = None, options: RequestOptions | None = None
752
+ ) -> AsyncIterator[m.ListTransactionsItem]:
753
+ return aiterate_pages(
754
+ lambda marker: self.list_transactions(
755
+ query=cast(m.ListTransactionsQuery, {**(query or {}), "marker": marker}),
756
+ options=options,
757
+ ),
758
+ (query or {}).get("marker", ""),
759
+ )
760
+
761
+ async def update_billing_profile(
762
+ self, body: m.UpdateBillingProfileBody, *, options: RequestOptions | None = None
763
+ ) -> ApiResponse[m.UpdateBillingProfileResponse]:
764
+ "Save organization billing details"
765
+ return cast(
766
+ ApiResponse[m.UpdateBillingProfileResponse],
767
+ await self._transport.request(
768
+ "billing",
769
+ "https://billing.basaltic.sh",
770
+ _OPS["updateBillingProfile"],
771
+ "json",
772
+ {},
773
+ body,
774
+ None,
775
+ options,
776
+ ),
777
+ )