Skip to content

Commit

Permalink
feat: add None default value to nullable response properties
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Jan 4, 2024
1 parent 42b60df commit c7c886f
Show file tree
Hide file tree
Showing 33 changed files with 496 additions and 496 deletions.
2 changes: 1 addition & 1 deletion src/orb/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class PagePaginationMetadata(BaseModel):
has_more: bool

next_cursor: Optional[str]
next_cursor: Optional[str] = None


class SyncPage(BaseSyncPage[ModelT], BasePage[ModelT], Generic[ModelT]):
Expand Down
6 changes: 3 additions & 3 deletions src/orb/types/coupon.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Coupon(BaseModel):
id: str
"""Also referred to as coupon_id in this documentation."""

archived_at: Optional[datetime]
archived_at: Optional[datetime] = None
"""An archived coupon can no longer be redeemed.
Active coupons will have a value of null for `archived_at`; this field will be
Expand All @@ -58,13 +58,13 @@ class Coupon(BaseModel):

discount: Discount

duration_in_months: Optional[int]
duration_in_months: Optional[int] = None
"""
This allows for a coupon's discount to apply for a limited time (determined in
months); a `null` value here means "unlimited time".
"""

max_redemptions: Optional[int]
max_redemptions: Optional[int] = None
"""
The maximum number of redemptions allowed for this coupon before it is
exhausted; `null` here means "unlimited".
Expand Down
20 changes: 10 additions & 10 deletions src/orb/types/credit_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class Customer(BaseModel):
id: str

external_customer_id: Optional[str]
external_customer_id: Optional[str] = None


class DiscountAppliesToPrice(BaseModel):
Expand Down Expand Up @@ -65,7 +65,7 @@ class LineItemSubLineItem(BaseModel):

name: str

quantity: Optional[float]
quantity: Optional[float] = None


class LineItemTaxAmount(BaseModel):
Expand All @@ -75,7 +75,7 @@ class LineItemTaxAmount(BaseModel):
tax_rate_description: str
"""The human-readable description of the applied tax rate."""

tax_rate_percentage: Optional[str]
tax_rate_percentage: Optional[str] = None
"""The tax rate percentage, out of 100."""


Expand All @@ -92,7 +92,7 @@ class LineItem(BaseModel):
name: str
"""The name of the corresponding invoice line item."""

quantity: Optional[float]
quantity: Optional[float] = None
"""An optional quantity credited."""

sub_line_items: List[LineItemSubLineItem]
Expand Down Expand Up @@ -133,7 +133,7 @@ class CreditNote(BaseModel):
credit_note_number: str
"""The unique identifier for credit notes."""

credit_note_pdf: Optional[str]
credit_note_pdf: Optional[str] = None
"""A URL to a PDF of the credit note."""

customer: Customer
Expand All @@ -147,16 +147,16 @@ class CreditNote(BaseModel):
line_items: List[LineItem]
"""All of the line items associated with this credit note."""

maximum_amount_adjustment: Optional[MaximumAmountAdjustment]
maximum_amount_adjustment: Optional[MaximumAmountAdjustment] = None
"""The maximum amount applied on the original invoice"""

memo: Optional[str]
memo: Optional[str] = None
"""An optional memo supplied on the credit note."""

minimum_amount_refunded: Optional[str]
minimum_amount_refunded: Optional[str] = None
"""Any credited amount from the applied minimum on the invoice."""

reason: Optional[Literal["Duplicate", "Fraudulent", "Order change", "Product unsatisfactory"]]
reason: Optional[Literal["Duplicate", "Fraudulent", "Order change", "Product unsatisfactory"]] = None

subtotal: str
"""The total prior to any creditable invoice-level discounts or minimums."""
Expand All @@ -166,5 +166,5 @@ class CreditNote(BaseModel):

type: Literal["refund", "adjustment"]

voided_at: Optional[datetime]
voided_at: Optional[datetime] = None
"""The time at which the credit note was voided in Orb, if applicable."""
42 changes: 21 additions & 21 deletions src/orb/types/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,31 @@


class BillingAddress(BaseModel):
city: Optional[str]
city: Optional[str] = None

country: Optional[str]
country: Optional[str] = None

line1: Optional[str]
line1: Optional[str] = None

line2: Optional[str]
line2: Optional[str] = None

postal_code: Optional[str]
postal_code: Optional[str] = None

state: Optional[str]
state: Optional[str] = None


class ShippingAddress(BaseModel):
city: Optional[str]
city: Optional[str] = None

country: Optional[str]
country: Optional[str] = None

line1: Optional[str]
line1: Optional[str] = None

line2: Optional[str]
line2: Optional[str] = None

postal_code: Optional[str]
postal_code: Optional[str] = None

state: Optional[str]
state: Optional[str] = None


