Skip to content

Commit 1a6d303

Browse files
committed
fix(types): loosen most List params types to Iterable (#167)
1 parent 2fe3f56 commit 1a6d303

17 files changed

+77
-75
lines changed

src/orb/resources/customers/usage.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Union, Optional
5+
from typing import Union, Iterable, Optional
66
from datetime import datetime
77

88
import httpx
@@ -39,7 +39,7 @@ def update(
3939
self,
4040
id: Optional[str],
4141
*,
42-
events: List[usage_update_params.Event],
42+
events: Iterable[usage_update_params.Event],
4343
timeframe_end: Union[str, datetime] | NotGiven = NOT_GIVEN,
4444
timeframe_start: Union[str, datetime] | NotGiven = NOT_GIVEN,
4545
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -192,7 +192,7 @@ def update_by_external_id(
192192
self,
193193
id: Optional[str],
194194
*,
195-
events: List[usage_update_by_external_id_params.Event],
195+
events: Iterable[usage_update_by_external_id_params.Event],
196196
timeframe_end: Union[str, datetime] | NotGiven = NOT_GIVEN,
197197
timeframe_start: Union[str, datetime] | NotGiven = NOT_GIVEN,
198198
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -355,7 +355,7 @@ async def update(
355355
self,
356356
id: Optional[str],
357357
*,
358-
events: List[usage_update_params.Event],
358+
events: Iterable[usage_update_params.Event],
359359
timeframe_end: Union[str, datetime] | NotGiven = NOT_GIVEN,
360360
timeframe_start: Union[str, datetime] | NotGiven = NOT_GIVEN,
361361
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -508,7 +508,7 @@ async def update_by_external_id(
508508
self,
509509
id: Optional[str],
510510
*,
511-
events: List[usage_update_by_external_id_params.Event],
511+
events: Iterable[usage_update_by_external_id_params.Event],
512512
timeframe_end: Union[str, datetime] | NotGiven = NOT_GIVEN,
513513
timeframe_start: Union[str, datetime] | NotGiven = NOT_GIVEN,
514514
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.

src/orb/resources/events/events.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Union, Optional
5+
from typing import List, Union, Iterable, Optional
66
from datetime import datetime
77

88
import httpx
@@ -240,7 +240,7 @@ def deprecate(
240240
def ingest(
241241
self,
242242
*,
243-
events: List[event_ingest_params.Event],
243+
events: Iterable[event_ingest_params.Event],
244244
backfill_id: Optional[str] | NotGiven = NOT_GIVEN,
245245
debug: bool | NotGiven = NOT_GIVEN,
246246
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -765,7 +765,7 @@ async def deprecate(
765765
async def ingest(
766766
self,
767767
*,
768-
events: List[event_ingest_params.Event],
768+
events: Iterable[event_ingest_params.Event],
769769
backfill_id: Optional[str] | NotGiven = NOT_GIVEN,
770770
debug: bool | NotGiven = NOT_GIVEN,
771771
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.

src/orb/resources/invoices.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Union, Optional
5+
from typing import List, Union, Iterable, Optional
66
from datetime import date, datetime
77
from typing_extensions import Literal
88

@@ -45,7 +45,7 @@ def create(
4545
*,
4646
currency: str,
4747
invoice_date: Union[str, datetime],
48-
line_items: List[invoice_create_params.LineItem],
48+
line_items: Iterable[invoice_create_params.LineItem],
4949
net_terms: int,
5050
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
5151
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
@@ -450,7 +450,7 @@ async def create(
450450
*,
451451
currency: str,
452452
invoice_date: Union[str, datetime],
453-
line_items: List[invoice_create_params.LineItem],
453+
line_items: Iterable[invoice_create_params.LineItem],
454454
net_terms: int,
455455
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
456456
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,

src/orb/resources/plans/plans.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, List, Union, Optional
5+
from typing import Dict, Union, Iterable, Optional
66
from datetime import datetime
77
from typing_extensions import Literal
88

@@ -50,7 +50,7 @@ def create(
5050
*,
5151
currency: str,
5252
name: str,
53-
prices: List[plan_create_params.Price],
53+
prices: Iterable[plan_create_params.Price],
5454
default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN,
5555
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
5656
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
@@ -309,7 +309,7 @@ async def create(
309309
*,
310310
currency: str,
311311
name: str,
312-
prices: List[plan_create_params.Price],
312+
prices: Iterable[plan_create_params.Price],
313313
default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN,
314314
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
315315
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,

src/orb/resources/subscriptions.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Any, Dict, List, Union, Optional, cast
5+
from typing import Any, Dict, Union, Iterable, Optional, cast
66
from datetime import date, datetime
77
from typing_extensions import Literal
88

@@ -70,7 +70,7 @@ def create(
7070
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
7171
per_credit_overage_amount: Optional[str] | NotGiven = NOT_GIVEN,
7272
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
73-
price_overrides: Optional[List[subscription_create_params.PriceOverride]] | NotGiven = NOT_GIVEN,
73+
price_overrides: Optional[Iterable[subscription_create_params.PriceOverride]] | NotGiven = NOT_GIVEN,
7474
start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
7575
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
7676
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1166,8 +1166,8 @@ def price_intervals(
11661166
self,
11671167
subscription_id: str,
11681168
*,
1169-
add: List[subscription_price_intervals_params.Add] | NotGiven = NOT_GIVEN,
1170-
edit: List[subscription_price_intervals_params.Edit] | NotGiven = NOT_GIVEN,
1169+
add: Iterable[subscription_price_intervals_params.Add] | NotGiven = NOT_GIVEN,
1170+
edit: Iterable[subscription_price_intervals_params.Edit] | NotGiven = NOT_GIVEN,
11711171
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
11721172
# The extra values given here take precedence over values defined on the client or passed to this method.
11731173
extra_headers: Headers | None = None,
@@ -1287,7 +1287,8 @@ def schedule_plan_change(
12871287
invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN,
12881288
per_credit_overage_amount: Optional[str] | NotGiven = NOT_GIVEN,
12891289
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
1290-
price_overrides: Optional[List[subscription_schedule_plan_change_params.PriceOverride]] | NotGiven = NOT_GIVEN,
1290+
price_overrides: Optional[Iterable[subscription_schedule_plan_change_params.PriceOverride]]
1291+
| NotGiven = NOT_GIVEN,
12911292
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
12921293
# The extra values given here take precedence over values defined on the client or passed to this method.
12931294
extra_headers: Headers | None = None,
@@ -1699,7 +1700,7 @@ async def create(
16991700
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
17001701
per_credit_overage_amount: Optional[str] | NotGiven = NOT_GIVEN,
17011702
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
1702-
price_overrides: Optional[List[subscription_create_params.PriceOverride]] | NotGiven = NOT_GIVEN,
1703+
price_overrides: Optional[Iterable[subscription_create_params.PriceOverride]] | NotGiven = NOT_GIVEN,
17031704
start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
17041705
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
17051706
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2795,8 +2796,8 @@ async def price_intervals(
27952796
self,
27962797
subscription_id: str,
27972798
*,
2798-
add: List[subscription_price_intervals_params.Add] | NotGiven = NOT_GIVEN,
2799-
edit: List[subscription_price_intervals_params.Edit] | NotGiven = NOT_GIVEN,
2799+
add: Iterable[subscription_price_intervals_params.Add] | NotGiven = NOT_GIVEN,
2800+
edit: Iterable[subscription_price_intervals_params.Edit] | NotGiven = NOT_GIVEN,
28002801
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
28012802
# The extra values given here take precedence over values defined on the client or passed to this method.
28022803
extra_headers: Headers | None = None,
@@ -2916,7 +2917,8 @@ async def schedule_plan_change(
29162917
invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN,
29172918
per_credit_overage_amount: Optional[str] | NotGiven = NOT_GIVEN,
29182919
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
2919-
price_overrides: Optional[List[subscription_schedule_plan_change_params.PriceOverride]] | NotGiven = NOT_GIVEN,
2920+
price_overrides: Optional[Iterable[subscription_schedule_plan_change_params.PriceOverride]]
2921+
| NotGiven = NOT_GIVEN,
29202922
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
29212923
# The extra values given here take precedence over values defined on the client or passed to this method.
29222924
extra_headers: Headers | None = None,

src/orb/types/customer_create_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, List, Optional
5+
from typing import Dict, List, Iterable, Optional
66
from typing_extensions import Literal, Required, TypedDict
77

88
__all__ = [
@@ -187,7 +187,7 @@ class AccountingSyncConfigurationAccountingProvider(TypedDict, total=False):
187187

188188

189189
class AccountingSyncConfiguration(TypedDict, total=False):
190-
accounting_providers: Optional[List[AccountingSyncConfigurationAccountingProvider]]
190+
accounting_providers: Optional[Iterable[AccountingSyncConfigurationAccountingProvider]]
191191

192192
excluded: Optional[bool]
193193

src/orb/types/customer_update_by_external_id_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, List, Optional
5+
from typing import Dict, List, Iterable, Optional
66
from typing_extensions import Literal, Required, TypedDict
77

88
__all__ = [
@@ -180,7 +180,7 @@ class AccountingSyncConfigurationAccountingProvider(TypedDict, total=False):
180180

181181

182182
class AccountingSyncConfiguration(TypedDict, total=False):
183-
accounting_providers: Optional[List[AccountingSyncConfigurationAccountingProvider]]
183+
accounting_providers: Optional[Iterable[AccountingSyncConfigurationAccountingProvider]]
184184

185185
excluded: Optional[bool]
186186

src/orb/types/customer_update_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, List, Optional
5+
from typing import Dict, List, Iterable, Optional
66
from typing_extensions import Literal, Required, TypedDict
77

88
__all__ = [
@@ -180,7 +180,7 @@ class AccountingSyncConfigurationAccountingProvider(TypedDict, total=False):
180180

181181

182182
class AccountingSyncConfiguration(TypedDict, total=False):
183-
accounting_providers: Optional[List[AccountingSyncConfigurationAccountingProvider]]
183+
accounting_providers: Optional[Iterable[AccountingSyncConfigurationAccountingProvider]]
184184

185185
excluded: Optional[bool]
186186

src/orb/types/customers/usage_update_by_external_id_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Union, Optional
5+
from typing import Union, Iterable, Optional
66
from datetime import datetime
77
from typing_extensions import Required, Annotated, TypedDict
88

@@ -12,7 +12,7 @@
1212

1313

1414
class UsageUpdateByExternalIDParams(TypedDict, total=False):
15-
events: Required[List[Event]]
15+
events: Required[Iterable[Event]]
1616
"""Events to update"""
1717

1818
timeframe_end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]

src/orb/types/customers/usage_update_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Union, Optional
5+
from typing import Union, Iterable, Optional
66
from datetime import datetime
77
from typing_extensions import Required, Annotated, TypedDict
88

@@ -12,7 +12,7 @@
1212

1313

1414
class UsageUpdateParams(TypedDict, total=False):
15-
events: Required[List[Event]]
15+
events: Required[Iterable[Event]]
1616
"""Events to update"""
1717

1818
timeframe_end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]

0 commit comments

Comments
 (0)