diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b6f0298a..830a6574 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.494.0" + ".": "0.495.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 2715c40d..e029231b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 241 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-1f2c653a8b55e63d756d60f9110ceadb18f87a6039762b5ee31b5373bbc4499a.yml -openapi_spec_hash: a7b01c23c92b07f280117e6ba6262a7e -config_hash: cb5b8736705c06b670f6a25484622d62 +configured_endpoints: 232 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4615e5953fac5a76724144fc2e1f9f675a9722dc05adaeab23e4d09c9577086b.yml +openapi_spec_hash: 6db98497c4dda09b575d5ee12371ef83 +config_hash: b24ba63471a818520cec39b4695e1825 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d19379c..595c3662 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.495.0 (2026-04-22) + +Full Changelog: [v0.494.0...v0.495.0](https://github.com/Increase/increase-python/compare/v0.494.0...v0.495.0) + +### Features + +* **api:** api update ([f129884](https://github.com/Increase/increase-python/commit/f1298848eba104cbea3d44c8d1d9cd5133f25212)) + + +### Chores + +* **internal:** more robust bootstrap script ([e08daa8](https://github.com/Increase/increase-python/commit/e08daa83e582d5cf8e3dead7b7567208a8c5fe37)) + ## 0.494.0 (2026-04-20) Full Changelog: [v0.493.0...v0.494.0](https://github.com/Increase/increase-python/compare/v0.493.0...v0.494.0) diff --git a/api.md b/api.md index 568b6ca4..91af5ff3 100644 --- a/api.md +++ b/api.md @@ -653,48 +653,6 @@ Methods: - client.real_time_decisions.retrieve(real_time_decision_id) -> RealTimeDecision - client.real_time_decisions.action(real_time_decision_id, \*\*params) -> RealTimeDecision -# BookkeepingAccounts - -Types: - -```python -from increase.types import BookkeepingAccount, BookkeepingBalanceLookup -``` - -Methods: - -- client.bookkeeping_accounts.create(\*\*params) -> BookkeepingAccount -- client.bookkeeping_accounts.update(bookkeeping_account_id, \*\*params) -> BookkeepingAccount -- client.bookkeeping_accounts.list(\*\*params) -> SyncPage[BookkeepingAccount] -- client.bookkeeping_accounts.balance(bookkeeping_account_id, \*\*params) -> BookkeepingBalanceLookup - -# BookkeepingEntrySets - -Types: - -```python -from increase.types import BookkeepingEntrySet -``` - -Methods: - -- client.bookkeeping_entry_sets.create(\*\*params) -> BookkeepingEntrySet -- client.bookkeeping_entry_sets.retrieve(bookkeeping_entry_set_id) -> BookkeepingEntrySet -- client.bookkeeping_entry_sets.list(\*\*params) -> SyncPage[BookkeepingEntrySet] - -# BookkeepingEntries - -Types: - -```python -from increase.types import BookkeepingEntry -``` - -Methods: - -- client.bookkeeping_entries.retrieve(bookkeeping_entry_id) -> BookkeepingEntry -- client.bookkeeping_entries.list(\*\*params) -> SyncPage[BookkeepingEntry] - # Groups Types: diff --git a/pyproject.toml b/pyproject.toml index 0bad680e..fa6e90d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.494.0" +version = "0.495.0" description = "The official Python library for the increase API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/scripts/bootstrap b/scripts/bootstrap index b430fee3..fe8451e4 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { echo -n "==> Install Homebrew dependencies? (y/N): " read -r response diff --git a/src/increase/_client.py b/src/increase/_client.py index 49280b23..9f62f853 100644 --- a/src/increase/_client.py +++ b/src/increase/_client.py @@ -71,18 +71,15 @@ inbound_mail_items, intrafi_exclusions, oauth_applications, - bookkeeping_entries, card_push_transfers, event_subscriptions, real_time_decisions, ach_prenotifications, - bookkeeping_accounts, pending_transactions, declined_transactions, digital_card_profiles, digital_wallet_tokens, inbound_ach_transfers, - bookkeeping_entry_sets, inbound_check_deposits, inbound_wire_transfers, physical_card_profiles, @@ -130,18 +127,15 @@ from .resources.inbound_mail_items import InboundMailItemsResource, AsyncInboundMailItemsResource from .resources.intrafi_exclusions import IntrafiExclusionsResource, AsyncIntrafiExclusionsResource from .resources.oauth_applications import OAuthApplicationsResource, AsyncOAuthApplicationsResource - from .resources.bookkeeping_entries import BookkeepingEntriesResource, AsyncBookkeepingEntriesResource from .resources.card_push_transfers import CardPushTransfersResource, AsyncCardPushTransfersResource from .resources.event_subscriptions import EventSubscriptionsResource, AsyncEventSubscriptionsResource from .resources.real_time_decisions import RealTimeDecisionsResource, AsyncRealTimeDecisionsResource from .resources.ach_prenotifications import ACHPrenotificationsResource, AsyncACHPrenotificationsResource - from .resources.bookkeeping_accounts import BookkeepingAccountsResource, AsyncBookkeepingAccountsResource from .resources.pending_transactions import PendingTransactionsResource, AsyncPendingTransactionsResource from .resources.declined_transactions import DeclinedTransactionsResource, AsyncDeclinedTransactionsResource from .resources.digital_card_profiles import DigitalCardProfilesResource, AsyncDigitalCardProfilesResource from .resources.digital_wallet_tokens import DigitalWalletTokensResource, AsyncDigitalWalletTokensResource from .resources.inbound_ach_transfers import InboundACHTransfersResource, AsyncInboundACHTransfersResource - from .resources.bookkeeping_entry_sets import BookkeepingEntrySetsResource, AsyncBookkeepingEntrySetsResource from .resources.inbound_check_deposits import InboundCheckDepositsResource, AsyncInboundCheckDepositsResource from .resources.inbound_wire_transfers import InboundWireTransfersResource, AsyncInboundWireTransfersResource from .resources.physical_card_profiles import PhysicalCardProfilesResource, AsyncPhysicalCardProfilesResource @@ -551,24 +545,6 @@ def real_time_decisions(self) -> RealTimeDecisionsResource: return RealTimeDecisionsResource(self) - @cached_property - def bookkeeping_accounts(self) -> BookkeepingAccountsResource: - from .resources.bookkeeping_accounts import BookkeepingAccountsResource - - return BookkeepingAccountsResource(self) - - @cached_property - def bookkeeping_entry_sets(self) -> BookkeepingEntrySetsResource: - from .resources.bookkeeping_entry_sets import BookkeepingEntrySetsResource - - return BookkeepingEntrySetsResource(self) - - @cached_property - def bookkeeping_entries(self) -> BookkeepingEntriesResource: - from .resources.bookkeeping_entries import BookkeepingEntriesResource - - return BookkeepingEntriesResource(self) - @cached_property def groups(self) -> GroupsResource: from .resources.groups import GroupsResource @@ -1156,24 +1132,6 @@ def real_time_decisions(self) -> AsyncRealTimeDecisionsResource: return AsyncRealTimeDecisionsResource(self) - @cached_property - def bookkeeping_accounts(self) -> AsyncBookkeepingAccountsResource: - from .resources.bookkeeping_accounts import AsyncBookkeepingAccountsResource - - return AsyncBookkeepingAccountsResource(self) - - @cached_property - def bookkeeping_entry_sets(self) -> AsyncBookkeepingEntrySetsResource: - from .resources.bookkeeping_entry_sets import AsyncBookkeepingEntrySetsResource - - return AsyncBookkeepingEntrySetsResource(self) - - @cached_property - def bookkeeping_entries(self) -> AsyncBookkeepingEntriesResource: - from .resources.bookkeeping_entries import AsyncBookkeepingEntriesResource - - return AsyncBookkeepingEntriesResource(self) - @cached_property def groups(self) -> AsyncGroupsResource: from .resources.groups import AsyncGroupsResource @@ -1688,24 +1646,6 @@ def real_time_decisions(self) -> real_time_decisions.RealTimeDecisionsResourceWi return RealTimeDecisionsResourceWithRawResponse(self._client.real_time_decisions) - @cached_property - def bookkeeping_accounts(self) -> bookkeeping_accounts.BookkeepingAccountsResourceWithRawResponse: - from .resources.bookkeeping_accounts import BookkeepingAccountsResourceWithRawResponse - - return BookkeepingAccountsResourceWithRawResponse(self._client.bookkeeping_accounts) - - @cached_property - def bookkeeping_entry_sets(self) -> bookkeeping_entry_sets.BookkeepingEntrySetsResourceWithRawResponse: - from .resources.bookkeeping_entry_sets import BookkeepingEntrySetsResourceWithRawResponse - - return BookkeepingEntrySetsResourceWithRawResponse(self._client.bookkeeping_entry_sets) - - @cached_property - def bookkeeping_entries(self) -> bookkeeping_entries.BookkeepingEntriesResourceWithRawResponse: - from .resources.bookkeeping_entries import BookkeepingEntriesResourceWithRawResponse - - return BookkeepingEntriesResourceWithRawResponse(self._client.bookkeeping_entries) - @cached_property def groups(self) -> groups.GroupsResourceWithRawResponse: from .resources.groups import GroupsResourceWithRawResponse @@ -2065,24 +2005,6 @@ def real_time_decisions(self) -> real_time_decisions.AsyncRealTimeDecisionsResou return AsyncRealTimeDecisionsResourceWithRawResponse(self._client.real_time_decisions) - @cached_property - def bookkeeping_accounts(self) -> bookkeeping_accounts.AsyncBookkeepingAccountsResourceWithRawResponse: - from .resources.bookkeeping_accounts import AsyncBookkeepingAccountsResourceWithRawResponse - - return AsyncBookkeepingAccountsResourceWithRawResponse(self._client.bookkeeping_accounts) - - @cached_property - def bookkeeping_entry_sets(self) -> bookkeeping_entry_sets.AsyncBookkeepingEntrySetsResourceWithRawResponse: - from .resources.bookkeeping_entry_sets import AsyncBookkeepingEntrySetsResourceWithRawResponse - - return AsyncBookkeepingEntrySetsResourceWithRawResponse(self._client.bookkeeping_entry_sets) - - @cached_property - def bookkeeping_entries(self) -> bookkeeping_entries.AsyncBookkeepingEntriesResourceWithRawResponse: - from .resources.bookkeeping_entries import AsyncBookkeepingEntriesResourceWithRawResponse - - return AsyncBookkeepingEntriesResourceWithRawResponse(self._client.bookkeeping_entries) - @cached_property def groups(self) -> groups.AsyncGroupsResourceWithRawResponse: from .resources.groups import AsyncGroupsResourceWithRawResponse @@ -2442,24 +2364,6 @@ def real_time_decisions(self) -> real_time_decisions.RealTimeDecisionsResourceWi return RealTimeDecisionsResourceWithStreamingResponse(self._client.real_time_decisions) - @cached_property - def bookkeeping_accounts(self) -> bookkeeping_accounts.BookkeepingAccountsResourceWithStreamingResponse: - from .resources.bookkeeping_accounts import BookkeepingAccountsResourceWithStreamingResponse - - return BookkeepingAccountsResourceWithStreamingResponse(self._client.bookkeeping_accounts) - - @cached_property - def bookkeeping_entry_sets(self) -> bookkeeping_entry_sets.BookkeepingEntrySetsResourceWithStreamingResponse: - from .resources.bookkeeping_entry_sets import BookkeepingEntrySetsResourceWithStreamingResponse - - return BookkeepingEntrySetsResourceWithStreamingResponse(self._client.bookkeeping_entry_sets) - - @cached_property - def bookkeeping_entries(self) -> bookkeeping_entries.BookkeepingEntriesResourceWithStreamingResponse: - from .resources.bookkeeping_entries import BookkeepingEntriesResourceWithStreamingResponse - - return BookkeepingEntriesResourceWithStreamingResponse(self._client.bookkeeping_entries) - @cached_property def groups(self) -> groups.GroupsResourceWithStreamingResponse: from .resources.groups import GroupsResourceWithStreamingResponse @@ -2825,24 +2729,6 @@ def real_time_decisions(self) -> real_time_decisions.AsyncRealTimeDecisionsResou return AsyncRealTimeDecisionsResourceWithStreamingResponse(self._client.real_time_decisions) - @cached_property - def bookkeeping_accounts(self) -> bookkeeping_accounts.AsyncBookkeepingAccountsResourceWithStreamingResponse: - from .resources.bookkeeping_accounts import AsyncBookkeepingAccountsResourceWithStreamingResponse - - return AsyncBookkeepingAccountsResourceWithStreamingResponse(self._client.bookkeeping_accounts) - - @cached_property - def bookkeeping_entry_sets(self) -> bookkeeping_entry_sets.AsyncBookkeepingEntrySetsResourceWithStreamingResponse: - from .resources.bookkeeping_entry_sets import AsyncBookkeepingEntrySetsResourceWithStreamingResponse - - return AsyncBookkeepingEntrySetsResourceWithStreamingResponse(self._client.bookkeeping_entry_sets) - - @cached_property - def bookkeeping_entries(self) -> bookkeeping_entries.AsyncBookkeepingEntriesResourceWithStreamingResponse: - from .resources.bookkeeping_entries import AsyncBookkeepingEntriesResourceWithStreamingResponse - - return AsyncBookkeepingEntriesResourceWithStreamingResponse(self._client.bookkeeping_entries) - @cached_property def groups(self) -> groups.AsyncGroupsResourceWithStreamingResponse: from .resources.groups import AsyncGroupsResourceWithStreamingResponse diff --git a/src/increase/_version.py b/src/increase/_version.py index 435160b5..0fd7edfd 100644 --- a/src/increase/_version.py +++ b/src/increase/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "increase" -__version__ = "0.494.0" # x-release-please-version +__version__ = "0.495.0" # x-release-please-version diff --git a/src/increase/resources/__init__.py b/src/increase/resources/__init__.py index 192bfb62..0e6da752 100644 --- a/src/increase/resources/__init__.py +++ b/src/increase/resources/__init__.py @@ -280,14 +280,6 @@ OAuthApplicationsResourceWithStreamingResponse, AsyncOAuthApplicationsResourceWithStreamingResponse, ) -from .bookkeeping_entries import ( - BookkeepingEntriesResource, - AsyncBookkeepingEntriesResource, - BookkeepingEntriesResourceWithRawResponse, - AsyncBookkeepingEntriesResourceWithRawResponse, - BookkeepingEntriesResourceWithStreamingResponse, - AsyncBookkeepingEntriesResourceWithStreamingResponse, -) from .card_push_transfers import ( CardPushTransfersResource, AsyncCardPushTransfersResource, @@ -320,14 +312,6 @@ ACHPrenotificationsResourceWithStreamingResponse, AsyncACHPrenotificationsResourceWithStreamingResponse, ) -from .bookkeeping_accounts import ( - BookkeepingAccountsResource, - AsyncBookkeepingAccountsResource, - BookkeepingAccountsResourceWithRawResponse, - AsyncBookkeepingAccountsResourceWithRawResponse, - BookkeepingAccountsResourceWithStreamingResponse, - AsyncBookkeepingAccountsResourceWithStreamingResponse, -) from .pending_transactions import ( PendingTransactionsResource, AsyncPendingTransactionsResource, @@ -368,14 +352,6 @@ InboundACHTransfersResourceWithStreamingResponse, AsyncInboundACHTransfersResourceWithStreamingResponse, ) -from .bookkeeping_entry_sets import ( - BookkeepingEntrySetsResource, - AsyncBookkeepingEntrySetsResource, - BookkeepingEntrySetsResourceWithRawResponse, - AsyncBookkeepingEntrySetsResourceWithRawResponse, - BookkeepingEntrySetsResourceWithStreamingResponse, - AsyncBookkeepingEntrySetsResourceWithStreamingResponse, -) from .inbound_check_deposits import ( InboundCheckDepositsResource, AsyncInboundCheckDepositsResource, @@ -744,24 +720,6 @@ "AsyncRealTimeDecisionsResourceWithRawResponse", "RealTimeDecisionsResourceWithStreamingResponse", "AsyncRealTimeDecisionsResourceWithStreamingResponse", - "BookkeepingAccountsResource", - "AsyncBookkeepingAccountsResource", - "BookkeepingAccountsResourceWithRawResponse", - "AsyncBookkeepingAccountsResourceWithRawResponse", - "BookkeepingAccountsResourceWithStreamingResponse", - "AsyncBookkeepingAccountsResourceWithStreamingResponse", - "BookkeepingEntrySetsResource", - "AsyncBookkeepingEntrySetsResource", - "BookkeepingEntrySetsResourceWithRawResponse", - "AsyncBookkeepingEntrySetsResourceWithRawResponse", - "BookkeepingEntrySetsResourceWithStreamingResponse", - "AsyncBookkeepingEntrySetsResourceWithStreamingResponse", - "BookkeepingEntriesResource", - "AsyncBookkeepingEntriesResource", - "BookkeepingEntriesResourceWithRawResponse", - "AsyncBookkeepingEntriesResourceWithRawResponse", - "BookkeepingEntriesResourceWithStreamingResponse", - "AsyncBookkeepingEntriesResourceWithStreamingResponse", "GroupsResource", "AsyncGroupsResource", "GroupsResourceWithRawResponse", diff --git a/src/increase/resources/bookkeeping_accounts.py b/src/increase/resources/bookkeeping_accounts.py deleted file mode 100644 index 3221f85c..00000000 --- a/src/increase/resources/bookkeeping_accounts.py +++ /dev/null @@ -1,576 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from datetime import datetime -from typing_extensions import Literal - -import httpx - -from ..types import ( - bookkeeping_account_list_params, - bookkeeping_account_create_params, - bookkeeping_account_update_params, - bookkeeping_account_balance_params, -) -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import path_template, maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..pagination import SyncPage, AsyncPage -from .._base_client import AsyncPaginator, make_request_options -from ..types.bookkeeping_account import BookkeepingAccount -from ..types.bookkeeping_balance_lookup import BookkeepingBalanceLookup - -__all__ = ["BookkeepingAccountsResource", "AsyncBookkeepingAccountsResource"] - - -class BookkeepingAccountsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> BookkeepingAccountsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers - """ - return BookkeepingAccountsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> BookkeepingAccountsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/Increase/increase-python#with_streaming_response - """ - return BookkeepingAccountsResourceWithStreamingResponse(self) - - def create( - self, - *, - name: str, - account_id: str | Omit = omit, - compliance_category: Literal["commingled_cash", "customer_balance"] | Omit = omit, - entity_id: str | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> BookkeepingAccount: - """ - Create a Bookkeeping Account - - Args: - name: The name you choose for the account. - - account_id: The account, if `compliance_category` is `commingled_cash`. - - compliance_category: The account compliance category. - - - `commingled_cash` - A cash in an commingled Increase Account. - - `customer_balance` - A customer balance. - - entity_id: The entity, if `compliance_category` is `customer_balance`. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - return self._post( - "/bookkeeping_accounts", - body=maybe_transform( - { - "name": name, - "account_id": account_id, - "compliance_category": compliance_category, - "entity_id": entity_id, - }, - bookkeeping_account_create_params.BookkeepingAccountCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=BookkeepingAccount, - ) - - def update( - self, - bookkeeping_account_id: str, - *, - name: 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> BookkeepingAccount: - """ - Update a Bookkeeping Account - - Args: - bookkeeping_account_id: The bookkeeping account you would like to update. - - name: The name you choose for the account. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not bookkeeping_account_id: - raise ValueError( - f"Expected a non-empty value for `bookkeeping_account_id` but received {bookkeeping_account_id!r}" - ) - return self._patch( - path_template( - "/bookkeeping_accounts/{bookkeeping_account_id}", bookkeeping_account_id=bookkeeping_account_id - ), - body=maybe_transform({"name": name}, bookkeeping_account_update_params.BookkeepingAccountUpdateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=BookkeepingAccount, - ) - - def list( - self, - *, - cursor: str | Omit = omit, - idempotency_key: str | Omit = omit, - limit: int | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncPage[BookkeepingAccount]: - """ - List Bookkeeping Accounts - - Args: - cursor: Return the page of entries after this one. - - idempotency_key: Filter records to the one with the specified `idempotency_key` you chose for - that object. This value is unique across Increase and is used to ensure that a - request is only processed once. Learn more about - [idempotency](https://increase.com/documentation/idempotency-keys). - - limit: Limit the size of the list that is returned. The default (and maximum) is 100 - objects. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/bookkeeping_accounts", - page=SyncPage[BookkeepingAccount], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "cursor": cursor, - "idempotency_key": idempotency_key, - "limit": limit, - }, - bookkeeping_account_list_params.BookkeepingAccountListParams, - ), - ), - model=BookkeepingAccount, - ) - - def balance( - self, - bookkeeping_account_id: str, - *, - at_time: Union[str, datetime] | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> BookkeepingBalanceLookup: - """ - Retrieve a Bookkeeping Account Balance - - Args: - bookkeeping_account_id: The identifier of the Bookkeeping Account to retrieve. - - at_time: The moment to query the balance at. If not set, returns the current balances. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not bookkeeping_account_id: - raise ValueError( - f"Expected a non-empty value for `bookkeeping_account_id` but received {bookkeeping_account_id!r}" - ) - return self._get( - path_template( - "/bookkeeping_accounts/{bookkeeping_account_id}/balance", bookkeeping_account_id=bookkeeping_account_id - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - {"at_time": at_time}, bookkeeping_account_balance_params.BookkeepingAccountBalanceParams - ), - ), - cast_to=BookkeepingBalanceLookup, - ) - - -class AsyncBookkeepingAccountsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncBookkeepingAccountsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers - """ - return AsyncBookkeepingAccountsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncBookkeepingAccountsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/Increase/increase-python#with_streaming_response - """ - return AsyncBookkeepingAccountsResourceWithStreamingResponse(self) - - async def create( - self, - *, - name: str, - account_id: str | Omit = omit, - compliance_category: Literal["commingled_cash", "customer_balance"] | Omit = omit, - entity_id: str | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> BookkeepingAccount: - """ - Create a Bookkeeping Account - - Args: - name: The name you choose for the account. - - account_id: The account, if `compliance_category` is `commingled_cash`. - - compliance_category: The account compliance category. - - - `commingled_cash` - A cash in an commingled Increase Account. - - `customer_balance` - A customer balance. - - entity_id: The entity, if `compliance_category` is `customer_balance`. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - return await self._post( - "/bookkeeping_accounts", - body=await async_maybe_transform( - { - "name": name, - "account_id": account_id, - "compliance_category": compliance_category, - "entity_id": entity_id, - }, - bookkeeping_account_create_params.BookkeepingAccountCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=BookkeepingAccount, - ) - - async def update( - self, - bookkeeping_account_id: str, - *, - name: 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> BookkeepingAccount: - """ - Update a Bookkeeping Account - - Args: - bookkeeping_account_id: The bookkeeping account you would like to update. - - name: The name you choose for the account. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not bookkeeping_account_id: - raise ValueError( - f"Expected a non-empty value for `bookkeeping_account_id` but received {bookkeeping_account_id!r}" - ) - return await self._patch( - path_template( - "/bookkeeping_accounts/{bookkeeping_account_id}", bookkeeping_account_id=bookkeeping_account_id - ), - body=await async_maybe_transform( - {"name": name}, bookkeeping_account_update_params.BookkeepingAccountUpdateParams - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=BookkeepingAccount, - ) - - def list( - self, - *, - cursor: str | Omit = omit, - idempotency_key: str | Omit = omit, - limit: int | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[BookkeepingAccount, AsyncPage[BookkeepingAccount]]: - """ - List Bookkeeping Accounts - - Args: - cursor: Return the page of entries after this one. - - idempotency_key: Filter records to the one with the specified `idempotency_key` you chose for - that object. This value is unique across Increase and is used to ensure that a - request is only processed once. Learn more about - [idempotency](https://increase.com/documentation/idempotency-keys). - - limit: Limit the size of the list that is returned. The default (and maximum) is 100 - objects. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/bookkeeping_accounts", - page=AsyncPage[BookkeepingAccount], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "cursor": cursor, - "idempotency_key": idempotency_key, - "limit": limit, - }, - bookkeeping_account_list_params.BookkeepingAccountListParams, - ), - ), - model=BookkeepingAccount, - ) - - async def balance( - self, - bookkeeping_account_id: str, - *, - at_time: Union[str, datetime] | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> BookkeepingBalanceLookup: - """ - Retrieve a Bookkeeping Account Balance - - Args: - bookkeeping_account_id: The identifier of the Bookkeeping Account to retrieve. - - at_time: The moment to query the balance at. If not set, returns the current balances. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not bookkeeping_account_id: - raise ValueError( - f"Expected a non-empty value for `bookkeeping_account_id` but received {bookkeeping_account_id!r}" - ) - return await self._get( - path_template( - "/bookkeeping_accounts/{bookkeeping_account_id}/balance", bookkeeping_account_id=bookkeeping_account_id - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - {"at_time": at_time}, bookkeeping_account_balance_params.BookkeepingAccountBalanceParams - ), - ), - cast_to=BookkeepingBalanceLookup, - ) - - -class BookkeepingAccountsResourceWithRawResponse: - def __init__(self, bookkeeping_accounts: BookkeepingAccountsResource) -> None: - self._bookkeeping_accounts = bookkeeping_accounts - - self.create = to_raw_response_wrapper( - bookkeeping_accounts.create, - ) - self.update = to_raw_response_wrapper( - bookkeeping_accounts.update, - ) - self.list = to_raw_response_wrapper( - bookkeeping_accounts.list, - ) - self.balance = to_raw_response_wrapper( - bookkeeping_accounts.balance, - ) - - -class AsyncBookkeepingAccountsResourceWithRawResponse: - def __init__(self, bookkeeping_accounts: AsyncBookkeepingAccountsResource) -> None: - self._bookkeeping_accounts = bookkeeping_accounts - - self.create = async_to_raw_response_wrapper( - bookkeeping_accounts.create, - ) - self.update = async_to_raw_response_wrapper( - bookkeeping_accounts.update, - ) - self.list = async_to_raw_response_wrapper( - bookkeeping_accounts.list, - ) - self.balance = async_to_raw_response_wrapper( - bookkeeping_accounts.balance, - ) - - -class BookkeepingAccountsResourceWithStreamingResponse: - def __init__(self, bookkeeping_accounts: BookkeepingAccountsResource) -> None: - self._bookkeeping_accounts = bookkeeping_accounts - - self.create = to_streamed_response_wrapper( - bookkeeping_accounts.create, - ) - self.update = to_streamed_response_wrapper( - bookkeeping_accounts.update, - ) - self.list = to_streamed_response_wrapper( - bookkeeping_accounts.list, - ) - self.balance = to_streamed_response_wrapper( - bookkeeping_accounts.balance, - ) - - -class AsyncBookkeepingAccountsResourceWithStreamingResponse: - def __init__(self, bookkeeping_accounts: AsyncBookkeepingAccountsResource) -> None: - self._bookkeeping_accounts = bookkeeping_accounts - - self.create = async_to_streamed_response_wrapper( - bookkeeping_accounts.create, - ) - self.update = async_to_streamed_response_wrapper( - bookkeeping_accounts.update, - ) - self.list = async_to_streamed_response_wrapper( - bookkeeping_accounts.list, - ) - self.balance = async_to_streamed_response_wrapper( - bookkeeping_accounts.balance, - ) diff --git a/src/increase/resources/bookkeeping_entries.py b/src/increase/resources/bookkeeping_entries.py deleted file mode 100644 index 906f6f9d..00000000 --- a/src/increase/resources/bookkeeping_entries.py +++ /dev/null @@ -1,290 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..types import bookkeeping_entry_list_params -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import path_template, maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..pagination import SyncPage, AsyncPage -from .._base_client import AsyncPaginator, make_request_options -from ..types.bookkeeping_entry import BookkeepingEntry - -__all__ = ["BookkeepingEntriesResource", "AsyncBookkeepingEntriesResource"] - - -class BookkeepingEntriesResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> BookkeepingEntriesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers - """ - return BookkeepingEntriesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> BookkeepingEntriesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/Increase/increase-python#with_streaming_response - """ - return BookkeepingEntriesResourceWithStreamingResponse(self) - - def retrieve( - self, - bookkeeping_entry_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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> BookkeepingEntry: - """ - Retrieve a Bookkeeping Entry - - Args: - bookkeeping_entry_id: The identifier of the Bookkeeping Entry. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not bookkeeping_entry_id: - raise ValueError( - f"Expected a non-empty value for `bookkeeping_entry_id` but received {bookkeeping_entry_id!r}" - ) - return self._get( - path_template("/bookkeeping_entries/{bookkeeping_entry_id}", bookkeeping_entry_id=bookkeeping_entry_id), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=BookkeepingEntry, - ) - - def list( - self, - *, - account_id: str | Omit = omit, - cursor: str | Omit = omit, - limit: int | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncPage[BookkeepingEntry]: - """ - List Bookkeeping Entries - - Args: - account_id: The identifier for the Bookkeeping Account to filter by. - - cursor: Return the page of entries after this one. - - limit: Limit the size of the list that is returned. The default (and maximum) is 100 - objects. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/bookkeeping_entries", - page=SyncPage[BookkeepingEntry], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "account_id": account_id, - "cursor": cursor, - "limit": limit, - }, - bookkeeping_entry_list_params.BookkeepingEntryListParams, - ), - ), - model=BookkeepingEntry, - ) - - -class AsyncBookkeepingEntriesResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncBookkeepingEntriesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers - """ - return AsyncBookkeepingEntriesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncBookkeepingEntriesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/Increase/increase-python#with_streaming_response - """ - return AsyncBookkeepingEntriesResourceWithStreamingResponse(self) - - async def retrieve( - self, - bookkeeping_entry_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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> BookkeepingEntry: - """ - Retrieve a Bookkeeping Entry - - Args: - bookkeeping_entry_id: The identifier of the Bookkeeping Entry. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not bookkeeping_entry_id: - raise ValueError( - f"Expected a non-empty value for `bookkeeping_entry_id` but received {bookkeeping_entry_id!r}" - ) - return await self._get( - path_template("/bookkeeping_entries/{bookkeeping_entry_id}", bookkeeping_entry_id=bookkeeping_entry_id), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=BookkeepingEntry, - ) - - def list( - self, - *, - account_id: str | Omit = omit, - cursor: str | Omit = omit, - limit: int | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[BookkeepingEntry, AsyncPage[BookkeepingEntry]]: - """ - List Bookkeeping Entries - - Args: - account_id: The identifier for the Bookkeeping Account to filter by. - - cursor: Return the page of entries after this one. - - limit: Limit the size of the list that is returned. The default (and maximum) is 100 - objects. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/bookkeeping_entries", - page=AsyncPage[BookkeepingEntry], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "account_id": account_id, - "cursor": cursor, - "limit": limit, - }, - bookkeeping_entry_list_params.BookkeepingEntryListParams, - ), - ), - model=BookkeepingEntry, - ) - - -class BookkeepingEntriesResourceWithRawResponse: - def __init__(self, bookkeeping_entries: BookkeepingEntriesResource) -> None: - self._bookkeeping_entries = bookkeeping_entries - - self.retrieve = to_raw_response_wrapper( - bookkeeping_entries.retrieve, - ) - self.list = to_raw_response_wrapper( - bookkeeping_entries.list, - ) - - -class AsyncBookkeepingEntriesResourceWithRawResponse: - def __init__(self, bookkeeping_entries: AsyncBookkeepingEntriesResource) -> None: - self._bookkeeping_entries = bookkeeping_entries - - self.retrieve = async_to_raw_response_wrapper( - bookkeeping_entries.retrieve, - ) - self.list = async_to_raw_response_wrapper( - bookkeeping_entries.list, - ) - - -class BookkeepingEntriesResourceWithStreamingResponse: - def __init__(self, bookkeeping_entries: BookkeepingEntriesResource) -> None: - self._bookkeeping_entries = bookkeeping_entries - - self.retrieve = to_streamed_response_wrapper( - bookkeeping_entries.retrieve, - ) - self.list = to_streamed_response_wrapper( - bookkeeping_entries.list, - ) - - -class AsyncBookkeepingEntriesResourceWithStreamingResponse: - def __init__(self, bookkeeping_entries: AsyncBookkeepingEntriesResource) -> None: - self._bookkeeping_entries = bookkeeping_entries - - self.retrieve = async_to_streamed_response_wrapper( - bookkeeping_entries.retrieve, - ) - self.list = async_to_streamed_response_wrapper( - bookkeeping_entries.list, - ) diff --git a/src/increase/resources/bookkeeping_entry_sets.py b/src/increase/resources/bookkeeping_entry_sets.py deleted file mode 100644 index ad50df6a..00000000 --- a/src/increase/resources/bookkeeping_entry_sets.py +++ /dev/null @@ -1,433 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from datetime import datetime - -import httpx - -from ..types import bookkeeping_entry_set_list_params, bookkeeping_entry_set_create_params -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import path_template, maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..pagination import SyncPage, AsyncPage -from .._base_client import AsyncPaginator, make_request_options -from ..types.bookkeeping_entry_set import BookkeepingEntrySet - -__all__ = ["BookkeepingEntrySetsResource", "AsyncBookkeepingEntrySetsResource"] - - -class BookkeepingEntrySetsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> BookkeepingEntrySetsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers - """ - return BookkeepingEntrySetsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> BookkeepingEntrySetsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/Increase/increase-python#with_streaming_response - """ - return BookkeepingEntrySetsResourceWithStreamingResponse(self) - - def create( - self, - *, - entries: Iterable[bookkeeping_entry_set_create_params.Entry], - date: Union[str, datetime] | Omit = omit, - transaction_id: str | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> BookkeepingEntrySet: - """ - Create a Bookkeeping Entry Set - - Args: - entries: The bookkeeping entries. - - date: The date of the transaction. Optional if `transaction_id` is provided, in which - case we use the `date` of that transaction. Required otherwise. - - transaction_id: The identifier of the Transaction related to this entry set, if any. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - return self._post( - "/bookkeeping_entry_sets", - body=maybe_transform( - { - "entries": entries, - "date": date, - "transaction_id": transaction_id, - }, - bookkeeping_entry_set_create_params.BookkeepingEntrySetCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=BookkeepingEntrySet, - ) - - def retrieve( - self, - bookkeeping_entry_set_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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> BookkeepingEntrySet: - """ - Retrieve a Bookkeeping Entry Set - - Args: - bookkeeping_entry_set_id: The identifier of the Bookkeeping Entry Set. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not bookkeeping_entry_set_id: - raise ValueError( - f"Expected a non-empty value for `bookkeeping_entry_set_id` but received {bookkeeping_entry_set_id!r}" - ) - return self._get( - path_template( - "/bookkeeping_entry_sets/{bookkeeping_entry_set_id}", bookkeeping_entry_set_id=bookkeeping_entry_set_id - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=BookkeepingEntrySet, - ) - - def list( - self, - *, - cursor: str | Omit = omit, - idempotency_key: str | Omit = omit, - limit: int | Omit = omit, - transaction_id: str | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncPage[BookkeepingEntrySet]: - """ - List Bookkeeping Entry Sets - - Args: - cursor: Return the page of entries after this one. - - idempotency_key: Filter records to the one with the specified `idempotency_key` you chose for - that object. This value is unique across Increase and is used to ensure that a - request is only processed once. Learn more about - [idempotency](https://increase.com/documentation/idempotency-keys). - - limit: Limit the size of the list that is returned. The default (and maximum) is 100 - objects. - - transaction_id: Filter to the Bookkeeping Entry Set that maps to this Transaction. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/bookkeeping_entry_sets", - page=SyncPage[BookkeepingEntrySet], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "cursor": cursor, - "idempotency_key": idempotency_key, - "limit": limit, - "transaction_id": transaction_id, - }, - bookkeeping_entry_set_list_params.BookkeepingEntrySetListParams, - ), - ), - model=BookkeepingEntrySet, - ) - - -class AsyncBookkeepingEntrySetsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncBookkeepingEntrySetsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers - """ - return AsyncBookkeepingEntrySetsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncBookkeepingEntrySetsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/Increase/increase-python#with_streaming_response - """ - return AsyncBookkeepingEntrySetsResourceWithStreamingResponse(self) - - async def create( - self, - *, - entries: Iterable[bookkeeping_entry_set_create_params.Entry], - date: Union[str, datetime] | Omit = omit, - transaction_id: str | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> BookkeepingEntrySet: - """ - Create a Bookkeeping Entry Set - - Args: - entries: The bookkeeping entries. - - date: The date of the transaction. Optional if `transaction_id` is provided, in which - case we use the `date` of that transaction. Required otherwise. - - transaction_id: The identifier of the Transaction related to this entry set, if any. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - return await self._post( - "/bookkeeping_entry_sets", - body=await async_maybe_transform( - { - "entries": entries, - "date": date, - "transaction_id": transaction_id, - }, - bookkeeping_entry_set_create_params.BookkeepingEntrySetCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=BookkeepingEntrySet, - ) - - async def retrieve( - self, - bookkeeping_entry_set_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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> BookkeepingEntrySet: - """ - Retrieve a Bookkeeping Entry Set - - Args: - bookkeeping_entry_set_id: The identifier of the Bookkeeping Entry Set. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not bookkeeping_entry_set_id: - raise ValueError( - f"Expected a non-empty value for `bookkeeping_entry_set_id` but received {bookkeeping_entry_set_id!r}" - ) - return await self._get( - path_template( - "/bookkeeping_entry_sets/{bookkeeping_entry_set_id}", bookkeeping_entry_set_id=bookkeeping_entry_set_id - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=BookkeepingEntrySet, - ) - - def list( - self, - *, - cursor: str | Omit = omit, - idempotency_key: str | Omit = omit, - limit: int | Omit = omit, - transaction_id: str | Omit = omit, - # 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, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[BookkeepingEntrySet, AsyncPage[BookkeepingEntrySet]]: - """ - List Bookkeeping Entry Sets - - Args: - cursor: Return the page of entries after this one. - - idempotency_key: Filter records to the one with the specified `idempotency_key` you chose for - that object. This value is unique across Increase and is used to ensure that a - request is only processed once. Learn more about - [idempotency](https://increase.com/documentation/idempotency-keys). - - limit: Limit the size of the list that is returned. The default (and maximum) is 100 - objects. - - transaction_id: Filter to the Bookkeeping Entry Set that maps to this Transaction. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/bookkeeping_entry_sets", - page=AsyncPage[BookkeepingEntrySet], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "cursor": cursor, - "idempotency_key": idempotency_key, - "limit": limit, - "transaction_id": transaction_id, - }, - bookkeeping_entry_set_list_params.BookkeepingEntrySetListParams, - ), - ), - model=BookkeepingEntrySet, - ) - - -class BookkeepingEntrySetsResourceWithRawResponse: - def __init__(self, bookkeeping_entry_sets: BookkeepingEntrySetsResource) -> None: - self._bookkeeping_entry_sets = bookkeeping_entry_sets - - self.create = to_raw_response_wrapper( - bookkeeping_entry_sets.create, - ) - self.retrieve = to_raw_response_wrapper( - bookkeeping_entry_sets.retrieve, - ) - self.list = to_raw_response_wrapper( - bookkeeping_entry_sets.list, - ) - - -class AsyncBookkeepingEntrySetsResourceWithRawResponse: - def __init__(self, bookkeeping_entry_sets: AsyncBookkeepingEntrySetsResource) -> None: - self._bookkeeping_entry_sets = bookkeeping_entry_sets - - self.create = async_to_raw_response_wrapper( - bookkeeping_entry_sets.create, - ) - self.retrieve = async_to_raw_response_wrapper( - bookkeeping_entry_sets.retrieve, - ) - self.list = async_to_raw_response_wrapper( - bookkeeping_entry_sets.list, - ) - - -class BookkeepingEntrySetsResourceWithStreamingResponse: - def __init__(self, bookkeeping_entry_sets: BookkeepingEntrySetsResource) -> None: - self._bookkeeping_entry_sets = bookkeeping_entry_sets - - self.create = to_streamed_response_wrapper( - bookkeeping_entry_sets.create, - ) - self.retrieve = to_streamed_response_wrapper( - bookkeeping_entry_sets.retrieve, - ) - self.list = to_streamed_response_wrapper( - bookkeeping_entry_sets.list, - ) - - -class AsyncBookkeepingEntrySetsResourceWithStreamingResponse: - def __init__(self, bookkeeping_entry_sets: AsyncBookkeepingEntrySetsResource) -> None: - self._bookkeeping_entry_sets = bookkeeping_entry_sets - - self.create = async_to_streamed_response_wrapper( - bookkeeping_entry_sets.create, - ) - self.retrieve = async_to_streamed_response_wrapper( - bookkeeping_entry_sets.retrieve, - ) - self.list = async_to_streamed_response_wrapper( - bookkeeping_entry_sets.list, - ) diff --git a/src/increase/types/__init__.py b/src/increase/types/__init__.py index 9ff68547..d19415dd 100644 --- a/src/increase/types/__init__.py +++ b/src/increase/types/__init__.py @@ -36,7 +36,6 @@ from .file_list_params import FileListParams as FileListParams from .oauth_connection import OAuthConnection as OAuthConnection from .account_statement import AccountStatement as AccountStatement -from .bookkeeping_entry import BookkeepingEntry as BookkeepingEntry from .event_list_params import EventListParams as EventListParams from .inbound_mail_item import InboundMailItem as InboundMailItem from .intrafi_exclusion import IntrafiExclusion as IntrafiExclusion @@ -51,7 +50,6 @@ from .real_time_decision import RealTimeDecision as RealTimeDecision from .account_list_params import AccountListParams as AccountListParams from .ach_prenotification import ACHPrenotification as ACHPrenotification -from .bookkeeping_account import BookkeepingAccount as BookkeepingAccount from .lockbox_list_params import LockboxListParams as LockboxListParams from .pending_transaction import PendingTransaction as PendingTransaction from .program_list_params import ProgramListParams as ProgramListParams @@ -65,7 +63,6 @@ from .unwrap_webhook_event import UnwrapWebhookEvent as UnwrapWebhookEvent from .account_create_params import AccountCreateParams as AccountCreateParams from .account_update_params import AccountUpdateParams as AccountUpdateParams -from .bookkeeping_entry_set import BookkeepingEntrySet as BookkeepingEntrySet from .inbound_check_deposit import InboundCheckDeposit as InboundCheckDeposit from .inbound_wire_transfer import InboundWireTransfer as InboundWireTransfer from .lockbox_create_params import LockboxCreateParams as LockboxCreateParams @@ -91,7 +88,6 @@ from .wire_transfer_list_params import WireTransferListParams as WireTransferListParams from .account_number_list_params import AccountNumberListParams as AccountNumberListParams from .ach_transfer_create_params import ACHTransferCreateParams as ACHTransferCreateParams -from .bookkeeping_balance_lookup import BookkeepingBalanceLookup as BookkeepingBalanceLookup from .card_dispute_create_params import CardDisputeCreateParams as CardDisputeCreateParams from .check_transfer_list_params import CheckTransferListParams as CheckTransferListParams from .intrafi_account_enrollment import IntrafiAccountEnrollment as IntrafiAccountEnrollment @@ -116,7 +112,6 @@ from .routing_number_list_response import RoutingNumberListResponse as RoutingNumberListResponse from .swift_transfer_create_params import SwiftTransferCreateParams as SwiftTransferCreateParams from .account_statement_list_params import AccountStatementListParams as AccountStatementListParams -from .bookkeeping_entry_list_params import BookkeepingEntryListParams as BookkeepingEntryListParams from .card_validation_create_params import CardValidationCreateParams as CardValidationCreateParams from .fednow_transfer_create_params import FednowTransferCreateParams as FednowTransferCreateParams from .inbound_mail_item_list_params import InboundMailItemListParams as InboundMailItemListParams @@ -131,7 +126,6 @@ from .external_account_create_params import ExternalAccountCreateParams as ExternalAccountCreateParams from .external_account_update_params import ExternalAccountUpdateParams as ExternalAccountUpdateParams from .ach_prenotification_list_params import ACHPrenotificationListParams as ACHPrenotificationListParams -from .bookkeeping_account_list_params import BookkeepingAccountListParams as BookkeepingAccountListParams from .inbound_mail_item_action_params import InboundMailItemActionParams as InboundMailItemActionParams from .intrafi_exclusion_create_params import IntrafiExclusionCreateParams as IntrafiExclusionCreateParams from .pending_transaction_list_params import PendingTransactionListParams as PendingTransactionListParams @@ -144,9 +138,6 @@ from .inbound_ach_transfer_list_params import InboundACHTransferListParams as InboundACHTransferListParams from .real_time_decision_action_params import RealTimeDecisionActionParams as RealTimeDecisionActionParams from .ach_prenotification_create_params import ACHPrenotificationCreateParams as ACHPrenotificationCreateParams -from .bookkeeping_account_create_params import BookkeepingAccountCreateParams as BookkeepingAccountCreateParams -from .bookkeeping_account_update_params import BookkeepingAccountUpdateParams as BookkeepingAccountUpdateParams -from .bookkeeping_entry_set_list_params import BookkeepingEntrySetListParams as BookkeepingEntrySetListParams from .card_create_details_iframe_params import CardCreateDetailsIframeParams as CardCreateDetailsIframeParams from .digital_card_profile_clone_params import DigitalCardProfileCloneParams as DigitalCardProfileCloneParams from .inbound_check_deposit_list_params import InboundCheckDepositListParams as InboundCheckDepositListParams @@ -155,11 +146,9 @@ from .physical_card_profile_list_params import PhysicalCardProfileListParams as PhysicalCardProfileListParams from .supplemental_document_list_params import SupplementalDocumentListParams as SupplementalDocumentListParams from .wire_drawdown_request_list_params import WireDrawdownRequestListParams as WireDrawdownRequestListParams -from .bookkeeping_account_balance_params import BookkeepingAccountBalanceParams as BookkeepingAccountBalanceParams from .check_transfer_stop_payment_params import CheckTransferStopPaymentParams as CheckTransferStopPaymentParams from .digital_card_profile_create_params import DigitalCardProfileCreateParams as DigitalCardProfileCreateParams from .physical_card_profile_clone_params import PhysicalCardProfileCloneParams as PhysicalCardProfileCloneParams -from .bookkeeping_entry_set_create_params import BookkeepingEntrySetCreateParams as BookkeepingEntrySetCreateParams from .inbound_ach_transfer_decline_params import InboundACHTransferDeclineParams as InboundACHTransferDeclineParams from .inbound_check_deposit_return_params import InboundCheckDepositReturnParams as InboundCheckDepositReturnParams from .inbound_fednow_transfer_list_params import InboundFednowTransferListParams as InboundFednowTransferListParams diff --git a/src/increase/types/bookkeeping_account.py b/src/increase/types/bookkeeping_account.py deleted file mode 100644 index b33b8f61..00000000 --- a/src/increase/types/bookkeeping_account.py +++ /dev/null @@ -1,48 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["BookkeepingAccount"] - - -class BookkeepingAccount(BaseModel): - """Accounts are T-accounts. - - They can store accounting entries. Your compliance setup might require annotating money movements using this API. Learn more in our [guide to Bookkeeping](https://increase.com/documentation/bookkeeping#bookkeeping). - """ - - id: str - """The account identifier.""" - - account_id: Optional[str] = None - """The API Account associated with this bookkeeping account.""" - - compliance_category: Optional[Literal["commingled_cash", "customer_balance"]] = None - """The compliance category of the account. - - - `commingled_cash` - A cash in an commingled Increase Account. - - `customer_balance` - A customer balance. - """ - - entity_id: Optional[str] = None - """The Entity associated with this bookkeeping account.""" - - idempotency_key: Optional[str] = None - """The idempotency key you chose for this object. - - This value is unique across Increase and is used to ensure that a request is - only processed once. Learn more about - [idempotency](https://increase.com/documentation/idempotency-keys). - """ - - name: str - """The name you choose for the account.""" - - type: Literal["bookkeeping_account"] - """A constant representing the object's type. - - For this resource it will always be `bookkeeping_account`. - """ diff --git a/src/increase/types/bookkeeping_account_balance_params.py b/src/increase/types/bookkeeping_account_balance_params.py deleted file mode 100644 index 235ec391..00000000 --- a/src/increase/types/bookkeeping_account_balance_params.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from datetime import datetime -from typing_extensions import Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["BookkeepingAccountBalanceParams"] - - -class BookkeepingAccountBalanceParams(TypedDict, total=False): - at_time: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """The moment to query the balance at. If not set, returns the current balances.""" diff --git a/src/increase/types/bookkeeping_account_create_params.py b/src/increase/types/bookkeeping_account_create_params.py deleted file mode 100644 index 5c974fcb..00000000 --- a/src/increase/types/bookkeeping_account_create_params.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["BookkeepingAccountCreateParams"] - - -class BookkeepingAccountCreateParams(TypedDict, total=False): - name: Required[str] - """The name you choose for the account.""" - - account_id: str - """The account, if `compliance_category` is `commingled_cash`.""" - - compliance_category: Literal["commingled_cash", "customer_balance"] - """The account compliance category. - - - `commingled_cash` - A cash in an commingled Increase Account. - - `customer_balance` - A customer balance. - """ - - entity_id: str - """The entity, if `compliance_category` is `customer_balance`.""" diff --git a/src/increase/types/bookkeeping_account_list_params.py b/src/increase/types/bookkeeping_account_list_params.py deleted file mode 100644 index 2415db88..00000000 --- a/src/increase/types/bookkeeping_account_list_params.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["BookkeepingAccountListParams"] - - -class BookkeepingAccountListParams(TypedDict, total=False): - cursor: str - """Return the page of entries after this one.""" - - idempotency_key: str - """ - Filter records to the one with the specified `idempotency_key` you chose for - that object. This value is unique across Increase and is used to ensure that a - request is only processed once. Learn more about - [idempotency](https://increase.com/documentation/idempotency-keys). - """ - - limit: int - """Limit the size of the list that is returned. - - The default (and maximum) is 100 objects. - """ diff --git a/src/increase/types/bookkeeping_account_update_params.py b/src/increase/types/bookkeeping_account_update_params.py deleted file mode 100644 index fb60fc19..00000000 --- a/src/increase/types/bookkeeping_account_update_params.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BookkeepingAccountUpdateParams"] - - -class BookkeepingAccountUpdateParams(TypedDict, total=False): - name: Required[str] - """The name you choose for the account.""" diff --git a/src/increase/types/bookkeeping_balance_lookup.py b/src/increase/types/bookkeeping_balance_lookup.py deleted file mode 100644 index e41891c3..00000000 --- a/src/increase/types/bookkeeping_balance_lookup.py +++ /dev/null @@ -1,28 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["BookkeepingBalanceLookup"] - - -class BookkeepingBalanceLookup(BaseModel): - """ - Represents a request to lookup the balance of a Bookkeeping Account at a given point in time. - """ - - balance: int - """ - The Bookkeeping Account's current balance, representing the sum of all - Bookkeeping Entries on the Bookkeeping Account. - """ - - bookkeeping_account_id: str - """The identifier for the account for which the balance was queried.""" - - type: Literal["bookkeeping_balance_lookup"] - """A constant representing the object's type. - - For this resource it will always be `bookkeeping_balance_lookup`. - """ diff --git a/src/increase/types/bookkeeping_entry.py b/src/increase/types/bookkeeping_entry.py deleted file mode 100644 index 5ccd70ac..00000000 --- a/src/increase/types/bookkeeping_entry.py +++ /dev/null @@ -1,39 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from datetime import datetime -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["BookkeepingEntry"] - - -class BookkeepingEntry(BaseModel): - """Entries are T-account entries recording debits and credits. - - Your compliance setup might require annotating money movements using this API. Learn more in our [guide to Bookkeeping](https://increase.com/documentation/bookkeeping#bookkeeping). - """ - - id: str - """The entry identifier.""" - - account_id: str - """The identifier for the Account the Entry belongs to.""" - - amount: int - """The Entry amount in the minor unit of its currency. - - For dollars, for example, this is cents. - """ - - created_at: datetime - """When the entry set was created.""" - - entry_set_id: str - """The identifier for the Entry Set the Entry belongs to.""" - - type: Literal["bookkeeping_entry"] - """A constant representing the object's type. - - For this resource it will always be `bookkeeping_entry`. - """ diff --git a/src/increase/types/bookkeeping_entry_list_params.py b/src/increase/types/bookkeeping_entry_list_params.py deleted file mode 100644 index 243b9bf9..00000000 --- a/src/increase/types/bookkeeping_entry_list_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["BookkeepingEntryListParams"] - - -class BookkeepingEntryListParams(TypedDict, total=False): - account_id: str - """The identifier for the Bookkeeping Account to filter by.""" - - cursor: str - """Return the page of entries after this one.""" - - limit: int - """Limit the size of the list that is returned. - - The default (and maximum) is 100 objects. - """ diff --git a/src/increase/types/bookkeeping_entry_set.py b/src/increase/types/bookkeeping_entry_set.py deleted file mode 100644 index 4b6760f0..00000000 --- a/src/increase/types/bookkeeping_entry_set.py +++ /dev/null @@ -1,56 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["BookkeepingEntrySet", "Entry"] - - -class Entry(BaseModel): - id: str - """The entry identifier.""" - - account_id: str - """The bookkeeping account impacted by the entry.""" - - amount: int - """The amount of the entry in minor units.""" - - -class BookkeepingEntrySet(BaseModel): - """Entry Sets are accounting entries that are transactionally applied. - - Your compliance setup might require annotating money movements using this API. Learn more in our [guide to Bookkeeping](https://increase.com/documentation/bookkeeping#bookkeeping). - """ - - id: str - """The entry set identifier.""" - - created_at: datetime - """When the entry set was created.""" - - date: datetime - """The timestamp of the entry set.""" - - entries: List[Entry] - """The entries.""" - - idempotency_key: Optional[str] = None - """The idempotency key you chose for this object. - - This value is unique across Increase and is used to ensure that a request is - only processed once. Learn more about - [idempotency](https://increase.com/documentation/idempotency-keys). - """ - - transaction_id: Optional[str] = None - """The transaction identifier, if any.""" - - type: Literal["bookkeeping_entry_set"] - """A constant representing the object's type. - - For this resource it will always be `bookkeeping_entry_set`. - """ diff --git a/src/increase/types/bookkeeping_entry_set_create_params.py b/src/increase/types/bookkeeping_entry_set_create_params.py deleted file mode 100644 index b75fc008..00000000 --- a/src/increase/types/bookkeeping_entry_set_create_params.py +++ /dev/null @@ -1,38 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from datetime import datetime -from typing_extensions import Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["BookkeepingEntrySetCreateParams", "Entry"] - - -class BookkeepingEntrySetCreateParams(TypedDict, total=False): - entries: Required[Iterable[Entry]] - """The bookkeeping entries.""" - - date: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """The date of the transaction. - - Optional if `transaction_id` is provided, in which case we use the `date` of - that transaction. Required otherwise. - """ - - transaction_id: str - """The identifier of the Transaction related to this entry set, if any.""" - - -class Entry(TypedDict, total=False): - account_id: Required[str] - """The identifier for the Bookkeeping Account impacted by this entry.""" - - amount: Required[int] - """The entry amount in the minor unit of the account currency. - - For dollars, for example, this is cents. Debit entries have positive amounts; - credit entries have negative amounts. - """ diff --git a/src/increase/types/bookkeeping_entry_set_list_params.py b/src/increase/types/bookkeeping_entry_set_list_params.py deleted file mode 100644 index ecba725e..00000000 --- a/src/increase/types/bookkeeping_entry_set_list_params.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["BookkeepingEntrySetListParams"] - - -class BookkeepingEntrySetListParams(TypedDict, total=False): - cursor: str - """Return the page of entries after this one.""" - - idempotency_key: str - """ - Filter records to the one with the specified `idempotency_key` you chose for - that object. This value is unique across Increase and is used to ensure that a - request is only processed once. Learn more about - [idempotency](https://increase.com/documentation/idempotency-keys). - """ - - limit: int - """Limit the size of the list that is returned. - - The default (and maximum) is 100 objects. - """ - - transaction_id: str - """Filter to the Bookkeeping Entry Set that maps to this Transaction.""" diff --git a/tests/api_resources/test_bookkeeping_accounts.py b/tests/api_resources/test_bookkeeping_accounts.py deleted file mode 100644 index e22057f1..00000000 --- a/tests/api_resources/test_bookkeeping_accounts.py +++ /dev/null @@ -1,363 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from increase import Increase, AsyncIncrease -from tests.utils import assert_matches_type -from increase.types import ( - BookkeepingAccount, - BookkeepingBalanceLookup, -) -from increase._utils import parse_datetime -from increase.pagination import SyncPage, AsyncPage - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestBookkeepingAccounts: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Increase) -> None: - bookkeeping_account = client.bookkeeping_accounts.create( - name="New Account!", - ) - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Increase) -> None: - bookkeeping_account = client.bookkeeping_accounts.create( - name="New Account!", - account_id="account_id", - compliance_category="commingled_cash", - entity_id="entity_id", - ) - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Increase) -> None: - response = client.bookkeeping_accounts.with_raw_response.create( - name="New Account!", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_account = response.parse() - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Increase) -> None: - with client.bookkeeping_accounts.with_streaming_response.create( - name="New Account!", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_account = response.parse() - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_update(self, client: Increase) -> None: - bookkeeping_account = client.bookkeeping_accounts.update( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - name="Deprecated Account", - ) - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - @parametrize - def test_raw_response_update(self, client: Increase) -> None: - response = client.bookkeeping_accounts.with_raw_response.update( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - name="Deprecated Account", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_account = response.parse() - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - @parametrize - def test_streaming_response_update(self, client: Increase) -> None: - with client.bookkeeping_accounts.with_streaming_response.update( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - name="Deprecated Account", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_account = response.parse() - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_update(self, client: Increase) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `bookkeeping_account_id` but received ''" - ): - client.bookkeeping_accounts.with_raw_response.update( - bookkeeping_account_id="", - name="Deprecated Account", - ) - - @parametrize - def test_method_list(self, client: Increase) -> None: - bookkeeping_account = client.bookkeeping_accounts.list() - assert_matches_type(SyncPage[BookkeepingAccount], bookkeeping_account, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Increase) -> None: - bookkeeping_account = client.bookkeeping_accounts.list( - cursor="cursor", - idempotency_key="x", - limit=1, - ) - assert_matches_type(SyncPage[BookkeepingAccount], bookkeeping_account, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Increase) -> None: - response = client.bookkeeping_accounts.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_account = response.parse() - assert_matches_type(SyncPage[BookkeepingAccount], bookkeeping_account, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Increase) -> None: - with client.bookkeeping_accounts.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_account = response.parse() - assert_matches_type(SyncPage[BookkeepingAccount], bookkeeping_account, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_balance(self, client: Increase) -> None: - bookkeeping_account = client.bookkeeping_accounts.balance( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - ) - assert_matches_type(BookkeepingBalanceLookup, bookkeeping_account, path=["response"]) - - @parametrize - def test_method_balance_with_all_params(self, client: Increase) -> None: - bookkeeping_account = client.bookkeeping_accounts.balance( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - at_time=parse_datetime("2019-12-27T18:11:19.117Z"), - ) - assert_matches_type(BookkeepingBalanceLookup, bookkeeping_account, path=["response"]) - - @parametrize - def test_raw_response_balance(self, client: Increase) -> None: - response = client.bookkeeping_accounts.with_raw_response.balance( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_account = response.parse() - assert_matches_type(BookkeepingBalanceLookup, bookkeeping_account, path=["response"]) - - @parametrize - def test_streaming_response_balance(self, client: Increase) -> None: - with client.bookkeeping_accounts.with_streaming_response.balance( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_account = response.parse() - assert_matches_type(BookkeepingBalanceLookup, bookkeeping_account, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_balance(self, client: Increase) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `bookkeeping_account_id` but received ''" - ): - client.bookkeeping_accounts.with_raw_response.balance( - bookkeeping_account_id="", - ) - - -class TestAsyncBookkeepingAccounts: - parametrize = pytest.mark.parametrize( - "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] - ) - - @parametrize - async def test_method_create(self, async_client: AsyncIncrease) -> None: - bookkeeping_account = await async_client.bookkeeping_accounts.create( - name="New Account!", - ) - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncIncrease) -> None: - bookkeeping_account = await async_client.bookkeeping_accounts.create( - name="New Account!", - account_id="account_id", - compliance_category="commingled_cash", - entity_id="entity_id", - ) - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncIncrease) -> None: - response = await async_client.bookkeeping_accounts.with_raw_response.create( - name="New Account!", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_account = await response.parse() - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncIncrease) -> None: - async with async_client.bookkeeping_accounts.with_streaming_response.create( - name="New Account!", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_account = await response.parse() - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_update(self, async_client: AsyncIncrease) -> None: - bookkeeping_account = await async_client.bookkeeping_accounts.update( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - name="Deprecated Account", - ) - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - @parametrize - async def test_raw_response_update(self, async_client: AsyncIncrease) -> None: - response = await async_client.bookkeeping_accounts.with_raw_response.update( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - name="Deprecated Account", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_account = await response.parse() - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - @parametrize - async def test_streaming_response_update(self, async_client: AsyncIncrease) -> None: - async with async_client.bookkeeping_accounts.with_streaming_response.update( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - name="Deprecated Account", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_account = await response.parse() - assert_matches_type(BookkeepingAccount, bookkeeping_account, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_update(self, async_client: AsyncIncrease) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `bookkeeping_account_id` but received ''" - ): - await async_client.bookkeeping_accounts.with_raw_response.update( - bookkeeping_account_id="", - name="Deprecated Account", - ) - - @parametrize - async def test_method_list(self, async_client: AsyncIncrease) -> None: - bookkeeping_account = await async_client.bookkeeping_accounts.list() - assert_matches_type(AsyncPage[BookkeepingAccount], bookkeeping_account, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncIncrease) -> None: - bookkeeping_account = await async_client.bookkeeping_accounts.list( - cursor="cursor", - idempotency_key="x", - limit=1, - ) - assert_matches_type(AsyncPage[BookkeepingAccount], bookkeeping_account, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncIncrease) -> None: - response = await async_client.bookkeeping_accounts.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_account = await response.parse() - assert_matches_type(AsyncPage[BookkeepingAccount], bookkeeping_account, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncIncrease) -> None: - async with async_client.bookkeeping_accounts.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_account = await response.parse() - assert_matches_type(AsyncPage[BookkeepingAccount], bookkeeping_account, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_balance(self, async_client: AsyncIncrease) -> None: - bookkeeping_account = await async_client.bookkeeping_accounts.balance( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - ) - assert_matches_type(BookkeepingBalanceLookup, bookkeeping_account, path=["response"]) - - @parametrize - async def test_method_balance_with_all_params(self, async_client: AsyncIncrease) -> None: - bookkeeping_account = await async_client.bookkeeping_accounts.balance( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - at_time=parse_datetime("2019-12-27T18:11:19.117Z"), - ) - assert_matches_type(BookkeepingBalanceLookup, bookkeeping_account, path=["response"]) - - @parametrize - async def test_raw_response_balance(self, async_client: AsyncIncrease) -> None: - response = await async_client.bookkeeping_accounts.with_raw_response.balance( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_account = await response.parse() - assert_matches_type(BookkeepingBalanceLookup, bookkeeping_account, path=["response"]) - - @parametrize - async def test_streaming_response_balance(self, async_client: AsyncIncrease) -> None: - async with async_client.bookkeeping_accounts.with_streaming_response.balance( - bookkeeping_account_id="bookkeeping_account_e37p1f1iuocw5intf35v", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_account = await response.parse() - assert_matches_type(BookkeepingBalanceLookup, bookkeeping_account, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_balance(self, async_client: AsyncIncrease) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `bookkeeping_account_id` but received ''" - ): - await async_client.bookkeeping_accounts.with_raw_response.balance( - bookkeeping_account_id="", - ) diff --git a/tests/api_resources/test_bookkeeping_entries.py b/tests/api_resources/test_bookkeeping_entries.py deleted file mode 100644 index 2e78003b..00000000 --- a/tests/api_resources/test_bookkeeping_entries.py +++ /dev/null @@ -1,169 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from increase import Increase, AsyncIncrease -from tests.utils import assert_matches_type -from increase.types import BookkeepingEntry -from increase.pagination import SyncPage, AsyncPage - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestBookkeepingEntries: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_retrieve(self, client: Increase) -> None: - bookkeeping_entry = client.bookkeeping_entries.retrieve( - "bookkeeping_entry_ctjpajsj3ks2blx10375", - ) - assert_matches_type(BookkeepingEntry, bookkeeping_entry, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Increase) -> None: - response = client.bookkeeping_entries.with_raw_response.retrieve( - "bookkeeping_entry_ctjpajsj3ks2blx10375", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_entry = response.parse() - assert_matches_type(BookkeepingEntry, bookkeeping_entry, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Increase) -> None: - with client.bookkeeping_entries.with_streaming_response.retrieve( - "bookkeeping_entry_ctjpajsj3ks2blx10375", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_entry = response.parse() - assert_matches_type(BookkeepingEntry, bookkeeping_entry, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_retrieve(self, client: Increase) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookkeeping_entry_id` but received ''"): - client.bookkeeping_entries.with_raw_response.retrieve( - "", - ) - - @parametrize - def test_method_list(self, client: Increase) -> None: - bookkeeping_entry = client.bookkeeping_entries.list() - assert_matches_type(SyncPage[BookkeepingEntry], bookkeeping_entry, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Increase) -> None: - bookkeeping_entry = client.bookkeeping_entries.list( - account_id="account_id", - cursor="cursor", - limit=1, - ) - assert_matches_type(SyncPage[BookkeepingEntry], bookkeeping_entry, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Increase) -> None: - response = client.bookkeeping_entries.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_entry = response.parse() - assert_matches_type(SyncPage[BookkeepingEntry], bookkeeping_entry, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Increase) -> None: - with client.bookkeeping_entries.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_entry = response.parse() - assert_matches_type(SyncPage[BookkeepingEntry], bookkeeping_entry, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncBookkeepingEntries: - parametrize = pytest.mark.parametrize( - "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] - ) - - @parametrize - async def test_method_retrieve(self, async_client: AsyncIncrease) -> None: - bookkeeping_entry = await async_client.bookkeeping_entries.retrieve( - "bookkeeping_entry_ctjpajsj3ks2blx10375", - ) - assert_matches_type(BookkeepingEntry, bookkeeping_entry, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncIncrease) -> None: - response = await async_client.bookkeeping_entries.with_raw_response.retrieve( - "bookkeeping_entry_ctjpajsj3ks2blx10375", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_entry = await response.parse() - assert_matches_type(BookkeepingEntry, bookkeeping_entry, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncIncrease) -> None: - async with async_client.bookkeeping_entries.with_streaming_response.retrieve( - "bookkeeping_entry_ctjpajsj3ks2blx10375", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_entry = await response.parse() - assert_matches_type(BookkeepingEntry, bookkeeping_entry, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_retrieve(self, async_client: AsyncIncrease) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bookkeeping_entry_id` but received ''"): - await async_client.bookkeeping_entries.with_raw_response.retrieve( - "", - ) - - @parametrize - async def test_method_list(self, async_client: AsyncIncrease) -> None: - bookkeeping_entry = await async_client.bookkeeping_entries.list() - assert_matches_type(AsyncPage[BookkeepingEntry], bookkeeping_entry, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncIncrease) -> None: - bookkeeping_entry = await async_client.bookkeeping_entries.list( - account_id="account_id", - cursor="cursor", - limit=1, - ) - assert_matches_type(AsyncPage[BookkeepingEntry], bookkeeping_entry, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncIncrease) -> None: - response = await async_client.bookkeeping_entries.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_entry = await response.parse() - assert_matches_type(AsyncPage[BookkeepingEntry], bookkeeping_entry, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncIncrease) -> None: - async with async_client.bookkeeping_entries.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_entry = await response.parse() - assert_matches_type(AsyncPage[BookkeepingEntry], bookkeeping_entry, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_bookkeeping_entry_sets.py b/tests/api_resources/test_bookkeeping_entry_sets.py deleted file mode 100644 index e13a51f2..00000000 --- a/tests/api_resources/test_bookkeeping_entry_sets.py +++ /dev/null @@ -1,328 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from increase import Increase, AsyncIncrease -from tests.utils import assert_matches_type -from increase.types import BookkeepingEntrySet -from increase._utils import parse_datetime -from increase.pagination import SyncPage, AsyncPage - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestBookkeepingEntrySets: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Increase) -> None: - bookkeeping_entry_set = client.bookkeeping_entry_sets.create( - entries=[ - { - "account_id": "bookkeeping_account_9husfpw68pzmve9dvvc7", - "amount": 100, - }, - { - "account_id": "bookkeeping_account_t2obldz1rcu15zr54umg", - "amount": -100, - }, - ], - ) - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Increase) -> None: - bookkeeping_entry_set = client.bookkeeping_entry_sets.create( - entries=[ - { - "account_id": "bookkeeping_account_9husfpw68pzmve9dvvc7", - "amount": 100, - }, - { - "account_id": "bookkeeping_account_t2obldz1rcu15zr54umg", - "amount": -100, - }, - ], - date=parse_datetime("2020-01-31T23:59:59Z"), - transaction_id="transaction_uyrp7fld2ium70oa7oi", - ) - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Increase) -> None: - response = client.bookkeeping_entry_sets.with_raw_response.create( - entries=[ - { - "account_id": "bookkeeping_account_9husfpw68pzmve9dvvc7", - "amount": 100, - }, - { - "account_id": "bookkeeping_account_t2obldz1rcu15zr54umg", - "amount": -100, - }, - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_entry_set = response.parse() - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Increase) -> None: - with client.bookkeeping_entry_sets.with_streaming_response.create( - entries=[ - { - "account_id": "bookkeeping_account_9husfpw68pzmve9dvvc7", - "amount": 100, - }, - { - "account_id": "bookkeeping_account_t2obldz1rcu15zr54umg", - "amount": -100, - }, - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_entry_set = response.parse() - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_retrieve(self, client: Increase) -> None: - bookkeeping_entry_set = client.bookkeeping_entry_sets.retrieve( - "bookkeeping_entry_set_n80c6wr2p8gtc6p4ingf", - ) - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Increase) -> None: - response = client.bookkeeping_entry_sets.with_raw_response.retrieve( - "bookkeeping_entry_set_n80c6wr2p8gtc6p4ingf", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_entry_set = response.parse() - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Increase) -> None: - with client.bookkeeping_entry_sets.with_streaming_response.retrieve( - "bookkeeping_entry_set_n80c6wr2p8gtc6p4ingf", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_entry_set = response.parse() - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_retrieve(self, client: Increase) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `bookkeeping_entry_set_id` but received ''" - ): - client.bookkeeping_entry_sets.with_raw_response.retrieve( - "", - ) - - @parametrize - def test_method_list(self, client: Increase) -> None: - bookkeeping_entry_set = client.bookkeeping_entry_sets.list() - assert_matches_type(SyncPage[BookkeepingEntrySet], bookkeeping_entry_set, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Increase) -> None: - bookkeeping_entry_set = client.bookkeeping_entry_sets.list( - cursor="cursor", - idempotency_key="x", - limit=1, - transaction_id="transaction_id", - ) - assert_matches_type(SyncPage[BookkeepingEntrySet], bookkeeping_entry_set, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Increase) -> None: - response = client.bookkeeping_entry_sets.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_entry_set = response.parse() - assert_matches_type(SyncPage[BookkeepingEntrySet], bookkeeping_entry_set, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Increase) -> None: - with client.bookkeeping_entry_sets.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_entry_set = response.parse() - assert_matches_type(SyncPage[BookkeepingEntrySet], bookkeeping_entry_set, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncBookkeepingEntrySets: - parametrize = pytest.mark.parametrize( - "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] - ) - - @parametrize - async def test_method_create(self, async_client: AsyncIncrease) -> None: - bookkeeping_entry_set = await async_client.bookkeeping_entry_sets.create( - entries=[ - { - "account_id": "bookkeeping_account_9husfpw68pzmve9dvvc7", - "amount": 100, - }, - { - "account_id": "bookkeeping_account_t2obldz1rcu15zr54umg", - "amount": -100, - }, - ], - ) - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncIncrease) -> None: - bookkeeping_entry_set = await async_client.bookkeeping_entry_sets.create( - entries=[ - { - "account_id": "bookkeeping_account_9husfpw68pzmve9dvvc7", - "amount": 100, - }, - { - "account_id": "bookkeeping_account_t2obldz1rcu15zr54umg", - "amount": -100, - }, - ], - date=parse_datetime("2020-01-31T23:59:59Z"), - transaction_id="transaction_uyrp7fld2ium70oa7oi", - ) - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncIncrease) -> None: - response = await async_client.bookkeeping_entry_sets.with_raw_response.create( - entries=[ - { - "account_id": "bookkeeping_account_9husfpw68pzmve9dvvc7", - "amount": 100, - }, - { - "account_id": "bookkeeping_account_t2obldz1rcu15zr54umg", - "amount": -100, - }, - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_entry_set = await response.parse() - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncIncrease) -> None: - async with async_client.bookkeeping_entry_sets.with_streaming_response.create( - entries=[ - { - "account_id": "bookkeeping_account_9husfpw68pzmve9dvvc7", - "amount": 100, - }, - { - "account_id": "bookkeeping_account_t2obldz1rcu15zr54umg", - "amount": -100, - }, - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_entry_set = await response.parse() - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_retrieve(self, async_client: AsyncIncrease) -> None: - bookkeeping_entry_set = await async_client.bookkeeping_entry_sets.retrieve( - "bookkeeping_entry_set_n80c6wr2p8gtc6p4ingf", - ) - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncIncrease) -> None: - response = await async_client.bookkeeping_entry_sets.with_raw_response.retrieve( - "bookkeeping_entry_set_n80c6wr2p8gtc6p4ingf", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_entry_set = await response.parse() - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncIncrease) -> None: - async with async_client.bookkeeping_entry_sets.with_streaming_response.retrieve( - "bookkeeping_entry_set_n80c6wr2p8gtc6p4ingf", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_entry_set = await response.parse() - assert_matches_type(BookkeepingEntrySet, bookkeeping_entry_set, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_retrieve(self, async_client: AsyncIncrease) -> None: - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `bookkeeping_entry_set_id` but received ''" - ): - await async_client.bookkeeping_entry_sets.with_raw_response.retrieve( - "", - ) - - @parametrize - async def test_method_list(self, async_client: AsyncIncrease) -> None: - bookkeeping_entry_set = await async_client.bookkeeping_entry_sets.list() - assert_matches_type(AsyncPage[BookkeepingEntrySet], bookkeeping_entry_set, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncIncrease) -> None: - bookkeeping_entry_set = await async_client.bookkeeping_entry_sets.list( - cursor="cursor", - idempotency_key="x", - limit=1, - transaction_id="transaction_id", - ) - assert_matches_type(AsyncPage[BookkeepingEntrySet], bookkeeping_entry_set, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncIncrease) -> None: - response = await async_client.bookkeeping_entry_sets.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bookkeeping_entry_set = await response.parse() - assert_matches_type(AsyncPage[BookkeepingEntrySet], bookkeeping_entry_set, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncIncrease) -> None: - async with async_client.bookkeeping_entry_sets.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bookkeeping_entry_set = await response.parse() - assert_matches_type(AsyncPage[BookkeepingEntrySet], bookkeeping_entry_set, path=["response"]) - - assert cast(Any, response.is_closed) is True