Skip to content

Commit 199805d

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): updates (#273)
1 parent c40750a commit 199805d

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
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-03945a99974ac1e7218fd458dceef31887a249cc048bcbbbe3828c1d893f95ea.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-9e131b1af87f473eee5a2320c826bf1ddf2cb1f1ea58212c367ba53ab8e4d5ef.yml

src/orb/types/credit_note.py

+34-34
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
__all__ = [
1010
"CreditNote",
1111
"Customer",
12-
"Discount",
13-
"DiscountAppliesToPrice",
1412
"LineItem",
15-
"LineItemDiscount",
1613
"LineItemTaxAmount",
14+
"LineItemDiscount",
1715
"MaximumAmountAdjustment",
1816
"MaximumAmountAdjustmentAppliesToPrice",
17+
"Discount",
18+
"DiscountAppliesToPrice",
1919
]
2020

2121

@@ -25,22 +25,15 @@ class Customer(BaseModel):
2525
external_customer_id: Optional[str] = None
2626

2727

28-
class DiscountAppliesToPrice(BaseModel):
29-
id: str
30-
31-
name: str
32-
33-
34-
class Discount(BaseModel):
35-
amount_applied: str
36-
37-
discount_type: Literal["percentage"]
38-
39-
percentage_discount: float
28+
class LineItemTaxAmount(BaseModel):
29+
amount: str
30+
"""The amount of additional tax incurred by this tax rate."""
4031

41-
applies_to_prices: Optional[List[DiscountAppliesToPrice]] = None
32+
tax_rate_description: str
33+
"""The human-readable description of the applied tax rate."""
4234

43-
reason: Optional[str] = None
35+
tax_rate_percentage: Optional[str] = None
36+
"""The tax rate percentage, out of 100."""
4437

4538

4639
class LineItemDiscount(BaseModel):
@@ -59,27 +52,13 @@ class LineItemDiscount(BaseModel):
5952
reason: Optional[str] = None
6053

6154

62-
class LineItemTaxAmount(BaseModel):
63-
amount: str
64-
"""The amount of additional tax incurred by this tax rate."""
65-
66-
tax_rate_description: str
67-
"""The human-readable description of the applied tax rate."""
68-
69-
tax_rate_percentage: Optional[str] = None
70-
"""The tax rate percentage, out of 100."""
71-
72-
7355
class LineItem(BaseModel):
7456
id: str
7557
"""The Orb id of this resource."""
7658

7759
amount: str
7860
"""The amount of the line item, including any line item minimums and discounts."""
7961

80-
discounts: List[LineItemDiscount]
81-
"""Any line item discounts from the invoice's line item."""
82-
8362
name: str
8463
"""The name of the corresponding invoice line item."""
8564

@@ -92,6 +71,9 @@ class LineItem(BaseModel):
9271
tax_amounts: List[LineItemTaxAmount]
9372
"""Any tax amounts applied onto the line item."""
9473

74+
discounts: Optional[List[LineItemDiscount]] = None
75+
"""Any line item discounts from the invoice's line item."""
76+
9577

9678
class MaximumAmountAdjustmentAppliesToPrice(BaseModel):
9779
id: str
@@ -111,6 +93,24 @@ class MaximumAmountAdjustment(BaseModel):
11193
reason: Optional[str] = None
11294

11395

96+
class DiscountAppliesToPrice(BaseModel):
97+
id: str
98+
99+
name: str
100+
101+
102+
class Discount(BaseModel):
103+
amount_applied: str
104+
105+
discount_type: Literal["percentage"]
106+
107+
percentage_discount: float
108+
109+
applies_to_prices: Optional[List[DiscountAppliesToPrice]] = None
110+
111+
reason: Optional[str] = None
112+
113+
114114
class CreditNote(BaseModel):
115115
id: str
116116
"""The Orb id of this credit note."""
@@ -126,9 +126,6 @@ class CreditNote(BaseModel):
126126

127127
customer: Customer
128128

129-
discounts: List[Discount]
130-
"""Any discounts applied on the original invoice."""
131-
132129
invoice_id: str
133130
"""The id of the invoice resource that this credit note is applied to."""
134131

@@ -156,3 +153,6 @@ class CreditNote(BaseModel):
156153

157154
voided_at: Optional[datetime] = None
158155
"""The time at which the credit note was voided in Orb, if applicable."""
156+
157+
discounts: Optional[List[Discount]] = None
158+
"""Any discounts applied on the original invoice."""

0 commit comments

Comments
 (0)