Skip to content

Commit

Permalink
chore(internal): minor type reference restructuring (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Oct 31, 2023
1 parent b1a1359 commit 717cc4a
Show file tree
Hide file tree
Showing 36 changed files with 117 additions and 123 deletions.
10 changes: 5 additions & 5 deletions src/modern_treasury/resources/account_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from ..types import (
AccountDetail,
shared_params,
account_detail_list_params,
account_detail_create_params,
)
Expand All @@ -16,6 +15,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from ..pagination import SyncPage, AsyncPage
from .._base_client import AsyncPaginator, make_request_options
from ..types.shared import AccountsType

__all__ = ["AccountDetails", "AsyncAccountDetails"]

Expand Down Expand Up @@ -78,7 +78,7 @@ def retrieve(
self,
id: str,
*,
accounts_type: shared_params.AccountsType,
accounts_type: AccountsType,
account_id: str,
# 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.
Expand Down Expand Up @@ -111,7 +111,7 @@ def list(
self,
account_id: str,
*,
accounts_type: shared_params.AccountsType,
accounts_type: AccountsType,
after_cursor: Optional[str] | NotGiven = NOT_GIVEN,
per_page: int | 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 @@ -252,7 +252,7 @@ async def retrieve(
self,
id: str,
*,
accounts_type: shared_params.AccountsType,
accounts_type: AccountsType,
account_id: str,
# 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.
Expand Down Expand Up @@ -285,7 +285,7 @@ def list(
self,
account_id: str,
*,
accounts_type: shared_params.AccountsType,
accounts_type: AccountsType,
after_cursor: Optional[str] | NotGiven = NOT_GIVEN,
per_page: int | 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
6 changes: 3 additions & 3 deletions src/modern_treasury/resources/counterparties.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from ..types import (
Counterparty,
CounterpartyCollectAccountResponse,
shared_params,
counterparty_list_params,
counterparty_create_params,
counterparty_update_params,
Expand All @@ -20,6 +19,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from ..pagination import SyncPage, AsyncPage
from .._base_client import AsyncPaginator, make_request_options
from ..types.shared import TransactionDirection

__all__ = ["Counterparties", "AsyncCounterparties"]

Expand Down Expand Up @@ -310,7 +310,7 @@ def collect_account(
self,
id: str,
*,
direction: shared_params.TransactionDirection,
direction: TransactionDirection,
custom_redirect: str | NotGiven = NOT_GIVEN,
fields: List[
Literal[
Expand Down Expand Up @@ -691,7 +691,7 @@ async def collect_account(
self,
id: str,
*,
direction: shared_params.TransactionDirection,
direction: TransactionDirection,
custom_redirect: str | NotGiven = NOT_GIVEN,
fields: List[
Literal[
Expand Down
22 changes: 11 additions & 11 deletions src/modern_treasury/resources/expected_payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from ..types import (
ExpectedPayment,
ExpectedPaymentType,
shared_params,
expected_payment_list_params,
expected_payment_create_params,
expected_payment_update_params,
Expand All @@ -19,6 +18,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from ..pagination import SyncPage, AsyncPage
from .._base_client import AsyncPaginator, make_request_options
from ..types.shared import Currency, TransactionDirection

__all__ = ["ExpectedPayments", "AsyncExpectedPayments"]

Expand All @@ -29,10 +29,10 @@ def create(
*,
amount_lower_bound: int,
amount_upper_bound: int,
direction: shared_params.TransactionDirection,
direction: TransactionDirection,
internal_account_id: str,
counterparty_id: Optional[str] | NotGiven = NOT_GIVEN,
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | NotGiven = NOT_GIVEN,
date_lower_bound: Union[str, date, None] | NotGiven = NOT_GIVEN,
date_upper_bound: Union[str, date, None] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -180,11 +180,11 @@ def update(
amount_lower_bound: int | NotGiven = NOT_GIVEN,
amount_upper_bound: int | NotGiven = NOT_GIVEN,
counterparty_id: Optional[str] | NotGiven = NOT_GIVEN,
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | NotGiven = NOT_GIVEN,
date_lower_bound: Union[str, date, None] | NotGiven = NOT_GIVEN,
date_upper_bound: Union[str, date, None] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
direction: shared_params.TransactionDirection | NotGiven = NOT_GIVEN,
direction: TransactionDirection | NotGiven = NOT_GIVEN,
internal_account_id: str | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
reconciliation_filters: Optional[object] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -297,7 +297,7 @@ def list(
counterparty_id: str | NotGiven = NOT_GIVEN,
created_at_lower_bound: Union[str, datetime] | NotGiven = NOT_GIVEN,
created_at_upper_bound: Union[str, datetime] | NotGiven = NOT_GIVEN,
direction: shared_params.TransactionDirection | NotGiven = NOT_GIVEN,
direction: TransactionDirection | NotGiven = NOT_GIVEN,
internal_account_id: str | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
per_page: int | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -438,10 +438,10 @@ async def create(
*,
amount_lower_bound: int,
amount_upper_bound: int,
direction: shared_params.TransactionDirection,
direction: TransactionDirection,
internal_account_id: str,
counterparty_id: Optional[str] | NotGiven = NOT_GIVEN,
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | NotGiven = NOT_GIVEN,
date_lower_bound: Union[str, date, None] | NotGiven = NOT_GIVEN,
date_upper_bound: Union[str, date, None] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -589,11 +589,11 @@ async def update(
amount_lower_bound: int | NotGiven = NOT_GIVEN,
amount_upper_bound: int | NotGiven = NOT_GIVEN,
counterparty_id: Optional[str] | NotGiven = NOT_GIVEN,
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | NotGiven = NOT_GIVEN,
date_lower_bound: Union[str, date, None] | NotGiven = NOT_GIVEN,
date_upper_bound: Union[str, date, None] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
direction: shared_params.TransactionDirection | NotGiven = NOT_GIVEN,
direction: TransactionDirection | NotGiven = NOT_GIVEN,
internal_account_id: str | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
reconciliation_filters: Optional[object] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -706,7 +706,7 @@ def list(
counterparty_id: str | NotGiven = NOT_GIVEN,
created_at_lower_bound: Union[str, datetime] | NotGiven = NOT_GIVEN,
created_at_upper_bound: Union[str, datetime] | NotGiven = NOT_GIVEN,
direction: shared_params.TransactionDirection | NotGiven = NOT_GIVEN,
direction: TransactionDirection | NotGiven = NOT_GIVEN,
internal_account_id: str | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
per_page: int | NotGiven = NOT_GIVEN,
Expand Down
6 changes: 3 additions & 3 deletions src/modern_treasury/resources/external_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from ..types import (
ExternalAccount,
ExternalAccountType,
shared_params,
external_account_list_params,
external_account_create_params,
external_account_update_params,
Expand All @@ -20,6 +19,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from ..pagination import SyncPage, AsyncPage
from .._base_client import AsyncPaginator, make_request_options
from ..types.shared import Currency

__all__ = ["ExternalAccounts", "AsyncExternalAccounts"]

Expand Down Expand Up @@ -383,7 +383,7 @@ def verify(
"wire",
"zengin",
],
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | 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 @@ -793,7 +793,7 @@ async def verify(
"wire",
"zengin",
],
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | 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
11 changes: 5 additions & 6 deletions src/modern_treasury/resources/incoming_payment_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from ..types import (
IncomingPaymentDetail,
shared_params,
incoming_payment_detail_list_params,
incoming_payment_detail_update_params,
incoming_payment_detail_create_async_params,
Expand All @@ -18,7 +17,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from ..pagination import SyncPage, AsyncPage
from .._base_client import AsyncPaginator, make_request_options
from ..types.shared import AsyncResponse
from ..types.shared import Currency, AsyncResponse, TransactionDirection

__all__ = ["IncomingPaymentDetails", "AsyncIncomingPaymentDetails"]

Expand Down Expand Up @@ -106,7 +105,7 @@ def list(
after_cursor: Optional[str] | NotGiven = NOT_GIVEN,
as_of_date_end: Union[str, date] | NotGiven = NOT_GIVEN,
as_of_date_start: Union[str, date] | NotGiven = NOT_GIVEN,
direction: shared_params.TransactionDirection | NotGiven = NOT_GIVEN,
direction: TransactionDirection | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
per_page: int | NotGiven = NOT_GIVEN,
status: Literal["completed", "pending", "returned"] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -183,7 +182,7 @@ def create_async(
*,
amount: int | NotGiven = NOT_GIVEN,
as_of_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
direction: Literal["credit", "debit"] | NotGiven = NOT_GIVEN,
internal_account_id: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -338,7 +337,7 @@ def list(
after_cursor: Optional[str] | NotGiven = NOT_GIVEN,
as_of_date_end: Union[str, date] | NotGiven = NOT_GIVEN,
as_of_date_start: Union[str, date] | NotGiven = NOT_GIVEN,
direction: shared_params.TransactionDirection | NotGiven = NOT_GIVEN,
direction: TransactionDirection | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
per_page: int | NotGiven = NOT_GIVEN,
status: Literal["completed", "pending", "returned"] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -415,7 +414,7 @@ async def create_async(
*,
amount: int | NotGiven = NOT_GIVEN,
as_of_date: Union[str, date, None] | NotGiven = NOT_GIVEN,
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
direction: Literal["credit", "debit"] | NotGiven = NOT_GIVEN,
internal_account_id: str | NotGiven = NOT_GIVEN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from ...types import (
InternalAccount,
shared_params,
internal_account_list_params,
internal_account_create_params,
internal_account_update_params,
Expand All @@ -17,6 +16,7 @@
from ..._resource import SyncAPIResource, AsyncAPIResource
from ...pagination import SyncPage, AsyncPage
from ..._base_client import AsyncPaginator, make_request_options
from ...types.shared import Currency, TransactionDirection
from .balance_reports import BalanceReports, AsyncBalanceReports

if TYPE_CHECKING:
Expand Down Expand Up @@ -204,9 +204,9 @@ def list(
*,
after_cursor: Optional[str] | NotGiven = NOT_GIVEN,
counterparty_id: str | NotGiven = NOT_GIVEN,
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
payment_direction: shared_params.TransactionDirection | NotGiven = NOT_GIVEN,
payment_direction: TransactionDirection | NotGiven = NOT_GIVEN,
payment_type: Literal[
"ach",
"au_becs",
Expand Down Expand Up @@ -469,9 +469,9 @@ def list(
*,
after_cursor: Optional[str] | NotGiven = NOT_GIVEN,
counterparty_id: str | NotGiven = NOT_GIVEN,
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
payment_direction: shared_params.TransactionDirection | NotGiven = NOT_GIVEN,
payment_direction: TransactionDirection | NotGiven = NOT_GIVEN,
payment_type: Literal[
"ach",
"au_becs",
Expand Down
10 changes: 5 additions & 5 deletions src/modern_treasury/resources/invoices/invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from ...types import (
Invoice,
PaymentOrderType,
shared_params,
invoice_list_params,
invoice_create_params,
invoice_update_params,
Expand All @@ -20,6 +19,7 @@
from ..._resource import SyncAPIResource, AsyncAPIResource
from ...pagination import SyncPage, AsyncPage
from ..._base_client import AsyncPaginator, make_request_options
from ...types.shared import Currency

if TYPE_CHECKING:
from ..._client import ModernTreasury, AsyncModernTreasury
Expand All @@ -44,7 +44,7 @@ def create(
counterparty_billing_address: Optional[invoice_create_params.CounterpartyBillingAddress] | NotGiven = NOT_GIVEN,
counterparty_shipping_address: Optional[invoice_create_params.CounterpartyShippingAddress]
| NotGiven = NOT_GIVEN,
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
invoicer_address: Optional[invoice_create_params.InvoicerAddress] | NotGiven = NOT_GIVEN,
notification_email_addresses: Optional[List[str]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -203,7 +203,7 @@ def update(
counterparty_id: str | NotGiven = NOT_GIVEN,
counterparty_shipping_address: Optional[invoice_update_params.CounterpartyShippingAddress]
| NotGiven = NOT_GIVEN,
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
due_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
invoicer_address: Optional[invoice_update_params.InvoicerAddress] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -431,7 +431,7 @@ async def create(
counterparty_billing_address: Optional[invoice_create_params.CounterpartyBillingAddress] | NotGiven = NOT_GIVEN,
counterparty_shipping_address: Optional[invoice_create_params.CounterpartyShippingAddress]
| NotGiven = NOT_GIVEN,
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
invoicer_address: Optional[invoice_create_params.InvoicerAddress] | NotGiven = NOT_GIVEN,
notification_email_addresses: Optional[List[str]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -590,7 +590,7 @@ async def update(
counterparty_id: str | NotGiven = NOT_GIVEN,
counterparty_shipping_address: Optional[invoice_update_params.CounterpartyShippingAddress]
| NotGiven = NOT_GIVEN,
currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN,
currency: Optional[Currency] | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
due_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
invoicer_address: Optional[invoice_update_params.InvoicerAddress] | NotGiven = NOT_GIVEN,
Expand Down
6 changes: 3 additions & 3 deletions src/modern_treasury/resources/ledger_account_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from ..types import (
LedgerAccountCategory,
shared_params,
ledger_account_category_list_params,
ledger_account_category_create_params,
ledger_account_category_update_params,
Expand All @@ -17,6 +16,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from ..pagination import SyncPage, AsyncPage
from .._base_client import AsyncPaginator, make_request_options
from ..types.shared import TransactionDirection

__all__ = ["LedgerAccountCategories", "AsyncLedgerAccountCategories"]

Expand All @@ -28,7 +28,7 @@ def create(
currency: str,
ledger_id: str,
name: str,
normal_balance: shared_params.TransactionDirection,
normal_balance: TransactionDirection,
currency_exponent: Optional[int] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -470,7 +470,7 @@ async def create(
currency: str,
ledger_id: str,
name: str,
normal_balance: shared_params.TransactionDirection,
normal_balance: TransactionDirection,
currency_exponent: Optional[int] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
Expand Down
Loading

0 comments on commit 717cc4a

Please sign in to comment.