class TaxID(BaseModel):
Expand Down Expand Up @@ -169,7 +169,7 @@ class TaxID(BaseModel):


class AccountingSyncConfigurationAccountingProvider(BaseModel):
external_provider_id: Optional[str]
external_provider_id: Optional[str] = None

provider_type: Literal["quickbooks", "netsuite"]

Expand All @@ -194,11 +194,11 @@ class Customer(BaseModel):
balance: str
"""The customer's current balance in their currency."""

billing_address: Optional[BillingAddress]
billing_address: Optional[BillingAddress] = None

created_at: datetime

currency: Optional[str]
currency: Optional[str] = None

email: str
"""A valid customer email, to be used for notifications.
Expand All @@ -209,7 +209,7 @@ class Customer(BaseModel):

email_delivery: bool

external_customer_id: Optional[str]
external_customer_id: Optional[str] = None
"""
An optional user-defined ID for this customer resource, used throughout the
system as an alias for this Customer. Use this field to identify a customer by
Expand All @@ -227,24 +227,24 @@ class Customer(BaseModel):
name: str
"""The full name of the customer"""

payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]]
payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] = None
"""This is used for creating charges or invoices in an external system via Orb.
When not in test mode, the connection must first be configured in the Orb
webapp.
"""

payment_provider_id: Optional[str]
payment_provider_id: Optional[str] = None
"""The ID of this customer in an external payments solution, such as Stripe.
This is used for creating charges or invoices in the external system via Orb.
"""

portal_url: Optional[str]
portal_url: Optional[str] = None

shipping_address: Optional[ShippingAddress]
shipping_address: Optional[ShippingAddress] = None

tax_id: Optional[TaxID]
tax_id: Optional[TaxID] = None
"""
Tax IDs are commonly required to be displayed on customer invoices, which are
added to the headers of invoices.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ class BalanceTransactionCreateResponse(BaseModel):
created_at: datetime
"""The creation time of this transaction."""

credit_note: Optional[CreditNote]
credit_note: Optional[CreditNote] = None

description: Optional[str]
description: Optional[str] = None
"""An optional description provided for manual customer balance adjustments."""

ending_balance: str
Expand All @@ -51,7 +51,7 @@ class BalanceTransactionCreateResponse(BaseModel):
customer's currency.
"""

invoice: Optional[Invoice]
invoice: Optional[Invoice] = None

starting_balance: str
"""
Expand Down
6 changes: 3 additions & 3 deletions src/orb/types/customers/balance_transaction_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ class BalanceTransactionListResponse(BaseModel):
created_at: datetime
"""The creation time of this transaction."""

credit_note: Optional[CreditNote]
credit_note: Optional[CreditNote] = None

description: Optional[str]
description: Optional[str] = None
"""An optional description provided for manual customer balance adjustments."""

ending_balance: str
Expand All @@ -51,7 +51,7 @@ class BalanceTransactionListResponse(BaseModel):
customer's currency.
"""

invoice: Optional[Invoice]
invoice: Optional[Invoice] = None

starting_balance: str
"""
Expand Down
6 changes: 3 additions & 3 deletions src/orb/types/customers/cost_list_by_external_id_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class DataPerPriceCostPriceGroup(BaseModel):
grouping_key: str
"""Grouping key to break down a single price's costs"""

grouping_value: Optional[str]
grouping_value: Optional[str] = None

secondary_grouping_key: Optional[str]
secondary_grouping_key: Optional[str] = None
"""If the price is a matrix price, this is the second dimension key"""

secondary_grouping_value: Optional[str]
secondary_grouping_value: Optional[str] = None

total: str
"""Total costs for this group for the timeframe.
Expand Down
6 changes: 3 additions & 3 deletions src/orb/types/customers/cost_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class DataPerPriceCostPriceGroup(BaseModel):
grouping_key: str
"""Grouping key to break down a single price's costs"""

grouping_value: Optional[str]
grouping_value: Optional[str] = None

secondary_grouping_key: Optional[str]
secondary_grouping_key: Optional[str] = None
"""If the price is a matrix price, this is the second dimension key"""

secondary_grouping_value: Optional[str]
secondary_grouping_value: Optional[str] = None

total: str
"""Total costs for this group for the timeframe.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ class CreditListByExternalIDResponse(BaseModel):

balance: float

expiry_date: Optional[datetime]
expiry_date: Optional[datetime] = None

per_unit_cost_basis: Optional[str]
per_unit_cost_basis: Optional[str] = None
4 changes: 2 additions & 2 deletions src/orb/types/customers/credit_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ class CreditListResponse(BaseModel):

balance: float

expiry_date: Optional[datetime]
expiry_date: Optional[datetime] = None

per_unit_cost_basis: Optional[str]
per_unit_cost_basis: Optional[str] = None
Loading

0 comments on commit c7c886f

Please sign in to comment.