Skip to content

Commit

Permalink
feat(api): updates (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Sep 19, 2023
1 parent 2b9d90b commit 27fc6bf
Show file tree
Hide file tree
Showing 63 changed files with 2,036 additions and 111 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 127
configured_endpoints: 134
24 changes: 21 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ Methods:
- <code title="get /api/invoices/{id}">client.invoices.<a href="./src/modern_treasury/resources/invoices/invoices.py">retrieve</a>(id) -> <a href="./src/modern_treasury/types/invoice.py">Invoice</a></code>
- <code title="patch /api/invoices/{id}">client.invoices.<a href="./src/modern_treasury/resources/invoices/invoices.py">update</a>(id, \*\*<a href="src/modern_treasury/types/invoice_update_params.py">params</a>) -> <a href="./src/modern_treasury/types/invoice.py">Invoice</a></code>
- <code title="get /api/invoices">client.invoices.<a href="./src/modern_treasury/resources/invoices/invoices.py">list</a>(\*\*<a href="src/modern_treasury/types/invoice_list_params.py">params</a>) -> <a href="./src/modern_treasury/types/invoice.py">SyncPage[Invoice]</a></code>
- <code title="put /api/invoices/{id}/payment_orders/{payment_order_id}">client.invoices.<a href="./src/modern_treasury/resources/invoices/invoices.py">add_payment_order</a>(id, payment_order_id) -> None</code>

## LineItems

Expand Down Expand Up @@ -290,6 +291,22 @@ Methods:
- <code title="get /api/ledger_accounts">client.ledger_accounts.<a href="./src/modern_treasury/resources/ledger_accounts.py">list</a>(\*\*<a href="src/modern_treasury/types/ledger_account_list_params.py">params</a>) -> <a href="./src/modern_treasury/types/ledger_account.py">SyncPage[LedgerAccount]</a></code>
- <code title="delete /api/ledger_accounts/{id}">client.ledger_accounts.<a href="./src/modern_treasury/resources/ledger_accounts.py">delete</a>(id) -> <a href="./src/modern_treasury/types/ledger_account.py">LedgerAccount</a></code>

# LedgerAccountBalanceMonitors

Types:

```python
from modern_treasury.types import LedgerAccountBalanceMonitor
```

Methods:

- <code title="post /api/ledger_account_balance_monitors">client.ledger_account_balance_monitors.<a href="./src/modern_treasury/resources/ledger_account_balance_monitors.py">create</a>(\*\*<a href="src/modern_treasury/types/ledger_account_balance_monitor_create_params.py">params</a>) -> <a href="./src/modern_treasury/types/ledger_account_balance_monitor.py">LedgerAccountBalanceMonitor</a></code>
- <code title="get /api/ledger_account_balance_monitors/{id}">client.ledger_account_balance_monitors.<a href="./src/modern_treasury/resources/ledger_account_balance_monitors.py">retrieve</a>(id) -> <a href="./src/modern_treasury/types/ledger_account_balance_monitor.py">LedgerAccountBalanceMonitor</a></code>
- <code title="patch /api/ledger_account_balance_monitors/{id}">client.ledger_account_balance_monitors.<a href="./src/modern_treasury/resources/ledger_account_balance_monitors.py">update</a>(id, \*\*<a href="src/modern_treasury/types/ledger_account_balance_monitor_update_params.py">params</a>) -> <a href="./src/modern_treasury/types/ledger_account_balance_monitor.py">LedgerAccountBalanceMonitor</a></code>
- <code title="get /api/ledger_account_balance_monitors">client.ledger_account_balance_monitors.<a href="./src/modern_treasury/resources/ledger_account_balance_monitors.py">list</a>(\*\*<a href="src/modern_treasury/types/ledger_account_balance_monitor_list_params.py">params</a>) -> <a href="./src/modern_treasury/types/ledger_account_balance_monitor.py">SyncPage[LedgerAccountBalanceMonitor]</a></code>
- <code title="delete /api/ledger_account_balance_monitors/{id}">client.ledger_account_balance_monitors.<a href="./src/modern_treasury/resources/ledger_account_balance_monitors.py">delete</a>(id) -> <a href="./src/modern_treasury/types/ledger_account_balance_monitor.py">LedgerAccountBalanceMonitor</a></code>

# LedgerAccountPayouts

Types:
Expand All @@ -301,9 +318,9 @@ from modern_treasury.types import LedgerAccountPayout
Methods:

- <code title="post /api/ledger_account_payouts">client.ledger_account_payouts.<a href="./src/modern_treasury/resources/ledger_account_payouts.py">create</a>(\*\*<a href="src/modern_treasury/types/ledger_account_payout_create_params.py">params</a>) -> <a href="./src/modern_treasury/types/ledger_account_payout.py">LedgerAccountPayout</a></code>
- <code title="get /api/ledger_account_payouts/{id}">client.ledger_account_payouts.<a href="./src/modern_treasury/resources/ledger_account_payouts.py">retrieve</a>(id) -> <a href="./src/modern_treasury/types/ledger_account_payout.py">LedgerAccountPayout</a></code>
- <code title="patch /api/ledger_account_payouts/{id}">client.ledger_account_payouts.<a href="./src/modern_treasury/resources/ledger_account_payouts.py">update</a>(id, \*\*<a href="src/modern_treasury/types/ledger_account_payout_update_params.py">params</a>) -> <a href="./src/modern_treasury/types/ledger_account_payout.py">LedgerAccountPayout</a></code>
- <code title="get /api/ledger_account_payouts">client.ledger_account_payouts.<a href="./src/modern_treasury/resources/ledger_account_payouts.py">list</a>(\*\*<a href="src/modern_treasury/types/ledger_account_payout_list_params.py">params</a>) -> <a href="./src/modern_treasury/types/ledger_account_payout.py">SyncPage[LedgerAccountPayout]</a></code>
- <code title="get /api/ledger_account_payouts/{id}">client.ledger_account_payouts.<a href="./src/modern_treasury/resources/ledger_account_payouts.py">retireve</a>(id) -> <a href="./src/modern_treasury/types/ledger_account_payout.py">LedgerAccountPayout</a></code>

# LedgerAccountStatements

Expand Down Expand Up @@ -451,8 +468,8 @@ from modern_treasury.types import PaymentReference

Methods:

- <code title="get /api/payment_references/{id}">client.payment_references.<a href="./src/modern_treasury/resources/payment_references.py">retrieve</a>(id) -> <a href="./src/modern_treasury/types/payment_reference.py">PaymentReference</a></code>
- <code title="get /api/payment_references">client.payment_references.<a href="./src/modern_treasury/resources/payment_references.py">list</a>(\*\*<a href="src/modern_treasury/types/payment_reference_list_params.py">params</a>) -> <a href="./src/modern_treasury/types/payment_reference.py">SyncPage[PaymentReference]</a></code>
- <code title="get /api/payment_references/{id}">client.payment_references.<a href="./src/modern_treasury/resources/payment_references.py">retireve</a>(id) -> <a href="./src/modern_treasury/types/payment_reference.py">PaymentReference</a></code>

# Returns

Expand Down Expand Up @@ -492,7 +509,8 @@ from modern_treasury.types.transactions import TransactionLineItem

Methods:

- <code title="get /api/transactions/{transaction_id}/line_items">client.transactions.line_items.<a href="./src/modern_treasury/resources/transactions/line_items.py">list</a>(transaction_id, \*\*<a href="src/modern_treasury/types/transactions/line_item_list_params.py">params</a>) -> <a href="./src/modern_treasury/types/transactions/transaction_line_item.py">SyncPage[TransactionLineItem]</a></code>
- <code title="get /api/transaction_line_items/{id}">client.transactions.line_items.<a href="./src/modern_treasury/resources/transactions/line_items.py">retrieve</a>(id) -> <a href="./src/modern_treasury/types/transactions/transaction_line_item.py">TransactionLineItem</a></code>
- <code title="get /api/transaction_line_items">client.transactions.line_items.<a href="./src/modern_treasury/resources/transactions/line_items.py">list</a>(\*\*<a href="src/modern_treasury/types/transactions/line_item_list_params.py">params</a>) -> <a href="./src/modern_treasury/types/transactions/transaction_line_item.py">SyncPage[TransactionLineItem]</a></code>

# Validations

Expand Down
4 changes: 4 additions & 0 deletions src/modern_treasury/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class ModernTreasury(SyncAPIClient):
ledgerable_events: resources.LedgerableEvents
ledger_account_categories: resources.LedgerAccountCategories
ledger_accounts: resources.LedgerAccounts
ledger_account_balance_monitors: resources.LedgerAccountBalanceMonitors
ledger_account_payouts: resources.LedgerAccountPayouts
ledger_account_statements: resources.LedgerAccountStatements
ledger_entries: resources.LedgerEntries
Expand Down Expand Up @@ -172,6 +173,7 @@ def __init__(
self.ledgerable_events = resources.LedgerableEvents(self)
self.ledger_account_categories = resources.LedgerAccountCategories(self)
self.ledger_accounts = resources.LedgerAccounts(self)
self.ledger_account_balance_monitors = resources.LedgerAccountBalanceMonitors(self)
self.ledger_account_payouts = resources.LedgerAccountPayouts(self)
self.ledger_account_statements = resources.LedgerAccountStatements(self)
self.ledger_entries = resources.LedgerEntries(self)
Expand Down Expand Up @@ -299,6 +301,7 @@ class AsyncModernTreasury(AsyncAPIClient):
ledgerable_events: resources.AsyncLedgerableEvents
ledger_account_categories: resources.AsyncLedgerAccountCategories
ledger_accounts: resources.AsyncLedgerAccounts
ledger_account_balance_monitors: resources.AsyncLedgerAccountBalanceMonitors
ledger_account_payouts: resources.AsyncLedgerAccountPayouts
ledger_account_statements: resources.AsyncLedgerAccountStatements
ledger_entries: resources.AsyncLedgerEntries
Expand Down Expand Up @@ -406,6 +409,7 @@ def __init__(
self.ledgerable_events = resources.AsyncLedgerableEvents(self)
self.ledger_account_categories = resources.AsyncLedgerAccountCategories(self)
self.ledger_accounts = resources.AsyncLedgerAccounts(self)
self.ledger_account_balance_monitors = resources.AsyncLedgerAccountBalanceMonitors(self)
self.ledger_account_payouts = resources.AsyncLedgerAccountPayouts(self)
self.ledger_account_statements = resources.AsyncLedgerAccountStatements(self)
self.ledger_entries = resources.AsyncLedgerEntries(self)
Expand Down
6 changes: 6 additions & 0 deletions src/modern_treasury/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
LedgerAccountStatements,
AsyncLedgerAccountStatements,
)
from .ledger_account_balance_monitors import (
LedgerAccountBalanceMonitors,
AsyncLedgerAccountBalanceMonitors,
)

__all__ = [
"Connections",
Expand Down Expand Up @@ -77,6 +81,8 @@
"AsyncLedgerAccountCategories",
"LedgerAccounts",
"AsyncLedgerAccounts",
"LedgerAccountBalanceMonitors",
"AsyncLedgerAccountBalanceMonitors",
"LedgerAccountPayouts",
"AsyncLedgerAccountPayouts",
"LedgerAccountStatements",
Expand Down
46 changes: 46 additions & 0 deletions src/modern_treasury/resources/account_collection_flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,28 @@ def create(
*,
counterparty_id: str,
payment_types: List[str],
receiving_countries: List[
Literal[
"USA",
"AUS",
"BEL",
"CAN",
"CHL",
"CHN",
"COL",
"FRA",
"DEU",
"HKG",
"IND",
"IRL",
"ITA",
"MEX",
"NLD",
"PER",
"ESP",
]
]
| NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -56,6 +78,7 @@ def create(
{
"counterparty_id": counterparty_id,
"payment_types": payment_types,
"receiving_countries": receiving_countries,
},
account_collection_flow_create_params.AccountCollectionFlowCreateParams,
),
Expand Down Expand Up @@ -204,6 +227,28 @@ async def create(
*,
counterparty_id: str,
payment_types: List[str],
receiving_countries: List[
Literal[
"USA",
"AUS",
"BEL",
"CAN",
"CHL",
"CHN",
"COL",
"FRA",
"DEU",
"HKG",
"IND",
"IRL",
"ITA",
"MEX",
"NLD",
"PER",
"ESP",
]
]
| NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -234,6 +279,7 @@ async def create(
{
"counterparty_id": counterparty_id,
"payment_types": payment_types,
"receiving_countries": receiving_countries,
},
account_collection_flow_create_params.AccountCollectionFlowCreateParams,
),
Expand Down
2 changes: 2 additions & 0 deletions src/modern_treasury/resources/counterparties.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ def collect_account(
"brCodigo",
"routingNumberType",
"address",
"jp_zengin_code",
]
]
| NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -712,6 +713,7 @@ async def collect_account(
"brCodigo",
"routingNumberType",
"address",
"jp_zengin_code",
]
]
| NotGiven = NOT_GIVEN,
Expand Down
12 changes: 10 additions & 2 deletions src/modern_treasury/resources/expected_payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def list(
internal_account_id: str | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
per_page: int | NotGiven = NOT_GIVEN,
status: Literal["archived", "reconciled", "unreconciled"] | NotGiven = NOT_GIVEN,
status: Literal["archived", "partially_reconciled", "reconciled", "unreconciled"] | NotGiven = NOT_GIVEN,
type: Literal[
"ach",
"au_becs",
Expand All @@ -306,12 +306,16 @@ def list(
"interac",
"masav",
"neft",
"nics",
"provxchange",
"rtp",
"se_bankgirot",
"sen",
"sepa",
"sic",
"signet",
"wire",
"zengin",
]
| NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -688,7 +692,7 @@ def list(
internal_account_id: str | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
per_page: int | NotGiven = NOT_GIVEN,
status: Literal["archived", "reconciled", "unreconciled"] | NotGiven = NOT_GIVEN,
status: Literal["archived", "partially_reconciled", "reconciled", "unreconciled"] | NotGiven = NOT_GIVEN,
type: Literal[
"ach",
"au_becs",
Expand All @@ -701,12 +705,16 @@ def list(
"interac",
"masav",
"neft",
"nics",
"provxchange",
"rtp",
"se_bankgirot",
"sen",
"sepa",
"sic",
"signet",
"wire",
"zengin",
]
| NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down
8 changes: 8 additions & 0 deletions src/modern_treasury/resources/external_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,16 @@ def verify(
"interac",
"masav",
"neft",
"nics",
"provxchange",
"rtp",
"se_bankgirot",
"sen",
"sepa",
"sic",
"signet",
"wire",
"zengin",
],
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -774,12 +778,16 @@ async def verify(
"interac",
"masav",
"neft",
"nics",
"provxchange",
"rtp",
"se_bankgirot",
"sen",
"sepa",
"sic",
"signet",
"wire",
"zengin",
],
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,16 @@ def list(
"interac",
"masav",
"neft",
"nics",
"provxchange",
"rtp",
"se_bankgirot",
"sen",
"sepa",
"sic",
"signet",
"wire",
"zengin",
]
| NotGiven = NOT_GIVEN,
per_page: int | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -478,12 +482,16 @@ def list(
"interac",
"masav",
"neft",
"nics",
"provxchange",
"rtp",
"se_bankgirot",
"sen",
"sepa",
"sic",
"signet",
"wire",
"zengin",
]
| NotGiven = NOT_GIVEN,
per_page: int | NotGiven = NOT_GIVEN,
Expand Down
Loading

0 comments on commit 27fc6bf

Please sign in to comment.