Skip to content

Commit e484056

Browse files
committed
feat(api): updates (#8)
1 parent 9322899 commit e484056

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+4594
-1060
lines changed

api.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Shared Types
2+
3+
```python
4+
from orb.types import Discount
5+
```
6+
17
# TopLevel
28

39
Types:
@@ -196,7 +202,7 @@ Methods:
196202
Types:
197203

198204
```python
199-
from orb.types import Invoice, InvoiceDiscount, InvoiceFetchUpcomingResponse
205+
from orb.types import Invoice, InvoiceFetchUpcomingResponse
200206
```
201207

202208
Methods:
@@ -263,7 +269,7 @@ Methods:
263269
Types:
264270

265271
```python
266-
from orb.types import Discount, Price
272+
from orb.types import Price
267273
```
268274

269275
Methods:
@@ -285,8 +291,8 @@ Types:
285291
```python
286292
from orb.types import (
287293
Subscription,
288-
Subscriptions,
289294
SubscriptionUsage,
295+
Subscriptions,
290296
SubscriptionFetchCostsResponse,
291297
SubscriptionFetchScheduleResponse,
292298
)

src/orb/resources/coupons/coupons.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(self, client: Orb) -> None:
2828
def create(
2929
self,
3030
*,
31-
discount: object,
31+
discount: coupon_create_params.Discount,
3232
redemption_code: str,
3333
duration_in_months: Optional[int] | NotGiven = NOT_GIVEN,
3434
max_redemptions: Optional[int] | NotGiven = NOT_GIVEN,
@@ -232,7 +232,7 @@ def __init__(self, client: AsyncOrb) -> None:
232232
async def create(
233233
self,
234234
*,
235-
discount: object,
235+
discount: coupon_create_params.Discount,
236236
redemption_code: str,
237237
duration_in_months: Optional[int] | NotGiven = NOT_GIVEN,
238238
max_redemptions: Optional[int] | NotGiven = NOT_GIVEN,

src/orb/resources/customers/customers.py

+510
Large diffs are not rendered by default.

src/orb/resources/customers/usage.py

+41-141
Large diffs are not rendered by default.

src/orb/resources/events/events.py

+80-80
Original file line numberDiff line numberDiff line change
@@ -246,47 +246,47 @@ def ingest(
246246
Events are the starting point for all usage calculations in the system, and are
247247
simple at their core:
248248
249-
```json
249+
```ts
250250
{
251-
// customer_id and external_customer_id are used to
252-
// attribute usage to a given Customer. Exactly one of these
253-
// should be specified in a given ingestion event.
254-
255-
// `customer_id` is the Orb generated identifier for the Customer,
256-
// which is returned from the Create customer API call.
257-
customer_id: string,
258-
259-
// external_customer_id is an alternate identifier which is associated
260-
// with a Customer at creation time. This is treated as an alias for
261-
// customer_id, and is usually set to an identifier native to your system.
262-
external_customer_id: string,
263-
264-
// A string name identifying the event, usually a usage
265-
// action. By convention, this should not contain any whitespace.
266-
event_name: string,
267-
268-
// An ISO 8601 format date with no timezone offset.
269-
// This should represent the time that usage occurred
270-
// and is important to attribute usage to a given
271-
// billing period. See the notes below on determining the timestamp.
272-
// e.g. 2020-12-09T16:09:53Z
273-
timestamp: string,
274-
275-
// A unique value, generated by the client, that is
276-
// used to de-duplicate events.
277-
// Exactly one event with a given
278-
// idempotency key will be ingested, which allows for
279-
// safe request retries.
280-
idempotency_key: string
281-
282-
// Optional custom metadata to attach to the event.
283-
// This might include a numeric value used for aggregation,
284-
// or a string/boolean value used for filtering.
285-
// The schema of this dictionary need not be pre-declared, and
286-
// properties can be added at any time.
287-
properties: {
288-
[key: string]?: string | number | boolean,
289-
},
251+
// customer_id and external_customer_id are used to
252+
// attribute usage to a given Customer. Exactly one of these
253+
// should be specified in a given ingestion event.
254+
255+
// `customer_id` is the Orb generated identifier for the Customer,
256+
// which is returned from the Create customer API call.
257+
customer_id: string,
258+
259+
// external_customer_id is an alternate identifier which is associated
260+
// with a Customer at creation time. This is treated as an alias for
261+
// customer_id, and is usually set to an identifier native to your system.
262+
external_customer_id: string,
263+
264+
// A string name identifying the event, usually a usage
265+
// action. By convention, this should not contain any whitespace.
266+
event_name: string,
267+
268+
// An ISO 8601 format date with no timezone offset.
269+
// This should represent the time that usage occurred
270+
// and is important to attribute usage to a given
271+
// billing period. See the notes below on determining the timestamp.
272+
// e.g. 2020-12-09T16:09:53Z
273+
timestamp: string,
274+
275+
// A unique value, generated by the client, that is
276+
// used to de-duplicate events.
277+
// Exactly one event with a given
278+
// idempotency key will be ingested, which allows for
279+
// safe request retries.
280+
idempotency_key: string
281+
282+
// Optional custom metadata to attach to the event.
283+
// This might include a numeric value used for aggregation,
284+
// or a string/boolean value used for filtering.
285+
// The schema of this dictionary need not be pre-declared, and
286+
// properties can be added at any time.
287+
properties: {
288+
[key: string]?: string | number | boolean,
289+
},
290290
}
291291
```
292292
@@ -785,47 +785,47 @@ async def ingest(
785785
Events are the starting point for all usage calculations in the system, and are
786786
simple at their core:
787787
788-
```json
788+
```ts
789789
{
790-
// customer_id and external_customer_id are used to
791-
// attribute usage to a given Customer. Exactly one of these
792-
// should be specified in a given ingestion event.
793-
794-
// `customer_id` is the Orb generated identifier for the Customer,
795-
// which is returned from the Create customer API call.
796-
customer_id: string,
797-
798-
// external_customer_id is an alternate identifier which is associated
799-
// with a Customer at creation time. This is treated as an alias for
800-
// customer_id, and is usually set to an identifier native to your system.
801-
external_customer_id: string,
802-
803-
// A string name identifying the event, usually a usage
804-
// action. By convention, this should not contain any whitespace.
805-
event_name: string,
806-
807-
// An ISO 8601 format date with no timezone offset.
808-
// This should represent the time that usage occurred
809-
// and is important to attribute usage to a given
810-
// billing period. See the notes below on determining the timestamp.
811-
// e.g. 2020-12-09T16:09:53Z
812-
timestamp: string,
813-
814-
// A unique value, generated by the client, that is
815-
// used to de-duplicate events.
816-
// Exactly one event with a given
817-
// idempotency key will be ingested, which allows for
818-
// safe request retries.
819-
idempotency_key: string
820-
821-
// Optional custom metadata to attach to the event.
822-
// This might include a numeric value used for aggregation,
823-
// or a string/boolean value used for filtering.
824-
// The schema of this dictionary need not be pre-declared, and
825-
// properties can be added at any time.
826-
properties: {
827-
[key: string]?: string | number | boolean,
828-
},
790+
// customer_id and external_customer_id are used to
791+
// attribute usage to a given Customer. Exactly one of these
792+
// should be specified in a given ingestion event.
793+
794+
// `customer_id` is the Orb generated identifier for the Customer,
795+
// which is returned from the Create customer API call.
796+
customer_id: string,
797+
798+
// external_customer_id is an alternate identifier which is associated
799+
// with a Customer at creation time. This is treated as an alias for
800+
// customer_id, and is usually set to an identifier native to your system.
801+
external_customer_id: string,
802+
803+
// A string name identifying the event, usually a usage
804+
// action. By convention, this should not contain any whitespace.
805+
event_name: string,
806+
807+
// An ISO 8601 format date with no timezone offset.
808+
// This should represent the time that usage occurred
809+
// and is important to attribute usage to a given
810+
// billing period. See the notes below on determining the timestamp.
811+
// e.g. 2020-12-09T16:09:53Z
812+
timestamp: string,
813+
814+
// A unique value, generated by the client, that is
815+
// used to de-duplicate events.
816+
// Exactly one event with a given
817+
// idempotency key will be ingested, which allows for
818+
// safe request retries.
819+
idempotency_key: string
820+
821+
// Optional custom metadata to attach to the event.
822+
// This might include a numeric value used for aggregation,
823+
// or a string/boolean value used for filtering.
824+
// The schema of this dictionary need not be pre-declared, and
825+
// properties can be added at any time.
826+
properties: {
827+
[key: string]?: string | number | boolean,
828+
},
829829
}
830830
```
831831

src/orb/resources/invoices.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def list(
124124
invoice_date_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
125125
is_recurring: Optional[bool] | NotGiven = NOT_GIVEN,
126126
limit: int | NotGiven = NOT_GIVEN,
127-
status: Optional[Literal["draft", "issued", "paid", "synced", "void"]] | NotGiven = NOT_GIVEN,
127+
status: Optional[List[Literal["draft", "issued", "paid", "synced", "void"]]] | NotGiven = NOT_GIVEN,
128128
subscription_id: Optional[str] | NotGiven = NOT_GIVEN,
129129
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
130130
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -513,7 +513,7 @@ def list(
513513
invoice_date_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
514514
is_recurring: Optional[bool] | NotGiven = NOT_GIVEN,
515515
limit: int | NotGiven = NOT_GIVEN,
516-
status: Optional[Literal["draft", "issued", "paid", "synced", "void"]] | NotGiven = NOT_GIVEN,
516+
status: Optional[List[Literal["draft", "issued", "paid", "synced", "void"]]] | NotGiven = NOT_GIVEN,
517517
subscription_id: Optional[str] | NotGiven = NOT_GIVEN,
518518
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
519519
# The extra values given here take precedence over values defined on the client or passed to this method.

src/orb/resources/plans/plans.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def create(
3232
*,
3333
currency: str,
3434
name: str,
35-
prices: List[object],
35+
prices: List[plan_create_params.Price],
3636
default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN,
3737
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
3838
metadata: Optional[object] | NotGiven = NOT_GIVEN,
@@ -273,7 +273,7 @@ async def create(
273273
*,
274274
currency: str,
275275
name: str,
276-
prices: List[object],
276+
prices: List[plan_create_params.Price],
277277
default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN,
278278
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
279279
metadata: Optional[object] | NotGiven = NOT_GIVEN,

0 commit comments

Comments
 (0)