Skip to content

Commit 8fd362f

Browse files
feat(api): updates (#270)
1 parent 634c71a commit 8fd362f

21 files changed

Lines changed: 61 additions & 65 deletions

.stats.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 12 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 4 additions & 4 deletions
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

0 commit comments

Comments
 (0)