Skip to content

Commit 285bbc2

Browse files
refactor: remove unnecessary builtin import (#149)
1 parent bf87d8e commit 285bbc2

25 files changed

+2969
-55
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 75
1+
configured_endpoints: 81

api.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,28 @@ Methods:
127127
- <code title="post /customers/external_customer_id/{external_customer_id}/credits/ledger_entry">client.customers.credits.ledger.<a href="./src/orb/resources/customers/credits/ledger.py">create_entry_by_external_id</a>(external_customer_id, \*\*<a href="src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py">params</a>) -> <a href="./src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py">LedgerCreateEntryByExternalIDResponse</a></code>
128128
- <code title="get /customers/external_customer_id/{external_customer_id}/credits/ledger">client.customers.credits.ledger.<a href="./src/orb/resources/customers/credits/ledger.py">list_by_external_id</a>(external_customer_id, \*\*<a href="src/orb/types/customers/credits/ledger_list_by_external_id_params.py">params</a>) -> <a href="./src/orb/types/customers/credits/ledger_list_by_external_id_response.py">SyncPage[LedgerListByExternalIDResponse]</a></code>
129129

130+
### TopUps
131+
132+
Types:
133+
134+
```python
135+
from orb.types.customers.credits import (
136+
TopUpCreateResponse,
137+
TopUpListResponse,
138+
TopUpCreateByExternalIDResponse,
139+
TopUpListByExternalIDResponse,
140+
)
141+
```
142+
143+
Methods:
144+
145+
- <code title="post /customers/{customer_id}/credits/top_ups">client.customers.credits.top_ups.<a href="./src/orb/resources/customers/credits/top_ups.py">create</a>(customer_id, \*\*<a href="src/orb/types/customers/credits/top_up_create_params.py">params</a>) -> <a href="./src/orb/types/customers/credits/top_up_create_response.py">TopUpCreateResponse</a></code>
146+
- <code title="get /customers/{customer_id}/credits/top_ups">client.customers.credits.top_ups.<a href="./src/orb/resources/customers/credits/top_ups.py">list</a>(customer_id, \*\*<a href="src/orb/types/customers/credits/top_up_list_params.py">params</a>) -> <a href="./src/orb/types/customers/credits/top_up_list_response.py">SyncPage[TopUpListResponse]</a></code>
147+
- <code title="delete /customers/{customer_id}/credits/top_ups/{top_up_id}">client.customers.credits.top_ups.<a href="./src/orb/resources/customers/credits/top_ups.py">delete</a>(top_up_id, \*, customer_id) -> None</code>
148+
- <code title="post /customers/external_customer_id/{external_customer_id}/credits/top_ups">client.customers.credits.top_ups.<a href="./src/orb/resources/customers/credits/top_ups.py">create_by_external_id</a>(external_customer_id, \*\*<a href="src/orb/types/customers/credits/top_up_create_by_external_id_params.py">params</a>) -> <a href="./src/orb/types/customers/credits/top_up_create_by_external_id_response.py">TopUpCreateByExternalIDResponse</a></code>
149+
- <code title="delete /customers/external_customer_id/{external_customer_id}/credits/top_ups/{top_up_id}">client.customers.credits.top_ups.<a href="./src/orb/resources/customers/credits/top_ups.py">delete_by_external_id</a>(top_up_id, \*, external_customer_id) -> None</code>
150+
- <code title="get /customers/external_customer_id/{external_customer_id}/credits/top_ups">client.customers.credits.top_ups.<a href="./src/orb/resources/customers/credits/top_ups.py">list_by_external_id</a>(external_customer_id, \*\*<a href="src/orb/types/customers/credits/top_up_list_by_external_id_params.py">params</a>) -> <a href="./src/orb/types/customers/credits/top_up_list_by_external_id_response.py">SyncPage[TopUpListByExternalIDResponse]</a></code>
151+
130152
## BalanceTransactions
131153

132154
Types:

src/orb/resources/customers/costs.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def list(
4040
self,
4141
customer_id: Optional[str],
4242
*,
43-
group_by: Optional[str] | NotGiven = NOT_GIVEN,
4443
timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
4544
timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
4645
view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN,
@@ -188,8 +187,6 @@ def list(
188187
`grouping_value` and `secondary_grouping_value` available.
189188
190189
Args:
191-
group_by: Groups per-price costs by the key provided.
192-
193190
timeframe_end: Costs returned are exclusive of `timeframe_end`.
194191
195192
timeframe_start: Costs returned are inclusive of `timeframe_start`.
@@ -218,7 +215,6 @@ def list(
218215
timeout=timeout,
219216
query=maybe_transform(
220217
{
221-
"group_by": group_by,
222218
"timeframe_end": timeframe_end,
223219
"timeframe_start": timeframe_start,
224220
"view_mode": view_mode,
@@ -233,7 +229,6 @@ def list_by_external_id(
233229
self,
234230
external_customer_id: Optional[str],
235231
*,
236-
group_by: Optional[str] | NotGiven = NOT_GIVEN,
237232
timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
238233
timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
239234
view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN,
@@ -381,8 +376,6 @@ def list_by_external_id(
381376
`grouping_value` and `secondary_grouping_value` available.
382377
383378
Args:
384-
group_by: Groups per-price costs by the key provided.
385-
386379
timeframe_end: Costs returned are exclusive of `timeframe_end`.
387380
388381
timeframe_start: Costs returned are inclusive of `timeframe_start`.
@@ -413,7 +406,6 @@ def list_by_external_id(
413406
timeout=timeout,
414407
query=maybe_transform(
415408
{
416-
"group_by": group_by,
417409
"timeframe_end": timeframe_end,
418410
"timeframe_start": timeframe_start,
419411
"view_mode": view_mode,
@@ -438,7 +430,6 @@ async def list(
438430
self,
439431
customer_id: Optional[str],
440432
*,
441-
group_by: Optional[str] | NotGiven = NOT_GIVEN,
442433
timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
443434
timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
444435
view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN,
@@ -586,8 +577,6 @@ async def list(
586577
`grouping_value` and `secondary_grouping_value` available.
587578
588579
Args:
589-
group_by: Groups per-price costs by the key provided.
590-
591580
timeframe_end: Costs returned are exclusive of `timeframe_end`.
592581
593582
timeframe_start: Costs returned are inclusive of `timeframe_start`.
@@ -616,7 +605,6 @@ async def list(
616605
timeout=timeout,
617606
query=maybe_transform(
618607
{
619-
"group_by": group_by,
620608
"timeframe_end": timeframe_end,
621609
"timeframe_start": timeframe_start,
622610
"view_mode": view_mode,
@@ -631,7 +619,6 @@ async def list_by_external_id(
631619
self,
632620
external_customer_id: Optional[str],
633621
*,
634-
group_by: Optional[str] | NotGiven = NOT_GIVEN,
635622
timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
636623
timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
637624
view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN,
@@ -779,8 +766,6 @@ async def list_by_external_id(
779766
`grouping_value` and `secondary_grouping_value` available.
780767
781768
Args:
782-
group_by: Groups per-price costs by the key provided.
783-
784769
timeframe_end: Costs returned are exclusive of `timeframe_end`.
785770
786771
timeframe_start: Costs returned are inclusive of `timeframe_start`.
@@ -811,7 +796,6 @@ async def list_by_external_id(
811796
timeout=timeout,
812797
query=maybe_transform(
813798
{
814-
"group_by": group_by,
815799
"timeframe_end": timeframe_end,
816800
"timeframe_start": timeframe_start,
817801
"view_mode": view_mode,

src/orb/resources/customers/credits/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
CreditsWithStreamingResponse,
1717
AsyncCreditsWithStreamingResponse,
1818
)
19+
from .top_ups import (
20+
TopUps,
21+
AsyncTopUps,
22+
TopUpsWithRawResponse,
23+
AsyncTopUpsWithRawResponse,
24+
TopUpsWithStreamingResponse,
25+
AsyncTopUpsWithStreamingResponse,
26+
)
1927

2028
__all__ = [
2129
"Ledger",
@@ -24,6 +32,12 @@
2432
"AsyncLedgerWithRawResponse",
2533
"LedgerWithStreamingResponse",
2634
"AsyncLedgerWithStreamingResponse",
35+
"TopUps",
36+
"AsyncTopUps",
37+
"TopUpsWithRawResponse",
38+
"AsyncTopUpsWithRawResponse",
39+
"TopUpsWithStreamingResponse",
40+
"AsyncTopUpsWithStreamingResponse",
2741
"Credits",
2842
"AsyncCredits",
2943
"CreditsWithRawResponse",

src/orb/resources/customers/credits/credits.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
LedgerWithStreamingResponse,
1616
AsyncLedgerWithStreamingResponse,
1717
)
18+
from .top_ups import (
19+
TopUps,
20+
AsyncTopUps,
21+
TopUpsWithRawResponse,
22+
AsyncTopUpsWithRawResponse,
23+
TopUpsWithStreamingResponse,
24+
AsyncTopUpsWithStreamingResponse,
25+
)
1826
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
1927
from ...._utils import maybe_transform
2028
from ...._compat import cached_property
@@ -40,6 +48,10 @@ class Credits(SyncAPIResource):
4048
def ledger(self) -> Ledger:
4149
return Ledger(self._client)
4250

51+
@cached_property
52+
def top_ups(self) -> TopUps:
53+
return TopUps(self._client)
54+
4355
@cached_property
4456
def with_raw_response(self) -> CreditsWithRawResponse:
4557
return CreditsWithRawResponse(self)
@@ -166,6 +178,10 @@ class AsyncCredits(AsyncAPIResource):
166178
def ledger(self) -> AsyncLedger:
167179
return AsyncLedger(self._client)
168180

181+
@cached_property
182+
def top_ups(self) -> AsyncTopUps:
183+
return AsyncTopUps(self._client)
184+
169185
@cached_property
170186
def with_raw_response(self) -> AsyncCreditsWithRawResponse:
171187
return AsyncCreditsWithRawResponse(self)
@@ -302,6 +318,10 @@ def __init__(self, credits: Credits) -> None:
302318
def ledger(self) -> LedgerWithRawResponse:
303319
return LedgerWithRawResponse(self._credits.ledger)
304320

321+
@cached_property
322+
def top_ups(self) -> TopUpsWithRawResponse:
323+
return TopUpsWithRawResponse(self._credits.top_ups)
324+
305325

306326
class AsyncCreditsWithRawResponse:
307327
def __init__(self, credits: AsyncCredits) -> None:
@@ -318,6 +338,10 @@ def __init__(self, credits: AsyncCredits) -> None:
318338
def ledger(self) -> AsyncLedgerWithRawResponse:
319339
return AsyncLedgerWithRawResponse(self._credits.ledger)
320340

341+
@cached_property
342+
def top_ups(self) -> AsyncTopUpsWithRawResponse:
343+
return AsyncTopUpsWithRawResponse(self._credits.top_ups)
344+
321345

322346
class CreditsWithStreamingResponse:
323347
def __init__(self, credits: Credits) -> None:
@@ -334,6 +358,10 @@ def __init__(self, credits: Credits) -> None:
334358
def ledger(self) -> LedgerWithStreamingResponse:
335359
return LedgerWithStreamingResponse(self._credits.ledger)
336360

361+
@cached_property
362+
def top_ups(self) -> TopUpsWithStreamingResponse:
363+
return TopUpsWithStreamingResponse(self._credits.top_ups)
364+
337365

338366
class AsyncCreditsWithStreamingResponse:
339367
def __init__(self, credits: AsyncCredits) -> None:
@@ -349,3 +377,7 @@ def __init__(self, credits: AsyncCredits) -> None:
349377
@cached_property
350378
def ledger(self) -> AsyncLedgerWithStreamingResponse:
351379
return AsyncLedgerWithStreamingResponse(self._credits.ledger)
380+
381+
@cached_property
382+
def top_ups(self) -> AsyncTopUpsWithStreamingResponse:
383+
return AsyncTopUpsWithStreamingResponse(self._credits.top_ups)

0 commit comments

Comments
 (0)