Skip to content

feat(api): updates #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 36 additions & 44 deletions src/orb/resources/customers/credits/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ def create_entry(
entry_type: Literal["increment"],
currency: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
invoice_settings: Optional[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings]
| NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -347,11 +347,10 @@ def create_entry(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

effective_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit
balance should become available for use.
effective_date: An ISO 8601 format date that denotes when this credit balance should become
available for use.

expiry_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit
balance should expire.
expiry_date: An ISO 8601 format date that denotes when this credit balance should expire.

invoice_settings: Passing `invoice_settings` automatically generates an invoice for the newly
added credits. If `invoice_settings` is passed, you must specify
Expand Down Expand Up @@ -539,7 +538,7 @@ def create_entry(
customer_id: Optional[str],
*,
entry_type: Literal["expiration_change"],
expiry_date: Union[str, date, None],
expiry_date: Union[str, datetime, None],
target_expiry_date: Union[str, date],
amount: Optional[float] | NotGiven = NOT_GIVEN,
block_id: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -666,8 +665,7 @@ def create_entry(
return to the customer, up to the block's initial balance.

Args:
expiry_date: A future date (specified in YYYY-MM-DD format) that identifies the origination
credit block to expire
expiry_date: An ISO 8601 format date that identifies the origination credit block to expire

target_expiry_date: A future date (specified in YYYY-MM-DD format) used for expiration change,
denoting when credits transferred (as part of a partial block expiration) should
Expand Down Expand Up @@ -1042,8 +1040,8 @@ def create_entry(
| Literal["amendment"],
currency: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
invoice_settings: Optional[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings]
| NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1104,8 +1102,8 @@ def create_entry_by_external_id(
entry_type: Literal["increment"],
currency: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
invoice_settings: Optional[
ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings
]
Expand Down Expand Up @@ -1242,11 +1240,10 @@ def create_entry_by_external_id(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

effective_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit
balance should become available for use.
effective_date: An ISO 8601 format date that denotes when this credit balance should become
available for use.

expiry_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit
balance should expire.
expiry_date: An ISO 8601 format date that denotes when this credit balance should expire.

invoice_settings: Passing `invoice_settings` automatically generates an invoice for the newly
added credits. If `invoice_settings` is passed, you must specify
Expand Down Expand Up @@ -1434,7 +1431,7 @@ def create_entry_by_external_id(
external_customer_id: Optional[str],
*,
entry_type: Literal["expiration_change"],
expiry_date: Union[str, date, None],
expiry_date: Union[str, datetime, None],
target_expiry_date: Union[str, date],
amount: Optional[float] | NotGiven = NOT_GIVEN,
block_id: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1561,8 +1558,7 @@ def create_entry_by_external_id(
return to the customer, up to the block's initial balance.

Args:
expiry_date: A future date (specified in YYYY-MM-DD format) that identifies the origination
credit block to expire
expiry_date: An ISO 8601 format date that identifies the origination credit block to expire

target_expiry_date: A future date (specified in YYYY-MM-DD format) used for expiration change,
denoting when credits transferred (as part of a partial block expiration) should
Expand Down Expand Up @@ -1937,8 +1933,8 @@ def create_entry_by_external_id(
| Literal["amendment"],
currency: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
invoice_settings: Optional[
ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings
]
Expand Down Expand Up @@ -2337,8 +2333,8 @@ async def create_entry(
entry_type: Literal["increment"],
currency: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
invoice_settings: Optional[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings]
| NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -2473,11 +2469,10 @@ async def create_entry(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

effective_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit
balance should become available for use.
effective_date: An ISO 8601 format date that denotes when this credit balance should become
available for use.

expiry_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit
balance should expire.
expiry_date: An ISO 8601 format date that denotes when this credit balance should expire.

invoice_settings: Passing `invoice_settings` automatically generates an invoice for the newly
added credits. If `invoice_settings` is passed, you must specify
Expand Down Expand Up @@ -2665,7 +2660,7 @@ async def create_entry(
customer_id: Optional[str],
*,
entry_type: Literal["expiration_change"],
expiry_date: Union[str, date, None],
expiry_date: Union[str, datetime, None],
target_expiry_date: Union[str, date],
amount: Optional[float] | NotGiven = NOT_GIVEN,
block_id: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -2792,8 +2787,7 @@ async def create_entry(
return to the customer, up to the block's initial balance.

Args:
expiry_date: A future date (specified in YYYY-MM-DD format) that identifies the origination
credit block to expire
expiry_date: An ISO 8601 format date that identifies the origination credit block to expire

target_expiry_date: A future date (specified in YYYY-MM-DD format) used for expiration change,
denoting when credits transferred (as part of a partial block expiration) should
Expand Down Expand Up @@ -3168,8 +3162,8 @@ async def create_entry(
| Literal["amendment"],
currency: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
invoice_settings: Optional[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings]
| NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -3230,8 +3224,8 @@ async def create_entry_by_external_id(
entry_type: Literal["increment"],
currency: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
invoice_settings: Optional[
ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings
]
Expand Down Expand Up @@ -3368,11 +3362,10 @@ async def create_entry_by_external_id(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

effective_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit
balance should become available for use.
effective_date: An ISO 8601 format date that denotes when this credit balance should become
available for use.

expiry_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit
balance should expire.
expiry_date: An ISO 8601 format date that denotes when this credit balance should expire.

invoice_settings: Passing `invoice_settings` automatically generates an invoice for the newly
added credits. If `invoice_settings` is passed, you must specify
Expand Down Expand Up @@ -3560,7 +3553,7 @@ async def create_entry_by_external_id(
external_customer_id: Optional[str],
*,
entry_type: Literal["expiration_change"],
expiry_date: Union[str, date, None],
expiry_date: Union[str, datetime, None],
target_expiry_date: Union[str, date],
amount: Optional[float] | NotGiven = NOT_GIVEN,
block_id: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -3687,8 +3680,7 @@ async def create_entry_by_external_id(
return to the customer, up to the block's initial balance.

Args:
expiry_date: A future date (specified in YYYY-MM-DD format) that identifies the origination
credit block to expire
expiry_date: An ISO 8601 format date that identifies the origination credit block to expire

target_expiry_date: A future date (specified in YYYY-MM-DD format) used for expiration change,
denoting when credits transferred (as part of a partial block expiration) should
Expand Down Expand Up @@ -4063,8 +4055,8 @@ async def create_entry_by_external_id(
| Literal["amendment"],
currency: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
invoice_settings: Optional[
ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

from typing import Dict, Union, Optional
from datetime import date
from datetime import date, datetime
from typing_extensions import Literal, Required, Annotated, TypedDict

from ...._utils import PropertyInfo
Expand Down Expand Up @@ -42,17 +42,14 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False):
for noting corrections as a result of an incident, etc.
"""

effective_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")]
effective_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""
A future date (specified in YYYY-MM-DD format) that denotes when this credit
balance should become available for use.
An ISO 8601 format date that denotes when this credit balance should become
available for use.
"""

expiry_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")]
"""
A future date (specified in YYYY-MM-DD format) that denotes when this credit
balance should expire.
"""
expiry_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""An ISO 8601 format date that denotes when this credit balance should expire."""

invoice_settings: Optional[AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings]
"""
Expand Down Expand Up @@ -128,11 +125,8 @@ class AddDecrementCreditLedgerEntryRequestParams(TypedDict, total=False):
class AddExpirationChangeCreditLedgerEntryRequestParams(TypedDict, total=False):
entry_type: Required[Literal["expiration_change"]]

expiry_date: Required[Annotated[Union[str, date, None], PropertyInfo(format="iso8601")]]
"""
A future date (specified in YYYY-MM-DD format) that identifies the origination
credit block to expire
"""
expiry_date: Required[Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]]
"""An ISO 8601 format date that identifies the origination credit block to expire"""

target_expiry_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]]
"""
Expand Down
22 changes: 8 additions & 14 deletions src/orb/types/customers/credits/ledger_create_entry_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

from typing import Dict, Union, Optional
from datetime import date
from datetime import date, datetime
from typing_extensions import Literal, Required, Annotated, TypedDict

from ...._utils import PropertyInfo
Expand Down Expand Up @@ -42,17 +42,14 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False):
for noting corrections as a result of an incident, etc.
"""

effective_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")]
effective_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""
A future date (specified in YYYY-MM-DD format) that denotes when this credit
balance should become available for use.
An ISO 8601 format date that denotes when this credit balance should become
available for use.
"""

expiry_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")]
"""
A future date (specified in YYYY-MM-DD format) that denotes when this credit
balance should expire.
"""
expiry_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""An ISO 8601 format date that denotes when this credit balance should expire."""

invoice_settings: Optional[AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings]
"""
Expand Down Expand Up @@ -128,11 +125,8 @@ class AddDecrementCreditLedgerEntryRequestParams(TypedDict, total=False):
class AddExpirationChangeCreditLedgerEntryRequestParams(TypedDict, total=False):
entry_type: Required[Literal["expiration_change"]]

expiry_date: Required[Annotated[Union[str, date, None], PropertyInfo(format="iso8601")]]
"""
A future date (specified in YYYY-MM-DD format) that identifies the origination
credit block to expire
"""
expiry_date: Required[Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]]
"""An ISO 8601 format date that identifies the origination credit block to expire"""

target_expiry_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]]
"""
Expand Down
Loading