Skip to content

Commit

Permalink
feat(api): updates (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Oct 31, 2023
1 parent 717cc4a commit a17dd72
Show file tree
Hide file tree
Showing 33 changed files with 268 additions and 25 deletions.
2 changes: 2 additions & 0 deletions src/modern_treasury/resources/expected_payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ def list(
"se_bankgirot",
"sen",
"sepa",
"sg_giro",
"sic",
"signet",
"wire",
Expand Down Expand Up @@ -731,6 +732,7 @@ def list(
"se_bankgirot",
"sen",
"sepa",
"sg_giro",
"sic",
"signet",
"wire",
Expand Down
2 changes: 2 additions & 0 deletions src/modern_treasury/resources/external_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ def verify(
"se_bankgirot",
"sen",
"sepa",
"sg_giro",
"sic",
"signet",
"wire",
Expand Down Expand Up @@ -788,6 +789,7 @@ async def verify(
"se_bankgirot",
"sen",
"sepa",
"sg_giro",
"sic",
"signet",
"wire",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def update(
id: str,
*,
counterparty_id: str | NotGiven = NOT_GIVEN,
ledger_account_id: str | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
parent_account_id: str | NotGiven = NOT_GIVEN,
Expand All @@ -161,6 +162,8 @@ def update(
Args:
counterparty_id: The Counterparty associated to this account.
ledger_account_id: The Ledger Account associated to this account.
metadata: Additional data in the form of key-value pairs. Pairs can be removed by passing
an empty string or `null` as the value.
Expand All @@ -183,6 +186,7 @@ def update(
body=maybe_transform(
{
"counterparty_id": counterparty_id,
"ledger_account_id": ledger_account_id,
"metadata": metadata,
"name": name,
"parent_account_id": parent_account_id,
Expand Down Expand Up @@ -227,6 +231,7 @@ def list(
"se_bankgirot",
"sen",
"sepa",
"sg_giro",
"sic",
"signet",
"wire",
Expand Down Expand Up @@ -409,6 +414,7 @@ async def update(
id: str,
*,
counterparty_id: str | NotGiven = NOT_GIVEN,
ledger_account_id: str | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
parent_account_id: str | NotGiven = NOT_GIVEN,
Expand All @@ -426,6 +432,8 @@ async def update(
Args:
counterparty_id: The Counterparty associated to this account.
ledger_account_id: The Ledger Account associated to this account.
metadata: Additional data in the form of key-value pairs. Pairs can be removed by passing
an empty string or `null` as the value.
Expand All @@ -448,6 +456,7 @@ async def update(
body=maybe_transform(
{
"counterparty_id": counterparty_id,
"ledger_account_id": ledger_account_id,
"metadata": metadata,
"name": name,
"parent_account_id": parent_account_id,
Expand Down Expand Up @@ -492,6 +501,7 @@ def list(
"se_bankgirot",
"sen",
"sepa",
"sg_giro",
"sic",
"signet",
"wire",
Expand Down
113 changes: 108 additions & 5 deletions src/modern_treasury/resources/invoices/invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from ...types import (
Invoice,
PaymentOrderType,
invoice_list_params,
invoice_create_params,
invoice_update_params,
Expand Down Expand Up @@ -51,7 +50,33 @@ def create(
notifications_enabled: bool | NotGiven = NOT_GIVEN,
payment_effective_date: Union[str, date] | NotGiven = NOT_GIVEN,
payment_method: Literal["ui", "manual", "automatic"] | NotGiven = NOT_GIVEN,
payment_type: PaymentOrderType | NotGiven = NOT_GIVEN,
payment_type: Literal[
"ach",
"au_becs",
"bacs",
"book",
"card",
"chats",
"check",
"cross_border",
"eft",
"interac",
"masav",
"neft",
"nics",
"nz_becs",
"provxchange",
"rtp",
"sg_giro",
"se_bankgirot",
"sen",
"sepa",
"sic",
"signet",
"wire",
"zengin",
]
| NotGiven = NOT_GIVEN,
receiving_account_id: str | NotGiven = NOT_GIVEN,
recipient_email: Optional[str] | NotGiven = NOT_GIVEN,
recipient_name: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -212,7 +237,33 @@ def update(
originating_account_id: str | NotGiven = NOT_GIVEN,
payment_effective_date: Union[str, date] | NotGiven = NOT_GIVEN,
payment_method: Literal["ui", "manual", "automatic"] | NotGiven = NOT_GIVEN,
payment_type: PaymentOrderType | NotGiven = NOT_GIVEN,
payment_type: Literal[
"ach",
"au_becs",
"bacs",
"book",
"card",
"chats",
"check",
"cross_border",
"eft",
"interac",
"masav",
"neft",
"nics",
"nz_becs",
"provxchange",
"rtp",
"sg_giro",
"se_bankgirot",
"sen",
"sepa",
"sic",
"signet",
"wire",
"zengin",
]
| NotGiven = NOT_GIVEN,
receiving_account_id: str | NotGiven = NOT_GIVEN,
recipient_email: Optional[str] | NotGiven = NOT_GIVEN,
recipient_name: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -438,7 +489,33 @@ async def create(
notifications_enabled: bool | NotGiven = NOT_GIVEN,
payment_effective_date: Union[str, date] | NotGiven = NOT_GIVEN,
payment_method: Literal["ui", "manual", "automatic"] | NotGiven = NOT_GIVEN,
payment_type: PaymentOrderType | NotGiven = NOT_GIVEN,
payment_type: Literal[
"ach",
"au_becs",
"bacs",
"book",
"card",
"chats",
"check",
"cross_border",
"eft",
"interac",
"masav",
"neft",
"nics",
"nz_becs",
"provxchange",
"rtp",
"sg_giro",
"se_bankgirot",
"sen",
"sepa",
"sic",
"signet",
"wire",
"zengin",
]
| NotGiven = NOT_GIVEN,
receiving_account_id: str | NotGiven = NOT_GIVEN,
recipient_email: Optional[str] | NotGiven = NOT_GIVEN,
recipient_name: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -599,7 +676,33 @@ async def update(
originating_account_id: str | NotGiven = NOT_GIVEN,
payment_effective_date: Union[str, date] | NotGiven = NOT_GIVEN,
payment_method: Literal["ui", "manual", "automatic"] | NotGiven = NOT_GIVEN,
payment_type: PaymentOrderType | NotGiven = NOT_GIVEN,
payment_type: Literal[
"ach",
"au_becs",
"bacs",
"book",
"card",
"chats",
"check",
"cross_border",
"eft",
"interac",
"masav",
"neft",
"nics",
"nz_becs",
"provxchange",
"rtp",
"sg_giro",
"se_bankgirot",
"sen",
"sepa",
"sic",
"signet",
"wire",
"zengin",
]
| NotGiven = NOT_GIVEN,
receiving_account_id: str | NotGiven = NOT_GIVEN,
recipient_email: Optional[str] | NotGiven = NOT_GIVEN,
recipient_name: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down
11 changes: 6 additions & 5 deletions src/modern_treasury/resources/ledger_account_payouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from __future__ import annotations

import typing_extensions
from typing import Dict, List, Optional
from typing import Dict, List, Union, Optional
from datetime import datetime
from typing_extensions import Literal

from ..types import (
Expand All @@ -29,7 +30,7 @@ def create(
payout_ledger_account_id: str,
allow_either_direction: Optional[bool] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
effective_at_upper_bound: Optional[str] | NotGiven = NOT_GIVEN,
effective_at_upper_bound: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
skip_payout_ledger_transaction: Optional[bool] | NotGiven = NOT_GIVEN,
status: Optional[Literal["pending", "posted"]] | NotGiven = NOT_GIVEN,
Expand All @@ -52,7 +53,7 @@ def create(
and its balance is reduced as a result.
allow_either_direction: If true, the payout amount and payout_entry_direction will bring the payout
ledger accounts balance closer to zero, even if the balance is negative.
ledger account's balance closer to zero, even if the balance is negative.
description: The description of the ledger account payout.
Expand Down Expand Up @@ -287,7 +288,7 @@ async def create(
payout_ledger_account_id: str,
allow_either_direction: Optional[bool] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
effective_at_upper_bound: Optional[str] | NotGiven = NOT_GIVEN,
effective_at_upper_bound: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
skip_payout_ledger_transaction: Optional[bool] | NotGiven = NOT_GIVEN,
status: Optional[Literal["pending", "posted"]] | NotGiven = NOT_GIVEN,
Expand All @@ -310,7 +311,7 @@ async def create(
and its balance is reduced as a result.
allow_either_direction: If true, the payout amount and payout_entry_direction will bring the payout
ledger accounts balance closer to zero, even if the balance is negative.
ledger account's balance closer to zero, even if the balance is negative.
description: The description of the ledger account payout.
Expand Down
4 changes: 2 additions & 2 deletions src/modern_treasury/resources/ledger_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def list(
after_cursor: Optional[str] | NotGiven = NOT_GIVEN,
as_of_lock_version: int | NotGiven = NOT_GIVEN,
direction: TransactionDirection | NotGiven = NOT_GIVEN,
effective_at: Dict[str, str] | NotGiven = NOT_GIVEN,
effective_at: Dict[str, Union[str, datetime]] | NotGiven = NOT_GIVEN,
effective_date: Dict[str, Union[str, date]] | NotGiven = NOT_GIVEN,
ledger_account_category_id: str | NotGiven = NOT_GIVEN,
ledger_account_id: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -234,7 +234,7 @@ def list(
after_cursor: Optional[str] | NotGiven = NOT_GIVEN,
as_of_lock_version: int | NotGiven = NOT_GIVEN,
direction: TransactionDirection | NotGiven = NOT_GIVEN,
effective_at: Dict[str, str] | NotGiven = NOT_GIVEN,
effective_at: Dict[str, Union[str, datetime]] | NotGiven = NOT_GIVEN,
effective_date: Dict[str, Union[str, date]] | NotGiven = NOT_GIVEN,
ledger_account_category_id: str | NotGiven = NOT_GIVEN,
ledger_account_id: str | NotGiven = NOT_GIVEN,
Expand Down
Loading

0 comments on commit a17dd72

Please sign in to comment.