Skip to content

Commit cc12356

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): updates (#270)
1 parent 57ed634 commit cc12356

21 files changed

+61
-65
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 89
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-762f50aa6ea13f42e719339aa5cb31233984499720a7be832182357f949927a1.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-03945a99974ac1e7218fd458dceef31887a249cc048bcbbbe3828c1d893f95ea.yml

src/orb/resources/events/events.py

+8-12
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,10 @@ def ingest(
373373
We validate the following:
374374
375375
- Exactly one of `customer_id` and `external_customer_id` should be specified.
376-
- If specified, `customer_id` must identify a Customer resource within Orb. We
377-
do not support sending events for customers that have not been provisioned.
378-
Similarly, if specified, `external_customer_id` must be an identifier that is
379-
associated with an Orb Customer resource. Note: During our initial integration
380-
period, this enforcement will be temporarily turned into a warning to ensure
381-
smooth customer migration.
376+
- If the `customer_id` is specified, the customer in Orb must exist.
377+
- If the `external_customer_id` is specified, the customer in Orb does not need
378+
to exist. Events will be attributed to any future customers with the
379+
`external_customer_id` on subscription creation.
382380
- `timestamp` must conform to ISO 8601 and represent a timestamp at most 1 hour
383381
in the future. This timestamp should be sent in UTC timezone (no timezone
384382
offset).
@@ -900,12 +898,10 @@ async def ingest(
900898
We validate the following:
901899
902900
- Exactly one of `customer_id` and `external_customer_id` should be specified.
903-
- If specified, `customer_id` must identify a Customer resource within Orb. We
904-
do not support sending events for customers that have not been provisioned.
905-
Similarly, if specified, `external_customer_id` must be an identifier that is
906-
associated with an Orb Customer resource. Note: During our initial integration
907-
period, this enforcement will be temporarily turned into a warning to ensure
908-
smooth customer migration.
901+
- If the `customer_id` is specified, the customer in Orb must exist.
902+
- If the `external_customer_id` is specified, the customer in Orb does not need
903+
to exist. Events will be attributed to any future customers with the
904+
`external_customer_id` on subscription creation.
909905
- `timestamp` must conform to ISO 8601 and represent a timestamp at most 1 hour
910906
in the future. This timestamp should be sent in UTC timezone (no timezone
911907
offset).

src/orb/resources/subscriptions.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def create(
7272
invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN,
7373
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
7474
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
75-
per_credit_overage_amount: Optional[str] | NotGiven = NOT_GIVEN,
75+
per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN,
7676
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
7777
price_overrides: Optional[Iterable[subscription_create_params.PriceOverride]] | NotGiven = NOT_GIVEN,
7878
start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
@@ -1366,7 +1366,7 @@ def schedule_plan_change(
13661366
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
13671367
initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN,
13681368
invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN,
1369-
per_credit_overage_amount: Optional[str] | NotGiven = NOT_GIVEN,
1369+
per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN,
13701370
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
13711371
price_overrides: Optional[Iterable[subscription_schedule_plan_change_params.PriceOverride]]
13721372
| NotGiven = NOT_GIVEN,
@@ -1784,7 +1784,7 @@ async def create(
17841784
invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN,
17851785
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
17861786
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
1787-
per_credit_overage_amount: Optional[str] | NotGiven = NOT_GIVEN,
1787+
per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN,
17881788
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
17891789
price_overrides: Optional[Iterable[subscription_create_params.PriceOverride]] | NotGiven = NOT_GIVEN,
17901790
start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
@@ -3078,7 +3078,7 @@ async def schedule_plan_change(
30783078
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
30793079
initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN,
30803080
invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN,
3081-
per_credit_overage_amount: Optional[str] | NotGiven = NOT_GIVEN,
3081+
per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN,
30823082
plan_id: Optional[str] | NotGiven = NOT_GIVEN,
30833083
price_overrides: Optional[Iterable[subscription_schedule_plan_change_params.PriceOverride]]
30843084
| NotGiven = NOT_GIVEN,

src/orb/types/subscription_create_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class SubscriptionCreateParams(TypedDict, total=False):
9595

9696
net_terms: Optional[int]
9797

98-
per_credit_overage_amount: Optional[str]
98+
per_credit_overage_amount: Optional[float]
9999

100100
plan_id: Optional[str]
101101
"""The plan that the given subscription should be switched to.

src/orb/types/subscription_schedule_plan_change_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False):
9797
at the end of the billing period.
9898
"""
9999

100-
per_credit_overage_amount: Optional[str]
100+
per_credit_overage_amount: Optional[float]
101101

102102
plan_id: Optional[str]
103103
"""The plan that the given subscription should be switched to.

tests/api_resources/coupons/test_subscriptions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None:
3030
subscription = client.coupons.subscriptions.list(
3131
"string",
3232
cursor="string",
33-
limit=0,
33+
limit=1,
3434
)
3535
assert_matches_type(SyncPage[Subscription], subscription, path=["response"])
3636

@@ -81,7 +81,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None
8181
subscription = await async_client.coupons.subscriptions.list(
8282
"string",
8383
cursor="string",
84-
limit=0,
84+
limit=1,
8585
)
8686
assert_matches_type(AsyncPage[Subscription], subscription, path=["response"])
8787

tests/api_resources/customers/credits/test_ledger.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None:
4343
cursor="string",
4444
entry_status="committed",
4545
entry_type="increment",
46-
limit=0,
46+
limit=1,
4747
minimum_amount="string",
4848
)
4949
assert_matches_type(SyncPage[LedgerListResponse], ledger, path=["response"])
@@ -732,7 +732,7 @@ def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None:
732732
cursor="string",
733733
entry_status="committed",
734734
entry_type="increment",
735-
limit=0,
735+
limit=1,
736736
minimum_amount="string",
737737
)
738738
assert_matches_type(SyncPage[LedgerListByExternalIDResponse], ledger, path=["response"])
@@ -791,7 +791,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None
791791
cursor="string",
792792
entry_status="committed",
793793
entry_type="increment",
794-
limit=0,
794+
limit=1,
795795
minimum_amount="string",
796796
)
797797
assert_matches_type(AsyncPage[LedgerListResponse], ledger, path=["response"])
@@ -1480,7 +1480,7 @@ async def test_method_list_by_external_id_with_all_params(self, async_client: As
14801480
cursor="string",
14811481
entry_status="committed",
14821482
entry_type="increment",
1483-
limit=0,
1483+
limit=1,
14841484
minimum_amount="string",
14851485
)
14861486
assert_matches_type(AsyncPage[LedgerListByExternalIDResponse], ledger, path=["response"])

tests/api_resources/customers/credits/test_top_ups.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None:
124124
top_up = client.customers.credits.top_ups.list(
125125
"string",
126126
cursor="string",
127-
limit=0,
127+
limit=1,
128128
)
129129
assert_matches_type(SyncPage[TopUpListResponse], top_up, path=["response"])
130130

@@ -356,7 +356,7 @@ def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None:
356356
top_up = client.customers.credits.top_ups.list_by_external_id(
357357
"string",
358358
cursor="string",
359-
limit=0,
359+
limit=1,
360360
)
361361
assert_matches_type(SyncPage[TopUpListByExternalIDResponse], top_up, path=["response"])
362362

@@ -496,7 +496,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None
496496
top_up = await async_client.customers.credits.top_ups.list(
497497
"string",
498498
cursor="string",
499-
limit=0,
499+
limit=1,
500500
)
501501
assert_matches_type(AsyncPage[TopUpListResponse], top_up, path=["response"])
502502

@@ -728,7 +728,7 @@ async def test_method_list_by_external_id_with_all_params(self, async_client: As
728728
top_up = await async_client.customers.credits.top_ups.list_by_external_id(
729729
"string",
730730
cursor="string",
731-
limit=0,
731+
limit=1,
732732
)
733733
assert_matches_type(AsyncPage[TopUpListByExternalIDResponse], top_up, path=["response"])
734734

tests/api_resources/customers/test_balance_transactions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None:
9090
balance_transaction = client.customers.balance_transactions.list(
9191
"string",
9292
cursor="string",
93-
limit=0,
93+
limit=1,
9494
operation_time_gt=parse_datetime("2019-12-27T18:11:19.117Z"),
9595
operation_time_gte=parse_datetime("2019-12-27T18:11:19.117Z"),
9696
operation_time_lt=parse_datetime("2019-12-27T18:11:19.117Z"),
@@ -201,7 +201,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None
201201
balance_transaction = await async_client.customers.balance_transactions.list(
202202
"string",
203203
cursor="string",
204-
limit=0,
204+
limit=1,
205205
operation_time_gt=parse_datetime("2019-12-27T18:11:19.117Z"),
206206
operation_time_gte=parse_datetime("2019-12-27T18:11:19.117Z"),
207207
operation_time_lt=parse_datetime("2019-12-27T18:11:19.117Z"),

tests/api_resources/customers/test_credits.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None:
3434
"string",
3535
currency="string",
3636
cursor="string",
37-
limit=0,
37+
limit=1,
3838
)
3939
assert_matches_type(SyncPage[CreditListResponse], credit, path=["response"])
4040

@@ -82,7 +82,7 @@ def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None:
8282
"string",
8383
currency="string",
8484
cursor="string",
85-
limit=0,
85+
limit=1,
8686
)
8787
assert_matches_type(SyncPage[CreditListByExternalIDResponse], credit, path=["response"])
8888

@@ -134,7 +134,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None
134134
"string",
135135
currency="string",
136136
cursor="string",
137-
limit=0,
137+
limit=1,
138138
)
139139
assert_matches_type(AsyncPage[CreditListResponse], credit, path=["response"])
140140

@@ -182,7 +182,7 @@ async def test_method_list_by_external_id_with_all_params(self, async_client: As
182182
"string",
183183
currency="string",
184184
cursor="string",
185-
limit=0,
185+
limit=1,
186186
)
187187
assert_matches_type(AsyncPage[CreditListByExternalIDResponse], credit, path=["response"])
188188

tests/api_resources/events/test_backfills.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_method_list(self, client: Orb) -> None:
8080
def test_method_list_with_all_params(self, client: Orb) -> None:
8181
backfill = client.events.backfills.list(
8282
cursor="string",
83-
limit=0,
83+
limit=1,
8484
)
8585
assert_matches_type(SyncPage[BackfillListResponse], backfill, path=["response"])
8686

@@ -277,7 +277,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None:
277277
async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None:
278278
backfill = await async_client.events.backfills.list(
279279
cursor="string",
280-
limit=0,
280+
limit=1,
281281
)
282282
assert_matches_type(AsyncPage[BackfillListResponse], backfill, path=["response"])
283283

tests/api_resources/test_alerts.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None:
7676
cursor="string",
7777
customer_id="string",
7878
external_customer_id="string",
79-
limit=0,
79+
limit=1,
8080
subscription_id="string",
8181
)
8282
assert_matches_type(SyncPage[Alert], alert, path=["response"])
@@ -410,7 +410,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None
410410
cursor="string",
411411
customer_id="string",
412412
external_customer_id="string",
413-
limit=0,
413+
limit=1,
414414
subscription_id="string",
415415
)
416416
assert_matches_type(AsyncPage[Alert], alert, path=["response"])

tests/api_resources/test_coupons.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
3838
},
3939
redemption_code="HALFOFF",
4040
duration_in_months=12,
41-
max_redemptions=0,
41+
max_redemptions=1,
4242
)
4343
assert_matches_type(Coupon, coupon, path=["response"])
4444

@@ -83,7 +83,7 @@ def test_method_list(self, client: Orb) -> None:
8383
def test_method_list_with_all_params(self, client: Orb) -> None:
8484
coupon = client.coupons.list(
8585
cursor="string",
86-
limit=0,
86+
limit=1,
8787
redemption_code="string",
8888
show_archived=True,
8989
)
@@ -209,7 +209,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
209209
},
210210
redemption_code="HALFOFF",
211211
duration_in_months=12,
212-
max_redemptions=0,
212+
max_redemptions=1,
213213
)
214214
assert_matches_type(Coupon, coupon, path=["response"])
215215

@@ -254,7 +254,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None:
254254
async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None:
255255
coupon = await async_client.coupons.list(
256256
cursor="string",
257-
limit=0,
257+
limit=1,
258258
redemption_code="string",
259259
show_archived=True,
260260
)

tests/api_resources/test_credit_notes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_method_list(self, client: Orb) -> None:
2727
def test_method_list_with_all_params(self, client: Orb) -> None:
2828
credit_note = client.credit_notes.list(
2929
cursor="string",
30-
limit=0,
30+
limit=1,
3131
)
3232
assert_matches_type(SyncPage[CreditNote], credit_note, path=["response"])
3333

@@ -102,7 +102,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None:
102102
async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None:
103103
credit_note = await async_client.credit_notes.list(
104104
cursor="string",
105-
limit=0,
105+
limit=1,
106106
)
107107
assert_matches_type(AsyncPage[CreditNote], credit_note, path=["response"])
108108

tests/api_resources/test_customers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None:
218218
created_at_lt=parse_datetime("2019-12-27T18:11:19.117Z"),
219219
created_at_lte=parse_datetime("2019-12-27T18:11:19.117Z"),
220220
cursor="string",
221-
limit=0,
221+
limit=1,
222222
)
223223
assert_matches_type(SyncPage[Customer], customer, path=["response"])
224224

@@ -652,7 +652,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None
652652
created_at_lt=parse_datetime("2019-12-27T18:11:19.117Z"),
653653
created_at_lte=parse_datetime("2019-12-27T18:11:19.117Z"),
654654
cursor="string",
655-
limit=0,
655+
limit=1,
656656
)
657657
assert_matches_type(AsyncPage[Customer], customer, path=["response"])
658658

tests/api_resources/test_invoices.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None:
213213
invoice_date_lt=parse_datetime("2019-12-27T18:11:19.117Z"),
214214
invoice_date_lte=parse_datetime("2019-12-27T18:11:19.117Z"),
215215
is_recurring=True,
216-
limit=0,
216+
limit=1,
217217
status=["draft", "issued", "paid"],
218218
subscription_id="string",
219219
)
@@ -632,7 +632,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None
632632
invoice_date_lt=parse_datetime("2019-12-27T18:11:19.117Z"),
633633
invoice_date_lte=parse_datetime("2019-12-27T18:11:19.117Z"),
634634
is_recurring=True,
635-
limit=0,
635+
limit=1,
636636
status=["draft", "issued", "paid"],
637637
subscription_id="string",
638638
)

tests/api_resources/test_items.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_method_list(self, client: Orb) -> None:
5858
def test_method_list_with_all_params(self, client: Orb) -> None:
5959
item = client.items.list(
6060
cursor="string",
61-
limit=0,
61+
limit=1,
6262
)
6363
assert_matches_type(SyncPage[Item], item, path=["response"])
6464

@@ -164,7 +164,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None:
164164
async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None:
165165
item = await async_client.items.list(
166166
cursor="string",
167-
limit=0,
167+
limit=1,
168168
)
169169
assert_matches_type(AsyncPage[Item], item, path=["response"])
170170

tests/api_resources/test_metrics.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None:
8787
created_at_lt=parse_datetime("2019-12-27T18:11:19.117Z"),
8888
created_at_lte=parse_datetime("2019-12-27T18:11:19.117Z"),
8989
cursor="string",
90-
limit=0,
90+
limit=1,
9191
)
9292
assert_matches_type(SyncPage[MetricListResponse], metric, path=["response"])
9393

@@ -217,7 +217,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None
217217
created_at_lt=parse_datetime("2019-12-27T18:11:19.117Z"),
218218
created_at_lte=parse_datetime("2019-12-27T18:11:19.117Z"),
219219
cursor="string",
220-
limit=0,
220+
limit=1,
221221
)
222222
assert_matches_type(AsyncPage[MetricListResponse], metric, path=["response"])
223223

0 commit comments

Comments
 (0)