From 16d60a1cd0e3fe3792515d4bb2b90e5f3f5fb734 Mon Sep 17 00:00:00 2001 From: Vigneshwer Vaidyanathan Date: Tue, 4 Aug 2026 19:38:58 -0400 Subject: [PATCH 1/3] Add snapshot of the SDK for snapshot tests --- .gitattributes | 13 + .github/workflows/tests.yml | 25 + .github/workflows/updateSDKQueries.yml | 13 +- Makefile | 38 +- .../001-marketing-schema/queries.graphql | 467 +++ .../001-marketing-schema/sdk/__init__.py | 936 +++++++ .../sdk/add_ledger_entry.py | 60 + .../sdk/add_ledger_entry_runtime.py | 60 + .../001-marketing-schema/sdk/async_client.py | 69 + .../001-marketing-schema/sdk/base_model.py | 30 + .../001-marketing-schema/sdk/client.py | 2492 +++++++++++++++++ .../sdk/create_custom_currency.py | 52 + .../sdk/create_custom_link.py | 46 + .../001-marketing-schema/sdk/create_ledger.py | 55 + .../sdk/delete_custom_txs.py | 55 + .../001-marketing-schema/sdk/delete_ledger.py | 38 + .../001-marketing-schema/sdk/delete_schema.py | 38 + .../001-marketing-schema/sdk/enums.py | 308 ++ .../sdk/get_account_data_migrations.py | 114 + ...grate_for_ledger_account_data_migration.py | 100 + ...migrate_for_ledger_entry_data_migration.py | 100 + .../sdk/get_entry_data_migrations.py | 113 + .../001-marketing-schema/sdk/get_ledger.py | 23 + .../sdk/get_ledger_account_balance.py | 23 + .../sdk/get_ledger_account_lines.py | 47 + .../sdk/get_ledger_entry.py | 41 + .../001-marketing-schema/sdk/get_schema.py | 28 + .../001-marketing-schema/sdk/get_workspace.py | 16 + .../001-marketing-schema/sdk/input_types.py | 1054 +++++++ .../sdk/list_ledger_account_balances.py | 53 + .../sdk/list_ledger_accounts.py | 50 + .../sdk/list_ledger_entries.py | 58 + .../sdk/list_ledger_entry_group_balances.py | 57 + ..._multi_currency_ledger_account_balances.py | 130 + .../sdk/migrate_ledger_entry.py | 165 ++ .../sdk/post_card_settle.py | 86 + .../sdk/post_dispute_payout_initiate.py | 94 + .../sdk/post_dispute_payout_settle.py | 88 + .../sdk/post_driver_payout_initiate.py | 92 + .../sdk/post_driver_payout_settle.py | 88 + .../sdk/post_order_placed.py | 86 + .../sdk/post_order_placed_v_2.py | 88 + .../sdk/post_restaurant_payout_initiate.py | 104 + .../sdk/post_restaurant_payout_settle.py | 98 + .../001-marketing-schema/sdk/reconcile_tx.py | 61 + .../sdk/reconcile_tx_runtime.py | 61 + .../sdk/reverse_ledger_entry.py | 121 + .../001-marketing-schema/sdk/store_schema.py | 51 + .../sdk/sync_custom_accounts.py | 59 + .../sdk/sync_custom_txs.py | 50 + .../001-marketing-schema/sdk/update_ledger.py | 45 + .../sdk/update_ledger_entry.py | 83 + tests/template-schema/queries.graphql | 467 +++ .../queries.runtime-args.graphql | 467 +++ tests/template-schema/schema.json | 1234 ++++++++ 55 files changed, 10488 insertions(+), 2 deletions(-) create mode 100644 .gitattributes create mode 100644 tests/snapshots/001-marketing-schema/queries.graphql create mode 100644 tests/snapshots/001-marketing-schema/sdk/__init__.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/add_ledger_entry.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/add_ledger_entry_runtime.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/async_client.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/base_model.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/client.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/create_custom_currency.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/create_custom_link.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/create_ledger.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/delete_custom_txs.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/delete_ledger.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/delete_schema.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/enums.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/get_account_data_migrations.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/get_entries_to_migrate_for_ledger_account_data_migration.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/get_entries_to_migrate_for_ledger_entry_data_migration.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/get_entry_data_migrations.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/get_ledger.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/get_ledger_account_balance.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/get_ledger_account_lines.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/get_ledger_entry.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/get_schema.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/get_workspace.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/input_types.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/list_ledger_account_balances.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/list_ledger_accounts.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/list_ledger_entries.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/list_ledger_entry_group_balances.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/list_multi_currency_ledger_account_balances.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/migrate_ledger_entry.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/post_card_settle.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/post_dispute_payout_initiate.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/post_dispute_payout_settle.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/post_driver_payout_initiate.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/post_driver_payout_settle.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/post_order_placed.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/post_order_placed_v_2.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/post_restaurant_payout_initiate.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/post_restaurant_payout_settle.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/reconcile_tx.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/reconcile_tx_runtime.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/reverse_ledger_entry.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/store_schema.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/sync_custom_accounts.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/sync_custom_txs.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/update_ledger.py create mode 100644 tests/snapshots/001-marketing-schema/sdk/update_ledger_entry.py create mode 100644 tests/template-schema/queries.graphql create mode 100644 tests/template-schema/queries.runtime-args.graphql create mode 100644 tests/template-schema/schema.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2c6240c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,13 @@ +# Collapse machine-produced files in pull request diffs and exclude them from +# the repository's language statistics. +# +# Deliberately NOT marked `-diff`: `make check-snapshots` fails when generated +# output drifts, and reviewing that diff is the point. These files stay +# diffable, just collapsed by default. + +# Vendored: synced verbatim from fragment-dev/graphql-queries by the +# updateSDKQueries workflow. Never edited here. +tests/template-schema/** linguist-vendored=true + +# Generated: produced by `make snapshots` from the sibling queries.graphql. +tests/snapshots/*/sdk/** linguist-generated=true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ece56d..5cf1f6e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,3 +35,28 @@ jobs: - name: Run tests run: poetry run pytest -v + + # Regenerates the clients in tests/snapshots/ and fails if the output differs + # from what is committed. Needs no credentials -- codegen only downloads the + # public GraphQL schema -- so it is a separate job and still runs on forks. + snapshots: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + name: Checkout fragment-python + + - name: Use Python 3.10.14 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 + with: + python-version: '3.10.14' + + - name: Install dependencies + run: | + pip install poetry + poetry install --with dev + + - name: Check generated clients match snapshots + run: make check-snapshots diff --git a/.github/workflows/updateSDKQueries.yml b/.github/workflows/updateSDKQueries.yml index 4da66a3..8f4b694 100644 --- a/.github/workflows/updateSDKQueries.yml +++ b/.github/workflows/updateSDKQueries.yml @@ -43,6 +43,17 @@ jobs: mkdir queries cp ../graphql-queries/queries.graphql fragment/std_queries/queries.graphql + # The template Schema is the source of truth the tests build against: + # schema.json is what they store, and queries.graphql is valid codegen + # input for the same Schema. Mirrored wholesale rather than file-by-file so + # that files removed upstream also disappear here. Do not edit the copy in + # tests/template-schema -- the next sync overwrites it. + - name: Copy template Schema + working-directory: ./fragment-python + run: | + rm -rf tests/template-schema + cp -R ../graphql-queries/template-schema tests/template-schema + - name: Generate SDK working-directory: ./fragment-python run: | @@ -55,7 +66,7 @@ jobs: path: ./fragment-python token: ${{ steps.generate-token.outputs.token }} commit-message: 'Update Python SDK queries' - title: 'Update Python SDK queries' + title: 'Update Python queries and snapshots' base: 'dev' branch: update-sdk-queries/${{ github.run_id }} body: > diff --git a/Makefile b/Makefile index 4eb7122..0ce0cc4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,10 @@ -.PHONY: lint test +.PHONY: lint test snapshots check-snapshots + +# Each tests/snapshots/*/ holds a queries.graphql and the client generated from +# it, checked in. The pair is a regression guard: a change to codegen that alters +# generated output shows up as a reviewable diff instead of silently. +SNAPSHOT_DIRS := $(sort $(dir $(wildcard tests/snapshots/*/queries.graphql))) +SNAPSHOT_PACKAGE := sdk install: poetry install --with dev @@ -19,6 +25,36 @@ typecheck: test: poetry run pytest +# Overwrite the checked-in snapshots with freshly generated clients. Run this +# deliberately after an intended codegen change, then review the diff before +# committing it. +snapshots: + @for dir in $(SNAPSHOT_DIRS); do \ + echo "Regenerating $$dir$(SNAPSHOT_PACKAGE)"; \ + rm -rf "$$dir$(SNAPSHOT_PACKAGE)"; \ + poetry run fragment-python-client-codegen \ + --input-dir="$$dir" \ + --target-package-name=$(SNAPSHOT_PACKAGE) \ + --output-dir="$$dir" || exit 1; \ + done + poetry run isort tests/snapshots/ + poetry run black tests/snapshots/ + +# Regenerate in place and fail if anything changed. Used in CI so generated +# output cannot drift from the committed snapshots. +check-snapshots: snapshots + @untracked="$$(git ls-files --others --exclude-standard -- tests/snapshots)"; \ + if ! git diff --quiet -- tests/snapshots || [ -n "$$untracked" ]; then \ + echo ""; \ + echo "Generated client differs from the committed snapshots."; \ + echo "If the change is intended, run 'make snapshots' and commit the result."; \ + echo ""; \ + git --no-pager diff --stat -- tests/snapshots; \ + [ -n "$$untracked" ] && printf 'untracked:\n%s\n' "$$untracked"; \ + exit 1; \ + fi + @echo "Snapshots up to date." + build: install poetry run fragment-python-client-codegen --input-dir=queries/ --target-package-name=sdk --output-dir fragment/ poetry run fragment-python-client-codegen --input-dir=queries/ --target-package-name=sync_sdk --output-dir fragment/ --sync diff --git a/tests/snapshots/001-marketing-schema/queries.graphql b/tests/snapshots/001-marketing-schema/queries.graphql new file mode 100644 index 0000000..052eb4c --- /dev/null +++ b/tests/snapshots/001-marketing-schema/queries.graphql @@ -0,0 +1,467 @@ +# Generated by the Fragment CLI (@fragment-dev/cli) v2026.8.4-11 +# Generated on 2026-08-04 from template-schema/schema.json +# +# Command: +# fragment gen-graphql --path template-schema/schema.json --output template-schema/queries.graphql +# +# Do not edit by hand -- regenerating overwrites this file, including this header. + +mutation PostOrderPlaced($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $order_id: String!, $order_cost: String!, $currency: String!, $platform_fee: String!, $driver_fee: String!, $restaurant_id: String!, $driver_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "order_placed", typeVersion: 1, posted: $posted, parameters: {user_id: $user_id, order_id: $order_id, order_cost: $order_cost, currency: $currency, platform_fee: $platform_fee, driver_fee: $driver_fee, restaurant_id: $restaurant_id, driver_id: $driver_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostOrderPlaced_v2($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $order_id: String!, $order_cost: String!, $currency: String!, $platform_fee: String!, $service_fee: String!, $driver_fee: String!, $restaurant_id: String!, $driver_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "order_placed", typeVersion: 2, posted: $posted, parameters: {user_id: $user_id, order_id: $order_id, order_cost: $order_cost, currency: $currency, platform_fee: $platform_fee, service_fee: $service_fee, driver_fee: $driver_fee, restaurant_id: $restaurant_id, driver_id: $driver_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostCardSettle($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $order_id: String!, $currency: String!, $amount: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "card_settle", typeVersion: 1, posted: $posted, parameters: {user_id: $user_id, order_id: $order_id, currency: $currency, amount: $amount}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostRestaurantPayoutInitiate($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $restaurant_id: String!, $order_id: String!, $currency: String!, $amount: String!, $payout_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "restaurant_payout_initiate", typeVersion: 1, posted: $posted, parameters: {restaurant_id: $restaurant_id, order_id: $order_id, currency: $currency, amount: $amount, payout_id: $payout_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostRestaurantPayoutSettle($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $restaurant_id: String!, $payout_id: String!, $currency: String!, $amount: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "restaurant_payout_settle", typeVersion: 1, posted: $posted, parameters: {restaurant_id: $restaurant_id, payout_id: $payout_id, currency: $currency, amount: $amount}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostDriverPayoutInitiate($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $driver_id: String!, $order_id: String!, $currency: String!, $amount: String!, $payout_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "driver_payout_initiate", typeVersion: 1, posted: $posted, parameters: {driver_id: $driver_id, order_id: $order_id, currency: $currency, amount: $amount, payout_id: $payout_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostDriverPayoutSettle($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $driver_id: String!, $payout_id: String!, $currency: String!, $amount: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "driver_payout_settle", typeVersion: 1, posted: $posted, parameters: {driver_id: $driver_id, payout_id: $payout_id, currency: $currency, amount: $amount}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostDisputePayoutInitiate($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $disputes_id: String!, $amount: String!, $currency: String!, $payout_id: String!, $order_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "dispute_payout_initiate", typeVersion: 1, posted: $posted, parameters: {user_id: $user_id, disputes_id: $disputes_id, amount: $amount, currency: $currency, payout_id: $payout_id, order_id: $order_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostDisputePayoutSettle($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $disputes_id: String!, $amount: String!, $currency: String!, $order_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "dispute_payout_settle", typeVersion: 1, posted: $posted, parameters: {user_id: $user_id, disputes_id: $disputes_id, amount: $amount, currency: $currency, order_id: $order_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} diff --git a/tests/snapshots/001-marketing-schema/sdk/__init__.py b/tests/snapshots/001-marketing-schema/sdk/__init__.py new file mode 100644 index 0000000..43ca152 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/__init__.py @@ -0,0 +1,936 @@ +# Generated by fragment (with the help of ariadne-codegen) + +from .add_ledger_entry import ( + AddLedgerEntry, + AddLedgerEntryAddLedgerEntryAddLedgerEntryResult, + AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry, + AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines, + AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLinesAccount, + AddLedgerEntryAddLedgerEntryBadRequestError, + AddLedgerEntryAddLedgerEntryInternalError, +) +from .add_ledger_entry_runtime import ( + AddLedgerEntryRuntime, + AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResult, + AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry, + AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines, + AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLinesAccount, + AddLedgerEntryRuntimeAddLedgerEntryBadRequestError, + AddLedgerEntryRuntimeAddLedgerEntryInternalError, +) +from .async_client import AsyncFragmentClient +from .base_model import BaseModel, Upload +from .client import Client +from .create_custom_currency import ( + CreateCustomCurrency, + CreateCustomCurrencyCreateCustomCurrencyBadRequestError, + CreateCustomCurrencyCreateCustomCurrencyCreateCustomCurrencyResult, + CreateCustomCurrencyCreateCustomCurrencyCreateCustomCurrencyResultCustomCurrency, + CreateCustomCurrencyCreateCustomCurrencyInternalError, +) +from .create_custom_link import ( + CreateCustomLink, + CreateCustomLinkCreateCustomLinkBadRequestError, + CreateCustomLinkCreateCustomLinkCreateCustomLinkResult, + CreateCustomLinkCreateCustomLinkCreateCustomLinkResultLink, + CreateCustomLinkCreateCustomLinkInternalError, +) +from .create_ledger import ( + CreateLedger, + CreateLedgerCreateLedgerBadRequestError, + CreateLedgerCreateLedgerCreateLedgerResult, + CreateLedgerCreateLedgerCreateLedgerResultLedger, + CreateLedgerCreateLedgerCreateLedgerResultLedgerSchema, + CreateLedgerCreateLedgerInternalError, +) +from .delete_custom_txs import ( + DeleteCustomTxs, + DeleteCustomTxsDeleteCustomTxsBadRequestError, + DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResult, + DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxs, + DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxsTx, + DeleteCustomTxsDeleteCustomTxsInternalError, +) +from .delete_ledger import ( + DeleteLedger, + DeleteLedgerDeleteLedgerBadRequestError, + DeleteLedgerDeleteLedgerDeleteLedgerResult, + DeleteLedgerDeleteLedgerInternalError, +) +from .delete_schema import ( + DeleteSchema, + DeleteSchemaDeleteSchemaBadRequestError, + DeleteSchemaDeleteSchemaDeleteSchemaResult, + DeleteSchemaDeleteSchemaInternalError, +) +from .enums import ( + BalanceUpdateConsistencyMode, + CurrencyCode, + CurrencyMode, + ExternalTransferType, + ExternalTxSource, + Granularity, + IncreaseEnv, + LedgerAccountClearingStatus, + LedgerAccountTypes, + LedgerDataMigrationStatus, + LedgerLinesConsistencyMode, + LedgerMigrationStatus, + LedgerTypes, + LinkType, + PostLinesAs, + ReadBalanceConsistencyMode, + SceneEventType, + SchemaConsistencyMode, + SchemaLedgerAccountStatus, + SchemaLedgerEntryStatus, + StripeEnv, + TxType, + UnitEnv, +) +from .get_account_data_migrations import ( + GetAccountDataMigrations, + GetAccountDataMigrationsLedger, + GetAccountDataMigrationsLedgerLedgerAccountDataMigrations, + GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodes, + GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesCurrentMigration, + GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistory, + GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistoryNodes, + GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistoryPageInfo, + GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntries, + GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodes, + GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntriesPageInfo, + GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsPageInfo, +) +from .get_entries_to_migrate_for_ledger_account_data_migration import ( + GetEntriesToMigrateForLedgerAccountDataMigration, + GetEntriesToMigrateForLedgerAccountDataMigrationLedger, + GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrations, + GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodes, + GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntries, + GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodes, + GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLines, + GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLinesNodes, + GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLinesNodesAccount, + GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesPageInfo, +) +from .get_entries_to_migrate_for_ledger_entry_data_migration import ( + GetEntriesToMigrateForLedgerEntryDataMigration, + GetEntriesToMigrateForLedgerEntryDataMigrationLedger, + GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrations, + GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodes, + GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntries, + GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodes, + GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLines, + GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLinesNodes, + GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLinesNodesAccount, + GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesPageInfo, +) +from .get_entry_data_migrations import ( + GetEntryDataMigrations, + GetEntryDataMigrationsLedger, + GetEntryDataMigrationsLedgerLedgerEntryDataMigrations, + GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodes, + GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesCurrentMigration, + GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistory, + GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistoryNodes, + GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistoryPageInfo, + GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntries, + GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodes, + GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesPageInfo, + GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsPageInfo, +) +from .get_ledger import GetLedger, GetLedgerLedger +from .get_ledger_account_balance import ( + GetLedgerAccountBalance, + GetLedgerAccountBalanceLedgerAccount, +) +from .get_ledger_account_lines import ( + GetLedgerAccountLines, + GetLedgerAccountLinesLedgerAccount, + GetLedgerAccountLinesLedgerAccountLines, + GetLedgerAccountLinesLedgerAccountLinesNodes, + GetLedgerAccountLinesLedgerAccountLinesPageInfo, +) +from .get_ledger_entry import ( + GetLedgerEntry, + GetLedgerEntryLedgerEntry, + GetLedgerEntryLedgerEntryLines, + GetLedgerEntryLedgerEntryLinesNodes, + GetLedgerEntryLedgerEntryLinesNodesAccount, +) +from .get_schema import GetSchema, GetSchemaSchema, GetSchemaSchemaVersion +from .get_workspace import GetWorkspace, GetWorkspaceWorkspace +from .input_types import ( + AddLedgerEntryInput, + ChartOfAccountsInput, + CreateCustomCurrencyInput, + CreateLedgerAccountInput, + CreateLedgerAccountsInput, + CreateLedgerInput, + CurrencyFilter, + CurrencyMatchInput, + CustomAccountInput, + CustomTxInput, + DateFilter, + DateTimeFilter, + EntryGroupMatchInput, + ExternalAccountFilter, + ExternalAccountMatchInput, + GroupBalanceAccountFilter, + GroupFilter, + GroupInput, + GroupMatchInput, + GroupNotFilter, + GroupReconciliationParametersInput, + Int96ConditionInput, + Int96Filter, + LedgerAccountClearingStatusFilter, + LedgerAccountConditionInput, + LedgerAccountConsistencyConfigInput, + LedgerAccountDataMigrationsFilterSet, + LedgerAccountFilter, + LedgerAccountGroupConsistencyConfigInput, + LedgerAccountMatchInput, + LedgerAccountsFilterSet, + LedgerAccountTypeFilter, + LedgerEntriesFilterSet, + LedgerEntryConditionInput, + LedgerEntryDataMigrationsFilterSet, + LedgerEntryFilter, + LedgerEntryGroupBalanceFilter, + LedgerEntryGroupBalanceFilterSet, + LedgerEntryGroupInput, + LedgerEntryGroupMatchInput, + LedgerEntryGroupsFilterSet, + LedgerEntryInput, + LedgerEntryMatchInput, + LedgerEntryTagInput, + LedgerLineInput, + LedgerLineMatchInput, + LedgerLinesFilterSet, + LedgerMatchInput, + LedgersFilterSet, + LedgerTypeFilter, + LinkMatchInput, + MigrateLedgerEntryInput, + SceneEntryInput, + SceneEventInput, + SceneInput, + SchemaConditionInput, + SchemaConsistencyConfigInput, + SchemaCurrencyMatchInput, + SchemaExternalAccountMatchInput, + SchemaInput, + SchemaInt96ConditionInput, + SchemaLedgerAccountInput, + SchemaLedgerAccountMatchInput, + SchemaLedgerEntriesInput, + SchemaLedgerEntryConditionInput, + SchemaLedgerEntryGroupInput, + SchemaLedgerEntryInput, + SchemaLedgerEntryTagInput, + SchemaLedgerLineInput, + SchemaMatchInput, + SchemaPaymentInput, + SchemaRepeatedConfigInput, + SchemaTxMatchInput, + StringFilter, + StringMatchFilter, + TagFilter, + TagMatchInput, + TxMatchInput, + TxTypeFilter, + UpdateLedgerAccountInput, + UpdateLedgerEntryInput, + UpdateLedgerInput, +) +from .list_ledger_account_balances import ( + ListLedgerAccountBalances, + ListLedgerAccountBalancesLedger, + ListLedgerAccountBalancesLedgerLedgerAccounts, + ListLedgerAccountBalancesLedgerLedgerAccountsNodes, + ListLedgerAccountBalancesLedgerLedgerAccountsPageInfo, +) +from .list_ledger_accounts import ( + ListLedgerAccounts, + ListLedgerAccountsLedger, + ListLedgerAccountsLedgerLedgerAccounts, + ListLedgerAccountsLedgerLedgerAccountsNodes, + ListLedgerAccountsLedgerLedgerAccountsPageInfo, +) +from .list_ledger_entries import ( + ListLedgerEntries, + ListLedgerEntriesLedger, + ListLedgerEntriesLedgerLedgerEntries, + ListLedgerEntriesLedgerLedgerEntriesNodes, + ListLedgerEntriesLedgerLedgerEntriesNodesLines, + ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodes, + ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodesAccount, + ListLedgerEntriesLedgerLedgerEntriesPageInfo, +) +from .list_ledger_entry_group_balances import ( + ListLedgerEntryGroupBalances, + ListLedgerEntryGroupBalancesLedgerEntryGroup, + ListLedgerEntryGroupBalancesLedgerEntryGroupBalances, + ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodes, + ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodesAccount, + ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodesCurrency, + ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesPageInfo, +) +from .list_multi_currency_ledger_account_balances import ( + ListMultiCurrencyLedgerAccountBalances, + ListMultiCurrencyLedgerAccountBalancesLedger, + ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccounts, + ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes, + ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalances, + ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodes, + ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodesCurrency, + ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalances, + ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodes, + ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodesCurrency, + ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalances, + ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodes, + ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodesCurrency, + ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsPageInfo, +) +from .migrate_ledger_entry import ( + MigrateLedgerEntry, + MigrateLedgerEntryMigrateLedgerEntryBadRequestError, + MigrateLedgerEntryMigrateLedgerEntryInternalError, + MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResult, + MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntry, + MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLines, + MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLinesNodes, + MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLinesNodesAccount, + MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntry, + MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLines, + MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLinesNodes, + MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLinesNodesAccount, + MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntry, + MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLines, + MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodes, + MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodesAccount, +) +from .post_card_settle import ( + PostCardSettle, + PostCardSettleAddLedgerEntryAddLedgerEntryResult, + PostCardSettleAddLedgerEntryAddLedgerEntryResultEntry, + PostCardSettleAddLedgerEntryAddLedgerEntryResultEntryGroups, + PostCardSettleAddLedgerEntryAddLedgerEntryResultEntryLedger, + PostCardSettleAddLedgerEntryAddLedgerEntryResultEntryTags, + PostCardSettleAddLedgerEntryAddLedgerEntryResultLines, + PostCardSettleAddLedgerEntryAddLedgerEntryResultLinesAccount, + PostCardSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency, + PostCardSettleAddLedgerEntryBadRequestError, + PostCardSettleAddLedgerEntryInternalError, +) +from .post_dispute_payout_initiate import ( + PostDisputePayoutInitiate, + PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResult, + PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry, + PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryGroups, + PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryLedger, + PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryTags, + PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultLines, + PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesAccount, + PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesCurrency, + PostDisputePayoutInitiateAddLedgerEntryBadRequestError, + PostDisputePayoutInitiateAddLedgerEntryInternalError, +) +from .post_dispute_payout_settle import ( + PostDisputePayoutSettle, + PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResult, + PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntry, + PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntryGroups, + PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntryLedger, + PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntryTags, + PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultLines, + PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultLinesAccount, + PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency, + PostDisputePayoutSettleAddLedgerEntryBadRequestError, + PostDisputePayoutSettleAddLedgerEntryInternalError, +) +from .post_driver_payout_initiate import ( + PostDriverPayoutInitiate, + PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResult, + PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry, + PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryGroups, + PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryLedger, + PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryTags, + PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultLines, + PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesAccount, + PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesCurrency, + PostDriverPayoutInitiateAddLedgerEntryBadRequestError, + PostDriverPayoutInitiateAddLedgerEntryInternalError, +) +from .post_driver_payout_settle import ( + PostDriverPayoutSettle, + PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResult, + PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntry, + PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryGroups, + PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryLedger, + PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryTags, + PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultLines, + PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesAccount, + PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency, + PostDriverPayoutSettleAddLedgerEntryBadRequestError, + PostDriverPayoutSettleAddLedgerEntryInternalError, +) +from .post_order_placed import ( + PostOrderPlaced, + PostOrderPlacedAddLedgerEntryAddLedgerEntryResult, + PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntry, + PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntryGroups, + PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntryLedger, + PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntryTags, + PostOrderPlacedAddLedgerEntryAddLedgerEntryResultLines, + PostOrderPlacedAddLedgerEntryAddLedgerEntryResultLinesAccount, + PostOrderPlacedAddLedgerEntryAddLedgerEntryResultLinesCurrency, + PostOrderPlacedAddLedgerEntryBadRequestError, + PostOrderPlacedAddLedgerEntryInternalError, +) +from .post_order_placed_v_2 import ( + PostOrderPlacedV2, + PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResult, + PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntry, + PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntryGroups, + PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntryLedger, + PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntryTags, + PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultLines, + PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultLinesAccount, + PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultLinesCurrency, + PostOrderPlacedV2AddLedgerEntryBadRequestError, + PostOrderPlacedV2AddLedgerEntryInternalError, +) +from .post_restaurant_payout_initiate import ( + PostRestaurantPayoutInitiate, + PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResult, + PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry, + PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryGroups, + PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryLedger, + PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryTags, + PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultLines, + PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesAccount, + PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesCurrency, + PostRestaurantPayoutInitiateAddLedgerEntryBadRequestError, + PostRestaurantPayoutInitiateAddLedgerEntryInternalError, +) +from .post_restaurant_payout_settle import ( + PostRestaurantPayoutSettle, + PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResult, + PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntry, + PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryGroups, + PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryLedger, + PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryTags, + PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultLines, + PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesAccount, + PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency, + PostRestaurantPayoutSettleAddLedgerEntryBadRequestError, + PostRestaurantPayoutSettleAddLedgerEntryInternalError, +) +from .reconcile_tx import ( + ReconcileTx, + ReconcileTxReconcileTxBadRequestError, + ReconcileTxReconcileTxInternalError, + ReconcileTxReconcileTxReconcileTxResult, + ReconcileTxReconcileTxReconcileTxResultEntry, + ReconcileTxReconcileTxReconcileTxResultLines, + ReconcileTxReconcileTxReconcileTxResultLinesAccount, +) +from .reconcile_tx_runtime import ( + ReconcileTxRuntime, + ReconcileTxRuntimeReconcileTxBadRequestError, + ReconcileTxRuntimeReconcileTxInternalError, + ReconcileTxRuntimeReconcileTxReconcileTxResult, + ReconcileTxRuntimeReconcileTxReconcileTxResultEntry, + ReconcileTxRuntimeReconcileTxReconcileTxResultLines, + ReconcileTxRuntimeReconcileTxReconcileTxResultLinesAccount, +) +from .reverse_ledger_entry import ( + ReverseLedgerEntry, + ReverseLedgerEntryReverseLedgerEntryBadRequestError, + ReverseLedgerEntryReverseLedgerEntryInternalError, + ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResult, + ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntry, + ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLines, + ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLinesNodes, + ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLinesNodesAccount, + ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntry, + ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLines, + ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLinesNodes, + ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLinesNodesAccount, +) +from .store_schema import ( + StoreSchema, + StoreSchemaStoreSchemaBadRequestError, + StoreSchemaStoreSchemaInternalError, + StoreSchemaStoreSchemaStoreSchemaResult, + StoreSchemaStoreSchemaStoreSchemaResultSchema, + StoreSchemaStoreSchemaStoreSchemaResultSchemaVersion, +) +from .sync_custom_accounts import ( + SyncCustomAccounts, + SyncCustomAccountsSyncCustomAccountsBadRequestError, + SyncCustomAccountsSyncCustomAccountsInternalError, + SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResult, + SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccounts, + SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccountsCurrency, +) +from .sync_custom_txs import ( + SyncCustomTxs, + SyncCustomTxsSyncCustomTxsBadRequestError, + SyncCustomTxsSyncCustomTxsInternalError, + SyncCustomTxsSyncCustomTxsSyncCustomTxsResult, + SyncCustomTxsSyncCustomTxsSyncCustomTxsResultTxs, +) +from .update_ledger import ( + UpdateLedger, + UpdateLedgerUpdateLedgerBadRequestError, + UpdateLedgerUpdateLedgerInternalError, + UpdateLedgerUpdateLedgerUpdateLedgerResult, + UpdateLedgerUpdateLedgerUpdateLedgerResultLedger, +) +from .update_ledger_entry import ( + UpdateLedgerEntry, + UpdateLedgerEntryUpdateLedgerEntryBadRequestError, + UpdateLedgerEntryUpdateLedgerEntryInternalError, + UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResult, + UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntry, + UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryGroups, + UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLines, + UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodes, + UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodesAccount, + UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryTags, +) + +__all__ = [ + "AddLedgerEntry", + "AddLedgerEntryAddLedgerEntryAddLedgerEntryResult", + "AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry", + "AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines", + "AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLinesAccount", + "AddLedgerEntryAddLedgerEntryBadRequestError", + "AddLedgerEntryAddLedgerEntryInternalError", + "AddLedgerEntryInput", + "AddLedgerEntryRuntime", + "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResult", + "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry", + "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines", + "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLinesAccount", + "AddLedgerEntryRuntimeAddLedgerEntryBadRequestError", + "AddLedgerEntryRuntimeAddLedgerEntryInternalError", + "AsyncFragmentClient", + "BalanceUpdateConsistencyMode", + "BaseModel", + "ChartOfAccountsInput", + "Client", + "CreateCustomCurrency", + "CreateCustomCurrencyCreateCustomCurrencyBadRequestError", + "CreateCustomCurrencyCreateCustomCurrencyCreateCustomCurrencyResult", + "CreateCustomCurrencyCreateCustomCurrencyCreateCustomCurrencyResultCustomCurrency", + "CreateCustomCurrencyCreateCustomCurrencyInternalError", + "CreateCustomCurrencyInput", + "CreateCustomLink", + "CreateCustomLinkCreateCustomLinkBadRequestError", + "CreateCustomLinkCreateCustomLinkCreateCustomLinkResult", + "CreateCustomLinkCreateCustomLinkCreateCustomLinkResultLink", + "CreateCustomLinkCreateCustomLinkInternalError", + "CreateLedger", + "CreateLedgerAccountInput", + "CreateLedgerAccountsInput", + "CreateLedgerCreateLedgerBadRequestError", + "CreateLedgerCreateLedgerCreateLedgerResult", + "CreateLedgerCreateLedgerCreateLedgerResultLedger", + "CreateLedgerCreateLedgerCreateLedgerResultLedgerSchema", + "CreateLedgerCreateLedgerInternalError", + "CreateLedgerInput", + "CurrencyCode", + "CurrencyFilter", + "CurrencyMatchInput", + "CurrencyMode", + "CustomAccountInput", + "CustomTxInput", + "DateFilter", + "DateTimeFilter", + "DeleteCustomTxs", + "DeleteCustomTxsDeleteCustomTxsBadRequestError", + "DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResult", + "DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxs", + "DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxsTx", + "DeleteCustomTxsDeleteCustomTxsInternalError", + "DeleteLedger", + "DeleteLedgerDeleteLedgerBadRequestError", + "DeleteLedgerDeleteLedgerDeleteLedgerResult", + "DeleteLedgerDeleteLedgerInternalError", + "DeleteSchema", + "DeleteSchemaDeleteSchemaBadRequestError", + "DeleteSchemaDeleteSchemaDeleteSchemaResult", + "DeleteSchemaDeleteSchemaInternalError", + "EntryGroupMatchInput", + "ExternalAccountFilter", + "ExternalAccountMatchInput", + "ExternalTransferType", + "ExternalTxSource", + "GetAccountDataMigrations", + "GetAccountDataMigrationsLedger", + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrations", + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodes", + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesCurrentMigration", + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistory", + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistoryNodes", + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistoryPageInfo", + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntries", + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodes", + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntriesPageInfo", + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsPageInfo", + "GetEntriesToMigrateForLedgerAccountDataMigration", + "GetEntriesToMigrateForLedgerAccountDataMigrationLedger", + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrations", + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodes", + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntries", + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodes", + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLines", + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLinesNodes", + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLinesNodesAccount", + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesPageInfo", + "GetEntriesToMigrateForLedgerEntryDataMigration", + "GetEntriesToMigrateForLedgerEntryDataMigrationLedger", + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrations", + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodes", + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntries", + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodes", + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLines", + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLinesNodes", + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLinesNodesAccount", + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesPageInfo", + "GetEntryDataMigrations", + "GetEntryDataMigrationsLedger", + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrations", + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodes", + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesCurrentMigration", + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistory", + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistoryNodes", + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistoryPageInfo", + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntries", + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodes", + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesPageInfo", + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsPageInfo", + "GetLedger", + "GetLedgerAccountBalance", + "GetLedgerAccountBalanceLedgerAccount", + "GetLedgerAccountLines", + "GetLedgerAccountLinesLedgerAccount", + "GetLedgerAccountLinesLedgerAccountLines", + "GetLedgerAccountLinesLedgerAccountLinesNodes", + "GetLedgerAccountLinesLedgerAccountLinesPageInfo", + "GetLedgerEntry", + "GetLedgerEntryLedgerEntry", + "GetLedgerEntryLedgerEntryLines", + "GetLedgerEntryLedgerEntryLinesNodes", + "GetLedgerEntryLedgerEntryLinesNodesAccount", + "GetLedgerLedger", + "GetSchema", + "GetSchemaSchema", + "GetSchemaSchemaVersion", + "GetWorkspace", + "GetWorkspaceWorkspace", + "Granularity", + "GroupBalanceAccountFilter", + "GroupFilter", + "GroupInput", + "GroupMatchInput", + "GroupNotFilter", + "GroupReconciliationParametersInput", + "IncreaseEnv", + "Int96ConditionInput", + "Int96Filter", + "LedgerAccountClearingStatus", + "LedgerAccountClearingStatusFilter", + "LedgerAccountConditionInput", + "LedgerAccountConsistencyConfigInput", + "LedgerAccountDataMigrationsFilterSet", + "LedgerAccountFilter", + "LedgerAccountGroupConsistencyConfigInput", + "LedgerAccountMatchInput", + "LedgerAccountTypeFilter", + "LedgerAccountTypes", + "LedgerAccountsFilterSet", + "LedgerDataMigrationStatus", + "LedgerEntriesFilterSet", + "LedgerEntryConditionInput", + "LedgerEntryDataMigrationsFilterSet", + "LedgerEntryFilter", + "LedgerEntryGroupBalanceFilter", + "LedgerEntryGroupBalanceFilterSet", + "LedgerEntryGroupInput", + "LedgerEntryGroupMatchInput", + "LedgerEntryGroupsFilterSet", + "LedgerEntryInput", + "LedgerEntryMatchInput", + "LedgerEntryTagInput", + "LedgerLineInput", + "LedgerLineMatchInput", + "LedgerLinesConsistencyMode", + "LedgerLinesFilterSet", + "LedgerMatchInput", + "LedgerMigrationStatus", + "LedgerTypeFilter", + "LedgerTypes", + "LedgersFilterSet", + "LinkMatchInput", + "LinkType", + "ListLedgerAccountBalances", + "ListLedgerAccountBalancesLedger", + "ListLedgerAccountBalancesLedgerLedgerAccounts", + "ListLedgerAccountBalancesLedgerLedgerAccountsNodes", + "ListLedgerAccountBalancesLedgerLedgerAccountsPageInfo", + "ListLedgerAccounts", + "ListLedgerAccountsLedger", + "ListLedgerAccountsLedgerLedgerAccounts", + "ListLedgerAccountsLedgerLedgerAccountsNodes", + "ListLedgerAccountsLedgerLedgerAccountsPageInfo", + "ListLedgerEntries", + "ListLedgerEntriesLedger", + "ListLedgerEntriesLedgerLedgerEntries", + "ListLedgerEntriesLedgerLedgerEntriesNodes", + "ListLedgerEntriesLedgerLedgerEntriesNodesLines", + "ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodes", + "ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodesAccount", + "ListLedgerEntriesLedgerLedgerEntriesPageInfo", + "ListLedgerEntryGroupBalances", + "ListLedgerEntryGroupBalancesLedgerEntryGroup", + "ListLedgerEntryGroupBalancesLedgerEntryGroupBalances", + "ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodes", + "ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodesAccount", + "ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodesCurrency", + "ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesPageInfo", + "ListMultiCurrencyLedgerAccountBalances", + "ListMultiCurrencyLedgerAccountBalancesLedger", + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccounts", + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes", + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalances", + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodes", + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodesCurrency", + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalances", + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodes", + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodesCurrency", + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalances", + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodes", + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodesCurrency", + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsPageInfo", + "MigrateLedgerEntry", + "MigrateLedgerEntryInput", + "MigrateLedgerEntryMigrateLedgerEntryBadRequestError", + "MigrateLedgerEntryMigrateLedgerEntryInternalError", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResult", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntry", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLines", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLinesNodes", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLinesNodesAccount", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntry", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLines", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLinesNodes", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLinesNodesAccount", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntry", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLines", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodes", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodesAccount", + "PostCardSettle", + "PostCardSettleAddLedgerEntryAddLedgerEntryResult", + "PostCardSettleAddLedgerEntryAddLedgerEntryResultEntry", + "PostCardSettleAddLedgerEntryAddLedgerEntryResultEntryGroups", + "PostCardSettleAddLedgerEntryAddLedgerEntryResultEntryLedger", + "PostCardSettleAddLedgerEntryAddLedgerEntryResultEntryTags", + "PostCardSettleAddLedgerEntryAddLedgerEntryResultLines", + "PostCardSettleAddLedgerEntryAddLedgerEntryResultLinesAccount", + "PostCardSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency", + "PostCardSettleAddLedgerEntryBadRequestError", + "PostCardSettleAddLedgerEntryInternalError", + "PostDisputePayoutInitiate", + "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResult", + "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry", + "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryGroups", + "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryLedger", + "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryTags", + "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultLines", + "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesAccount", + "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesCurrency", + "PostDisputePayoutInitiateAddLedgerEntryBadRequestError", + "PostDisputePayoutInitiateAddLedgerEntryInternalError", + "PostDisputePayoutSettle", + "PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResult", + "PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntry", + "PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntryGroups", + "PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntryLedger", + "PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntryTags", + "PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultLines", + "PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultLinesAccount", + "PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency", + "PostDisputePayoutSettleAddLedgerEntryBadRequestError", + "PostDisputePayoutSettleAddLedgerEntryInternalError", + "PostDriverPayoutInitiate", + "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResult", + "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry", + "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryGroups", + "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryLedger", + "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryTags", + "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultLines", + "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesAccount", + "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesCurrency", + "PostDriverPayoutInitiateAddLedgerEntryBadRequestError", + "PostDriverPayoutInitiateAddLedgerEntryInternalError", + "PostDriverPayoutSettle", + "PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResult", + "PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntry", + "PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryGroups", + "PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryLedger", + "PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryTags", + "PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultLines", + "PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesAccount", + "PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency", + "PostDriverPayoutSettleAddLedgerEntryBadRequestError", + "PostDriverPayoutSettleAddLedgerEntryInternalError", + "PostLinesAs", + "PostOrderPlaced", + "PostOrderPlacedAddLedgerEntryAddLedgerEntryResult", + "PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntry", + "PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntryGroups", + "PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntryLedger", + "PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntryTags", + "PostOrderPlacedAddLedgerEntryAddLedgerEntryResultLines", + "PostOrderPlacedAddLedgerEntryAddLedgerEntryResultLinesAccount", + "PostOrderPlacedAddLedgerEntryAddLedgerEntryResultLinesCurrency", + "PostOrderPlacedAddLedgerEntryBadRequestError", + "PostOrderPlacedAddLedgerEntryInternalError", + "PostOrderPlacedV2", + "PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResult", + "PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntry", + "PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntryGroups", + "PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntryLedger", + "PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntryTags", + "PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultLines", + "PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultLinesAccount", + "PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultLinesCurrency", + "PostOrderPlacedV2AddLedgerEntryBadRequestError", + "PostOrderPlacedV2AddLedgerEntryInternalError", + "PostRestaurantPayoutInitiate", + "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResult", + "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry", + "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryGroups", + "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryLedger", + "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryTags", + "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultLines", + "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesAccount", + "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesCurrency", + "PostRestaurantPayoutInitiateAddLedgerEntryBadRequestError", + "PostRestaurantPayoutInitiateAddLedgerEntryInternalError", + "PostRestaurantPayoutSettle", + "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResult", + "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntry", + "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryGroups", + "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryLedger", + "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryTags", + "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultLines", + "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesAccount", + "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency", + "PostRestaurantPayoutSettleAddLedgerEntryBadRequestError", + "PostRestaurantPayoutSettleAddLedgerEntryInternalError", + "ReadBalanceConsistencyMode", + "ReconcileTx", + "ReconcileTxReconcileTxBadRequestError", + "ReconcileTxReconcileTxInternalError", + "ReconcileTxReconcileTxReconcileTxResult", + "ReconcileTxReconcileTxReconcileTxResultEntry", + "ReconcileTxReconcileTxReconcileTxResultLines", + "ReconcileTxReconcileTxReconcileTxResultLinesAccount", + "ReconcileTxRuntime", + "ReconcileTxRuntimeReconcileTxBadRequestError", + "ReconcileTxRuntimeReconcileTxInternalError", + "ReconcileTxRuntimeReconcileTxReconcileTxResult", + "ReconcileTxRuntimeReconcileTxReconcileTxResultEntry", + "ReconcileTxRuntimeReconcileTxReconcileTxResultLines", + "ReconcileTxRuntimeReconcileTxReconcileTxResultLinesAccount", + "ReverseLedgerEntry", + "ReverseLedgerEntryReverseLedgerEntryBadRequestError", + "ReverseLedgerEntryReverseLedgerEntryInternalError", + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResult", + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntry", + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLines", + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLinesNodes", + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLinesNodesAccount", + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntry", + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLines", + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLinesNodes", + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLinesNodesAccount", + "SceneEntryInput", + "SceneEventInput", + "SceneEventType", + "SceneInput", + "SchemaConditionInput", + "SchemaConsistencyConfigInput", + "SchemaConsistencyMode", + "SchemaCurrencyMatchInput", + "SchemaExternalAccountMatchInput", + "SchemaInput", + "SchemaInt96ConditionInput", + "SchemaLedgerAccountInput", + "SchemaLedgerAccountMatchInput", + "SchemaLedgerAccountStatus", + "SchemaLedgerEntriesInput", + "SchemaLedgerEntryConditionInput", + "SchemaLedgerEntryGroupInput", + "SchemaLedgerEntryInput", + "SchemaLedgerEntryStatus", + "SchemaLedgerEntryTagInput", + "SchemaLedgerLineInput", + "SchemaMatchInput", + "SchemaPaymentInput", + "SchemaRepeatedConfigInput", + "SchemaTxMatchInput", + "StoreSchema", + "StoreSchemaStoreSchemaBadRequestError", + "StoreSchemaStoreSchemaInternalError", + "StoreSchemaStoreSchemaStoreSchemaResult", + "StoreSchemaStoreSchemaStoreSchemaResultSchema", + "StoreSchemaStoreSchemaStoreSchemaResultSchemaVersion", + "StringFilter", + "StringMatchFilter", + "StripeEnv", + "SyncCustomAccounts", + "SyncCustomAccountsSyncCustomAccountsBadRequestError", + "SyncCustomAccountsSyncCustomAccountsInternalError", + "SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResult", + "SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccounts", + "SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccountsCurrency", + "SyncCustomTxs", + "SyncCustomTxsSyncCustomTxsBadRequestError", + "SyncCustomTxsSyncCustomTxsInternalError", + "SyncCustomTxsSyncCustomTxsSyncCustomTxsResult", + "SyncCustomTxsSyncCustomTxsSyncCustomTxsResultTxs", + "TagFilter", + "TagMatchInput", + "TxMatchInput", + "TxType", + "TxTypeFilter", + "UnitEnv", + "UpdateLedger", + "UpdateLedgerAccountInput", + "UpdateLedgerEntry", + "UpdateLedgerEntryInput", + "UpdateLedgerEntryUpdateLedgerEntryBadRequestError", + "UpdateLedgerEntryUpdateLedgerEntryInternalError", + "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResult", + "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntry", + "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryGroups", + "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLines", + "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodes", + "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodesAccount", + "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryTags", + "UpdateLedgerInput", + "UpdateLedgerUpdateLedgerBadRequestError", + "UpdateLedgerUpdateLedgerInternalError", + "UpdateLedgerUpdateLedgerUpdateLedgerResult", + "UpdateLedgerUpdateLedgerUpdateLedgerResultLedger", + "Upload", +] diff --git a/tests/snapshots/001-marketing-schema/sdk/add_ledger_entry.py b/tests/snapshots/001-marketing-schema/sdk/add_ledger_entry.py new file mode 100644 index 0000000..bb8aa5e --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/add_ledger_entry.py @@ -0,0 +1,60 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class AddLedgerEntry(BaseModel): + add_ledger_entry: Union[ + "AddLedgerEntryAddLedgerEntryAddLedgerEntryResult", + "AddLedgerEntryAddLedgerEntryBadRequestError", + "AddLedgerEntryAddLedgerEntryInternalError", + ] = Field(alias="addLedgerEntry", discriminator="typename__") + + +class AddLedgerEntryAddLedgerEntryAddLedgerEntryResult(BaseModel): + typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") + is_ik_replay: bool = Field(alias="isIkReplay") + entry: "AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry" + lines: list["AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines"] + + +class AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): + type_: Optional[Any] = Field(alias="type") + id: str + ik: str + posted: Any + created: Any + + +class AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines(BaseModel): + id: str + amount: Any + account: "AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLinesAccount" + + +class AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLinesAccount(BaseModel): + path: str + + +class AddLedgerEntryAddLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class AddLedgerEntryAddLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +AddLedgerEntry.model_rebuild() +AddLedgerEntryAddLedgerEntryAddLedgerEntryResult.model_rebuild() +AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/add_ledger_entry_runtime.py b/tests/snapshots/001-marketing-schema/sdk/add_ledger_entry_runtime.py new file mode 100644 index 0000000..4d08547 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/add_ledger_entry_runtime.py @@ -0,0 +1,60 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class AddLedgerEntryRuntime(BaseModel): + add_ledger_entry: Union[ + "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResult", + "AddLedgerEntryRuntimeAddLedgerEntryBadRequestError", + "AddLedgerEntryRuntimeAddLedgerEntryInternalError", + ] = Field(alias="addLedgerEntry", discriminator="typename__") + + +class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResult(BaseModel): + typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") + is_ik_replay: bool = Field(alias="isIkReplay") + entry: "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry" + lines: list["AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines"] + + +class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): + type_: Optional[Any] = Field(alias="type") + id: str + ik: str + posted: Any + created: Any + + +class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines(BaseModel): + id: str + amount: Any + account: "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLinesAccount" + + +class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLinesAccount(BaseModel): + path: str + + +class AddLedgerEntryRuntimeAddLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class AddLedgerEntryRuntimeAddLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +AddLedgerEntryRuntime.model_rebuild() +AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResult.model_rebuild() +AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/async_client.py b/tests/snapshots/001-marketing-schema/sdk/async_client.py new file mode 100644 index 0000000..98e1f61 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/async_client.py @@ -0,0 +1,69 @@ +# Generated by fragment (with the help of ariadne-codegen) + +# Ignore untyped authlib +# mypy: disable-error-code="import-untyped" +import time +from typing import Any, Dict, Optional + +import httpx +from ariadne_codegen.client_generators.dependencies.async_base_client import ( + AsyncBaseClient, +) +from authlib.integrations.httpx_client import AsyncOAuth2Client + +from fragment.exceptions import MissingArgumentException, MissingTokenException + + +class AsyncFragmentClient(AsyncBaseClient): + def __init__( + self, + api_url: str = "", + auth_url: str = "", + auth_scope: str = "", + client_id: str = "", + client_secret: str = "", + http_client: Optional[httpx.AsyncClient] = None, + ): + if api_url == "": + raise MissingArgumentException("api_url") + if auth_url == "": + raise MissingArgumentException("auth_url") + if auth_scope == "": + raise MissingArgumentException("auth_scope") + if client_id == "": + raise MissingArgumentException("client_id") + if client_secret == "": + raise MissingArgumentException("client_secret") + super().__init__(url=api_url, http_client=http_client) + + self.auth_url = auth_url + self.expiration_time = None + self.token = None + self.oauth2_client = AsyncOAuth2Client( + client_id, client_secret, scope=auth_scope + ) + + async def refresh_token(self): + now = time.time() + if self.expiration_time is None or self.expiration_time <= now: + self.token = await self.oauth2_client.fetch_token(self.auth_url) + self.expiration_time = now + self.token["expires_in"] + + async def execute( + self, + query: str, + operation_name: Optional[str] = None, + variables: Optional[Dict[str, Any]] = None, + **kwargs: Any, + ) -> httpx.Response: + await self.refresh_token() + if self.token is None: + raise MissingTokenException() + headers = kwargs.get("headers", {}) + kwargs.update( + headers={ + "Authorization": f'Bearer {self.token["access_token"]}', + **headers, + } + ) + return await super().execute(query, operation_name, variables, **kwargs) diff --git a/tests/snapshots/001-marketing-schema/sdk/base_model.py b/tests/snapshots/001-marketing-schema/sdk/base_model.py new file mode 100644 index 0000000..f5edb52 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/base_model.py @@ -0,0 +1,30 @@ +# Generated by fragment (with the help of ariadne-codegen) + +from io import IOBase + +from pydantic import BaseModel as PydanticBaseModel +from pydantic import ConfigDict + + +class UnsetType: + def __bool__(self) -> bool: + return False + + +UNSET = UnsetType() + + +class BaseModel(PydanticBaseModel): + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + arbitrary_types_allowed=True, + protected_namespaces=(), + ) + + +class Upload: + def __init__(self, filename: str, content: IOBase, content_type: str): + self.filename = filename + self.content = content + self.content_type = content_type diff --git a/tests/snapshots/001-marketing-schema/sdk/client.py b/tests/snapshots/001-marketing-schema/sdk/client.py new file mode 100644 index 0000000..199a693 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/client.py @@ -0,0 +1,2492 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from .add_ledger_entry import AddLedgerEntry +from .add_ledger_entry_runtime import AddLedgerEntryRuntime +from .async_client import AsyncFragmentClient +from .create_custom_currency import CreateCustomCurrency +from .create_custom_link import CreateCustomLink +from .create_ledger import CreateLedger +from .delete_custom_txs import DeleteCustomTxs +from .delete_ledger import DeleteLedger +from .delete_schema import DeleteSchema +from .enums import ReadBalanceConsistencyMode +from .get_account_data_migrations import GetAccountDataMigrations +from .get_entries_to_migrate_for_ledger_account_data_migration import ( + GetEntriesToMigrateForLedgerAccountDataMigration, +) +from .get_entries_to_migrate_for_ledger_entry_data_migration import ( + GetEntriesToMigrateForLedgerEntryDataMigration, +) +from .get_entry_data_migrations import GetEntryDataMigrations +from .get_ledger import GetLedger +from .get_ledger_account_balance import GetLedgerAccountBalance +from .get_ledger_account_lines import GetLedgerAccountLines +from .get_ledger_entry import GetLedgerEntry +from .get_schema import GetSchema +from .get_workspace import GetWorkspace +from .input_types import ( + CreateLedgerInput, + CurrencyMatchInput, + CustomAccountInput, + CustomTxInput, + LedgerAccountDataMigrationsFilterSet, + LedgerEntriesFilterSet, + LedgerEntryDataMigrationsFilterSet, + LedgerEntryGroupBalanceFilterSet, + LedgerEntryGroupInput, + LedgerEntryInput, + LedgerEntryTagInput, + LedgerLineInput, + LedgerLinesFilterSet, + LedgerMatchInput, + SchemaInput, + SchemaMatchInput, + UpdateLedgerEntryInput, + UpdateLedgerInput, +) +from .list_ledger_account_balances import ListLedgerAccountBalances +from .list_ledger_accounts import ListLedgerAccounts +from .list_ledger_entries import ListLedgerEntries +from .list_ledger_entry_group_balances import ListLedgerEntryGroupBalances +from .list_multi_currency_ledger_account_balances import ( + ListMultiCurrencyLedgerAccountBalances, +) +from .migrate_ledger_entry import MigrateLedgerEntry +from .post_card_settle import PostCardSettle +from .post_dispute_payout_initiate import PostDisputePayoutInitiate +from .post_dispute_payout_settle import PostDisputePayoutSettle +from .post_driver_payout_initiate import PostDriverPayoutInitiate +from .post_driver_payout_settle import PostDriverPayoutSettle +from .post_order_placed import PostOrderPlaced +from .post_order_placed_v_2 import PostOrderPlacedV2 +from .post_restaurant_payout_initiate import PostRestaurantPayoutInitiate +from .post_restaurant_payout_settle import PostRestaurantPayoutSettle +from .reconcile_tx import ReconcileTx +from .reconcile_tx_runtime import ReconcileTxRuntime +from .reverse_ledger_entry import ReverseLedgerEntry +from .store_schema import StoreSchema +from .sync_custom_accounts import SyncCustomAccounts +from .sync_custom_txs import SyncCustomTxs +from .update_ledger import UpdateLedger +from .update_ledger_entry import UpdateLedgerEntry + + +def gql(q: str) -> str: + return q + + +class Client(AsyncFragmentClient): + async def post_order_placed( + self, + ik: Any, + ledger_ik: Any, + user_id: str, + order_id: str, + order_cost: str, + currency: str, + platform_fee: str, + driver_fee: str, + restaurant_id: str, + driver_id: str, + posted: Optional[Any] = None, + **kwargs: Any + ) -> PostOrderPlaced: + query = gql(""" + mutation PostOrderPlaced($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $order_id: String!, $order_cost: String!, $currency: String!, $platform_fee: String!, $driver_fee: String!, $restaurant_id: String!, $driver_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "order_placed", typeVersion: 1, posted: $posted, parameters: {user_id: $user_id, order_id: $order_id, order_cost: $order_cost, currency: $currency, platform_fee: $platform_fee, driver_fee: $driver_fee, restaurant_id: $restaurant_id, driver_id: $driver_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ik": ik, + "posted": posted, + "ledgerIk": ledger_ik, + "user_id": user_id, + "order_id": order_id, + "order_cost": order_cost, + "currency": currency, + "platform_fee": platform_fee, + "driver_fee": driver_fee, + "restaurant_id": restaurant_id, + "driver_id": driver_id, + } + response = await self.execute( + query=query, operation_name="PostOrderPlaced", variables=variables, **kwargs + ) + data = self.get_data(response) + return PostOrderPlaced.model_validate(data) + + async def post_order_placed_v_2( + self, + ik: Any, + ledger_ik: Any, + user_id: str, + order_id: str, + order_cost: str, + currency: str, + platform_fee: str, + service_fee: str, + driver_fee: str, + restaurant_id: str, + driver_id: str, + posted: Optional[Any] = None, + **kwargs: Any + ) -> PostOrderPlacedV2: + query = gql(""" + mutation PostOrderPlaced_v2($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $order_id: String!, $order_cost: String!, $currency: String!, $platform_fee: String!, $service_fee: String!, $driver_fee: String!, $restaurant_id: String!, $driver_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "order_placed", typeVersion: 2, posted: $posted, parameters: {user_id: $user_id, order_id: $order_id, order_cost: $order_cost, currency: $currency, platform_fee: $platform_fee, service_fee: $service_fee, driver_fee: $driver_fee, restaurant_id: $restaurant_id, driver_id: $driver_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ik": ik, + "posted": posted, + "ledgerIk": ledger_ik, + "user_id": user_id, + "order_id": order_id, + "order_cost": order_cost, + "currency": currency, + "platform_fee": platform_fee, + "service_fee": service_fee, + "driver_fee": driver_fee, + "restaurant_id": restaurant_id, + "driver_id": driver_id, + } + response = await self.execute( + query=query, + operation_name="PostOrderPlaced_v2", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return PostOrderPlacedV2.model_validate(data) + + async def post_card_settle( + self, + ik: Any, + ledger_ik: Any, + user_id: str, + order_id: str, + currency: str, + amount: str, + posted: Optional[Any] = None, + **kwargs: Any + ) -> PostCardSettle: + query = gql(""" + mutation PostCardSettle($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $order_id: String!, $currency: String!, $amount: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "card_settle", typeVersion: 1, posted: $posted, parameters: {user_id: $user_id, order_id: $order_id, currency: $currency, amount: $amount}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ik": ik, + "posted": posted, + "ledgerIk": ledger_ik, + "user_id": user_id, + "order_id": order_id, + "currency": currency, + "amount": amount, + } + response = await self.execute( + query=query, operation_name="PostCardSettle", variables=variables, **kwargs + ) + data = self.get_data(response) + return PostCardSettle.model_validate(data) + + async def post_restaurant_payout_initiate( + self, + ik: Any, + ledger_ik: Any, + restaurant_id: str, + order_id: str, + currency: str, + amount: str, + payout_id: str, + posted: Optional[Any] = None, + **kwargs: Any + ) -> PostRestaurantPayoutInitiate: + query = gql(""" + mutation PostRestaurantPayoutInitiate($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $restaurant_id: String!, $order_id: String!, $currency: String!, $amount: String!, $payout_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "restaurant_payout_initiate", typeVersion: 1, posted: $posted, parameters: {restaurant_id: $restaurant_id, order_id: $order_id, currency: $currency, amount: $amount, payout_id: $payout_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ik": ik, + "posted": posted, + "ledgerIk": ledger_ik, + "restaurant_id": restaurant_id, + "order_id": order_id, + "currency": currency, + "amount": amount, + "payout_id": payout_id, + } + response = await self.execute( + query=query, + operation_name="PostRestaurantPayoutInitiate", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return PostRestaurantPayoutInitiate.model_validate(data) + + async def post_restaurant_payout_settle( + self, + ik: Any, + ledger_ik: Any, + restaurant_id: str, + payout_id: str, + currency: str, + amount: str, + posted: Optional[Any] = None, + **kwargs: Any + ) -> PostRestaurantPayoutSettle: + query = gql(""" + mutation PostRestaurantPayoutSettle($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $restaurant_id: String!, $payout_id: String!, $currency: String!, $amount: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "restaurant_payout_settle", typeVersion: 1, posted: $posted, parameters: {restaurant_id: $restaurant_id, payout_id: $payout_id, currency: $currency, amount: $amount}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ik": ik, + "posted": posted, + "ledgerIk": ledger_ik, + "restaurant_id": restaurant_id, + "payout_id": payout_id, + "currency": currency, + "amount": amount, + } + response = await self.execute( + query=query, + operation_name="PostRestaurantPayoutSettle", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return PostRestaurantPayoutSettle.model_validate(data) + + async def post_driver_payout_initiate( + self, + ik: Any, + ledger_ik: Any, + driver_id: str, + order_id: str, + currency: str, + amount: str, + payout_id: str, + posted: Optional[Any] = None, + **kwargs: Any + ) -> PostDriverPayoutInitiate: + query = gql(""" + mutation PostDriverPayoutInitiate($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $driver_id: String!, $order_id: String!, $currency: String!, $amount: String!, $payout_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "driver_payout_initiate", typeVersion: 1, posted: $posted, parameters: {driver_id: $driver_id, order_id: $order_id, currency: $currency, amount: $amount, payout_id: $payout_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ik": ik, + "posted": posted, + "ledgerIk": ledger_ik, + "driver_id": driver_id, + "order_id": order_id, + "currency": currency, + "amount": amount, + "payout_id": payout_id, + } + response = await self.execute( + query=query, + operation_name="PostDriverPayoutInitiate", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return PostDriverPayoutInitiate.model_validate(data) + + async def post_driver_payout_settle( + self, + ik: Any, + ledger_ik: Any, + driver_id: str, + payout_id: str, + currency: str, + amount: str, + posted: Optional[Any] = None, + **kwargs: Any + ) -> PostDriverPayoutSettle: + query = gql(""" + mutation PostDriverPayoutSettle($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $driver_id: String!, $payout_id: String!, $currency: String!, $amount: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "driver_payout_settle", typeVersion: 1, posted: $posted, parameters: {driver_id: $driver_id, payout_id: $payout_id, currency: $currency, amount: $amount}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ik": ik, + "posted": posted, + "ledgerIk": ledger_ik, + "driver_id": driver_id, + "payout_id": payout_id, + "currency": currency, + "amount": amount, + } + response = await self.execute( + query=query, + operation_name="PostDriverPayoutSettle", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return PostDriverPayoutSettle.model_validate(data) + + async def post_dispute_payout_initiate( + self, + ik: Any, + ledger_ik: Any, + user_id: str, + disputes_id: str, + amount: str, + currency: str, + payout_id: str, + order_id: str, + posted: Optional[Any] = None, + **kwargs: Any + ) -> PostDisputePayoutInitiate: + query = gql(""" + mutation PostDisputePayoutInitiate($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $disputes_id: String!, $amount: String!, $currency: String!, $payout_id: String!, $order_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "dispute_payout_initiate", typeVersion: 1, posted: $posted, parameters: {user_id: $user_id, disputes_id: $disputes_id, amount: $amount, currency: $currency, payout_id: $payout_id, order_id: $order_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ik": ik, + "posted": posted, + "ledgerIk": ledger_ik, + "user_id": user_id, + "disputes_id": disputes_id, + "amount": amount, + "currency": currency, + "payout_id": payout_id, + "order_id": order_id, + } + response = await self.execute( + query=query, + operation_name="PostDisputePayoutInitiate", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return PostDisputePayoutInitiate.model_validate(data) + + async def post_dispute_payout_settle( + self, + ik: Any, + ledger_ik: Any, + user_id: str, + disputes_id: str, + amount: str, + currency: str, + order_id: str, + posted: Optional[Any] = None, + **kwargs: Any + ) -> PostDisputePayoutSettle: + query = gql(""" + mutation PostDisputePayoutSettle($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $disputes_id: String!, $amount: String!, $currency: String!, $order_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "dispute_payout_settle", typeVersion: 1, posted: $posted, parameters: {user_id: $user_id, disputes_id: $disputes_id, amount: $amount, currency: $currency, order_id: $order_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ik": ik, + "posted": posted, + "ledgerIk": ledger_ik, + "user_id": user_id, + "disputes_id": disputes_id, + "amount": amount, + "currency": currency, + "order_id": order_id, + } + response = await self.execute( + query=query, + operation_name="PostDisputePayoutSettle", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return PostDisputePayoutSettle.model_validate(data) + + async def store_schema(self, schema: SchemaInput, **kwargs: Any) -> StoreSchema: + query = gql(""" + mutation storeSchema($schema: SchemaInput!) { + storeSchema(schema: $schema) { + __typename + ... on StoreSchemaResult { + schema { + key + name + version { + created + version + } + } + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = {"schema": schema} + response = await self.execute( + query=query, operation_name="storeSchema", variables=variables, **kwargs + ) + data = self.get_data(response) + return StoreSchema.model_validate(data) + + async def delete_schema( + self, schema: SchemaMatchInput, **kwargs: Any + ) -> DeleteSchema: + query = gql(""" + mutation deleteSchema($schema: SchemaMatchInput!) { + deleteSchema(schema: $schema) { + __typename + ... on DeleteSchemaResult { + success + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = {"schema": schema} + response = await self.execute( + query=query, operation_name="deleteSchema", variables=variables, **kwargs + ) + data = self.get_data(response) + return DeleteSchema.model_validate(data) + + async def create_ledger( + self, ik: Any, ledger: CreateLedgerInput, schema_key: Any, **kwargs: Any + ) -> CreateLedger: + query = gql(""" + mutation createLedger($ik: SafeString!, $ledger: CreateLedgerInput!, $schemaKey: SafeString!) { + createLedger(ik: $ik, ledger: $ledger, schema: {key: $schemaKey}) { + __typename + ... on CreateLedgerResult { + ledger { + id + ik + name + created + schema { + key + } + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ik": ik, + "ledger": ledger, + "schemaKey": schema_key, + } + response = await self.execute( + query=query, operation_name="createLedger", variables=variables, **kwargs + ) + data = self.get_data(response) + return CreateLedger.model_validate(data) + + async def delete_ledger( + self, ledger: LedgerMatchInput, **kwargs: Any + ) -> DeleteLedger: + query = gql(""" + mutation deleteLedger($ledger: LedgerMatchInput!) { + deleteLedger(ledger: $ledger) { + __typename + ... on DeleteLedgerResult { + success + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = {"ledger": ledger} + response = await self.execute( + query=query, operation_name="deleteLedger", variables=variables, **kwargs + ) + data = self.get_data(response) + return DeleteLedger.model_validate(data) + + async def add_ledger_entry( + self, + ik: Any, + ledger_ik: Any, + type_: str, + parameters: Any, + type_version: Optional[int] = None, + posted: Optional[Any] = None, + tags: Optional[list[LedgerEntryTagInput]] = None, + groups: Optional[list[LedgerEntryGroupInput]] = None, + **kwargs: Any + ) -> AddLedgerEntry: + query = gql(""" + mutation addLedgerEntry($ik: SafeString!, $ledgerIk: SafeString!, $type: String!, $typeVersion: Int, $posted: DateTime, $parameters: JSON!, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!]) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: $type, typeVersion: $typeVersion, posted: $posted, parameters: $parameters, tags: $tags, groups: $groups} + ) { + __typename + ... on AddLedgerEntryResult { + isIkReplay + entry { + type + id + ik + posted + created + } + lines { + id + amount + account { + path + } + } + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ik": ik, + "ledgerIk": ledger_ik, + "type": type_, + "typeVersion": type_version, + "posted": posted, + "parameters": parameters, + "tags": tags, + "groups": groups, + } + response = await self.execute( + query=query, operation_name="addLedgerEntry", variables=variables, **kwargs + ) + data = self.get_data(response) + return AddLedgerEntry.model_validate(data) + + async def reverse_ledger_entry(self, id: str, **kwargs: Any) -> ReverseLedgerEntry: + query = gql(""" + mutation reverseLedgerEntry($id: ID!) { + reverseLedgerEntry(id: $id) { + __typename + ... on ReverseLedgerEntryResult { + reversingLedgerEntry { + ik + id + created + posted + type + description + hidden + lines { + nodes { + id + amount + account { + path + } + } + } + } + reversedLedgerEntry { + ik + id + created + posted + type + description + hidden + lines { + nodes { + id + amount + account { + path + } + } + } + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = {"id": id} + response = await self.execute( + query=query, + operation_name="reverseLedgerEntry", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return ReverseLedgerEntry.model_validate(data) + + async def migrate_ledger_entry( + self, id: str, new_ledger_entry: LedgerEntryInput, **kwargs: Any + ) -> MigrateLedgerEntry: + query = gql(""" + mutation migrateLedgerEntry($id: ID!, $newLedgerEntry: LedgerEntryInput!) { + migrateLedgerEntry(input: {id: $id, newLedgerEntry: $newLedgerEntry}) { + __typename + ... on MigrateLedgerEntryResult { + reversingLedgerEntry { + ik + id + created + posted + type + description + reversedAt + hidden + lines { + nodes { + id + amount + account { + path + } + } + } + } + reversedLedgerEntry { + ik + id + created + posted + type + description + reversedAt + hidden + lines { + nodes { + id + amount + account { + path + } + } + } + } + newLedgerEntry { + ik + id + created + posted + type + description + reversedAt + hidden + lines { + nodes { + id + amount + account { + path + } + } + } + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = {"id": id, "newLedgerEntry": new_ledger_entry} + response = await self.execute( + query=query, + operation_name="migrateLedgerEntry", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return MigrateLedgerEntry.model_validate(data) + + async def add_ledger_entry_runtime( + self, + ik: Any, + type_: str, + ledger_ik: Any, + lines: list[LedgerLineInput], + type_version: Optional[int] = None, + posted: Optional[Any] = None, + tags: Optional[list[LedgerEntryTagInput]] = None, + groups: Optional[list[LedgerEntryGroupInput]] = None, + **kwargs: Any + ) -> AddLedgerEntryRuntime: + query = gql(""" + mutation addLedgerEntryRuntime($ik: SafeString!, $type: String!, $typeVersion: Int, $ledgerIk: SafeString!, $posted: DateTime, $lines: [LedgerLineInput!]!, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!]) { + addLedgerEntry( + ik: $ik + entry: {type: $type, typeVersion: $typeVersion, ledger: {ik: $ledgerIk}, posted: $posted, lines: $lines, tags: $tags, groups: $groups} + ) { + __typename + ... on AddLedgerEntryResult { + isIkReplay + entry { + type + id + ik + posted + created + } + lines { + id + amount + account { + path + } + } + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ik": ik, + "type": type_, + "typeVersion": type_version, + "ledgerIk": ledger_ik, + "posted": posted, + "lines": lines, + "tags": tags, + "groups": groups, + } + response = await self.execute( + query=query, + operation_name="addLedgerEntryRuntime", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return AddLedgerEntryRuntime.model_validate(data) + + async def reconcile_tx( + self, + ledger_ik: Any, + type_: str, + parameters: Any, + type_version: Optional[int] = None, + tags: Optional[list[LedgerEntryTagInput]] = None, + groups: Optional[list[LedgerEntryGroupInput]] = None, + **kwargs: Any + ) -> ReconcileTx: + query = gql(""" + mutation reconcileTx($ledgerIk: SafeString!, $type: String!, $typeVersion: Int, $parameters: JSON!, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!]) { + reconcileTx( + entry: {ledger: {ik: $ledgerIk}, type: $type, typeVersion: $typeVersion, parameters: $parameters, tags: $tags, groups: $groups} + ) { + __typename + ... on ReconcileTxResult { + entry { + id + ik + date + posted + created + description + } + lines { + id + amount + account { + path + } + externalTxId + } + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ledgerIk": ledger_ik, + "type": type_, + "typeVersion": type_version, + "parameters": parameters, + "tags": tags, + "groups": groups, + } + response = await self.execute( + query=query, operation_name="reconcileTx", variables=variables, **kwargs + ) + data = self.get_data(response) + return ReconcileTx.model_validate(data) + + async def reconcile_tx_runtime( + self, + ledger_ik: Any, + type_: str, + lines: list[LedgerLineInput], + type_version: Optional[int] = None, + tags: Optional[list[LedgerEntryTagInput]] = None, + groups: Optional[list[LedgerEntryGroupInput]] = None, + **kwargs: Any + ) -> ReconcileTxRuntime: + query = gql(""" + mutation reconcileTxRuntime($ledgerIk: SafeString!, $type: String!, $typeVersion: Int, $lines: [LedgerLineInput!]!, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!]) { + reconcileTx( + entry: {ledger: {ik: $ledgerIk}, type: $type, typeVersion: $typeVersion, lines: $lines, tags: $tags, groups: $groups} + ) { + __typename + ... on ReconcileTxResult { + entry { + id + ik + date + posted + created + description + } + lines { + id + amount + account { + path + } + externalTxId + } + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "ledgerIk": ledger_ik, + "type": type_, + "typeVersion": type_version, + "lines": lines, + "tags": tags, + "groups": groups, + } + response = await self.execute( + query=query, + operation_name="reconcileTxRuntime", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return ReconcileTxRuntime.model_validate(data) + + async def update_ledger_entry( + self, + entry_ik: Any, + ledger_ik: Any, + update: UpdateLedgerEntryInput, + **kwargs: Any + ) -> UpdateLedgerEntry: + query = gql(""" + mutation updateLedgerEntry($entryIk: SafeString!, $ledgerIk: SafeString!, $update: UpdateLedgerEntryInput!) { + updateLedgerEntry( + ledgerEntry: {ik: $entryIk, ledger: {ik: $ledgerIk}} + update: $update + ) { + __typename + ... on UpdateLedgerEntryResult { + entry { + id + ik + posted + created + description + lines { + nodes { + id + amount + account { + path + } + } + } + groups { + key + value + } + tags { + key + value + } + } + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "entryIk": entry_ik, + "ledgerIk": ledger_ik, + "update": update, + } + response = await self.execute( + query=query, + operation_name="updateLedgerEntry", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return UpdateLedgerEntry.model_validate(data) + + async def update_ledger( + self, ledger_ik: Any, update: UpdateLedgerInput, **kwargs: Any + ) -> UpdateLedger: + query = gql(""" + mutation updateLedger($ledgerIk: SafeString!, $update: UpdateLedgerInput!) { + updateLedger(ledger: {ik: $ledgerIk}, update: $update) { + __typename + ... on UpdateLedgerResult { + ledger { + id + ik + name + } + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = {"ledgerIk": ledger_ik, "update": update} + response = await self.execute( + query=query, operation_name="updateLedger", variables=variables, **kwargs + ) + data = self.get_data(response) + return UpdateLedger.model_validate(data) + + async def create_custom_link( + self, name: str, ik: Any, **kwargs: Any + ) -> CreateCustomLink: + query = gql(""" + mutation createCustomLink($name: String!, $ik: SafeString!) { + createCustomLink(name: $name, ik: $ik) { + __typename + ... on CreateCustomLinkResult { + link { + id + name + created + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = {"name": name, "ik": ik} + response = await self.execute( + query=query, + operation_name="createCustomLink", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return CreateCustomLink.model_validate(data) + + async def sync_custom_accounts( + self, link_id: str, accounts: list[CustomAccountInput], **kwargs: Any + ) -> SyncCustomAccounts: + query = gql(""" + mutation syncCustomAccounts($linkId: ID!, $accounts: [CustomAccountInput!]!) { + syncCustomAccounts(link: {id: $linkId}, accounts: $accounts) { + __typename + ... on SyncCustomAccountsResult { + accounts { + id + externalId + name + currency { + code + customCurrencyId + } + } + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = {"linkId": link_id, "accounts": accounts} + response = await self.execute( + query=query, + operation_name="syncCustomAccounts", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return SyncCustomAccounts.model_validate(data) + + async def sync_custom_txs( + self, link_id: str, txs: list[CustomTxInput], **kwargs: Any + ) -> SyncCustomTxs: + query = gql(""" + mutation syncCustomTxs($linkId: ID!, $txs: [CustomTxInput!]!) { + syncCustomTxs(link: {id: $linkId}, txs: $txs) { + __typename + ... on SyncCustomTxsResult { + txs { + __typename + linkId + id + externalId + externalAccountId + amount + description + posted + } + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = {"linkId": link_id, "txs": txs} + response = await self.execute( + query=query, operation_name="syncCustomTxs", variables=variables, **kwargs + ) + data = self.get_data(response) + return SyncCustomTxs.model_validate(data) + + async def delete_custom_txs(self, txs: list[str], **kwargs: Any) -> DeleteCustomTxs: + query = gql(""" + mutation deleteCustomTxs($txs: [ID!]!) { + deleteCustomTxs(txs: $txs) { + __typename + ... on DeleteCustomTxsResult { + txs { + tx { + linkId + id + externalId + externalAccountId + amount + description + posted + deletedAt + } + } + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = {"txs": txs} + response = await self.execute( + query=query, operation_name="deleteCustomTxs", variables=variables, **kwargs + ) + data = self.get_data(response) + return DeleteCustomTxs.model_validate(data) + + async def get_ledger(self, ik: Any, **kwargs: Any) -> GetLedger: + query = gql(""" + query getLedger($ik: SafeString!) { + ledger(ledger: {ik: $ik}) { + id + ik + name + created + balanceUTCOffset + } + } + """) + variables: dict[str, object] = {"ik": ik} + response = await self.execute( + query=query, operation_name="getLedger", variables=variables, **kwargs + ) + data = self.get_data(response) + return GetLedger.model_validate(data) + + async def get_ledger_entry( + self, ik: Any, ledger_ik: Any, **kwargs: Any + ) -> GetLedgerEntry: + query = gql(""" + query getLedgerEntry($ik: SafeString!, $ledgerIk: SafeString!) { + ledgerEntry(ledgerEntry: {ik: $ik, ledger: {ik: $ledgerIk}}) { + id + ik + posted + created + description + lines { + nodes { + id + amount + account { + path + } + } + } + } + } + """) + variables: dict[str, object] = {"ik": ik, "ledgerIk": ledger_ik} + response = await self.execute( + query=query, operation_name="getLedgerEntry", variables=variables, **kwargs + ) + data = self.get_data(response) + return GetLedgerEntry.model_validate(data) + + async def list_ledger_accounts( + self, + ledger_ik: Any, + after: Optional[str] = None, + first: Optional[int] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ListLedgerAccounts: + query = gql(""" + query listLedgerAccounts($ledgerIk: SafeString!, $after: String, $first: Int, $before: String) { + ledger(ledger: {ik: $ledgerIk}) { + id + ik + name + created + ledgerAccounts(after: $after, first: $first, before: $before) { + nodes { + id + path + name + type + created + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } + } + """) + variables: dict[str, object] = { + "ledgerIk": ledger_ik, + "after": after, + "first": first, + "before": before, + } + response = await self.execute( + query=query, + operation_name="listLedgerAccounts", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return ListLedgerAccounts.model_validate(data) + + async def list_ledger_account_balances( + self, + ledger_ik: Any, + after: Optional[str] = None, + first: Optional[int] = None, + before: Optional[str] = None, + balance_currency: Optional[CurrencyMatchInput] = None, + balance_at: Optional[Any] = None, + own_balance_consistency_mode: Optional[ReadBalanceConsistencyMode] = None, + child_balance_consistency_mode: Optional[ReadBalanceConsistencyMode] = None, + balance_consistency_mode: Optional[ReadBalanceConsistencyMode] = None, + **kwargs: Any + ) -> ListLedgerAccountBalances: + query = gql(""" + query listLedgerAccountBalances($ledgerIk: SafeString!, $after: String, $first: Int, $before: String, $balanceCurrency: CurrencyMatchInput, $balanceAt: LastMoment, $ownBalanceConsistencyMode: ReadBalanceConsistencyMode, $childBalanceConsistencyMode: ReadBalanceConsistencyMode, $balanceConsistencyMode: ReadBalanceConsistencyMode) { + ledger(ledger: {ik: $ledgerIk}) { + id + ik + name + created + ledgerAccounts(after: $after, first: $first, before: $before) { + nodes { + id + path + name + type + created + ownBalance( + currency: $balanceCurrency + at: $balanceAt + consistencyMode: $ownBalanceConsistencyMode + ) + childBalance( + currency: $balanceCurrency + at: $balanceAt + consistencyMode: $childBalanceConsistencyMode + ) + balance( + currency: $balanceCurrency + at: $balanceAt + consistencyMode: $balanceConsistencyMode + ) + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } + } + """) + variables: dict[str, object] = { + "ledgerIk": ledger_ik, + "after": after, + "first": first, + "before": before, + "balanceCurrency": balance_currency, + "balanceAt": balance_at, + "ownBalanceConsistencyMode": own_balance_consistency_mode, + "childBalanceConsistencyMode": child_balance_consistency_mode, + "balanceConsistencyMode": balance_consistency_mode, + } + response = await self.execute( + query=query, + operation_name="listLedgerAccountBalances", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return ListLedgerAccountBalances.model_validate(data) + + async def list_multi_currency_ledger_account_balances( + self, + ledger_ik: Any, + after: Optional[str] = None, + first: Optional[int] = None, + before: Optional[str] = None, + balance_at: Optional[Any] = None, + own_balances_consistency_mode: Optional[ReadBalanceConsistencyMode] = None, + child_balances_consistency_mode: Optional[ReadBalanceConsistencyMode] = None, + balances_consistency_mode: Optional[ReadBalanceConsistencyMode] = None, + **kwargs: Any + ) -> ListMultiCurrencyLedgerAccountBalances: + query = gql(""" + query listMultiCurrencyLedgerAccountBalances($ledgerIk: SafeString!, $after: String, $first: Int, $before: String, $balanceAt: LastMoment, $ownBalancesConsistencyMode: ReadBalanceConsistencyMode, $childBalancesConsistencyMode: ReadBalanceConsistencyMode, $balancesConsistencyMode: ReadBalanceConsistencyMode) { + ledger(ledger: {ik: $ledgerIk}) { + id + ik + name + created + ledgerAccounts(after: $after, first: $first, before: $before) { + nodes { + id + path + name + type + created + ownBalances(at: $balanceAt, consistencyMode: $ownBalancesConsistencyMode) { + nodes { + currency { + code + customCurrencyId + } + amount + } + } + childBalances(at: $balanceAt, consistencyMode: $childBalancesConsistencyMode) { + nodes { + currency { + code + customCurrencyId + } + amount + } + } + balances(at: $balanceAt, consistencyMode: $balancesConsistencyMode) { + nodes { + currency { + code + customCurrencyId + } + amount + } + } + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } + } + """) + variables: dict[str, object] = { + "ledgerIk": ledger_ik, + "after": after, + "first": first, + "before": before, + "balanceAt": balance_at, + "ownBalancesConsistencyMode": own_balances_consistency_mode, + "childBalancesConsistencyMode": child_balances_consistency_mode, + "balancesConsistencyMode": balances_consistency_mode, + } + response = await self.execute( + query=query, + operation_name="listMultiCurrencyLedgerAccountBalances", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return ListMultiCurrencyLedgerAccountBalances.model_validate(data) + + async def get_ledger_account_lines( + self, + path: str, + ledger_ik: Any, + after: Optional[str] = None, + first: Optional[int] = None, + before: Optional[str] = None, + filter_: Optional[LedgerLinesFilterSet] = None, + **kwargs: Any + ) -> GetLedgerAccountLines: + query = gql(""" + query getLedgerAccountLines($path: String!, $ledgerIk: SafeString!, $after: String, $first: Int, $before: String, $filter: LedgerLinesFilterSet) { + ledgerAccount(ledgerAccount: {ledger: {ik: $ledgerIk}, path: $path}) { + id + path + lines(after: $after, first: $first, before: $before, filter: $filter) { + nodes { + id + posted + created + amount + description + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } + } + """) + variables: dict[str, object] = { + "path": path, + "ledgerIk": ledger_ik, + "after": after, + "first": first, + "before": before, + "filter": filter_, + } + response = await self.execute( + query=query, + operation_name="getLedgerAccountLines", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return GetLedgerAccountLines.model_validate(data) + + async def get_ledger_account_balance( + self, + path: str, + ledger_ik: Any, + balance_currency: Optional[CurrencyMatchInput] = None, + balance_at: Optional[Any] = None, + balance_consistency_mode: Optional[ReadBalanceConsistencyMode] = None, + **kwargs: Any + ) -> GetLedgerAccountBalance: + query = gql(""" + query getLedgerAccountBalance($path: String!, $ledgerIk: SafeString!, $balanceCurrency: CurrencyMatchInput, $balanceAt: LastMoment, $balanceConsistencyMode: ReadBalanceConsistencyMode) { + ledgerAccount(ledgerAccount: {ledger: {ik: $ledgerIk}, path: $path}) { + id + path + balance( + currency: $balanceCurrency + at: $balanceAt + consistencyMode: $balanceConsistencyMode + ) + } + } + """) + variables: dict[str, object] = { + "path": path, + "ledgerIk": ledger_ik, + "balanceCurrency": balance_currency, + "balanceAt": balance_at, + "balanceConsistencyMode": balance_consistency_mode, + } + response = await self.execute( + query=query, + operation_name="getLedgerAccountBalance", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return GetLedgerAccountBalance.model_validate(data) + + async def get_schema( + self, key: Any, version: Optional[int] = None, **kwargs: Any + ) -> GetSchema: + query = gql(""" + query getSchema($key: SafeString!, $version: Int) { + schema(schema: {key: $key, version: $version}) { + key + name + version { + created + version + json + } + } + } + """) + variables: dict[str, object] = {"key": key, "version": version} + response = await self.execute( + query=query, operation_name="getSchema", variables=variables, **kwargs + ) + data = self.get_data(response) + return GetSchema.model_validate(data) + + async def list_ledger_entries( + self, + ledger_ik: Any, + after: Optional[str] = None, + first: Optional[int] = None, + before: Optional[str] = None, + filter_: Optional[LedgerEntriesFilterSet] = None, + **kwargs: Any + ) -> ListLedgerEntries: + query = gql(""" + query listLedgerEntries($ledgerIk: SafeString!, $after: String, $first: Int, $before: String, $filter: LedgerEntriesFilterSet) { + ledger(ledger: {ik: $ledgerIk}) { + ledgerEntries(after: $after, first: $first, before: $before, filter: $filter) { + nodes { + ik + type + posted + lines { + nodes { + amount + account { + path + } + } + } + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } + } + """) + variables: dict[str, object] = { + "ledgerIk": ledger_ik, + "after": after, + "first": first, + "before": before, + "filter": filter_, + } + response = await self.execute( + query=query, + operation_name="listLedgerEntries", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return ListLedgerEntries.model_validate(data) + + async def get_workspace(self, **kwargs: Any) -> GetWorkspace: + query = gql(""" + query getWorkspace { + workspace { + id + name + } + } + """) + variables: dict[str, object] = {} + response = await self.execute( + query=query, operation_name="getWorkspace", variables=variables, **kwargs + ) + data = self.get_data(response) + return GetWorkspace.model_validate(data) + + async def list_ledger_entry_group_balances( + self, + ledger_ik: Any, + group_key: Any, + group_value: Any, + consistency_mode: Optional[ReadBalanceConsistencyMode] = None, + after: Optional[str] = None, + before: Optional[str] = None, + first: Optional[int] = None, + last: Optional[int] = None, + filter_: Optional[LedgerEntryGroupBalanceFilterSet] = None, + **kwargs: Any + ) -> ListLedgerEntryGroupBalances: + query = gql(""" + query listLedgerEntryGroupBalances($ledgerIk: SafeString!, $groupKey: SafeString!, $groupValue: SafeString!, $consistencyMode: ReadBalanceConsistencyMode = use_account, $after: String, $before: String, $first: Int, $last: Int, $filter: LedgerEntryGroupBalanceFilterSet) { + ledgerEntryGroup( + ledgerEntryGroup: {ledger: {ik: $ledgerIk}, key: $groupKey, value: $groupValue} + ) { + key + value + created + balances( + after: $after + before: $before + first: $first + last: $last + filter: $filter + ) { + nodes { + account { + path + } + currency { + code + customCurrencyId + } + ownBalance(consistencyMode: $consistencyMode) + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } + } + """) + variables: dict[str, object] = { + "ledgerIk": ledger_ik, + "groupKey": group_key, + "groupValue": group_value, + "consistencyMode": consistency_mode, + "after": after, + "before": before, + "first": first, + "last": last, + "filter": filter_, + } + response = await self.execute( + query=query, + operation_name="listLedgerEntryGroupBalances", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return ListLedgerEntryGroupBalances.model_validate(data) + + async def get_entry_data_migrations( + self, + ledger_ik: Any, + filter_: Optional[LedgerEntryDataMigrationsFilterSet] = None, + after: Optional[str] = None, + before: Optional[str] = None, + first: Optional[int] = None, + last: Optional[int] = None, + **kwargs: Any + ) -> GetEntryDataMigrations: + query = gql(""" + query getEntryDataMigrations($ledgerIk: SafeString!, $filter: LedgerEntryDataMigrationsFilterSet, $after: String, $before: String, $first: Int, $last: Int) { + ledger(ledger: {ik: $ledgerIk}) { + ledgerEntryDataMigrations( + first: $first + after: $after + before: $before + last: $last + filter: $filter + ) { + nodes { + entryType + typeVersion + status + currentMigration { + schemaVersion + status + } + ledgerEntries { + nodes { + id + type + posted + parameters + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + history { + nodes { + schemaVersion + status + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } + } + """) + variables: dict[str, object] = { + "ledgerIk": ledger_ik, + "filter": filter_, + "after": after, + "before": before, + "first": first, + "last": last, + } + response = await self.execute( + query=query, + operation_name="getEntryDataMigrations", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return GetEntryDataMigrations.model_validate(data) + + async def get_entries_to_migrate_for_ledger_entry_data_migration( + self, + ledger_ik: Any, + entry_type: str, + type_version: str, + after: Optional[str] = None, + before: Optional[str] = None, + first: Optional[int] = None, + last: Optional[int] = None, + **kwargs: Any + ) -> GetEntriesToMigrateForLedgerEntryDataMigration: + query = gql(""" + query getEntriesToMigrateForLedgerEntryDataMigration($ledgerIk: SafeString!, $entryType: String!, $typeVersion: String!, $after: String, $before: String, $first: Int, $last: Int) { + ledger(ledger: {ik: $ledgerIk}) { + ledgerEntryDataMigrations( + filter: {entryType: {equalTo: $entryType}, typeVersion: {equalTo: $typeVersion}} + ) { + nodes { + ledgerEntries(first: $first, after: $after, last: $last, before: $before) { + nodes { + id + ik + type + typeVersion + description + posted + created + parameters + lines { + nodes { + id + amount + account { + path + } + } + } + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } + } + } + } + """) + variables: dict[str, object] = { + "ledgerIk": ledger_ik, + "entryType": entry_type, + "typeVersion": type_version, + "after": after, + "before": before, + "first": first, + "last": last, + } + response = await self.execute( + query=query, + operation_name="getEntriesToMigrateForLedgerEntryDataMigration", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return GetEntriesToMigrateForLedgerEntryDataMigration.model_validate(data) + + async def get_account_data_migrations( + self, + ledger_ik: Any, + filter_: Optional[LedgerAccountDataMigrationsFilterSet] = None, + after: Optional[str] = None, + before: Optional[str] = None, + first: Optional[int] = None, + last: Optional[int] = None, + **kwargs: Any + ) -> GetAccountDataMigrations: + query = gql(""" + query getAccountDataMigrations($ledgerIk: SafeString!, $filter: LedgerAccountDataMigrationsFilterSet, $after: String, $before: String, $first: Int, $last: Int) { + ledger(ledger: {ik: $ledgerIk}) { + ledgerAccountDataMigrations( + first: $first + after: $after + before: $before + last: $last + filter: $filter + ) { + nodes { + accountPath + status + currentMigration { + schemaVersion + status + } + ledgerEntries { + nodes { + id + type + posted + parameters + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + history { + nodes { + schemaVersion + status + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } + } + """) + variables: dict[str, object] = { + "ledgerIk": ledger_ik, + "filter": filter_, + "after": after, + "before": before, + "first": first, + "last": last, + } + response = await self.execute( + query=query, + operation_name="getAccountDataMigrations", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return GetAccountDataMigrations.model_validate(data) + + async def get_entries_to_migrate_for_ledger_account_data_migration( + self, + ledger_ik: Any, + account_path: str, + after: Optional[str] = None, + before: Optional[str] = None, + first: Optional[int] = None, + last: Optional[int] = None, + **kwargs: Any + ) -> GetEntriesToMigrateForLedgerAccountDataMigration: + query = gql(""" + query getEntriesToMigrateForLedgerAccountDataMigration($ledgerIk: SafeString!, $accountPath: String!, $after: String, $before: String, $first: Int, $last: Int) { + ledger(ledger: {ik: $ledgerIk}) { + ledgerAccountDataMigrations(filter: {accountPath: {equalTo: $accountPath}}) { + nodes { + ledgerEntries(first: $first, after: $after, last: $last, before: $before) { + nodes { + id + ik + type + typeVersion + description + posted + created + parameters + lines { + nodes { + id + amount + account { + path + } + } + } + } + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } + } + } + } + """) + variables: dict[str, object] = { + "ledgerIk": ledger_ik, + "accountPath": account_path, + "after": after, + "before": before, + "first": first, + "last": last, + } + response = await self.execute( + query=query, + operation_name="getEntriesToMigrateForLedgerAccountDataMigration", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return GetEntriesToMigrateForLedgerAccountDataMigration.model_validate(data) + + async def create_custom_currency( + self, id: Any, name: str, precision: int, custom_code: str, **kwargs: Any + ) -> CreateCustomCurrency: + query = gql(""" + mutation createCustomCurrency($id: SafeString!, $name: String!, $precision: Int!, $customCode: String!) { + createCustomCurrency( + customCurrency: {customCurrencyId: $id, name: $name, precision: $precision, customCode: $customCode} + ) { + __typename + ... on CreateCustomCurrencyResult { + customCurrency { + code + customCurrencyId + precision + name + customCode + } + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } + } + """) + variables: dict[str, object] = { + "id": id, + "name": name, + "precision": precision, + "customCode": custom_code, + } + response = await self.execute( + query=query, + operation_name="createCustomCurrency", + variables=variables, + **kwargs + ) + data = self.get_data(response) + return CreateCustomCurrency.model_validate(data) diff --git a/tests/snapshots/001-marketing-schema/sdk/create_custom_currency.py b/tests/snapshots/001-marketing-schema/sdk/create_custom_currency.py new file mode 100644 index 0000000..3f0fe95 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/create_custom_currency.py @@ -0,0 +1,52 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel +from .enums import CurrencyCode + + +class CreateCustomCurrency(BaseModel): + create_custom_currency: Union[ + "CreateCustomCurrencyCreateCustomCurrencyBadRequestError", + "CreateCustomCurrencyCreateCustomCurrencyCreateCustomCurrencyResult", + "CreateCustomCurrencyCreateCustomCurrencyInternalError", + ] = Field(alias="createCustomCurrency", discriminator="typename__") + + +class CreateCustomCurrencyCreateCustomCurrencyBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class CreateCustomCurrencyCreateCustomCurrencyCreateCustomCurrencyResult(BaseModel): + typename__: Literal["CreateCustomCurrencyResult"] = Field(alias="__typename") + custom_currency: ( + "CreateCustomCurrencyCreateCustomCurrencyCreateCustomCurrencyResultCustomCurrency" + ) = Field(alias="customCurrency") + + +class CreateCustomCurrencyCreateCustomCurrencyCreateCustomCurrencyResultCustomCurrency( + BaseModel +): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + precision: int + name: str + custom_code: Optional[str] = Field(alias="customCode") + + +class CreateCustomCurrencyCreateCustomCurrencyInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +CreateCustomCurrency.model_rebuild() +CreateCustomCurrencyCreateCustomCurrencyCreateCustomCurrencyResult.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/create_custom_link.py b/tests/snapshots/001-marketing-schema/sdk/create_custom_link.py new file mode 100644 index 0000000..d87bcbc --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/create_custom_link.py @@ -0,0 +1,46 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Literal, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class CreateCustomLink(BaseModel): + create_custom_link: Union[ + "CreateCustomLinkCreateCustomLinkBadRequestError", + "CreateCustomLinkCreateCustomLinkCreateCustomLinkResult", + "CreateCustomLinkCreateCustomLinkInternalError", + ] = Field(alias="createCustomLink", discriminator="typename__") + + +class CreateCustomLinkCreateCustomLinkBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class CreateCustomLinkCreateCustomLinkCreateCustomLinkResult(BaseModel): + typename__: Literal["CreateCustomLinkResult"] = Field(alias="__typename") + link: "CreateCustomLinkCreateCustomLinkCreateCustomLinkResultLink" + is_ik_replay: bool = Field(alias="isIkReplay") + + +class CreateCustomLinkCreateCustomLinkCreateCustomLinkResultLink(BaseModel): + id: str + name: str + created: str + + +class CreateCustomLinkCreateCustomLinkInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +CreateCustomLink.model_rebuild() +CreateCustomLinkCreateCustomLinkCreateCustomLinkResult.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/create_ledger.py b/tests/snapshots/001-marketing-schema/sdk/create_ledger.py new file mode 100644 index 0000000..c38dd09 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/create_ledger.py @@ -0,0 +1,55 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class CreateLedger(BaseModel): + create_ledger: Union[ + "CreateLedgerCreateLedgerBadRequestError", + "CreateLedgerCreateLedgerCreateLedgerResult", + "CreateLedgerCreateLedgerInternalError", + ] = Field(alias="createLedger", discriminator="typename__") + + +class CreateLedgerCreateLedgerBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class CreateLedgerCreateLedgerCreateLedgerResult(BaseModel): + typename__: Literal["CreateLedgerResult"] = Field(alias="__typename") + ledger: "CreateLedgerCreateLedgerCreateLedgerResultLedger" + is_ik_replay: bool = Field(alias="isIkReplay") + + +class CreateLedgerCreateLedgerCreateLedgerResultLedger(BaseModel): + id: str + ik: Any + name: str + created: Any + schema_: Optional["CreateLedgerCreateLedgerCreateLedgerResultLedgerSchema"] = Field( + alias="schema" + ) + + +class CreateLedgerCreateLedgerCreateLedgerResultLedgerSchema(BaseModel): + key: Any + + +class CreateLedgerCreateLedgerInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +CreateLedger.model_rebuild() +CreateLedgerCreateLedgerCreateLedgerResult.model_rebuild() +CreateLedgerCreateLedgerCreateLedgerResultLedger.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/delete_custom_txs.py b/tests/snapshots/001-marketing-schema/sdk/delete_custom_txs.py new file mode 100644 index 0000000..4e36443 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/delete_custom_txs.py @@ -0,0 +1,55 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class DeleteCustomTxs(BaseModel): + delete_custom_txs: Union[ + "DeleteCustomTxsDeleteCustomTxsBadRequestError", + "DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResult", + "DeleteCustomTxsDeleteCustomTxsInternalError", + ] = Field(alias="deleteCustomTxs", discriminator="typename__") + + +class DeleteCustomTxsDeleteCustomTxsBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResult(BaseModel): + typename__: Literal["DeleteCustomTxsResult"] = Field(alias="__typename") + txs: list["DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxs"] + + +class DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxs(BaseModel): + tx: "DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxsTx" + + +class DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxsTx(BaseModel): + link_id: str = Field(alias="linkId") + id: str + external_id: str = Field(alias="externalId") + external_account_id: str = Field(alias="externalAccountId") + amount: Any + description: str + posted: Any + deleted_at: Optional[Any] = Field(alias="deletedAt") + + +class DeleteCustomTxsDeleteCustomTxsInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +DeleteCustomTxs.model_rebuild() +DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResult.model_rebuild() +DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxs.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/delete_ledger.py b/tests/snapshots/001-marketing-schema/sdk/delete_ledger.py new file mode 100644 index 0000000..9af4bed --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/delete_ledger.py @@ -0,0 +1,38 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Literal, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class DeleteLedger(BaseModel): + delete_ledger: Union[ + "DeleteLedgerDeleteLedgerBadRequestError", + "DeleteLedgerDeleteLedgerDeleteLedgerResult", + "DeleteLedgerDeleteLedgerInternalError", + ] = Field(alias="deleteLedger", discriminator="typename__") + + +class DeleteLedgerDeleteLedgerBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class DeleteLedgerDeleteLedgerDeleteLedgerResult(BaseModel): + typename__: Literal["DeleteLedgerResult"] = Field(alias="__typename") + success: bool + + +class DeleteLedgerDeleteLedgerInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +DeleteLedger.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/delete_schema.py b/tests/snapshots/001-marketing-schema/sdk/delete_schema.py new file mode 100644 index 0000000..9d57311 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/delete_schema.py @@ -0,0 +1,38 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Literal, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class DeleteSchema(BaseModel): + delete_schema: Union[ + "DeleteSchemaDeleteSchemaBadRequestError", + "DeleteSchemaDeleteSchemaDeleteSchemaResult", + "DeleteSchemaDeleteSchemaInternalError", + ] = Field(alias="deleteSchema", discriminator="typename__") + + +class DeleteSchemaDeleteSchemaBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class DeleteSchemaDeleteSchemaDeleteSchemaResult(BaseModel): + typename__: Literal["DeleteSchemaResult"] = Field(alias="__typename") + success: bool + + +class DeleteSchemaDeleteSchemaInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +DeleteSchema.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/enums.py b/tests/snapshots/001-marketing-schema/sdk/enums.py new file mode 100644 index 0000000..b9f0234 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/enums.py @@ -0,0 +1,308 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: schema.graphql + +from enum import Enum + + +class BalanceUpdateConsistencyMode(str, Enum): + eventual = "eventual" + strong = "strong" + + +class CurrencyCode(str, Enum): + AAVE = "AAVE" + ADA = "ADA" + AED = "AED" + AFN = "AFN" + ALL = "ALL" + AMD = "AMD" + ANG = "ANG" + AOA = "AOA" + ARS = "ARS" + AUD = "AUD" + AWG = "AWG" + AZN = "AZN" + BAM = "BAM" + BBD = "BBD" + BCH = "BCH" + BDT = "BDT" + BGN = "BGN" + BHD = "BHD" + BIF = "BIF" + BMD = "BMD" + BND = "BND" + BOB = "BOB" + BRL = "BRL" + BSD = "BSD" + BTC = "BTC" + BTN = "BTN" + BWP = "BWP" + BYR = "BYR" + BZD = "BZD" + CAD = "CAD" + CADC = "CADC" + CADT = "CADT" + CDF = "CDF" + CHF = "CHF" + CLP = "CLP" + CNY = "CNY" + COP = "COP" + CRC = "CRC" + CUC = "CUC" + CUP = "CUP" + CUSTOM = "CUSTOM" + CVE = "CVE" + CZK = "CZK" + DAI = "DAI" + DJF = "DJF" + DKK = "DKK" + DOP = "DOP" + DZD = "DZD" + EGP = "EGP" + ERN = "ERN" + ETB = "ETB" + ETH = "ETH" + EUR = "EUR" + EURC = "EURC" + FJD = "FJD" + FKP = "FKP" + GBP = "GBP" + GEL = "GEL" + GGP = "GGP" + GHS = "GHS" + GIP = "GIP" + GMD = "GMD" + GNF = "GNF" + GTQ = "GTQ" + GYD = "GYD" + HKD = "HKD" + HNL = "HNL" + HRK = "HRK" + HTG = "HTG" + HUF = "HUF" + IDR = "IDR" + ILS = "ILS" + IMP = "IMP" + INR = "INR" + IQD = "IQD" + IRR = "IRR" + ISK = "ISK" + JMD = "JMD" + JOD = "JOD" + JPY = "JPY" + KES = "KES" + KGS = "KGS" + KHR = "KHR" + KMF = "KMF" + KPW = "KPW" + KRW = "KRW" + KWD = "KWD" + KYD = "KYD" + KZT = "KZT" + LAK = "LAK" + LBP = "LBP" + LINK = "LINK" + LKR = "LKR" + LOGICAL = "LOGICAL" + LRD = "LRD" + LSL = "LSL" + LTC = "LTC" + LYD = "LYD" + MAD = "MAD" + MATIC = "MATIC" + MDL = "MDL" + MGA = "MGA" + MKD = "MKD" + MMK = "MMK" + MNT = "MNT" + MOP = "MOP" + MUR = "MUR" + MVR = "MVR" + MWK = "MWK" + MXN = "MXN" + MYR = "MYR" + MZN = "MZN" + NAD = "NAD" + NGN = "NGN" + NIO = "NIO" + NOK = "NOK" + NPR = "NPR" + NZD = "NZD" + OMR = "OMR" + PAB = "PAB" + PEN = "PEN" + PGK = "PGK" + PHP = "PHP" + PKR = "PKR" + PLN = "PLN" + PTS = "PTS" + PYG = "PYG" + QAR = "QAR" + RON = "RON" + RSD = "RSD" + RUB = "RUB" + RWF = "RWF" + SAR = "SAR" + SBD = "SBD" + SCR = "SCR" + SDG = "SDG" + SEK = "SEK" + SGD = "SGD" + SHP = "SHP" + SLL = "SLL" + SOL = "SOL" + SOS = "SOS" + SPL = "SPL" + SRD = "SRD" + STN = "STN" + SVC = "SVC" + SYP = "SYP" + SZL = "SZL" + THB = "THB" + TJS = "TJS" + TMT = "TMT" + TND = "TND" + TOP = "TOP" + TRY = "TRY" + TTD = "TTD" + TVD = "TVD" + TWD = "TWD" + TZS = "TZS" + UAH = "UAH" + UGX = "UGX" + UNI = "UNI" + USD = "USD" + USDC = "USDC" + USDG = "USDG" + USDT = "USDT" + UYU = "UYU" + UZS = "UZS" + VEF = "VEF" + VND = "VND" + VUV = "VUV" + WST = "WST" + XAF = "XAF" + XCD = "XCD" + XLM = "XLM" + XOF = "XOF" + XPF = "XPF" + YER = "YER" + ZAR = "ZAR" + ZMW = "ZMW" + + +class CurrencyMode(str, Enum): + multi = "multi" + single = "single" + + +class ExternalTransferType(str, Enum): + ach = "ach" + card = "card" + check = "check" + internal = "internal" + wire = "wire" + + +class ExternalTxSource(str, Enum): + increase = "increase" + + +class Granularity(str, Enum): + daily = "daily" + hourly = "hourly" + monthly = "monthly" + + +class IncreaseEnv(str, Enum): + production = "production" + sandbox = "sandbox" + + +class LedgerAccountClearingStatus(str, Enum): + cleared = "cleared" + pending = "pending" + + +class LedgerAccountTypes(str, Enum): + asset = "asset" + expense = "expense" + income = "income" + liability = "liability" + + +class LedgerDataMigrationStatus(str, Enum): + active = "active" + inactive = "inactive" + + +class LedgerLinesConsistencyMode(str, Enum): + eventual = "eventual" + strong = "strong" + + +class LedgerMigrationStatus(str, Enum): + completed = "completed" + failed = "failed" + queued = "queued" + skipped = "skipped" + started = "started" + + +class LedgerTypes(str, Enum): + double = "double" + + +class LinkType(str, Enum): + CustomLink = "CustomLink" + IncreaseLink = "IncreaseLink" + StripeLink = "StripeLink" + UnitLink = "UnitLink" + + +class PostLinesAs(str, Enum): + net_amounts = "net_amounts" + raw_lines = "raw_lines" + skip_zero_lines = "skip_zero_lines" + + +class ReadBalanceConsistencyMode(str, Enum): + eventual = "eventual" + strong = "strong" + use_account = "use_account" + + +class SceneEventType(str, Enum): + entry = "entry" + + +class SchemaConsistencyMode(str, Enum): + eventual = "eventual" + strong = "strong" + + +class SchemaLedgerAccountStatus(str, Enum): + active = "active" + archived = "archived" + disabled = "disabled" + + +class SchemaLedgerEntryStatus(str, Enum): + active = "active" + archived = "archived" + disabled = "disabled" + + +class StripeEnv(str, Enum): + livemode = "livemode" + testmode = "testmode" + + +class TxType(str, Enum): + credit = "credit" + debit = "debit" + + +class UnitEnv(str, Enum): + production = "production" + sandbox = "sandbox" diff --git a/tests/snapshots/001-marketing-schema/sdk/get_account_data_migrations.py b/tests/snapshots/001-marketing-schema/sdk/get_account_data_migrations.py new file mode 100644 index 0000000..2e1f21d --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/get_account_data_migrations.py @@ -0,0 +1,114 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel +from .enums import LedgerDataMigrationStatus + + +class GetAccountDataMigrations(BaseModel): + ledger: Optional["GetAccountDataMigrationsLedger"] + + +class GetAccountDataMigrationsLedger(BaseModel): + ledger_account_data_migrations: ( + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrations" + ) = Field(alias="ledgerAccountDataMigrations") + + +class GetAccountDataMigrationsLedgerLedgerAccountDataMigrations(BaseModel): + nodes: list["GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodes"] + page_info: "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsPageInfo" = ( + Field(alias="pageInfo") + ) + + +class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodes(BaseModel): + account_path: str = Field(alias="accountPath") + status: LedgerDataMigrationStatus + current_migration: Optional[ + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesCurrentMigration" + ] = Field(alias="currentMigration") + ledger_entries: ( + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntries" + ) = Field(alias="ledgerEntries") + history: "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistory" + + +class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesCurrentMigration( + BaseModel +): + schema_version: int = Field(alias="schemaVersion") + status: LedgerDataMigrationStatus + + +class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntries( + BaseModel +): + nodes: list[ + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodes" + ] + page_info: ( + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntriesPageInfo" + ) = Field(alias="pageInfo") + + +class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodes( + BaseModel +): + id: str + type_: Optional[Any] = Field(alias="type") + posted: Any + parameters: Optional[Any] + + +class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntriesPageInfo( + BaseModel +): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistory(BaseModel): + nodes: list[ + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistoryNodes" + ] + page_info: ( + "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistoryPageInfo" + ) = Field(alias="pageInfo") + + +class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistoryNodes( + BaseModel +): + schema_version: int = Field(alias="schemaVersion") + status: LedgerDataMigrationStatus + + +class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistoryPageInfo( + BaseModel +): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsPageInfo(BaseModel): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +GetAccountDataMigrations.model_rebuild() +GetAccountDataMigrationsLedger.model_rebuild() +GetAccountDataMigrationsLedgerLedgerAccountDataMigrations.model_rebuild() +GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodes.model_rebuild() +GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntries.model_rebuild() +GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistory.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/get_entries_to_migrate_for_ledger_account_data_migration.py b/tests/snapshots/001-marketing-schema/sdk/get_entries_to_migrate_for_ledger_account_data_migration.py new file mode 100644 index 0000000..c822a23 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/get_entries_to_migrate_for_ledger_account_data_migration.py @@ -0,0 +1,100 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel + + +class GetEntriesToMigrateForLedgerAccountDataMigration(BaseModel): + ledger: Optional["GetEntriesToMigrateForLedgerAccountDataMigrationLedger"] + + +class GetEntriesToMigrateForLedgerAccountDataMigrationLedger(BaseModel): + ledger_account_data_migrations: ( + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrations" + ) = Field(alias="ledgerAccountDataMigrations") + + +class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrations( + BaseModel +): + nodes: list[ + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodes" + ] + + +class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodes( + BaseModel +): + ledger_entries: ( + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntries" + ) = Field(alias="ledgerEntries") + + +class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntries( + BaseModel +): + nodes: list[ + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodes" + ] + page_info: ( + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesPageInfo" + ) = Field(alias="pageInfo") + + +class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodes( + BaseModel +): + id: str + ik: str + type_: Optional[Any] = Field(alias="type") + type_version: Optional[int] = Field(alias="typeVersion") + description: Optional[str] + posted: Any + created: Any + parameters: Optional[Any] + lines: "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLines" + + +class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLines( + BaseModel +): + nodes: list[ + "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLinesNodes" + ] + + +class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLinesNodes( + BaseModel +): + id: str + amount: Any + account: "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLinesNodesAccount" + + +class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLinesNodesAccount( + BaseModel +): + path: str + + +class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesPageInfo( + BaseModel +): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +GetEntriesToMigrateForLedgerAccountDataMigration.model_rebuild() +GetEntriesToMigrateForLedgerAccountDataMigrationLedger.model_rebuild() +GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrations.model_rebuild() +GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodes.model_rebuild() +GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntries.model_rebuild() +GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodes.model_rebuild() +GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLines.model_rebuild() +GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLinesNodes.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/get_entries_to_migrate_for_ledger_entry_data_migration.py b/tests/snapshots/001-marketing-schema/sdk/get_entries_to_migrate_for_ledger_entry_data_migration.py new file mode 100644 index 0000000..e943c4c --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/get_entries_to_migrate_for_ledger_entry_data_migration.py @@ -0,0 +1,100 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel + + +class GetEntriesToMigrateForLedgerEntryDataMigration(BaseModel): + ledger: Optional["GetEntriesToMigrateForLedgerEntryDataMigrationLedger"] + + +class GetEntriesToMigrateForLedgerEntryDataMigrationLedger(BaseModel): + ledger_entry_data_migrations: ( + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrations" + ) = Field(alias="ledgerEntryDataMigrations") + + +class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrations( + BaseModel +): + nodes: list[ + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodes" + ] + + +class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodes( + BaseModel +): + ledger_entries: ( + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntries" + ) = Field(alias="ledgerEntries") + + +class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntries( + BaseModel +): + nodes: list[ + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodes" + ] + page_info: ( + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesPageInfo" + ) = Field(alias="pageInfo") + + +class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodes( + BaseModel +): + id: str + ik: str + type_: Optional[Any] = Field(alias="type") + type_version: Optional[int] = Field(alias="typeVersion") + description: Optional[str] + posted: Any + created: Any + parameters: Optional[Any] + lines: "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLines" + + +class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLines( + BaseModel +): + nodes: list[ + "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLinesNodes" + ] + + +class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLinesNodes( + BaseModel +): + id: str + amount: Any + account: "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLinesNodesAccount" + + +class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLinesNodesAccount( + BaseModel +): + path: str + + +class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesPageInfo( + BaseModel +): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +GetEntriesToMigrateForLedgerEntryDataMigration.model_rebuild() +GetEntriesToMigrateForLedgerEntryDataMigrationLedger.model_rebuild() +GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrations.model_rebuild() +GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodes.model_rebuild() +GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntries.model_rebuild() +GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodes.model_rebuild() +GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLines.model_rebuild() +GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLinesNodes.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/get_entry_data_migrations.py b/tests/snapshots/001-marketing-schema/sdk/get_entry_data_migrations.py new file mode 100644 index 0000000..dab547d --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/get_entry_data_migrations.py @@ -0,0 +1,113 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel +from .enums import LedgerDataMigrationStatus + + +class GetEntryDataMigrations(BaseModel): + ledger: Optional["GetEntryDataMigrationsLedger"] + + +class GetEntryDataMigrationsLedger(BaseModel): + ledger_entry_data_migrations: ( + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrations" + ) = Field(alias="ledgerEntryDataMigrations") + + +class GetEntryDataMigrationsLedgerLedgerEntryDataMigrations(BaseModel): + nodes: list["GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodes"] + page_info: "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsPageInfo" = Field( + alias="pageInfo" + ) + + +class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodes(BaseModel): + entry_type: Any = Field(alias="entryType") + type_version: int = Field(alias="typeVersion") + status: LedgerDataMigrationStatus + current_migration: Optional[ + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesCurrentMigration" + ] = Field(alias="currentMigration") + ledger_entries: ( + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntries" + ) = Field(alias="ledgerEntries") + history: "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistory" + + +class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesCurrentMigration( + BaseModel +): + schema_version: int = Field(alias="schemaVersion") + status: LedgerDataMigrationStatus + + +class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntries( + BaseModel +): + nodes: list[ + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodes" + ] + page_info: ( + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesPageInfo" + ) = Field(alias="pageInfo") + + +class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodes( + BaseModel +): + id: str + type_: Optional[Any] = Field(alias="type") + posted: Any + parameters: Optional[Any] + + +class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesPageInfo( + BaseModel +): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistory(BaseModel): + nodes: list[ + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistoryNodes" + ] + page_info: ( + "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistoryPageInfo" + ) = Field(alias="pageInfo") + + +class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistoryNodes(BaseModel): + schema_version: int = Field(alias="schemaVersion") + status: LedgerDataMigrationStatus + + +class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistoryPageInfo( + BaseModel +): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsPageInfo(BaseModel): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +GetEntryDataMigrations.model_rebuild() +GetEntryDataMigrationsLedger.model_rebuild() +GetEntryDataMigrationsLedgerLedgerEntryDataMigrations.model_rebuild() +GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodes.model_rebuild() +GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntries.model_rebuild() +GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistory.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/get_ledger.py b/tests/snapshots/001-marketing-schema/sdk/get_ledger.py new file mode 100644 index 0000000..97f73d7 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/get_ledger.py @@ -0,0 +1,23 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel + + +class GetLedger(BaseModel): + ledger: Optional["GetLedgerLedger"] + + +class GetLedgerLedger(BaseModel): + id: str + ik: Any + name: str + created: Any + balance_utc_offset: Any = Field(alias="balanceUTCOffset") + + +GetLedger.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/get_ledger_account_balance.py b/tests/snapshots/001-marketing-schema/sdk/get_ledger_account_balance.py new file mode 100644 index 0000000..1da1ac2 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/get_ledger_account_balance.py @@ -0,0 +1,23 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel + + +class GetLedgerAccountBalance(BaseModel): + ledger_account: Optional["GetLedgerAccountBalanceLedgerAccount"] = Field( + alias="ledgerAccount" + ) + + +class GetLedgerAccountBalanceLedgerAccount(BaseModel): + id: str + path: str + balance: Any + + +GetLedgerAccountBalance.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/get_ledger_account_lines.py b/tests/snapshots/001-marketing-schema/sdk/get_ledger_account_lines.py new file mode 100644 index 0000000..d181aee --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/get_ledger_account_lines.py @@ -0,0 +1,47 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel + + +class GetLedgerAccountLines(BaseModel): + ledger_account: Optional["GetLedgerAccountLinesLedgerAccount"] = Field( + alias="ledgerAccount" + ) + + +class GetLedgerAccountLinesLedgerAccount(BaseModel): + id: str + path: str + lines: "GetLedgerAccountLinesLedgerAccountLines" + + +class GetLedgerAccountLinesLedgerAccountLines(BaseModel): + nodes: list["GetLedgerAccountLinesLedgerAccountLinesNodes"] + page_info: "GetLedgerAccountLinesLedgerAccountLinesPageInfo" = Field( + alias="pageInfo" + ) + + +class GetLedgerAccountLinesLedgerAccountLinesNodes(BaseModel): + id: str + posted: Optional[Any] + created: Optional[Any] + amount: Any + description: Optional[str] + + +class GetLedgerAccountLinesLedgerAccountLinesPageInfo(BaseModel): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +GetLedgerAccountLines.model_rebuild() +GetLedgerAccountLinesLedgerAccount.model_rebuild() +GetLedgerAccountLinesLedgerAccountLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/get_ledger_entry.py b/tests/snapshots/001-marketing-schema/sdk/get_ledger_entry.py new file mode 100644 index 0000000..799e036 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/get_ledger_entry.py @@ -0,0 +1,41 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel + + +class GetLedgerEntry(BaseModel): + ledger_entry: Optional["GetLedgerEntryLedgerEntry"] = Field(alias="ledgerEntry") + + +class GetLedgerEntryLedgerEntry(BaseModel): + id: str + ik: str + posted: Any + created: Any + description: Optional[str] + lines: "GetLedgerEntryLedgerEntryLines" + + +class GetLedgerEntryLedgerEntryLines(BaseModel): + nodes: list["GetLedgerEntryLedgerEntryLinesNodes"] + + +class GetLedgerEntryLedgerEntryLinesNodes(BaseModel): + id: str + amount: Any + account: "GetLedgerEntryLedgerEntryLinesNodesAccount" + + +class GetLedgerEntryLedgerEntryLinesNodesAccount(BaseModel): + path: str + + +GetLedgerEntry.model_rebuild() +GetLedgerEntryLedgerEntry.model_rebuild() +GetLedgerEntryLedgerEntryLines.model_rebuild() +GetLedgerEntryLedgerEntryLinesNodes.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/get_schema.py b/tests/snapshots/001-marketing-schema/sdk/get_schema.py new file mode 100644 index 0000000..f3b317c --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/get_schema.py @@ -0,0 +1,28 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel + + +class GetSchema(BaseModel): + schema_: Optional["GetSchemaSchema"] = Field(alias="schema") + + +class GetSchemaSchema(BaseModel): + key: Any + name: str + version: "GetSchemaSchemaVersion" + + +class GetSchemaSchemaVersion(BaseModel): + created: Any + version: int + json_: Any = Field(alias="json") + + +GetSchema.model_rebuild() +GetSchemaSchema.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/get_workspace.py b/tests/snapshots/001-marketing-schema/sdk/get_workspace.py new file mode 100644 index 0000000..f59ae35 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/get_workspace.py @@ -0,0 +1,16 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from .base_model import BaseModel + + +class GetWorkspace(BaseModel): + workspace: "GetWorkspaceWorkspace" + + +class GetWorkspaceWorkspace(BaseModel): + id: str + name: str + + +GetWorkspace.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/input_types.py b/tests/snapshots/001-marketing-schema/sdk/input_types.py new file mode 100644 index 0000000..22e83ff --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/input_types.py @@ -0,0 +1,1054 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: schema.graphql + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel +from .enums import ( + BalanceUpdateConsistencyMode, + CurrencyCode, + CurrencyMode, + LedgerAccountClearingStatus, + LedgerAccountTypes, + LedgerDataMigrationStatus, + LedgerLinesConsistencyMode, + LedgerTypes, + LinkType, + PostLinesAs, + SceneEventType, + SchemaConsistencyMode, + SchemaLedgerAccountStatus, + SchemaLedgerEntryStatus, + TxType, +) + + +class AddLedgerEntryInput(BaseModel): + entry: "LedgerEntryInput" + "The [Ledger Entry](https://fragment.dev/api-reference/api-types#input-types-ledgerentryinput) to commit" + ik: Any + "The [Idempotency Key](https://fragment.dev/api-reference/api-overview#idempotency) for this entry" + + +class ChartOfAccountsInput(BaseModel): + """The input for your Chart of Accounts in a Schema.""" + + accounts: list["SchemaLedgerAccountInput"] + "The Ledger Accounts modeled by your Schema. Ledger Accounts may be nested up to a maximum depth of 10." + default_consistency_config: Optional["LedgerAccountConsistencyConfigInput"] = Field( + alias="defaultConsistencyConfig", default=None + ) + "The default consistency configuration for all Ledger Accounts in this Schema. \nIf a Ledger Account does not specify its own consistency configuration, it will use the default values provided here. \n\nSee [Configure consistency](https://fragment.dev/guides/configure-consistency)." + default_currency: Optional["CurrencyMatchInput"] = Field( + alias="defaultCurrency", default=None + ) + "The default currency of each Ledger Account in the Chart Of Accounts.\nIt must be provided if `defaultCurrencyMode` is set to `single`.\nAdditionally, `defaultCurrency` must be omitted if `defaultCurrencyMode` is set to `multi`." + default_currency_mode: Optional[CurrencyMode] = Field( + alias="defaultCurrencyMode", default=None + ) + "The default currency mode of each Ledger Account in the Chart Of Accounts." + + +class CreateCustomCurrencyInput(BaseModel): + custom_code: str = Field(alias="customCode") + "The currency code for custom currencies. It can be up to 36 characters long. This is used for display purposes." + custom_currency_id: Any = Field(alias="customCurrencyId") + "The ID for a custom currency. This is specified when creating the custom currency using the [createCustomCurrency](https://fragment.dev/api-reference/api-mutations#createcustomcurrency) mutation. It can be up to 36 characters long." + name: str + "A human readable name for the currency (e.g. United States Dollar). This is used for display purposes." + precision: int + "The number of decimal places this currency goes to. For example, United States Dollars have a precision of 2 (i.e. 100 cents in a dollar), whereas the Jordanian Dinar has a precision of 3. This is used for display purposes." + + +class CreateLedgerAccountInput(BaseModel): + consistency_config: Optional["LedgerAccountConsistencyConfigInput"] = Field( + alias="consistencyConfig", default=None + ) + "The consistency configuration for this Ledger Account. This defines how updates to this Ledger Account's balance are handled." + currency: Optional["CurrencyMatchInput"] = None + "The currency of this Ledger Account. If this is not set, and `currencyMode` is\nnot set to `multi`, the workspace-level default is used." + currency_mode: Optional[CurrencyMode] = Field(alias="currencyMode", default=None) + "If set to `multi`, creates a multi-currency Ledger Account. If set to `single`, creates a single-currency Ledger Account." + linked_account: Optional["ExternalAccountMatchInput"] = Field( + alias="linkedAccount", default=None + ) + "The External Account to link to this Ledger Account." + name: str + "The human-readable name of this Ledger Account." + parent: Optional["LedgerAccountMatchInput"] = None + "The parent of this Ledger Account." + type_: Optional[LedgerAccountTypes] = Field(alias="type", default=None) + "The type of ledger account to create. Required if this is a top-level Ledger Account. If not provided, the type will be inferred from the parent." + + +class CreateLedgerAccountsInput(BaseModel): + child_ledger_accounts: Optional[list["CreateLedgerAccountsInput"]] = Field( + alias="childLedgerAccounts", default=None + ) + "Ledger Accounts to create as children of this Ledger Account." + consistency_config: Optional["LedgerAccountConsistencyConfigInput"] = Field( + alias="consistencyConfig", default=None + ) + "The consistency configuration for this ledger account. See [Configure consistency](https://fragment.dev/guides/configure-consistency)." + currency: Optional["CurrencyMatchInput"] = None + "The currency of this Ledger Account. If this is not set, the workspace level default is used." + currency_mode: Optional[CurrencyMode] = Field(alias="currencyMode", default=None) + "The currency mode of this Ledger Account. If this is not set, the workspace level default is used." + ik: Any + "The idempotency key for creating this Ledger Account." + linked_account: Optional["ExternalAccountMatchInput"] = Field( + alias="linkedAccount", default=None + ) + "The External Account to link to this Ledger Account. This can only be specified on leaf Ledger Accounts. See [Reconcile payments](https://fragment.dev/guides/reconcile-payments)." + name: str + "The name of the Ledger Account." + parent: Optional["LedgerAccountMatchInput"] = None + "The parent of this Ledger Account. This is only valid on the top level Ledger Account in the payload." + type_: Optional[LedgerAccountTypes] = Field(alias="type", default=None) + "The type of this Ledger Account. This field is only required if this is a root Ledger Account. Otherwise, the type will get inherited from its parent." + + +class CreateLedgerInput(BaseModel): + balance_utc_offset: Optional[Any] = Field(alias="balanceUTCOffset", default=None) + 'Use this field to specify a timezone for queries to your Ledger. \n\nWhen aggregating balances, all transactions within a 24 hour period starting at midnight UTC are included in each day. \nYou can specify a different starting hour for balances. For example, use "-08:00" to align balances with Pacific Standard Time. \nBalance queries would then consider the start of each local day to be at 8am UTC the next day in UTC. \nThe default timezone is UTC.' + name: str + type_: Optional[LedgerTypes] = Field(alias="type", default=None) + + +class CurrencyFilter(BaseModel): + equal_to: Optional["CurrencyMatchInput"] = Field(alias="equalTo", default=None) + "Must match the value provided" + in_: Optional[list["CurrencyMatchInput"]] = Field(alias="in", default=None) + "Must match one of the values provided. Limited to 100 items maximum." + + +class CurrencyMatchInput(BaseModel): + code: CurrencyCode + "The currency code. This is an [enum type](https://fragment.dev/api-reference/api-types#scalars-and-enums-currencycode)." + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId", default=None) + "The ID for a custom currency. This is specified when creating the custom currency using the [createCustomCurrency](https://fragment.dev/api-reference/api-mutations#createcustomcurrency) mutation." + + +class CustomAccountInput(BaseModel): + currency: Optional["CurrencyMatchInput"] = None + "The currency of this external account. If this is not set, the workspace level default is used. 'currency' cannot be set if 'currencyMode' is 'multi'." + currency_mode: Optional[CurrencyMode] = Field(alias="currencyMode", default=None) + "The currency mode of this external account. If set to multi, creates a multi-currency account." + external_id: Any = Field(alias="externalId") + "The ID of this account at the external system. This is used as the idempotency key, within the scope of its Custom Link." + name: str + "The name of the account at the external system." + + +class CustomTxInput(BaseModel): + account: "ExternalAccountMatchInput" + amount: Any + currency: Optional["CurrencyMatchInput"] = None + "The currency of this tx. Should be set for multi-currency accounts." + description: str + external_id: Any = Field(alias="externalId") + "The ID of this tx at the external system. This is used as the idempotency key, within the scope of its Custom Account." + posted: Any + + +class DateFilter(BaseModel): + equal_to: Optional[Any] = Field(alias="equalTo", default=None) + in_: Optional[list[Any]] = Field(alias="in", default=None) + "Must match one of the values provided. Limited to 100 items maximum." + within: Optional[Any] = None + 'Must fall within the given period. Supports a year (e.g. "2026") or a month (e.g. "2026-05"). To match a specific day, use `equalTo`. Cannot be combined with `withinBalanceUTCOffset`.' + within_balance_utc_offset: Optional[Any] = Field( + alias="withinBalanceUTCOffset", default=None + ) + 'Must fall within the given period, taking into account the Ledger\'s `balanceUTCOffset`. Supports a year (e.g. "2026") or a month (e.g. "2026-05"). Cannot be combined with `within`.' + + +class DateTimeFilter(BaseModel): + """Filters a timestamp field between two moments in time""" + + after: Optional[Any] = None + 'The timestamp value must be after this moment. Specified in ISO 8601 format e.g "1968-01-01T16:45:00Z"' + before: Optional[Any] = None + 'The timestamp value must be before this moment. Specified in ISO 8601 format e.g "1968-01-01T16:45:00Z"' + + +class EntryGroupMatchInput(BaseModel): + key: Any + value: Any + + +class ExternalAccountFilter(BaseModel): + equal_to: Optional["ExternalAccountMatchInput"] = Field( + alias="equalTo", default=None + ) + "Ledger Account must linked to the the specified external account" + in_: Optional[list["ExternalAccountMatchInput"]] = Field(alias="in", default=None) + "Ledger Account can be linked to any of the specified external accounts. Limited to 100 items maximum." + + +class ExternalAccountMatchInput(BaseModel): + """Specify an External Account by using `id`, or `linkId` and `externalId`.""" + + external_id: Optional[str] = Field(alias="externalId", default=None) + "The external system's ID of the External Account. If this is specified, `linkId` is required. `id` is optional, but will be validated if provided." + id: Optional[str] = None + "The FRAGMENT ID of the External Account. If this is specified, both `linkId` and `externalId` are optional, but will be validated if provided." + link_id: Optional[str] = Field(alias="linkId", default=None) + "The FRAGMENT ID of the Link the External Account is in. If this is specified, `externalId` is required. `id` is optional, but will be validated if provided." + + +class GroupBalanceAccountFilter(BaseModel): + """A filter to query balances of a specific subset of accounts""" + + id: Optional["StringFilter"] = None + "A filter that must match the account ID" + path: Optional["StringMatchFilter"] = None + "A filter that must match the account path. Wildcards ('*') may be used only for template variables, and will only match a single variable each." + + +class GroupFilter(BaseModel): + """Filter for finding entries by group membership""" + + all: Optional[list["GroupMatchInput"]] = None + "Find entries that have ALL of the specified groups. Limited to 10 items maximum." + equal_to: Optional["GroupMatchInput"] = Field(alias="equalTo", default=None) + "Find groups that exactly match this group" + in_: Optional[list["GroupMatchInput"]] = Field(alias="in", default=None) + "Find groups that match any of these groups" + key_equal_to: Optional[Any] = Field(alias="keyEqualTo", default=None) + "Find groups with a specific key" + key_in: Optional[list[Any]] = Field(alias="keyIn", default=None) + "Find groups with any of these keys" + not_: Optional["GroupNotFilter"] = Field(alias="not", default=None) + "Find groups that do not match this predicate" + not_equal_to: Optional["GroupMatchInput"] = Field(alias="notEqualTo", default=None) + "Find groups that do not exactly match this group" + not_in: Optional[list["GroupMatchInput"]] = Field(alias="notIn", default=None) + "Find groups that do not match any of these groups" + not_key_equal_to: Optional[Any] = Field(alias="notKeyEqualTo", default=None) + "Find groups that do not have a specific key" + not_key_in: Optional[list[Any]] = Field(alias="notKeyIn", default=None) + "Find groups that do not have any of these keys" + + +class GroupInput(BaseModel): + """A Group in a Schema. Group define sequences of Ledger Entries and can help with reconciliation tasks.""" + + description: Optional[Any] = None + "Human-readable description of the Group." + key: Any + "The key of this Group. This combined with its value is a stable, unique identifier for this group." + reconciliation: Optional["GroupReconciliationParametersInput"] = None + "The parameters that are used to enable reconciliation abilities in a group." + + +class GroupMatchInput(BaseModel): + """Input type for matching a specific group by key and value""" + + key: Any + "The key of the group to match" + value: Any + "The value of the group to match" + + +class GroupNotFilter(BaseModel): + """DEPRECATED: Use GroupFilter and notKeyIn or notKeyEqualTo instead. Filter for finding entries that do not match this predicate""" + + key_in: Optional[list[Any]] = Field(alias="keyIn", default=None) + "DEPRECATED: Find entries that are not members of all of these groups. This is an AND filter." + + +class GroupReconciliationParametersInput(BaseModel): + """A set of parameters that are used to enable reconciliation abilities in a group""" + + clearing_account_path: "SchemaLedgerAccountMatchInput" = Field( + alias="clearingAccountPath" + ) + "The path to the clearing account for this group. A clearing account is an account that is used to indicate funds that are in transit. Also called a suspense account, pending account, or zero balance account." + + +class Int96ConditionInput(BaseModel): + """A condition that must be met on an `Int96` field.""" + + eq: Optional[Any] = None + "Amount must exactly match this value. You may not specify this alongside `gte` or `lte`." + gte: Optional[Any] = None + "Amount must be greater than or equal to this value." + lte: Optional[Any] = None + "Amount must be less than or equal to this value." + + +class Int96Filter(BaseModel): + eq: Optional[Any] = None + "Must exactly equal this Int96 value" + gte: Optional[Any] = None + "Must be greater than or equal to this Int96 value" + lte: Optional[Any] = None + "Must be less than or equal to this Int96 value" + ne: Optional[Any] = None + "Must not equal this Int96 value" + + +class LedgerAccountClearingStatusFilter(BaseModel): + equal_to: Optional[LedgerAccountClearingStatus] = Field( + alias="equalTo", default=None + ) + "Results must match the specified clearing account status" + + +class LedgerAccountConditionInput(BaseModel): + """A set of conditions that a Ledger Account must meet for an operation to succeed.""" + + own_balance: Optional["Int96ConditionInput"] = Field( + alias="ownBalance", default=None + ) + "A condition that the ownBalance field must satisfy. Note that this condition always applies to the latest balance, not to balances at a specific date or time. See [Read balances](https://fragment.dev/read-balances) for more on the different types of Ledger Account balances." + total_balance: Optional["Int96ConditionInput"] = Field( + alias="totalBalance", default=None + ) + "A condition that the totalBalance field must satisfy. Note that this condition always applies to the latest balance, not to balances at a specific date or time. See [Read balances](https://fragment.dev/read-balances) for more on the different types of Ledger Account balances." + + +class LedgerAccountConsistencyConfigInput(BaseModel): + """The payload configuring the consistency for this Ledger Account. + See [Configure consistency](https://fragment.dev/guides/configure-consistency).""" + + groups: Optional[list["LedgerAccountGroupConsistencyConfigInput"]] = None + "The consistency configuration for Ledger Entry Groups affecting this account.\n\nSee [Configure consistency](https://fragment.dev/guides/configure-consistency)." + lines: Optional[LedgerLinesConsistencyMode] = None + "If set to `strong`, then a Ledger Account's `lines` updates will be strongly consistent with the API response.\nThis Ledger Account's balance will be updated and available for strongly consistent reads before you receive an API response.\n\nOtherwise if unset or set to `eventual`, `lines` updates are applied asynchronously and may not be immediately reflected in queries.\n\nSee [Configure consistency](https://fragment.dev/guides/configure-consistency)." + own_balance_updates: Optional[BalanceUpdateConsistencyMode] = Field( + alias="ownBalanceUpdates", default=None + ) + "If set to `strong`, then a Ledger Account's `ownBalance` updates will be strongly consistent with the API response.\nThis Ledger Account's balance will be updated and available for strongly consistent reads before you receive an API response.\n\nOtherwise if unset or set to `eventual`, `ownBalance` updates are applied asynchronously and may not be immediately reflected in queries.\n\nSee [Configure consistency](https://fragment.dev/guides/configure-consistency)." + total_balance_updates: Optional[BalanceUpdateConsistencyMode] = Field( + alias="totalBalanceUpdates", default=None + ) + "EXPERIMENTAL: If set to `strong`, then a Ledger Account's `totalBalance` updates will be strongly consistent with the API response.\nThis Ledger Account's balance will be updated and available for strongly consistent reads before you receive an API response.\n\nOtherwise if unset or set to `eventual`, `totalBalance` updates are applied asynchronously and may not be immediately reflected in queries.\n\nSee [Configure consistency](https://fragment.dev/guides/configure-consistency)." + + +class LedgerAccountDataMigrationsFilterSet(BaseModel): + account_path: Optional["StringFilter"] = Field(alias="accountPath", default=None) + "Filter by Ledger Account path." + status: Optional[LedgerDataMigrationStatus] = None + "Filter by the status of the data migration." + + +class LedgerAccountFilter(BaseModel): + equal_to: Optional["LedgerAccountMatchInput"] = Field(alias="equalTo", default=None) + "Result must match the specified Ledger Account" + in_: Optional[list["LedgerAccountMatchInput"]] = Field(alias="in", default=None) + "Results can match any of specified Ledger Accounts" + + +class LedgerAccountGroupConsistencyConfigInput(BaseModel): + """The consistency configuration for a specific Ledger Entry Group in this account.""" + + key: Any + "The group key for this configuration." + own_balance_updates: BalanceUpdateConsistencyMode = Field(alias="ownBalanceUpdates") + "If set to `strong`, then Ledger Entry Group `ownBalance`s updates for this account will be strongly consistent with the API response.\nThis Ledger Account's Ledger Entry Group balances will be updated and available for strongly consistent reads before you receive an API response.\n\nOtherwise if unset or set to `eventual`, Ledger Entry Group `ownBalance` updates are applied asynchronously and may not be immediately reflected in queries.\n\nSee [Configure consistency](https://fragment.dev/guides/configure-consistency)." + + +class LedgerAccountMatchInput(BaseModel): + """Specify a Ledger Account by using `id` or `path`. + + When specifying a Ledger Account by `path`, you must provide `ledger`.""" + + id: Optional[str] = None + "The FRAGMENT ID of the Ledger Account" + ledger: Optional["LedgerMatchInput"] = None + "The Ledger to which this Ledger Account belongs. This is required if you are specifying the Ledger Account by `path`." + path: Optional[str] = None + "The unique path of the Ledger Account.\nThis is a slash-delimited string containing the keys of an account and all its direct ancestors." + + +class LedgerAccountTypeFilter(BaseModel): + equal_to: Optional[LedgerAccountTypes] = Field(alias="equalTo", default=None) + "Results must be of the specified Ledger Account type" + in_: Optional[list[LedgerAccountTypes]] = Field(alias="in", default=None) + "Results can have any of the specified Ledger Account types" + + +class LedgerAccountsFilterSet(BaseModel): + clearing_status: Optional["LedgerAccountClearingStatusFilter"] = Field( + alias="clearingStatus", default=None + ) + "Use this to filter Ledger Accounts by their clearing account status" + earliest_posted: Optional["DateTimeFilter"] = Field( + alias="earliestPosted", default=None + ) + "Filter by the earliest posted timestamp across all currencies for clearing accounts. You must also provide clearingStatus in the same filter.\nOnly clearing accounts where the minimum posted timestamp (across all currencies) matches this filter will be included." + has_parent_ledger_account: Optional[bool] = Field( + alias="hasParentLedgerAccount", default=None + ) + "Use this to filter Ledger Accounts by their parent status" + is_linked_account: Optional[bool] = Field(alias="isLinkedAccount", default=None) + "Use this to filter Ledger Accounts by their linked status" + latest_posted: Optional["DateTimeFilter"] = Field( + alias="latestPosted", default=None + ) + "Filter by the latest posted timestamp across all currencies for clearing accounts. You must also provide clearingStatus in the same filter.\nOnly clearing accounts where the maximum posted timestamp (across all currencies) matches this filter will be included." + ledger_account: Optional["LedgerAccountFilter"] = Field( + alias="ledgerAccount", default=None + ) + "Use this to filter Ledger Accounts by their ID or path" + linked_account: Optional["ExternalAccountFilter"] = Field( + alias="linkedAccount", default=None + ) + "Use this to filter Ledger Accounts by their external linked account ID" + parent_ledger_account: Optional["LedgerAccountFilter"] = Field( + alias="parentLedgerAccount", default=None + ) + "Use this to filter Ledger Accounts by their parent account IDs" + path: Optional["StringMatchFilter"] = None + "A filter that must match the account path. Wildcards ('*') may be used only for template variables, and will only match a single variable each.\nFor example: 'assets-root/accounts-receivable/merchant:*' would match: 'assets-root/accounts-receivable/merchant:1' and 'assets-root/accounts-receivable/merchant:1/child'.\nWildcards may not be used outside of template variables. For example, passing in 'assets-root/*' as a filter is invalid and would raise a GraphQL error." + type_: Optional["LedgerAccountTypeFilter"] = Field(alias="type", default=None) + "Use this to filter Ledger Accounts by their type" + + +class LedgerEntriesFilterSet(BaseModel): + date: Optional["DateFilter"] = None + "Use this filter to filter Ledger Entries by their `posted` date." + group: Optional["GroupFilter"] = None + "Use this to filter Ledger Entries by groups. The response will include entries that contain or do not contain specific groups." + is_reversal: Optional[bool] = Field(alias="isReversal", default=None) + "Use this to filter Ledger Entries that were posted using `reverseLedgerEntry`." + is_reversed: Optional[bool] = Field(alias="isReversed", default=None) + "Use this to filter Ledger Entries that have been reversed." + ledger_entry: Optional["LedgerEntryFilter"] = Field( + alias="ledgerEntry", default=None + ) + "Use to filter Ledger Entries by their IDs or IKs." + posted: Optional["DateTimeFilter"] = None + "Use this filter to filter Ledger Entries by their `posted` timestamp." + show_hidden: Optional[bool] = Field(alias="showHidden", default=None) + "Use this filter to show hidden Ledger Entries." + tag: Optional["TagFilter"] = None + "Use this to filter Ledger Entries by tags. The response will include entries that contain tags matching the filter." + type_: Optional["StringFilter"] = Field(alias="type", default=None) + "Use this to filter Ledger Entries by type. Ledger Entry types are defined in Schemas." + type_version: Optional["StringFilter"] = Field(alias="typeVersion", default=None) + "Use this to filter Ledger Entries by their type version." + + +class LedgerEntryConditionInput(BaseModel): + """A set of pre-conditions and post-conditions that a Ledger Account balance must meet for an operation to succeed. You must specify at least one of `precondition` or `postcondition` for each condition.""" + + account: "LedgerAccountMatchInput" + "The Ledger Account that must satisfy the provided conditions." + currency: Optional["CurrencyMatchInput"] = None + "For Ledger Accounts in the `multi` currency mode, you must specify the currency of the balance affected by the condition. You only need to specify this field for multi-currency accounts." + postcondition: Optional["LedgerAccountConditionInput"] = None + "The conditions that must hold after the operation." + precondition: Optional["LedgerAccountConditionInput"] = None + "The conditions that must hold prior to the operation." + + +class LedgerEntryDataMigrationsFilterSet(BaseModel): + entry_type: Optional["StringFilter"] = Field(alias="entryType", default=None) + "Filter by Ledger Entry type." + status: Optional[LedgerDataMigrationStatus] = None + "Filter by the status of the data migration." + type_version: Optional["StringFilter"] = Field(alias="typeVersion", default=None) + "Filter by Ledger Entry type version." + + +class LedgerEntryFilter(BaseModel): + equal_to: Optional["LedgerEntryMatchInput"] = Field(alias="equalTo", default=None) + "Result must be the specified Ledger Entry." + in_: Optional[list["LedgerEntryMatchInput"]] = Field(alias="in", default=None) + "Result can be any of the specified Ledger Entries. Limited to 100 items maximum." + + +class LedgerEntryGroupBalanceFilter(BaseModel): + """Filter Ledger Entry Groups by their balance impact on a Ledger Account. If a group has a matching balance for the specified account, the group will be included in the results.""" + + account: "GroupBalanceAccountFilter" + "A Ledger Entry Group will be included in the result if it has a balance for the specified account. If 'account' is the only filter specified, then any non-null balance in any currency will match." + currency: Optional["CurrencyFilter"] = None + "A Ledger Entry Group will be included in the result if it has a balance for the specified account in the specified currency. If the 'ownBalance' filter is omitted then any non-null balance will match." + own_balance: Optional["Int96Filter"] = Field(alias="ownBalance", default=None) + "A Ledger Entry Group will be included in the result if it has a balance for the specified account that passes the specified value predicate. If the 'currency' filter is omitted then any balance in any currency that passes the predicate will match. If the 'currency' filter is included, the value predicate will only be evaluated against the specified currency. " + + +class LedgerEntryGroupBalanceFilterSet(BaseModel): + """Optional filters for querying balances on a Ledger Entry Group.""" + + account: Optional["GroupBalanceAccountFilter"] = None + "Filter to a subset of accounts" + currency: Optional["CurrencyFilter"] = None + "Filter to one or more currencies" + own_balance: Optional["Int96Filter"] = Field(alias="ownBalance", default=None) + "Filter to only balances in a certain range" + + +class LedgerEntryGroupInput(BaseModel): + key: Any + "The key of this group. Can be up to 128 characters long." + value: Any + "The value associated with this group's key. Can be up to 128 characters long." + + +class LedgerEntryGroupMatchInput(BaseModel): + key: Any + ledger: "LedgerMatchInput" + value: Any + + +class LedgerEntryGroupsFilterSet(BaseModel): + balance: Optional["LedgerEntryGroupBalanceFilter"] = None + "Filter Ledger Entry Groups by their balance impact on a Ledger Account. If a group has a matching balance for the specified account, the group will be included in the results." + created: Optional["DateTimeFilter"] = None + "Use to filter Ledger Entry Groups by their created timestamp" + key: Optional["StringFilter"] = None + "Use to filter Ledger Entry Groups by their key" + value: Optional["StringFilter"] = None + "Use to filter Ledger Entry Groups by their value" + + +class LedgerEntryInput(BaseModel): + """Ledger Entries are limited to 30 Ledger Lines.""" + + conditions: Optional[list["LedgerEntryConditionInput"]] = None + "Conditions that must be satisfied to post this Ledger Entry. The Ledger Entry will reject with a BadRequestError if any condition is not met. You can only add a condition on a Ledger Account containing a Line in this Ledger Entry." + description: Optional[str] = None + "If specified, will also be used as the description for LedgerLines unless they specify their own description." + groups: Optional[list["LedgerEntryGroupInput"]] = None + "Adds this Ledger Entry to this set of Ledger Entry Groups" + ledger: Optional["LedgerMatchInput"] = None + "The Ledger to which to post this Ledger Entry. Must be linked to a Schema that defines the provided Ledger Entry type." + lines: Optional[list["LedgerLineInput"]] = None + "The Ledger Lines to create as part of this Ledger Entry. This cannot be used with Ledger Entries that have a 'type' i.e. Ledger Entries defined in the Schema. This can be useful during non-routine operations such as an incident. It is not recommended to use 'lines' during routine operations." + parameters: Optional[Any] = None + "Parameters to be included in a templated Ledger Entry. All provided parameters must be present in the typed Ledger Entry within the Schema linked to the provided Ledger." + posted: Optional[Any] = None + 'ISO 8601 timestamp to post this Ledger Entry e.g. "2021-01-01" or "2021-01-01T16:45:00Z". Will error out if supplied to reconcileTx or createOrder since the transaction timestamp will be used instead' + tags: Optional[list["LedgerEntryTagInput"]] = None + "A set of tags attached to this Ledger Entry." + type_: Optional[str] = Field(alias="type", default=None) + "The type of the Ledger Entry. Must be defined in the Schema linked to the Ledger specified below." + type_version: Optional[int] = Field(alias="typeVersion", default=None) + "Experimental: This field is reserved for an upcoming feature and is not yet supported." + + +class LedgerEntryMatchInput(BaseModel): + """Specify a Ledger Entry by using `id`.""" + + id: Optional[str] = None + "The FRAGMENT ID of the Ledger Entry" + ik: Optional[Any] = None + "The IK provided to the `addLedgerEntry` mutation or the `ik` field returned from a `reconcileTx` mutation. This is required if you have not provided `id`." + ledger: Optional["LedgerMatchInput"] = None + "The FRAGMENT ID of the Ledger to which this Ledger Entry belongs. This is required if you have not provided `id`." + + +class LedgerEntryTagInput(BaseModel): + key: Any + "The key of this tag. Can be up to 128 characters long." + value: Any + "The value associated with this tag's key. Can be up to 128 characters long." + + +class LedgerLineInput(BaseModel): + account: "LedgerAccountMatchInput" + "The LedgerAccount this line is being added to" + amount: Optional[Any] = None + "A positive amount increases the balance of its LedgerAccount, a negative amount reduces the balance of its LedgerAccount" + currency: Optional["CurrencyMatchInput"] = None + "The currency the ledger line is in" + description: Optional[str] = None + "If not specified the description from the parent LedgerEntryInput will be used" + key: Optional[str] = None + "Optional identifier for Ledger Line. You can filter lines by key using [LedgerLinesFilterSet](https://fragment.dev/api-reference/api-types#filter-types-ledgerlinesfilterset)." + tags: Optional[list["LedgerEntryTagInput"]] = None + "A set of tags attached to this Ledger Line." + tx: Optional["TxMatchInput"] = None + "Required for reconcileTx to specify the transaction being reconciled, you can specify either the FRAGMENT ID or external ID of the transaction" + + +class LedgerLineMatchInput(BaseModel): + """Specify a Ledger Line by using `id`.""" + + id: str + "The FRAGMENT ID of the ledger line" + + +class LedgerLinesFilterSet(BaseModel): + created: Optional["DateTimeFilter"] = None + "Filter by the created timestamp of the Ledger Line. This is the wall-clock time when the Ledger Line was created." + currency: Optional["CurrencyFilter"] = None + "Filter by the currency of the Ledger Line." + date: Optional["DateFilter"] = None + "Use this filter to filter Ledger Lines by their `posted` date." + is_reversal: Optional[bool] = Field(alias="isReversal", default=None) + "Use this to filter Ledger Lines that were posted to this Ledger Account, using `reverseLedgerEntry`." + is_reversed: Optional[bool] = Field(alias="isReversed", default=None) + "Use this to filter Ledger Lines that have been reversed." + key: Optional["StringFilter"] = None + "Use this to filter Ledger Lines by key. Ledger Line keys are defined in Schemas." + ledger_account: Optional["LedgerAccountFilter"] = Field( + alias="ledgerAccount", default=None + ) + "Specify which Ledger Account to read lines from. Required when querying lines via `Ledger.lines` without a `path` filter. Not allowed when querying via `LedgerAccount.lines`." + path: Optional["StringMatchFilter"] = None + 'A filter that string matches the account path. Wildcards (\'*\') can be used to return lines across multiple accounts.\nTo search for all instances of a a Ledger Account template, use the `matches` filter with an wildcard character in place of the template value e.g. `assets/user:*`. This returns lines from all instances of this template, interleaved by `posted` timestamp.\nTo search for all descendant Ledger Accounts under a given path, use a trailing `/*` in the `matches` filter e.g. `assets/user:user-1>/*`. This returns lines from all descendants at any depth, but not lines from the parent account at `assets/user:user-1>`.\nTo OR multiple `matches` patterns and get a single paginated list, use `matchesAny` — e.g. `matchesAny: ["assets/user:user-1/*", "assets/user:user-2/*"]` returns descendants of both prefixes interleaved by `posted` timestamp.\nCannot be combined with `ledgerAccount` filter. Not allowed when querying via `LedgerAccount.lines`. You cannot use wildcards for both descendant and template instance matching in the same query.' + posted: Optional["DateTimeFilter"] = None + "Use this filter to filter Ledger Lines by their `posted` timestamp." + show_hidden: Optional[bool] = Field(alias="showHidden", default=None) + "Use this filter to find hidden Ledger Lines." + tag: Optional["TagFilter"] = None + "Filter Ledger Lines by tag. Only matches lines that have the specified tags attached directly to them." + type_: Optional["TxTypeFilter"] = Field(alias="type", default=None) + + +class LedgerMatchInput(BaseModel): + """Specify a Ledger by using `id` or `ik`.""" + + id: Optional[str] = None + "The FRAGMENT ID of the Ledger" + ik: Optional[Any] = None + "The IK passed into the [createLedger](/api-reference/api-mutations#createledger) mutation. This is treated as a second unique identifier for this Ledger." + + +class LedgerTypeFilter(BaseModel): + equal_to: Optional[LedgerTypes] = Field(alias="equalTo", default=None) + in_: Optional[list[LedgerTypes]] = Field(alias="in", default=None) + "Must match one of the values provided. Limited to 100 items maximum." + + +class LedgersFilterSet(BaseModel): + has_schema: Optional[bool] = Field(alias="hasSchema", default=None) + type_: Optional["LedgerTypeFilter"] = Field(alias="type", default=None) + + +class LinkMatchInput(BaseModel): + id: str + + +class MigrateLedgerEntryInput(BaseModel): + """An object defining the input for migrating a Ledger Entry.""" + + id: str + "The Ledger Entry to migrate" + new_ledger_entry: "LedgerEntryInput" = Field(alias="newLedgerEntry") + "The Ledger Entry you want to migrate it to" + + +class SceneEntryInput(BaseModel): + """A simulated Ledger Entry posted as a part of a Scene.""" + + parameters: Optional[Any] = None + "Any parameters to be used as inputs to this simulated Ledger Entry." + type_: Any = Field(alias="type") + "The type of the simulated Ledger Entry. Must match one of the types provided in schema.ledgerEntries.types." + type_version: Optional[int] = Field(alias="typeVersion", default=None) + "The version of the Ledger Entry type." + + +class SceneEventInput(BaseModel): + entry: "SceneEntryInput" + "The simulated Ledger Entry." + event_type: SceneEventType = Field(alias="eventType") + "The type of the Scene Event. Currently, only entries are supported." + + +class SceneInput(BaseModel): + events: list["SceneEventInput"] + "A list of simulated ledger entries that make up the Scene." + name: str + "The human-readable name of the Scene." + + +class SchemaConditionInput(BaseModel): + """A condition that must be met on a Ledger Account balance. The condition can be + either a `precondition` or `postcondition`.""" + + own_balance: Optional["SchemaInt96ConditionInput"] = Field( + alias="ownBalance", default=None + ) + "A condition on the `ownBalance` of the Ledger Account." + total_balance: Optional["SchemaInt96ConditionInput"] = Field( + alias="totalBalance", default=None + ) + "A condition on the `totalBalance` of the Ledger Account." + + +class SchemaConsistencyConfigInput(BaseModel): + """The consistency configuration for entities created within Ledgers created by this Schema. + + See [Configure consistency](https://fragment.dev/guides/configure-consistency).""" + + entries: Optional[SchemaConsistencyMode] = None + "The consistency mode for the Ledger Entries list query within Ledgers created by this Schema.\n\nSee [Configure consistency](https://fragment.dev/guides/configure-consistency)." + + +class SchemaCurrencyMatchInput(BaseModel): + """Matches a Currency. Can be a built-in [CurrencyCode](https://fragment.dev/api-reference/api-types#scalars-and-enums-currencycode), custom Currency, or a parameterized string. + If you supply a parameterized string, you must pass in a valid CurrencyCode as a parameter when posting a Ledger Entry. + """ + + code: Any + "The currency code. This must either be a [CurrencyCode](https://fragment.dev/api-reference/api-types#scalars-and-enums-currencycode) or a parameterized string that resolves to a CurrencyCode ." + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId", default=None) + "The ID for a custom currency. This is specified when creating the custom currency using the [createCustomCurrency](https://fragment.dev/api-reference/api-mutations#createcustomcurrency) mutation." + + +class SchemaExternalAccountMatchInput(BaseModel): + external_id: Optional[Any] = Field(alias="externalId", default=None) + "The External systems's ID of the account" + id: Optional[Any] = None + "The FRAGMENT ID of the external account" + link_id: Optional[Any] = Field(alias="linkId", default=None) + "The FRAGMENT ID of the link" + link_type: Optional[LinkType] = Field(alias="linkType", default=None) + "The type of Link this external account belongs to. Must be one of: IncreaseLink, UnitLink, CustomLink, or StripeLink." + + +class SchemaInput(BaseModel): + """Input to the API for creating a Schema.""" + + chart_of_accounts: "ChartOfAccountsInput" = Field(alias="chartOfAccounts") + "The Chart of Accounts for the Schema." + consistency_config: Optional["SchemaConsistencyConfigInput"] = Field( + alias="consistencyConfig", default=None + ) + "The consistency configuration for this Schema." + groups: Optional[list["GroupInput"]] = None + "Any groups associated with this Schema." + key: Any + "The key of the Schema. This is a stable, unique identifier for the Schema. Uniqueness is enforced at the Workspace level." + ledger_entries: Optional["SchemaLedgerEntriesInput"] = Field( + alias="ledgerEntries", default=None + ) + "The Ledger Entries to add to the Schema." + name: Optional[Any] = None + "The human-readable name of the Schema." + scenes: Optional[list["SceneInput"]] = None + "Any scenes associated with this Schema." + + +class SchemaInt96ConditionInput(BaseModel): + """A condition that must be met on a field.""" + + eq: Optional[Any] = None + "Amount must be exactly equal to this value. You may not specify this alongside `gte` or `lte`." + gte: Optional[Any] = None + "Amount must be greater than or equal to this value." + lte: Optional[Any] = None + "Amount must be less than or equal to this value." + + +class SchemaLedgerAccountInput(BaseModel): + """Models a Ledger Account in a Schema. + Upon successfully storing a [Schema](https://fragment.dev/api-reference/api-types#core-types-schema), a [LedgerAccount](https://fragment.dev/api-reference/api-types#core-types-ledgeraccount) will be created for + each corresponding non-templated `SchemaLedgerAccountInput` in your Chart of Accounts. + """ + + children: Optional[list["SchemaLedgerAccountInput"]] = None + "Ledger Accounts to create as children of this Ledger Account. Ledger Accounts may be nested up to a maximum depth of 10." + clearing: Optional[bool] = None + "EXPERIMENTAL: Whether or not this Ledger Account is a Clearing Account.\nClearing Accounts have balances that should tend to zero. They are used to track in-progress workflows and payments." + consistency_config: Optional["LedgerAccountConsistencyConfigInput"] = Field( + alias="consistencyConfig", default=None + ) + "The consistency configuration for this ledger account. See [Configure consistency](https://fragment.dev/guides/configure-consistency)." + currency: Optional["SchemaCurrencyMatchInput"] = None + "The currency of this Ledger Account. If this is not set, and `currencyMode` is\nnot set to `multi`, it is derived from the Chart of Accounts' default." + currency_mode: Optional[CurrencyMode] = Field(alias="currencyMode", default=None) + "If set to `multi`, creates a multi-currency Ledger Account. If set to `single`, creates a single-currency Ledger Account." + key: Any + "The key of this Ledger Account. Keys are used to formulate the unique path of the Ledger Account in your Chart of Accounts.\nSiblings must have unique keys." + linked_account: Optional["SchemaExternalAccountMatchInput"] = Field( + alias="linkedAccount", default=None + ) + "The External Account to link to this Ledger Account.\nIt must be provided of `linked` is true." + name: Optional[Any] = None + "The human-readable name of this Ledger Account." + payment: Optional["SchemaPaymentInput"] = None + "EXPERIMENTAL: Marks this as a Payment Account." + status: Optional[SchemaLedgerAccountStatus] = None + "The status of this Ledger Account. Defaults to active." + template: Optional[bool] = None + "Whether or not this Ledger Account should be templated." + type_: Optional[LedgerAccountTypes] = Field(alias="type", default=None) + "The type of ledger account to create. Required if this is a top-level Ledger Account. If not provided, the type will be inferred from the parent." + + +class SchemaLedgerAccountMatchInput(BaseModel): + """Matches a Ledger Account in a Schema.""" + + path: Any + 'The unique path of the Ledger Account in the Schema.\nThis is a slash-delimited string containing the keys of a Ledger Account and all its direct ancestors.\nex: expense-root/subscriptions/netflix\nFor Templated Ledger Accounts, you must supply a parameter in the path that will be used to name an instance of the template.\nex: `"expense-root/subscriptions/vendor:{{vendor_name}}"`' + + +class SchemaLedgerEntriesInput(BaseModel): + """The Ledger Entries in your Schema.""" + + types: list["SchemaLedgerEntryInput"] + "A list of Ledger Entry definitions." + + +class SchemaLedgerEntryConditionInput(BaseModel): + """A condition that must be met on a Ledger Account when a Ledger Entry is posted.""" + + account: "SchemaLedgerAccountMatchInput" + "The Ledger Account to apply the condition to." + currency: Optional["SchemaCurrencyMatchInput"] = None + "The currency of the balance to apply the condition to. Required if the Ledger Account matched is a multi-currency Ledger Account.\nOtherwise, this field is defaults to the Ledger Account's currency." + postcondition: Optional["SchemaConditionInput"] = None + "A `postcondition` must be met after the Ledger Entry updates are applied." + precondition: Optional["SchemaConditionInput"] = None + "A `precondition` must be met before any Ledger Entry updates are applied." + repeated: Optional["SchemaRepeatedConfigInput"] = None + "Repeated expansion configuration. When set, this condition is expanded at runtime for each element\nin the array parameter named by the key." + + +class SchemaLedgerEntryGroupInput(BaseModel): + """A Ledger Entry Group associated with a Ledger Entry type.""" + + key: Any + "The key for this Ledger Entry Group." + value: Any + "The value associated with this Ledger Entry Group." + + +class SchemaLedgerEntryInput(BaseModel): + """A Ledger Entry in a Schema. All Ledger Entries defined in a Schema must have a unique `type`.""" + + conditions: Optional[list["SchemaLedgerEntryConditionInput"]] = None + "Conditions that must be satisfied to post this Ledger Entry. The Ledger Entry will reject with a BadRequestError if any condition is not met. You can only add a condition on a Ledger Account containing a Line in this Ledger Entry." + description: Optional[Any] = None + "Human-readable description of the Ledger Entry." + groups: Optional[list["SchemaLedgerEntryGroupInput"]] = None + "Ledger Entries posted with this type will be in these Ledger Entry Groups." + lines: Optional[list["SchemaLedgerLineInput"]] = None + "The Ledger Lines in the Ledger Entry.\nIf provided, when posting a Typed Entry, a [LedgerEntry](https://fragment.dev/api-reference/api-types#core-types-ledgerline) will be posted containing [LedgerLines](https://fragment.dev/api-reference/api-types#core-types-ledgerline) corresponding\nto the values you provide here. If your lines contain parameters, you must supply values for those parameters that balance out the Ledger Entry. If not provided, lines will be required when posting a Typed Entry." + parameters: Optional[Any] = None + "Fixed partial set of parameters to be included in a templated Ledger Entry." + post_lines_as: Optional[PostLinesAs] = Field(alias="postLinesAs", default=None) + "Controls how lines are posted. When set to `net_amounts`, all lines targeting the same account, currency, and tx are aggregated into a single line with the net amount, and lines that sum to zero are skipped. When set to `skip_zero_lines`, lines with a zero amount are skipped but not aggregated. In both modes, if all lines are zero, no lines are skipped. When set to `raw_lines`, lines are posted as-is without aggregation. New entries created via the dashboard default to `net_amounts`. Existing entries without this field set are treated as `raw_lines`." + status: Optional[SchemaLedgerEntryStatus] = None + "The status of this Ledger Entry. Defaults to active." + tags: Optional[list["SchemaLedgerEntryTagInput"]] = None + "Ledger Entries posted with this type will be associated with these tags." + type_: Any = Field(alias="type") + "The type of this Ledger Entry. This is a stable, unique identifier for this entry. Uniqueness is enforced at the Schema level.\nYou can filter on this field when querying for Ledger Entries. See the docs on [LedgerEntryFilterSet](https://fragment.dev/api-reference/api-types#filter-types-ledgerentriesfilterset)" + type_version: Optional[int] = Field(alias="typeVersion", default=None) + "The version of the Ledger Entry type." + + +class SchemaLedgerEntryTagInput(BaseModel): + """A tag associated with a Ledger Entry type.""" + + key: Any + "The key for this tag." + value: Any + "The value associated with the given key for this tag." + + +class SchemaLedgerLineInput(BaseModel): + """A Ledger Line in a Ledger Entry.""" + + account: "SchemaLedgerAccountMatchInput" + "The Ledger Account this Ledger Line will be posted to.\nIt supports parameters in its attributes via handlebars syntax." + amount: Optional[Any] = None + "The amount of the Ledger Line. It supports parameters via the handlebars syntax and addition (+) and subtraction (-)." + currency: Optional["SchemaCurrencyMatchInput"] = None + "The currency of the Ledger Line. This is required if the Ledger Account has currencyMode multi.\nIt supports parameters in its attributes via handlebars syntax." + description: Optional[Any] = None + "Human-readable description of the line." + key: Any + "The key for the Ledger Line. Ledger Line keys must be unique within a Ledger Entry. Key can be filtered on as part of the LedgerLinesFilterSet." + repeated: Optional["SchemaRepeatedConfigInput"] = None + "Repeated expansion configuration. When set, this line is expanded at runtime for each element\nin the array parameter named by the key." + tags: Optional[list["SchemaLedgerEntryTagInput"]] = None + "Tags to attach to this Ledger Line. Supports parameterized values via handlebars syntax." + tx: Optional["SchemaTxMatchInput"] = None + "The external transaction to reconcile.\nThis field is required if the Ledger Account being posted to is a Linked Ledger Account. Otherwise, this field is disallowed.\nIt supports parameters in its attributes via handlebars syntax.\n\nSee the docs on [reconciling payments](https://fragment.dev/guides/reconcile-payments)." + + +class SchemaMatchInput(BaseModel): + """An object used to retrieve a Schema.""" + + key: Any + "The key to retrieve a Schema by.\n`key` is unique to a Workspace." + version: Optional[int] = None + "Optional parameter to specify version of requested Schema. If not provided, it defaults to 0, representing the latest available version for the provided Schema key." + + +class SchemaPaymentInput(BaseModel): + """EXPERIMENTAL: Marks a Ledger Account as a Payment Account.""" + + penguin: bool + + +class SchemaRepeatedConfigInput(BaseModel): + """Configuration for repeated expansion of a line or condition. The key names a client-supplied + array parameter whose elements each generate one copy of the line or condition at runtime. + """ + + key: Any + "The key of the array parameter whose elements expand this line or condition." + + +class SchemaTxMatchInput(BaseModel): + """Matches a transaction at an external system. + This is used to specify the transaction being reconciled into a Linked Ledger Account + """ + + external_id: Optional[Any] = Field(alias="externalId", default=None) + "The external system's ID for the transaction." + id: Optional[Any] = None + "The FRAGMENT ID for the transaction." + + +class StringFilter(BaseModel): + equal_to: Optional[str] = Field(alias="equalTo", default=None) + in_: Optional[list[str]] = Field(alias="in", default=None) + "Must match one of the values provided. Limited to 100 items maximum." + not_equal_to: Optional[str] = Field(alias="notEqualTo", default=None) + "Must not equal this string value" + not_in: Optional[list[str]] = Field(alias="notIn", default=None) + "Must not match any of the values provided. Limited to 100 items maximum." + + +class StringMatchFilter(BaseModel): + contains: Optional[str] = None + "Must contain the provided pattern somewhere within the string. For example, 'contains: hat' will match 'hat', 'chat', and 'hate'." + equal_to: Optional[str] = Field(alias="equalTo", default=None) + "Must exactly equal the provided value" + in_: Optional[list[str]] = Field(alias="in", default=None) + "Must exactly equal one of the provided values. Limited to 100 items maximum." + matches: Optional[str] = None + 'Must match the provided pattern. Wildcards ("*") will match any substring' + matches_any: Optional[list[str]] = Field(alias="matchesAny", default=None) + "Must match any one of the provided `matches` patterns, OR-ed together — results are returned as a single paginated list. Each entry uses the same wildcard grammar as `matches`. Cannot be combined with `matches`. Limited to 100 entries." + + +class TagFilter(BaseModel): + """Filters a result set based on the tags it contains.""" + + all: Optional[list["TagMatchInput"]] = None + "Matches entries that have ALL of the specified tags. The key and value are both matched exactly. Limited to 10 items maximum." + contains: Optional["TagMatchInput"] = None + "Matches tag values based on the existence of the provided string within the tag value. The key is matched exactly." + equal_to: Optional["TagMatchInput"] = Field(alias="equalTo", default=None) + "Matches tags based on the exact value provided. The key and value are both matched exactly." + in_: Optional[list["TagMatchInput"]] = Field(alias="in", default=None) + "Matches tags based on a list of possible tag matches. The key and value are both matched exactly. Limited to 100 items maximum." + key_equal_to: Optional[Any] = Field(alias="keyEqualTo", default=None) + "Matches tags where the key exactly equals the provided value." + key_in: Optional[list[Any]] = Field(alias="keyIn", default=None) + "Matches tags where the key matches any of the provided values. Limited to 100 items maximum." + not_equal_to: Optional["TagMatchInput"] = Field(alias="notEqualTo", default=None) + "Matches tags that do not equal the provided value. The key and value are both matched exactly." + not_in: Optional[list["TagMatchInput"]] = Field(alias="notIn", default=None) + "Matches tags that do not match any of the provided values. The key and value are both matched exactly. Limited to 100 items maximum." + not_key_equal_to: Optional[Any] = Field(alias="notKeyEqualTo", default=None) + "Matches tags where the key does not equal the provided value." + not_key_in: Optional[list[Any]] = Field(alias="notKeyIn", default=None) + "Matches tags where the key does not match any of the provided values. Limited to 100 items maximum." + + +class TagMatchInput(BaseModel): + """Specifies a single tag that an entity is expected to have. You must specify both the key and the value.""" + + key: Any + "The key of this tag." + value: Any + "The value associated with this tag's key." + + +class TxMatchInput(BaseModel): + """Specify a Tx by using `id` or `externalId`, the Link it belongs to by `linkId`, and the External Account it is a part of by `accountId` or `externalAccountId`.""" + + account_id: Optional[str] = Field(alias="accountId", default=None) + "The FRAGMENT ID of the external account" + external_account_id: Optional[str] = Field(alias="externalAccountId", default=None) + "The external system's ID for the account" + external_id: Optional[str] = Field(alias="externalId", default=None) + "The external system's ID for the transaction" + id: Optional[str] = None + "The FRAGMENT ID of the transaction" + link_id: Optional[str] = Field(alias="linkId", default=None) + "The FRAGMENT ID of the link" + + +class TxTypeFilter(BaseModel): + equal_to: Optional[TxType] = Field(alias="equalTo", default=None) + in_: Optional[list[TxType]] = Field(alias="in", default=None) + "Must match one of the values provided. Limited to 100 items maximum." + + +class UpdateLedgerAccountInput(BaseModel): + consistency_config: Optional["LedgerAccountConsistencyConfigInput"] = Field( + alias="consistencyConfig", default=None + ) + "The consistency configuration for this ledger account. This defines how updates to this ledger account's balance are handled." + name: Optional[str] = None + "The name to update the ledger account to" + + +class UpdateLedgerEntryInput(BaseModel): + groups: Optional[list["LedgerEntryGroupInput"]] = None + "The list of Groups to add to this Ledger Entry." + tags: Optional[list["LedgerEntryTagInput"]] = None + "The list of Tags to add and/or update on this Ledger Entry." + tags_to_remove: Optional[list["LedgerEntryTagInput"]] = Field( + alias="tagsToRemove", default=None + ) + "The list of Tags to remove from this Ledger Entry." + + +class UpdateLedgerInput(BaseModel): + name: Optional[str] = None + "The new Ledger name. " + + +AddLedgerEntryInput.model_rebuild() +ChartOfAccountsInput.model_rebuild() +CreateLedgerAccountInput.model_rebuild() +CreateLedgerAccountsInput.model_rebuild() +CurrencyFilter.model_rebuild() +CustomAccountInput.model_rebuild() +CustomTxInput.model_rebuild() +ExternalAccountFilter.model_rebuild() +GroupBalanceAccountFilter.model_rebuild() +GroupFilter.model_rebuild() +GroupInput.model_rebuild() +GroupReconciliationParametersInput.model_rebuild() +LedgerAccountConditionInput.model_rebuild() +LedgerAccountConsistencyConfigInput.model_rebuild() +LedgerAccountDataMigrationsFilterSet.model_rebuild() +LedgerAccountFilter.model_rebuild() +LedgerAccountMatchInput.model_rebuild() +LedgerAccountsFilterSet.model_rebuild() +LedgerEntriesFilterSet.model_rebuild() +LedgerEntryConditionInput.model_rebuild() +LedgerEntryDataMigrationsFilterSet.model_rebuild() +LedgerEntryFilter.model_rebuild() +LedgerEntryGroupBalanceFilter.model_rebuild() +LedgerEntryGroupBalanceFilterSet.model_rebuild() +LedgerEntryGroupMatchInput.model_rebuild() +LedgerEntryGroupsFilterSet.model_rebuild() +LedgerEntryInput.model_rebuild() +LedgerEntryMatchInput.model_rebuild() +LedgerLineInput.model_rebuild() +LedgerLinesFilterSet.model_rebuild() +LedgersFilterSet.model_rebuild() +MigrateLedgerEntryInput.model_rebuild() +SceneEventInput.model_rebuild() +SceneInput.model_rebuild() +SchemaConditionInput.model_rebuild() +SchemaInput.model_rebuild() +SchemaLedgerAccountInput.model_rebuild() +SchemaLedgerEntriesInput.model_rebuild() +SchemaLedgerEntryConditionInput.model_rebuild() +SchemaLedgerEntryInput.model_rebuild() +SchemaLedgerLineInput.model_rebuild() +TagFilter.model_rebuild() +UpdateLedgerAccountInput.model_rebuild() +UpdateLedgerEntryInput.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/list_ledger_account_balances.py b/tests/snapshots/001-marketing-schema/sdk/list_ledger_account_balances.py new file mode 100644 index 0000000..af7235b --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/list_ledger_account_balances.py @@ -0,0 +1,53 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel +from .enums import LedgerAccountTypes + + +class ListLedgerAccountBalances(BaseModel): + ledger: Optional["ListLedgerAccountBalancesLedger"] + + +class ListLedgerAccountBalancesLedger(BaseModel): + id: str + ik: Any + name: str + created: Any + ledger_accounts: "ListLedgerAccountBalancesLedgerLedgerAccounts" = Field( + alias="ledgerAccounts" + ) + + +class ListLedgerAccountBalancesLedgerLedgerAccounts(BaseModel): + nodes: list["ListLedgerAccountBalancesLedgerLedgerAccountsNodes"] + page_info: "ListLedgerAccountBalancesLedgerLedgerAccountsPageInfo" = Field( + alias="pageInfo" + ) + + +class ListLedgerAccountBalancesLedgerLedgerAccountsNodes(BaseModel): + id: str + path: str + name: Optional[str] + type_: LedgerAccountTypes = Field(alias="type") + created: Any + own_balance: Any = Field(alias="ownBalance") + child_balance: Any = Field(alias="childBalance") + balance: Any + + +class ListLedgerAccountBalancesLedgerLedgerAccountsPageInfo(BaseModel): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +ListLedgerAccountBalances.model_rebuild() +ListLedgerAccountBalancesLedger.model_rebuild() +ListLedgerAccountBalancesLedgerLedgerAccounts.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/list_ledger_accounts.py b/tests/snapshots/001-marketing-schema/sdk/list_ledger_accounts.py new file mode 100644 index 0000000..4bc0d1c --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/list_ledger_accounts.py @@ -0,0 +1,50 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel +from .enums import LedgerAccountTypes + + +class ListLedgerAccounts(BaseModel): + ledger: Optional["ListLedgerAccountsLedger"] + + +class ListLedgerAccountsLedger(BaseModel): + id: str + ik: Any + name: str + created: Any + ledger_accounts: "ListLedgerAccountsLedgerLedgerAccounts" = Field( + alias="ledgerAccounts" + ) + + +class ListLedgerAccountsLedgerLedgerAccounts(BaseModel): + nodes: list["ListLedgerAccountsLedgerLedgerAccountsNodes"] + page_info: "ListLedgerAccountsLedgerLedgerAccountsPageInfo" = Field( + alias="pageInfo" + ) + + +class ListLedgerAccountsLedgerLedgerAccountsNodes(BaseModel): + id: str + path: str + name: Optional[str] + type_: LedgerAccountTypes = Field(alias="type") + created: Any + + +class ListLedgerAccountsLedgerLedgerAccountsPageInfo(BaseModel): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +ListLedgerAccounts.model_rebuild() +ListLedgerAccountsLedger.model_rebuild() +ListLedgerAccountsLedgerLedgerAccounts.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/list_ledger_entries.py b/tests/snapshots/001-marketing-schema/sdk/list_ledger_entries.py new file mode 100644 index 0000000..9cb1e74 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/list_ledger_entries.py @@ -0,0 +1,58 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel + + +class ListLedgerEntries(BaseModel): + ledger: Optional["ListLedgerEntriesLedger"] + + +class ListLedgerEntriesLedger(BaseModel): + ledger_entries: "ListLedgerEntriesLedgerLedgerEntries" = Field( + alias="ledgerEntries" + ) + + +class ListLedgerEntriesLedgerLedgerEntries(BaseModel): + nodes: list["ListLedgerEntriesLedgerLedgerEntriesNodes"] + page_info: "ListLedgerEntriesLedgerLedgerEntriesPageInfo" = Field(alias="pageInfo") + + +class ListLedgerEntriesLedgerLedgerEntriesNodes(BaseModel): + ik: str + type_: Optional[Any] = Field(alias="type") + posted: Any + lines: "ListLedgerEntriesLedgerLedgerEntriesNodesLines" + + +class ListLedgerEntriesLedgerLedgerEntriesNodesLines(BaseModel): + nodes: list["ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodes"] + + +class ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodes(BaseModel): + amount: Any + account: "ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodesAccount" + + +class ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodesAccount(BaseModel): + path: str + + +class ListLedgerEntriesLedgerLedgerEntriesPageInfo(BaseModel): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +ListLedgerEntries.model_rebuild() +ListLedgerEntriesLedger.model_rebuild() +ListLedgerEntriesLedgerLedgerEntries.model_rebuild() +ListLedgerEntriesLedgerLedgerEntriesNodes.model_rebuild() +ListLedgerEntriesLedgerLedgerEntriesNodesLines.model_rebuild() +ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodes.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/list_ledger_entry_group_balances.py b/tests/snapshots/001-marketing-schema/sdk/list_ledger_entry_group_balances.py new file mode 100644 index 0000000..9bf9da9 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/list_ledger_entry_group_balances.py @@ -0,0 +1,57 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel +from .enums import CurrencyCode + + +class ListLedgerEntryGroupBalances(BaseModel): + ledger_entry_group: Optional["ListLedgerEntryGroupBalancesLedgerEntryGroup"] = ( + Field(alias="ledgerEntryGroup") + ) + + +class ListLedgerEntryGroupBalancesLedgerEntryGroup(BaseModel): + key: Any + value: Any + created: Optional[Any] + balances: "ListLedgerEntryGroupBalancesLedgerEntryGroupBalances" + + +class ListLedgerEntryGroupBalancesLedgerEntryGroupBalances(BaseModel): + nodes: list["ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodes"] + page_info: "ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesPageInfo" = Field( + alias="pageInfo" + ) + + +class ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodes(BaseModel): + account: "ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodesAccount" + currency: "ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodesCurrency" + own_balance: Any = Field(alias="ownBalance") + + +class ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodesAccount(BaseModel): + path: str + + +class ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodesCurrency(BaseModel): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +class ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesPageInfo(BaseModel): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +ListLedgerEntryGroupBalances.model_rebuild() +ListLedgerEntryGroupBalancesLedgerEntryGroup.model_rebuild() +ListLedgerEntryGroupBalancesLedgerEntryGroupBalances.model_rebuild() +ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodes.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/list_multi_currency_ledger_account_balances.py b/tests/snapshots/001-marketing-schema/sdk/list_multi_currency_ledger_account_balances.py new file mode 100644 index 0000000..6b1df06 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/list_multi_currency_ledger_account_balances.py @@ -0,0 +1,130 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Optional + +from pydantic import Field + +from .base_model import BaseModel +from .enums import CurrencyCode, LedgerAccountTypes + + +class ListMultiCurrencyLedgerAccountBalances(BaseModel): + ledger: Optional["ListMultiCurrencyLedgerAccountBalancesLedger"] + + +class ListMultiCurrencyLedgerAccountBalancesLedger(BaseModel): + id: str + ik: Any + name: str + created: Any + ledger_accounts: "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccounts" = ( + Field(alias="ledgerAccounts") + ) + + +class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccounts(BaseModel): + nodes: list["ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes"] + page_info: "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsPageInfo" = ( + Field(alias="pageInfo") + ) + + +class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes(BaseModel): + id: str + path: str + name: Optional[str] + type_: LedgerAccountTypes = Field(alias="type") + created: Any + own_balances: ( + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalances" + ) = Field(alias="ownBalances") + child_balances: ( + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalances" + ) = Field(alias="childBalances") + balances: "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalances" + + +class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalances( + BaseModel +): + nodes: list[ + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodes" + ] + + +class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodes( + BaseModel +): + currency: "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodesCurrency" + amount: Any + + +class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodesCurrency( + BaseModel +): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalances( + BaseModel +): + nodes: list[ + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodes" + ] + + +class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodes( + BaseModel +): + currency: "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodesCurrency" + amount: Any + + +class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodesCurrency( + BaseModel +): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalances( + BaseModel +): + nodes: list[ + "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodes" + ] + + +class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodes( + BaseModel +): + currency: "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodesCurrency" + amount: Any + + +class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodesCurrency( + BaseModel +): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsPageInfo(BaseModel): + has_next_page: bool = Field(alias="hasNextPage") + end_cursor: Optional[str] = Field(alias="endCursor") + has_previous_page: bool = Field(alias="hasPreviousPage") + start_cursor: Optional[str] = Field(alias="startCursor") + + +ListMultiCurrencyLedgerAccountBalances.model_rebuild() +ListMultiCurrencyLedgerAccountBalancesLedger.model_rebuild() +ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccounts.model_rebuild() +ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes.model_rebuild() +ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalances.model_rebuild() +ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodes.model_rebuild() +ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalances.model_rebuild() +ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodes.model_rebuild() +ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalances.model_rebuild() +ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodes.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/migrate_ledger_entry.py b/tests/snapshots/001-marketing-schema/sdk/migrate_ledger_entry.py new file mode 100644 index 0000000..3a3bb56 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/migrate_ledger_entry.py @@ -0,0 +1,165 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class MigrateLedgerEntry(BaseModel): + migrate_ledger_entry: Union[ + "MigrateLedgerEntryMigrateLedgerEntryBadRequestError", + "MigrateLedgerEntryMigrateLedgerEntryInternalError", + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResult", + ] = Field(alias="migrateLedgerEntry", discriminator="typename__") + + +class MigrateLedgerEntryMigrateLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class MigrateLedgerEntryMigrateLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResult(BaseModel): + typename__: Literal["MigrateLedgerEntryResult"] = Field(alias="__typename") + reversing_ledger_entry: ( + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntry" + ) = Field(alias="reversingLedgerEntry") + reversed_ledger_entry: ( + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntry" + ) = Field(alias="reversedLedgerEntry") + new_ledger_entry: ( + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntry" + ) = Field(alias="newLedgerEntry") + is_ik_replay: bool = Field(alias="isIkReplay") + + +class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntry( + BaseModel +): + ik: str + id: str + created: Any + posted: Any + type_: Optional[Any] = Field(alias="type") + description: Optional[str] + reversed_at: Optional[Any] = Field(alias="reversedAt") + hidden: bool + lines: "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLines" + + +class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLines( + BaseModel +): + nodes: list[ + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodes" + ] + + +class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodes( + BaseModel +): + id: str + amount: Any + account: "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodesAccount" + + +class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodesAccount( + BaseModel +): + path: str + + +class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntry( + BaseModel +): + ik: str + id: str + created: Any + posted: Any + type_: Optional[Any] = Field(alias="type") + description: Optional[str] + reversed_at: Optional[Any] = Field(alias="reversedAt") + hidden: bool + lines: "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLines" + + +class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLines( + BaseModel +): + nodes: list[ + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLinesNodes" + ] + + +class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLinesNodes( + BaseModel +): + id: str + amount: Any + account: "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLinesNodesAccount" + + +class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLinesNodesAccount( + BaseModel +): + path: str + + +class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntry( + BaseModel +): + ik: str + id: str + created: Any + posted: Any + type_: Optional[Any] = Field(alias="type") + description: Optional[str] + reversed_at: Optional[Any] = Field(alias="reversedAt") + hidden: bool + lines: "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLines" + + +class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLines( + BaseModel +): + nodes: list[ + "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLinesNodes" + ] + + +class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLinesNodes( + BaseModel +): + id: str + amount: Any + account: "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLinesNodesAccount" + + +class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLinesNodesAccount( + BaseModel +): + path: str + + +MigrateLedgerEntry.model_rebuild() +MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResult.model_rebuild() +MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntry.model_rebuild() +MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLines.model_rebuild() +MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodes.model_rebuild() +MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntry.model_rebuild() +MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLines.model_rebuild() +MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLinesNodes.model_rebuild() +MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntry.model_rebuild() +MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLines.model_rebuild() +MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLinesNodes.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/post_card_settle.py b/tests/snapshots/001-marketing-schema/sdk/post_card_settle.py new file mode 100644 index 0000000..e0298c5 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/post_card_settle.py @@ -0,0 +1,86 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel +from .enums import CurrencyCode + + +class PostCardSettle(BaseModel): + add_ledger_entry: Union[ + "PostCardSettleAddLedgerEntryAddLedgerEntryResult", + "PostCardSettleAddLedgerEntryBadRequestError", + "PostCardSettleAddLedgerEntryInternalError", + ] = Field(alias="addLedgerEntry", discriminator="typename__") + + +class PostCardSettleAddLedgerEntryAddLedgerEntryResult(BaseModel): + typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") + entry: "PostCardSettleAddLedgerEntryAddLedgerEntryResultEntry" + lines: list["PostCardSettleAddLedgerEntryAddLedgerEntryResultLines"] + is_ik_replay: bool = Field(alias="isIkReplay") + + +class PostCardSettleAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): + ik: str + id: str + created: Any + type_: Optional[Any] = Field(alias="type") + posted: Any + description: Optional[str] + ledger: "PostCardSettleAddLedgerEntryAddLedgerEntryResultEntryLedger" + tags: list["PostCardSettleAddLedgerEntryAddLedgerEntryResultEntryTags"] + groups: list["PostCardSettleAddLedgerEntryAddLedgerEntryResultEntryGroups"] + + +class PostCardSettleAddLedgerEntryAddLedgerEntryResultEntryLedger(BaseModel): + ik: Any + + +class PostCardSettleAddLedgerEntryAddLedgerEntryResultEntryTags(BaseModel): + key: Any + value: Any + + +class PostCardSettleAddLedgerEntryAddLedgerEntryResultEntryGroups(BaseModel): + key: Any + value: Any + + +class PostCardSettleAddLedgerEntryAddLedgerEntryResultLines(BaseModel): + account: "PostCardSettleAddLedgerEntryAddLedgerEntryResultLinesAccount" + amount: Any + currency: Optional["PostCardSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency"] + key: Optional[str] + + +class PostCardSettleAddLedgerEntryAddLedgerEntryResultLinesAccount(BaseModel): + path: str + + +class PostCardSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency(BaseModel): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +class PostCardSettleAddLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class PostCardSettleAddLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +PostCardSettle.model_rebuild() +PostCardSettleAddLedgerEntryAddLedgerEntryResult.model_rebuild() +PostCardSettleAddLedgerEntryAddLedgerEntryResultEntry.model_rebuild() +PostCardSettleAddLedgerEntryAddLedgerEntryResultLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/post_dispute_payout_initiate.py b/tests/snapshots/001-marketing-schema/sdk/post_dispute_payout_initiate.py new file mode 100644 index 0000000..3a5121f --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/post_dispute_payout_initiate.py @@ -0,0 +1,94 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel +from .enums import CurrencyCode + + +class PostDisputePayoutInitiate(BaseModel): + add_ledger_entry: Union[ + "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResult", + "PostDisputePayoutInitiateAddLedgerEntryBadRequestError", + "PostDisputePayoutInitiateAddLedgerEntryInternalError", + ] = Field(alias="addLedgerEntry", discriminator="typename__") + + +class PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResult(BaseModel): + typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") + entry: "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry" + lines: list["PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultLines"] + is_ik_replay: bool = Field(alias="isIkReplay") + + +class PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): + ik: str + id: str + created: Any + type_: Optional[Any] = Field(alias="type") + posted: Any + description: Optional[str] + ledger: "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryLedger" + tags: list["PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryTags"] + groups: list[ + "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryGroups" + ] + + +class PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryLedger(BaseModel): + ik: Any + + +class PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryTags(BaseModel): + key: Any + value: Any + + +class PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryGroups(BaseModel): + key: Any + value: Any + + +class PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultLines(BaseModel): + account: "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesAccount" + amount: Any + currency: Optional[ + "PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesCurrency" + ] + key: Optional[str] + + +class PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesAccount( + BaseModel +): + path: str + + +class PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesCurrency( + BaseModel +): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +class PostDisputePayoutInitiateAddLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class PostDisputePayoutInitiateAddLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +PostDisputePayoutInitiate.model_rebuild() +PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResult.model_rebuild() +PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry.model_rebuild() +PostDisputePayoutInitiateAddLedgerEntryAddLedgerEntryResultLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/post_dispute_payout_settle.py b/tests/snapshots/001-marketing-schema/sdk/post_dispute_payout_settle.py new file mode 100644 index 0000000..67de889 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/post_dispute_payout_settle.py @@ -0,0 +1,88 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel +from .enums import CurrencyCode + + +class PostDisputePayoutSettle(BaseModel): + add_ledger_entry: Union[ + "PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResult", + "PostDisputePayoutSettleAddLedgerEntryBadRequestError", + "PostDisputePayoutSettleAddLedgerEntryInternalError", + ] = Field(alias="addLedgerEntry", discriminator="typename__") + + +class PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResult(BaseModel): + typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") + entry: "PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntry" + lines: list["PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultLines"] + is_ik_replay: bool = Field(alias="isIkReplay") + + +class PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): + ik: str + id: str + created: Any + type_: Optional[Any] = Field(alias="type") + posted: Any + description: Optional[str] + ledger: "PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntryLedger" + tags: list["PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntryTags"] + groups: list["PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntryGroups"] + + +class PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntryLedger(BaseModel): + ik: Any + + +class PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntryTags(BaseModel): + key: Any + value: Any + + +class PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntryGroups(BaseModel): + key: Any + value: Any + + +class PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultLines(BaseModel): + account: "PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultLinesAccount" + amount: Any + currency: Optional[ + "PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency" + ] + key: Optional[str] + + +class PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultLinesAccount(BaseModel): + path: str + + +class PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency(BaseModel): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +class PostDisputePayoutSettleAddLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class PostDisputePayoutSettleAddLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +PostDisputePayoutSettle.model_rebuild() +PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResult.model_rebuild() +PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultEntry.model_rebuild() +PostDisputePayoutSettleAddLedgerEntryAddLedgerEntryResultLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/post_driver_payout_initiate.py b/tests/snapshots/001-marketing-schema/sdk/post_driver_payout_initiate.py new file mode 100644 index 0000000..820f246 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/post_driver_payout_initiate.py @@ -0,0 +1,92 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel +from .enums import CurrencyCode + + +class PostDriverPayoutInitiate(BaseModel): + add_ledger_entry: Union[ + "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResult", + "PostDriverPayoutInitiateAddLedgerEntryBadRequestError", + "PostDriverPayoutInitiateAddLedgerEntryInternalError", + ] = Field(alias="addLedgerEntry", discriminator="typename__") + + +class PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResult(BaseModel): + typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") + entry: "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry" + lines: list["PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultLines"] + is_ik_replay: bool = Field(alias="isIkReplay") + + +class PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): + ik: str + id: str + created: Any + type_: Optional[Any] = Field(alias="type") + posted: Any + description: Optional[str] + ledger: "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryLedger" + tags: list["PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryTags"] + groups: list[ + "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryGroups" + ] + + +class PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryLedger(BaseModel): + ik: Any + + +class PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryTags(BaseModel): + key: Any + value: Any + + +class PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryGroups(BaseModel): + key: Any + value: Any + + +class PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultLines(BaseModel): + account: "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesAccount" + amount: Any + currency: Optional[ + "PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesCurrency" + ] + key: Optional[str] + + +class PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesAccount(BaseModel): + path: str + + +class PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesCurrency( + BaseModel +): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +class PostDriverPayoutInitiateAddLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class PostDriverPayoutInitiateAddLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +PostDriverPayoutInitiate.model_rebuild() +PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResult.model_rebuild() +PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry.model_rebuild() +PostDriverPayoutInitiateAddLedgerEntryAddLedgerEntryResultLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/post_driver_payout_settle.py b/tests/snapshots/001-marketing-schema/sdk/post_driver_payout_settle.py new file mode 100644 index 0000000..46a2022 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/post_driver_payout_settle.py @@ -0,0 +1,88 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel +from .enums import CurrencyCode + + +class PostDriverPayoutSettle(BaseModel): + add_ledger_entry: Union[ + "PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResult", + "PostDriverPayoutSettleAddLedgerEntryBadRequestError", + "PostDriverPayoutSettleAddLedgerEntryInternalError", + ] = Field(alias="addLedgerEntry", discriminator="typename__") + + +class PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResult(BaseModel): + typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") + entry: "PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntry" + lines: list["PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultLines"] + is_ik_replay: bool = Field(alias="isIkReplay") + + +class PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): + ik: str + id: str + created: Any + type_: Optional[Any] = Field(alias="type") + posted: Any + description: Optional[str] + ledger: "PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryLedger" + tags: list["PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryTags"] + groups: list["PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryGroups"] + + +class PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryLedger(BaseModel): + ik: Any + + +class PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryTags(BaseModel): + key: Any + value: Any + + +class PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryGroups(BaseModel): + key: Any + value: Any + + +class PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultLines(BaseModel): + account: "PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesAccount" + amount: Any + currency: Optional[ + "PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency" + ] + key: Optional[str] + + +class PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesAccount(BaseModel): + path: str + + +class PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency(BaseModel): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +class PostDriverPayoutSettleAddLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class PostDriverPayoutSettleAddLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +PostDriverPayoutSettle.model_rebuild() +PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResult.model_rebuild() +PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultEntry.model_rebuild() +PostDriverPayoutSettleAddLedgerEntryAddLedgerEntryResultLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/post_order_placed.py b/tests/snapshots/001-marketing-schema/sdk/post_order_placed.py new file mode 100644 index 0000000..a798bfe --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/post_order_placed.py @@ -0,0 +1,86 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel +from .enums import CurrencyCode + + +class PostOrderPlaced(BaseModel): + add_ledger_entry: Union[ + "PostOrderPlacedAddLedgerEntryAddLedgerEntryResult", + "PostOrderPlacedAddLedgerEntryBadRequestError", + "PostOrderPlacedAddLedgerEntryInternalError", + ] = Field(alias="addLedgerEntry", discriminator="typename__") + + +class PostOrderPlacedAddLedgerEntryAddLedgerEntryResult(BaseModel): + typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") + entry: "PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntry" + lines: list["PostOrderPlacedAddLedgerEntryAddLedgerEntryResultLines"] + is_ik_replay: bool = Field(alias="isIkReplay") + + +class PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): + ik: str + id: str + created: Any + type_: Optional[Any] = Field(alias="type") + posted: Any + description: Optional[str] + ledger: "PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntryLedger" + tags: list["PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntryTags"] + groups: list["PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntryGroups"] + + +class PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntryLedger(BaseModel): + ik: Any + + +class PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntryTags(BaseModel): + key: Any + value: Any + + +class PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntryGroups(BaseModel): + key: Any + value: Any + + +class PostOrderPlacedAddLedgerEntryAddLedgerEntryResultLines(BaseModel): + account: "PostOrderPlacedAddLedgerEntryAddLedgerEntryResultLinesAccount" + amount: Any + currency: Optional["PostOrderPlacedAddLedgerEntryAddLedgerEntryResultLinesCurrency"] + key: Optional[str] + + +class PostOrderPlacedAddLedgerEntryAddLedgerEntryResultLinesAccount(BaseModel): + path: str + + +class PostOrderPlacedAddLedgerEntryAddLedgerEntryResultLinesCurrency(BaseModel): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +class PostOrderPlacedAddLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class PostOrderPlacedAddLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +PostOrderPlaced.model_rebuild() +PostOrderPlacedAddLedgerEntryAddLedgerEntryResult.model_rebuild() +PostOrderPlacedAddLedgerEntryAddLedgerEntryResultEntry.model_rebuild() +PostOrderPlacedAddLedgerEntryAddLedgerEntryResultLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/post_order_placed_v_2.py b/tests/snapshots/001-marketing-schema/sdk/post_order_placed_v_2.py new file mode 100644 index 0000000..cb340e0 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/post_order_placed_v_2.py @@ -0,0 +1,88 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel +from .enums import CurrencyCode + + +class PostOrderPlacedV2(BaseModel): + add_ledger_entry: Union[ + "PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResult", + "PostOrderPlacedV2AddLedgerEntryBadRequestError", + "PostOrderPlacedV2AddLedgerEntryInternalError", + ] = Field(alias="addLedgerEntry", discriminator="typename__") + + +class PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResult(BaseModel): + typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") + entry: "PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntry" + lines: list["PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultLines"] + is_ik_replay: bool = Field(alias="isIkReplay") + + +class PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntry(BaseModel): + ik: str + id: str + created: Any + type_: Optional[Any] = Field(alias="type") + posted: Any + description: Optional[str] + ledger: "PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntryLedger" + tags: list["PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntryTags"] + groups: list["PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntryGroups"] + + +class PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntryLedger(BaseModel): + ik: Any + + +class PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntryTags(BaseModel): + key: Any + value: Any + + +class PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntryGroups(BaseModel): + key: Any + value: Any + + +class PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultLines(BaseModel): + account: "PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultLinesAccount" + amount: Any + currency: Optional[ + "PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultLinesCurrency" + ] + key: Optional[str] + + +class PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultLinesAccount(BaseModel): + path: str + + +class PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultLinesCurrency(BaseModel): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +class PostOrderPlacedV2AddLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class PostOrderPlacedV2AddLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +PostOrderPlacedV2.model_rebuild() +PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResult.model_rebuild() +PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultEntry.model_rebuild() +PostOrderPlacedV2AddLedgerEntryAddLedgerEntryResultLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/post_restaurant_payout_initiate.py b/tests/snapshots/001-marketing-schema/sdk/post_restaurant_payout_initiate.py new file mode 100644 index 0000000..037bb83 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/post_restaurant_payout_initiate.py @@ -0,0 +1,104 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel +from .enums import CurrencyCode + + +class PostRestaurantPayoutInitiate(BaseModel): + add_ledger_entry: Union[ + "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResult", + "PostRestaurantPayoutInitiateAddLedgerEntryBadRequestError", + "PostRestaurantPayoutInitiateAddLedgerEntryInternalError", + ] = Field(alias="addLedgerEntry", discriminator="typename__") + + +class PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResult(BaseModel): + typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") + entry: "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry" + lines: list["PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultLines"] + is_ik_replay: bool = Field(alias="isIkReplay") + + +class PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): + ik: str + id: str + created: Any + type_: Optional[Any] = Field(alias="type") + posted: Any + description: Optional[str] + ledger: "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryLedger" + tags: list[ + "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryTags" + ] + groups: list[ + "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryGroups" + ] + + +class PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryLedger( + BaseModel +): + ik: Any + + +class PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryTags( + BaseModel +): + key: Any + value: Any + + +class PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntryGroups( + BaseModel +): + key: Any + value: Any + + +class PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultLines(BaseModel): + account: ( + "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesAccount" + ) + amount: Any + currency: Optional[ + "PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesCurrency" + ] + key: Optional[str] + + +class PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesAccount( + BaseModel +): + path: str + + +class PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultLinesCurrency( + BaseModel +): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +class PostRestaurantPayoutInitiateAddLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class PostRestaurantPayoutInitiateAddLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +PostRestaurantPayoutInitiate.model_rebuild() +PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResult.model_rebuild() +PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultEntry.model_rebuild() +PostRestaurantPayoutInitiateAddLedgerEntryAddLedgerEntryResultLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/post_restaurant_payout_settle.py b/tests/snapshots/001-marketing-schema/sdk/post_restaurant_payout_settle.py new file mode 100644 index 0000000..41a9891 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/post_restaurant_payout_settle.py @@ -0,0 +1,98 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel +from .enums import CurrencyCode + + +class PostRestaurantPayoutSettle(BaseModel): + add_ledger_entry: Union[ + "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResult", + "PostRestaurantPayoutSettleAddLedgerEntryBadRequestError", + "PostRestaurantPayoutSettleAddLedgerEntryInternalError", + ] = Field(alias="addLedgerEntry", discriminator="typename__") + + +class PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResult(BaseModel): + typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") + entry: "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntry" + lines: list["PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultLines"] + is_ik_replay: bool = Field(alias="isIkReplay") + + +class PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): + ik: str + id: str + created: Any + type_: Optional[Any] = Field(alias="type") + posted: Any + description: Optional[str] + ledger: "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryLedger" + tags: list["PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryTags"] + groups: list[ + "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryGroups" + ] + + +class PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryLedger( + BaseModel +): + ik: Any + + +class PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryTags(BaseModel): + key: Any + value: Any + + +class PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntryGroups( + BaseModel +): + key: Any + value: Any + + +class PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultLines(BaseModel): + account: "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesAccount" + amount: Any + currency: Optional[ + "PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency" + ] + key: Optional[str] + + +class PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesAccount( + BaseModel +): + path: str + + +class PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultLinesCurrency( + BaseModel +): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +class PostRestaurantPayoutSettleAddLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class PostRestaurantPayoutSettleAddLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +PostRestaurantPayoutSettle.model_rebuild() +PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResult.model_rebuild() +PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultEntry.model_rebuild() +PostRestaurantPayoutSettleAddLedgerEntryAddLedgerEntryResultLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/reconcile_tx.py b/tests/snapshots/001-marketing-schema/sdk/reconcile_tx.py new file mode 100644 index 0000000..8328f41 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/reconcile_tx.py @@ -0,0 +1,61 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class ReconcileTx(BaseModel): + reconcile_tx: Union[ + "ReconcileTxReconcileTxBadRequestError", + "ReconcileTxReconcileTxInternalError", + "ReconcileTxReconcileTxReconcileTxResult", + ] = Field(alias="reconcileTx", discriminator="typename__") + + +class ReconcileTxReconcileTxBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class ReconcileTxReconcileTxInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class ReconcileTxReconcileTxReconcileTxResult(BaseModel): + typename__: Literal["ReconcileTxResult"] = Field(alias="__typename") + entry: "ReconcileTxReconcileTxReconcileTxResultEntry" + lines: list["ReconcileTxReconcileTxReconcileTxResultLines"] + + +class ReconcileTxReconcileTxReconcileTxResultEntry(BaseModel): + id: str + ik: str + date: Any + posted: Any + created: Any + description: Optional[str] + + +class ReconcileTxReconcileTxReconcileTxResultLines(BaseModel): + id: str + amount: Any + account: "ReconcileTxReconcileTxReconcileTxResultLinesAccount" + external_tx_id: Optional[str] = Field(alias="externalTxId") + + +class ReconcileTxReconcileTxReconcileTxResultLinesAccount(BaseModel): + path: str + + +ReconcileTx.model_rebuild() +ReconcileTxReconcileTxReconcileTxResult.model_rebuild() +ReconcileTxReconcileTxReconcileTxResultLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/reconcile_tx_runtime.py b/tests/snapshots/001-marketing-schema/sdk/reconcile_tx_runtime.py new file mode 100644 index 0000000..b38b5be --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/reconcile_tx_runtime.py @@ -0,0 +1,61 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class ReconcileTxRuntime(BaseModel): + reconcile_tx: Union[ + "ReconcileTxRuntimeReconcileTxBadRequestError", + "ReconcileTxRuntimeReconcileTxInternalError", + "ReconcileTxRuntimeReconcileTxReconcileTxResult", + ] = Field(alias="reconcileTx", discriminator="typename__") + + +class ReconcileTxRuntimeReconcileTxBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class ReconcileTxRuntimeReconcileTxInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class ReconcileTxRuntimeReconcileTxReconcileTxResult(BaseModel): + typename__: Literal["ReconcileTxResult"] = Field(alias="__typename") + entry: "ReconcileTxRuntimeReconcileTxReconcileTxResultEntry" + lines: list["ReconcileTxRuntimeReconcileTxReconcileTxResultLines"] + + +class ReconcileTxRuntimeReconcileTxReconcileTxResultEntry(BaseModel): + id: str + ik: str + date: Any + posted: Any + created: Any + description: Optional[str] + + +class ReconcileTxRuntimeReconcileTxReconcileTxResultLines(BaseModel): + id: str + amount: Any + account: "ReconcileTxRuntimeReconcileTxReconcileTxResultLinesAccount" + external_tx_id: Optional[str] = Field(alias="externalTxId") + + +class ReconcileTxRuntimeReconcileTxReconcileTxResultLinesAccount(BaseModel): + path: str + + +ReconcileTxRuntime.model_rebuild() +ReconcileTxRuntimeReconcileTxReconcileTxResult.model_rebuild() +ReconcileTxRuntimeReconcileTxReconcileTxResultLines.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/reverse_ledger_entry.py b/tests/snapshots/001-marketing-schema/sdk/reverse_ledger_entry.py new file mode 100644 index 0000000..3da1802 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/reverse_ledger_entry.py @@ -0,0 +1,121 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class ReverseLedgerEntry(BaseModel): + reverse_ledger_entry: Union[ + "ReverseLedgerEntryReverseLedgerEntryBadRequestError", + "ReverseLedgerEntryReverseLedgerEntryInternalError", + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResult", + ] = Field(alias="reverseLedgerEntry", discriminator="typename__") + + +class ReverseLedgerEntryReverseLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class ReverseLedgerEntryReverseLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResult(BaseModel): + typename__: Literal["ReverseLedgerEntryResult"] = Field(alias="__typename") + reversing_ledger_entry: ( + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntry" + ) = Field(alias="reversingLedgerEntry") + reversed_ledger_entry: ( + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntry" + ) = Field(alias="reversedLedgerEntry") + is_ik_replay: bool = Field(alias="isIkReplay") + + +class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntry( + BaseModel +): + ik: str + id: str + created: Any + posted: Any + type_: Optional[Any] = Field(alias="type") + description: Optional[str] + hidden: bool + lines: "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLines" + + +class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLines( + BaseModel +): + nodes: list[ + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLinesNodes" + ] + + +class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLinesNodes( + BaseModel +): + id: str + amount: Any + account: "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLinesNodesAccount" + + +class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLinesNodesAccount( + BaseModel +): + path: str + + +class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntry( + BaseModel +): + ik: str + id: str + created: Any + posted: Any + type_: Optional[Any] = Field(alias="type") + description: Optional[str] + hidden: bool + lines: "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLines" + + +class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLines( + BaseModel +): + nodes: list[ + "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLinesNodes" + ] + + +class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLinesNodes( + BaseModel +): + id: str + amount: Any + account: "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLinesNodesAccount" + + +class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLinesNodesAccount( + BaseModel +): + path: str + + +ReverseLedgerEntry.model_rebuild() +ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResult.model_rebuild() +ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntry.model_rebuild() +ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLines.model_rebuild() +ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLinesNodes.model_rebuild() +ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntry.model_rebuild() +ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLines.model_rebuild() +ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLinesNodes.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/store_schema.py b/tests/snapshots/001-marketing-schema/sdk/store_schema.py new file mode 100644 index 0000000..e3b1ca5 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/store_schema.py @@ -0,0 +1,51 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class StoreSchema(BaseModel): + store_schema: Union[ + "StoreSchemaStoreSchemaBadRequestError", + "StoreSchemaStoreSchemaInternalError", + "StoreSchemaStoreSchemaStoreSchemaResult", + ] = Field(alias="storeSchema", discriminator="typename__") + + +class StoreSchemaStoreSchemaBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class StoreSchemaStoreSchemaInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class StoreSchemaStoreSchemaStoreSchemaResult(BaseModel): + typename__: Literal["StoreSchemaResult"] = Field(alias="__typename") + schema_: "StoreSchemaStoreSchemaStoreSchemaResultSchema" = Field(alias="schema") + + +class StoreSchemaStoreSchemaStoreSchemaResultSchema(BaseModel): + key: Any + name: str + version: "StoreSchemaStoreSchemaStoreSchemaResultSchemaVersion" + + +class StoreSchemaStoreSchemaStoreSchemaResultSchemaVersion(BaseModel): + created: Any + version: int + + +StoreSchema.model_rebuild() +StoreSchemaStoreSchemaStoreSchemaResult.model_rebuild() +StoreSchemaStoreSchemaStoreSchemaResultSchema.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/sync_custom_accounts.py b/tests/snapshots/001-marketing-schema/sdk/sync_custom_accounts.py new file mode 100644 index 0000000..7b325e4 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/sync_custom_accounts.py @@ -0,0 +1,59 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel +from .enums import CurrencyCode + + +class SyncCustomAccounts(BaseModel): + sync_custom_accounts: Union[ + "SyncCustomAccountsSyncCustomAccountsBadRequestError", + "SyncCustomAccountsSyncCustomAccountsInternalError", + "SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResult", + ] = Field(alias="syncCustomAccounts", discriminator="typename__") + + +class SyncCustomAccountsSyncCustomAccountsBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class SyncCustomAccountsSyncCustomAccountsInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResult(BaseModel): + typename__: Literal["SyncCustomAccountsResult"] = Field(alias="__typename") + accounts: list[ + "SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccounts" + ] + + +class SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccounts(BaseModel): + id: str + external_id: str = Field(alias="externalId") + name: str + currency: Optional[ + "SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccountsCurrency" + ] + + +class SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccountsCurrency( + BaseModel +): + code: CurrencyCode + custom_currency_id: Optional[Any] = Field(alias="customCurrencyId") + + +SyncCustomAccounts.model_rebuild() +SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResult.model_rebuild() +SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccounts.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/sync_custom_txs.py b/tests/snapshots/001-marketing-schema/sdk/sync_custom_txs.py new file mode 100644 index 0000000..0919ae6 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/sync_custom_txs.py @@ -0,0 +1,50 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class SyncCustomTxs(BaseModel): + sync_custom_txs: Union[ + "SyncCustomTxsSyncCustomTxsBadRequestError", + "SyncCustomTxsSyncCustomTxsInternalError", + "SyncCustomTxsSyncCustomTxsSyncCustomTxsResult", + ] = Field(alias="syncCustomTxs", discriminator="typename__") + + +class SyncCustomTxsSyncCustomTxsBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class SyncCustomTxsSyncCustomTxsInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class SyncCustomTxsSyncCustomTxsSyncCustomTxsResult(BaseModel): + typename__: Literal["SyncCustomTxsResult"] = Field(alias="__typename") + txs: list["SyncCustomTxsSyncCustomTxsSyncCustomTxsResultTxs"] + + +class SyncCustomTxsSyncCustomTxsSyncCustomTxsResultTxs(BaseModel): + typename__: Literal["Tx"] = Field(alias="__typename") + link_id: str = Field(alias="linkId") + id: str + external_id: str = Field(alias="externalId") + external_account_id: str = Field(alias="externalAccountId") + amount: Any + description: str + posted: Any + + +SyncCustomTxs.model_rebuild() +SyncCustomTxsSyncCustomTxsSyncCustomTxsResult.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/update_ledger.py b/tests/snapshots/001-marketing-schema/sdk/update_ledger.py new file mode 100644 index 0000000..296a4c3 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/update_ledger.py @@ -0,0 +1,45 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class UpdateLedger(BaseModel): + update_ledger: Union[ + "UpdateLedgerUpdateLedgerBadRequestError", + "UpdateLedgerUpdateLedgerInternalError", + "UpdateLedgerUpdateLedgerUpdateLedgerResult", + ] = Field(alias="updateLedger", discriminator="typename__") + + +class UpdateLedgerUpdateLedgerBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class UpdateLedgerUpdateLedgerInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class UpdateLedgerUpdateLedgerUpdateLedgerResult(BaseModel): + typename__: Literal["UpdateLedgerResult"] = Field(alias="__typename") + ledger: "UpdateLedgerUpdateLedgerUpdateLedgerResultLedger" + + +class UpdateLedgerUpdateLedgerUpdateLedgerResultLedger(BaseModel): + id: str + ik: Any + name: str + + +UpdateLedger.model_rebuild() +UpdateLedgerUpdateLedgerUpdateLedgerResult.model_rebuild() diff --git a/tests/snapshots/001-marketing-schema/sdk/update_ledger_entry.py b/tests/snapshots/001-marketing-schema/sdk/update_ledger_entry.py new file mode 100644 index 0000000..b0cd136 --- /dev/null +++ b/tests/snapshots/001-marketing-schema/sdk/update_ledger_entry.py @@ -0,0 +1,83 @@ +# Generated by fragment (with the help of ariadne-codegen) +# Source: tests/snapshots/001-marketing-schema/ + +from typing import Any, Literal, Optional, Union + +from pydantic import Field + +from .base_model import BaseModel + + +class UpdateLedgerEntry(BaseModel): + update_ledger_entry: Union[ + "UpdateLedgerEntryUpdateLedgerEntryBadRequestError", + "UpdateLedgerEntryUpdateLedgerEntryInternalError", + "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResult", + ] = Field(alias="updateLedgerEntry", discriminator="typename__") + + +class UpdateLedgerEntryUpdateLedgerEntryBadRequestError(BaseModel): + typename__: Literal["BadRequestError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class UpdateLedgerEntryUpdateLedgerEntryInternalError(BaseModel): + typename__: Literal["InternalError"] = Field(alias="__typename") + code: str + message: str + retryable: bool + + +class UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResult(BaseModel): + typename__: Literal["UpdateLedgerEntryResult"] = Field(alias="__typename") + entry: "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntry" + + +class UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntry(BaseModel): + id: str + ik: str + posted: Any + created: Any + description: Optional[str] + lines: "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLines" + groups: list["UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryGroups"] + tags: list["UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryTags"] + + +class UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLines(BaseModel): + nodes: list[ + "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodes" + ] + + +class UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodes( + BaseModel +): + id: str + amount: Any + account: "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodesAccount" + + +class UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodesAccount( + BaseModel +): + path: str + + +class UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryGroups(BaseModel): + key: Any + value: Any + + +class UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryTags(BaseModel): + key: Any + value: Any + + +UpdateLedgerEntry.model_rebuild() +UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResult.model_rebuild() +UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntry.model_rebuild() +UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLines.model_rebuild() +UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodes.model_rebuild() diff --git a/tests/template-schema/queries.graphql b/tests/template-schema/queries.graphql new file mode 100644 index 0000000..052eb4c --- /dev/null +++ b/tests/template-schema/queries.graphql @@ -0,0 +1,467 @@ +# Generated by the Fragment CLI (@fragment-dev/cli) v2026.8.4-11 +# Generated on 2026-08-04 from template-schema/schema.json +# +# Command: +# fragment gen-graphql --path template-schema/schema.json --output template-schema/queries.graphql +# +# Do not edit by hand -- regenerating overwrites this file, including this header. + +mutation PostOrderPlaced($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $order_id: String!, $order_cost: String!, $currency: String!, $platform_fee: String!, $driver_fee: String!, $restaurant_id: String!, $driver_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "order_placed", typeVersion: 1, posted: $posted, parameters: {user_id: $user_id, order_id: $order_id, order_cost: $order_cost, currency: $currency, platform_fee: $platform_fee, driver_fee: $driver_fee, restaurant_id: $restaurant_id, driver_id: $driver_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostOrderPlaced_v2($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $order_id: String!, $order_cost: String!, $currency: String!, $platform_fee: String!, $service_fee: String!, $driver_fee: String!, $restaurant_id: String!, $driver_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "order_placed", typeVersion: 2, posted: $posted, parameters: {user_id: $user_id, order_id: $order_id, order_cost: $order_cost, currency: $currency, platform_fee: $platform_fee, service_fee: $service_fee, driver_fee: $driver_fee, restaurant_id: $restaurant_id, driver_id: $driver_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostCardSettle($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $order_id: String!, $currency: String!, $amount: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "card_settle", typeVersion: 1, posted: $posted, parameters: {user_id: $user_id, order_id: $order_id, currency: $currency, amount: $amount}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostRestaurantPayoutInitiate($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $restaurant_id: String!, $order_id: String!, $currency: String!, $amount: String!, $payout_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "restaurant_payout_initiate", typeVersion: 1, posted: $posted, parameters: {restaurant_id: $restaurant_id, order_id: $order_id, currency: $currency, amount: $amount, payout_id: $payout_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostRestaurantPayoutSettle($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $restaurant_id: String!, $payout_id: String!, $currency: String!, $amount: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "restaurant_payout_settle", typeVersion: 1, posted: $posted, parameters: {restaurant_id: $restaurant_id, payout_id: $payout_id, currency: $currency, amount: $amount}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostDriverPayoutInitiate($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $driver_id: String!, $order_id: String!, $currency: String!, $amount: String!, $payout_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "driver_payout_initiate", typeVersion: 1, posted: $posted, parameters: {driver_id: $driver_id, order_id: $order_id, currency: $currency, amount: $amount, payout_id: $payout_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostDriverPayoutSettle($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $driver_id: String!, $payout_id: String!, $currency: String!, $amount: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "driver_payout_settle", typeVersion: 1, posted: $posted, parameters: {driver_id: $driver_id, payout_id: $payout_id, currency: $currency, amount: $amount}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostDisputePayoutInitiate($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $disputes_id: String!, $amount: String!, $currency: String!, $payout_id: String!, $order_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "dispute_payout_initiate", typeVersion: 1, posted: $posted, parameters: {user_id: $user_id, disputes_id: $disputes_id, amount: $amount, currency: $currency, payout_id: $payout_id, order_id: $order_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostDisputePayoutSettle($ik: SafeString!, $posted: DateTime, $ledgerIk: SafeString!, $user_id: String!, $disputes_id: String!, $amount: String!, $currency: String!, $order_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "dispute_payout_settle", typeVersion: 1, posted: $posted, parameters: {user_id: $user_id, disputes_id: $disputes_id, amount: $amount, currency: $currency, order_id: $order_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} diff --git a/tests/template-schema/queries.runtime-args.graphql b/tests/template-schema/queries.runtime-args.graphql new file mode 100644 index 0000000..39f8ec0 --- /dev/null +++ b/tests/template-schema/queries.runtime-args.graphql @@ -0,0 +1,467 @@ +# Generated by the Fragment CLI (@fragment-dev/cli) v2026.8.4-11 +# Generated on 2026-08-04 from template-schema/schema.json +# +# Command: +# fragment gen-graphql --path template-schema/schema.json --output template-schema/queries.runtime-args.graphql --include-runtime-args +# +# Do not edit by hand -- regenerating overwrites this file, including this header. + +mutation PostOrderPlaced($ik: SafeString!, $posted: DateTime, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!], $conditions: [LedgerEntryConditionInput!], $ledgerIk: SafeString!, $user_id: String!, $order_id: String!, $order_cost: String!, $currency: String!, $platform_fee: String!, $driver_fee: String!, $restaurant_id: String!, $driver_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "order_placed", typeVersion: 1, posted: $posted, tags: $tags, groups: $groups, conditions: $conditions, parameters: {user_id: $user_id, order_id: $order_id, order_cost: $order_cost, currency: $currency, platform_fee: $platform_fee, driver_fee: $driver_fee, restaurant_id: $restaurant_id, driver_id: $driver_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostOrderPlaced_v2($ik: SafeString!, $posted: DateTime, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!], $conditions: [LedgerEntryConditionInput!], $ledgerIk: SafeString!, $user_id: String!, $order_id: String!, $order_cost: String!, $currency: String!, $platform_fee: String!, $service_fee: String!, $driver_fee: String!, $restaurant_id: String!, $driver_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "order_placed", typeVersion: 2, posted: $posted, tags: $tags, groups: $groups, conditions: $conditions, parameters: {user_id: $user_id, order_id: $order_id, order_cost: $order_cost, currency: $currency, platform_fee: $platform_fee, service_fee: $service_fee, driver_fee: $driver_fee, restaurant_id: $restaurant_id, driver_id: $driver_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostCardSettle($ik: SafeString!, $posted: DateTime, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!], $ledgerIk: SafeString!, $user_id: String!, $order_id: String!, $currency: String!, $amount: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "card_settle", typeVersion: 1, posted: $posted, tags: $tags, groups: $groups, parameters: {user_id: $user_id, order_id: $order_id, currency: $currency, amount: $amount}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostRestaurantPayoutInitiate($ik: SafeString!, $posted: DateTime, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!], $ledgerIk: SafeString!, $restaurant_id: String!, $order_id: String!, $currency: String!, $amount: String!, $payout_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "restaurant_payout_initiate", typeVersion: 1, posted: $posted, tags: $tags, groups: $groups, parameters: {restaurant_id: $restaurant_id, order_id: $order_id, currency: $currency, amount: $amount, payout_id: $payout_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostRestaurantPayoutSettle($ik: SafeString!, $posted: DateTime, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!], $ledgerIk: SafeString!, $restaurant_id: String!, $payout_id: String!, $currency: String!, $amount: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "restaurant_payout_settle", typeVersion: 1, posted: $posted, tags: $tags, groups: $groups, parameters: {restaurant_id: $restaurant_id, payout_id: $payout_id, currency: $currency, amount: $amount}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostDriverPayoutInitiate($ik: SafeString!, $posted: DateTime, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!], $ledgerIk: SafeString!, $driver_id: String!, $order_id: String!, $currency: String!, $amount: String!, $payout_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "driver_payout_initiate", typeVersion: 1, posted: $posted, tags: $tags, groups: $groups, parameters: {driver_id: $driver_id, order_id: $order_id, currency: $currency, amount: $amount, payout_id: $payout_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostDriverPayoutSettle($ik: SafeString!, $posted: DateTime, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!], $ledgerIk: SafeString!, $driver_id: String!, $payout_id: String!, $currency: String!, $amount: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "driver_payout_settle", typeVersion: 1, posted: $posted, tags: $tags, groups: $groups, parameters: {driver_id: $driver_id, payout_id: $payout_id, currency: $currency, amount: $amount}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostDisputePayoutInitiate($ik: SafeString!, $posted: DateTime, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!], $conditions: [LedgerEntryConditionInput!], $ledgerIk: SafeString!, $user_id: String!, $disputes_id: String!, $amount: String!, $currency: String!, $payout_id: String!, $order_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "dispute_payout_initiate", typeVersion: 1, posted: $posted, tags: $tags, groups: $groups, conditions: $conditions, parameters: {user_id: $user_id, disputes_id: $disputes_id, amount: $amount, currency: $currency, payout_id: $payout_id, order_id: $order_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} +mutation PostDisputePayoutSettle($ik: SafeString!, $posted: DateTime, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!], $conditions: [LedgerEntryConditionInput!], $ledgerIk: SafeString!, $user_id: String!, $disputes_id: String!, $amount: String!, $currency: String!, $order_id: String!) { + addLedgerEntry( + ik: $ik + entry: {ledger: {ik: $ledgerIk}, type: "dispute_payout_settle", typeVersion: 1, posted: $posted, tags: $tags, groups: $groups, conditions: $conditions, parameters: {user_id: $user_id, disputes_id: $disputes_id, amount: $amount, currency: $currency, order_id: $order_id}} + ) { + __typename + ... on AddLedgerEntryResult { + entry { + ik + id + created + type + posted + description + ledger { + ik + } + tags { + key + value + } + groups { + key + value + } + } + lines { + account { + path + } + amount + currency { + code + customCurrencyId + } + key + } + isIkReplay + } + ... on BadRequestError { + code + message + retryable + } + ... on InternalError { + code + message + retryable + } + } +} diff --git a/tests/template-schema/schema.json b/tests/template-schema/schema.json new file mode 100644 index 0000000..3b9c210 --- /dev/null +++ b/tests/template-schema/schema.json @@ -0,0 +1,1234 @@ +{ + "key": "marketplace-template", + "name": "marketplace-template", + "chartOfAccounts": { + "defaultCurrencyMode": "multi", + "defaultConsistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "accounts": [ + { + "key": "assets", + "type": "asset", + "name": "assets", + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [ + { + "key": "cash", + "type": "asset", + "name": "cash", + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [], + "status": "active" + }, + { + "key": "receivables", + "type": "asset", + "name": "receivables", + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [ + { + "key": "user", + "type": "asset", + "name": "user", + "template": true, + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [ + { + "key": "order", + "type": "asset", + "name": "order", + "template": true, + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [], + "status": "active", + "clearing": true + } + ], + "status": "active" + } + ], + "status": "active" + } + ], + "status": "active" + }, + { + "key": "liabilities", + "type": "liability", + "name": "liabilities", + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [ + { + "key": "payables", + "type": "liability", + "name": "payables", + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [ + { + "key": "restaurant", + "type": "liability", + "name": "restaurant", + "template": true, + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [ + { + "key": "order", + "type": "liability", + "name": "order", + "template": true, + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [], + "status": "active", + "clearing": true + }, + { + "key": "payout", + "type": "liability", + "name": "payout", + "template": true, + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [], + "status": "active", + "clearing": true + } + ], + "status": "active" + }, + { + "key": "driver", + "type": "liability", + "name": "driver", + "template": true, + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [ + { + "key": "order", + "type": "liability", + "name": "order", + "template": true, + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [], + "status": "active", + "clearing": true + }, + { + "key": "payout", + "type": "liability", + "name": "payout", + "template": true, + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [], + "status": "active", + "clearing": true + } + ], + "status": "active" + }, + { + "key": "user", + "type": "liability", + "name": "user", + "template": true, + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [ + { + "key": "disputes", + "type": "liability", + "name": "disputes", + "template": true, + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [ + { + "key": "payout", + "type": "liability", + "name": "payout", + "template": true, + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [], + "status": "active", + "clearing": true + } + ], + "status": "active" + } + ], + "status": "active" + } + ], + "status": "active" + } + ], + "status": "active" + }, + { + "key": "income", + "type": "income", + "name": "income", + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [ + { + "key": "platform_fee", + "type": "income", + "name": "platform_fee", + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [], + "status": "active" + } + ], + "status": "active" + }, + { + "key": "expenses", + "type": "expense", + "name": "expenses", + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [ + { + "key": "disputes", + "type": "expense", + "name": "disputes", + "template": true, + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [ + { + "key": "payout", + "type": "expense", + "name": "payout", + "template": true, + "currencyMode": "multi", + "consistencyConfig": { + "lines": "eventual", + "totalBalanceUpdates": "strong", + "groups": [] + }, + "children": [], + "status": "active" + } + ], + "status": "active" + } + ], + "status": "active" + } + ] + }, + "consistencyConfig": { + "entries": "eventual" + }, + "ledgerEntries": { + "types": [ + { + "conditions": [], + "description": "Buyer places a food order paid by card. The card charge is booked as a receivable from the card network; per-order payables are created for the restaurant and driver; platform fee is recognized as income.", + "groups": [], + "lines": [ + { + "key": "line-aX9LiI8OYR1t", + "account": { + "path": "assets/receivables/user:{{user_id}}/order:{{order_id}}" + }, + "amount": "{{order_cost}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-awQYhSGjNrmz", + "account": { + "path": "assets/receivables/user:{{user_id}}/order:{{order_id}}" + }, + "amount": "{{platform_fee}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-sH8INdJEcuJq", + "account": { + "path": "assets/receivables/user:{{user_id}}/order:{{order_id}}" + }, + "amount": "{{driver_fee}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-RoE5jE2sZoSM", + "account": { + "path": "liabilities/payables/restaurant:{{restaurant_id}}/order:{{order_id}}" + }, + "amount": "{{order_cost}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-kYWR5qby88cZ", + "account": { + "path": "liabilities/payables/driver:{{driver_id}}/order:{{order_id}}" + }, + "amount": "{{driver_fee}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-PdgTyZclO8T4", + "account": { + "path": "income/platform_fee" + }, + "amount": "{{platform_fee}}", + "currency": { + "code": "{{currency}}" + } + } + ], + "postLinesAs": "net_amounts", + "status": "active", + "tags": [ + { + "key": "order_id", + "value": "{{order_id}}" + } + ], + "type": "order_placed", + "typeVersion": 1 + }, + { + "conditions": [], + "description": "v2: Buyer places a food order paid by card. Adds a separate service_fee charged to the buyer and recognized as platform income, alongside the existing platform_fee. Per-order payables are created for the restaurant and driver.", + "groups": [], + "lines": [ + { + "key": "line-s6w7JEGShB4t", + "account": { + "path": "assets/receivables/user:{{user_id}}/order:{{order_id}}" + }, + "amount": "{{order_cost}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-BSMQeAXOR887", + "account": { + "path": "assets/receivables/user:{{user_id}}/order:{{order_id}}" + }, + "amount": "{{platform_fee}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-ROgHdMAebwAu", + "account": { + "path": "assets/receivables/user:{{user_id}}/order:{{order_id}}" + }, + "amount": "{{service_fee}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-ZfvhdcqpuoVP", + "account": { + "path": "assets/receivables/user:{{user_id}}/order:{{order_id}}" + }, + "amount": "{{driver_fee}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-vGkJkALirzrn", + "account": { + "path": "liabilities/payables/restaurant:{{restaurant_id}}/order:{{order_id}}" + }, + "amount": "{{order_cost}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-L2Sl1bCNTT3P", + "account": { + "path": "liabilities/payables/driver:{{driver_id}}/order:{{order_id}}" + }, + "amount": "{{driver_fee}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-SV8LS0hHPe9y", + "account": { + "path": "income/platform_fee" + }, + "amount": "{{platform_fee}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-jd1mtCc0XXPY", + "account": { + "path": "income/platform_fee" + }, + "amount": "{{service_fee}}", + "currency": { + "code": "{{currency}}" + } + } + ], + "postLinesAs": "net_amounts", + "status": "active", + "tags": [ + { + "key": "order_id", + "value": "{{order_id}}" + }, + { + "key": "restaurant_id", + "value": "{{restaurant_id}}" + } + ], + "type": "order_placed", + "typeVersion": 2 + }, + { + "conditions": [ + { + "account": { + "path": "assets/receivables/user:{{user_id}}/order:{{order_id}}" + }, + "currency": { + "code": "{{currency}}" + }, + "postcondition": { + "totalBalance": { + "gte": "0" + } + } + } + ], + "description": "Card network settles a card charge: clears the order's card receivable and deposits funds into cash.", + "groups": [], + "lines": [ + { + "key": "line-1MqNjwZV54G1", + "account": { + "path": "assets/receivables/user:{{user_id}}/order:{{order_id}}" + }, + "amount": "-{{amount}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-n4tIH5XZep5f", + "account": { + "path": "assets/cash" + }, + "amount": "{{amount}}", + "currency": { + "code": "{{currency}}" + } + } + ], + "postLinesAs": "raw_lines", + "status": "active", + "tags": [ + { + "key": "order_id", + "value": "{{order_id}}" + } + ], + "type": "card_settle", + "typeVersion": 1 + }, + { + "conditions": [ + { + "account": { + "path": "liabilities/payables/restaurant:{{restaurant_id}}/order:{{order_id}}" + }, + "currency": { + "code": "{{currency}}" + }, + "postcondition": { + "totalBalance": { + "gte": "0" + } + } + } + ], + "description": "Initiates an ACH payout to a restaurant: moves one or more order payables into a payout batch (payout_id).", + "groups": [], + "lines": [ + { + "key": "line-v7RhhaV2D5LZ", + "account": { + "path": "liabilities/payables/restaurant:{{restaurant_id}}/order:{{order_id}}" + }, + "amount": "-{{amount}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-gLxqKai2j5LE", + "account": { + "path": "liabilities/payables/restaurant:{{restaurant_id}}/payout:{{payout_id}}" + }, + "amount": "{{amount}}", + "currency": { + "code": "{{currency}}" + } + } + ], + "postLinesAs": "raw_lines", + "status": "active", + "tags": [ + { + "key": "restaurant_id", + "value": "{{restaurant_id}}" + }, + { + "key": "order_id", + "value": "{{order_id}}" + }, + { + "key": "payout_id", + "value": "{{payout_id}}" + } + ], + "type": "restaurant_payout_initiate", + "typeVersion": 1 + }, + { + "conditions": [ + { + "account": { + "path": "liabilities/payables/restaurant:{{restaurant_id}}/payout:{{payout_id}}" + }, + "currency": { + "code": "{{currency}}" + }, + "postcondition": { + "totalBalance": { + "gte": "0" + } + } + } + ], + "description": "Settles an ACH payout batch to a restaurant: clears the payout balance and reduces cash.", + "groups": [], + "lines": [ + { + "key": "line-tLx34nt5WFKC", + "account": { + "path": "liabilities/payables/restaurant:{{restaurant_id}}/payout:{{payout_id}}" + }, + "amount": "-{{amount}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-p3ynuNKIF81K", + "account": { + "path": "assets/cash" + }, + "amount": "-{{amount}}", + "currency": { + "code": "{{currency}}" + } + } + ], + "postLinesAs": "raw_lines", + "status": "active", + "tags": [ + { + "key": "restaurant_id", + "value": "{{restaurant_id}}" + }, + { + "key": "payout_id", + "value": "{{payout_id}}" + } + ], + "type": "restaurant_payout_settle", + "typeVersion": 1 + }, + { + "conditions": [ + { + "account": { + "path": "liabilities/payables/driver:{{driver_id}}/order:{{order_id}}" + }, + "currency": { + "code": "{{currency}}" + }, + "postcondition": { + "totalBalance": { + "gte": "0" + } + } + } + ], + "description": "Initiates an ACH payout to a driver: moves one or more order payables into a payout batch (payout_id).", + "groups": [], + "lines": [ + { + "key": "line-FX7v2cZoKRn7", + "account": { + "path": "liabilities/payables/driver:{{driver_id}}/order:{{order_id}}" + }, + "amount": "-{{amount}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-18LThiLLNDW5", + "account": { + "path": "liabilities/payables/driver:{{driver_id}}/payout:{{payout_id}}" + }, + "amount": "{{amount}}", + "currency": { + "code": "{{currency}}" + } + } + ], + "postLinesAs": "raw_lines", + "status": "active", + "tags": [ + { + "key": "driver_id", + "value": "{{driver_id}}" + }, + { + "key": "order_id", + "value": "{{order_id}}" + }, + { + "key": "payout_id", + "value": "{{payout_id}}" + } + ], + "type": "driver_payout_initiate", + "typeVersion": 1 + }, + { + "conditions": [ + { + "account": { + "path": "liabilities/payables/driver:{{driver_id}}/payout:{{payout_id}}" + }, + "currency": { + "code": "{{currency}}" + }, + "postcondition": { + "totalBalance": { + "gte": "0" + } + } + } + ], + "description": "Settles an ACH payout batch to a driver: clears the payout balance and reduces cash.", + "groups": [], + "lines": [ + { + "key": "line-ribhyxr21Qwa", + "account": { + "path": "liabilities/payables/driver:{{driver_id}}/payout:{{payout_id}}" + }, + "amount": "-{{amount}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-UIcHoToL7HSt", + "account": { + "path": "assets/cash" + }, + "amount": "-{{amount}}", + "currency": { + "code": "{{currency}}" + } + } + ], + "postLinesAs": "raw_lines", + "status": "active", + "tags": [ + { + "key": "driver_id", + "value": "{{driver_id}}" + }, + { + "key": "payout_id", + "value": "{{payout_id}}" + } + ], + "type": "driver_payout_settle", + "typeVersion": 1 + }, + { + "conditions": [], + "description": "User charge is disputed", + "groups": [], + "lines": [ + { + "key": "line-WZ5Xt1114ub1", + "account": { + "path": "liabilities/payables/user:{{user_id}}/disputes:{{disputes_id}}" + }, + "amount": "{{amount}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-qS2ANgzPxGxG", + "account": { + "path": "expenses/disputes:{{disputes_id}}/payout:{{payout_id}}" + }, + "amount": "{{amount}}", + "currency": { + "code": "{{currency}}" + } + } + ], + "postLinesAs": "raw_lines", + "status": "active", + "tags": [ + { + "key": "user_id", + "value": "{{user_id}}" + }, + { + "key": "order_id", + "value": "{{order_id}}" + } + ], + "type": "dispute_payout_initiate", + "typeVersion": 1 + }, + { + "conditions": [], + "description": "dispute paid out from cash, payable removed, transfer from held to paid", + "groups": [], + "lines": [ + { + "key": "line-Zh7Qzh5ORaj1", + "account": { + "path": "liabilities/payables/user:{{user_id}}/disputes:{{disputes_id}}" + }, + "amount": "-{{amount}}", + "currency": { + "code": "{{currency}}" + } + }, + { + "key": "line-8hREp3o0EnEL", + "account": { + "path": "assets/cash" + }, + "amount": "-{{amount}}", + "currency": { + "code": "{{currency}}" + } + } + ], + "postLinesAs": "raw_lines", + "status": "active", + "tags": [ + { + "key": "user_id", + "value": "{{user_id}}" + }, + { + "key": "order_id", + "value": "{{order_id}}" + } + ], + "type": "dispute_payout_settle", + "typeVersion": 1 + } + ] + }, + "scenes": [ + { + "name": "Single order", + "events": [ + { + "eventType": "entry", + "entry": { + "type": "order_placed", + "typeVersion": 1, + "parameters": { + "order_cost": "2000", + "platform_fee": "500", + "driver_fee": "500", + "restaurant_id": "Arbys", + "driver_id": "alice", + "order_id": "1", + "currency": "USD", + "user_id": "carol" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "card_settle", + "typeVersion": 1, + "parameters": { + "amount": "3000", + "order_id": "1", + "currency": "USD", + "user_id": "carol" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "restaurant_payout_initiate", + "typeVersion": 1, + "parameters": { + "amount": "2000", + "restaurant_id": "Arbys", + "order_id": "1", + "currency": "USD", + "payout_id": "1" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "driver_payout_initiate", + "typeVersion": 1, + "parameters": { + "amount": "500", + "driver_id": "alice", + "order_id": "1", + "currency": "USD", + "payout_id": "2" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "restaurant_payout_settle", + "typeVersion": 1, + "parameters": { + "amount": "2000", + "restaurant_id": "Arbys", + "currency": "USD", + "payout_id": "1" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "driver_payout_settle", + "typeVersion": 1, + "parameters": { + "amount": "500", + "driver_id": "alice", + "currency": "USD", + "payout_id": "2" + } + } + } + ] + }, + { + "name": "Multiple orders", + "events": [ + { + "eventType": "entry", + "entry": { + "type": "order_placed", + "typeVersion": 1, + "parameters": { + "order_cost": "2000", + "platform_fee": "500", + "driver_fee": "500", + "restaurant_id": "Arbys", + "driver_id": "bob", + "order_id": "1", + "currency": "USD", + "user_id": "carol" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "order_placed", + "typeVersion": 1, + "parameters": { + "order_cost": "3000", + "platform_fee": "1000", + "driver_fee": "1000", + "restaurant_id": "Arbys", + "driver_id": "alice", + "order_id": "2", + "currency": "USD", + "user_id": "dave" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "card_settle", + "typeVersion": 1, + "parameters": { + "amount": "3000", + "order_id": "1", + "currency": "USD", + "user_id": "carol" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "card_settle", + "typeVersion": 1, + "parameters": { + "amount": "5000", + "order_id": "2", + "currency": "USD", + "user_id": "dave" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "restaurant_payout_initiate", + "typeVersion": 1, + "parameters": { + "amount": "2000", + "restaurant_id": "Arbys", + "order_id": "1", + "currency": "USD", + "payout_id": "1" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "restaurant_payout_initiate", + "typeVersion": 1, + "parameters": { + "amount": "3000", + "restaurant_id": "Arbys", + "order_id": "2", + "currency": "USD", + "payout_id": "1" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "driver_payout_initiate", + "typeVersion": 1, + "parameters": { + "amount": "1000", + "driver_id": "alice", + "order_id": "2", + "currency": "USD", + "payout_id": "3" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "driver_payout_initiate", + "typeVersion": 1, + "parameters": { + "amount": "500", + "driver_id": "bob", + "order_id": "1", + "currency": "USD", + "payout_id": "2" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "restaurant_payout_settle", + "typeVersion": 1, + "parameters": { + "amount": "5000", + "restaurant_id": "Arbys", + "currency": "USD", + "payout_id": "1" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "driver_payout_settle", + "typeVersion": 1, + "parameters": { + "amount": "500", + "driver_id": "bob", + "currency": "USD", + "payout_id": "2" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "driver_payout_settle", + "typeVersion": 1, + "parameters": { + "amount": "1000", + "driver_id": "alice", + "currency": "USD", + "payout_id": "3" + } + } + } + ] + }, + { + "name": "Charge Dispute", + "events": [ + { + "eventType": "entry", + "entry": { + "type": "order_placed", + "typeVersion": 1, + "parameters": { + "order_cost": "2000", + "platform_fee": "500", + "driver_fee": "500", + "restaurant_id": "Arbys", + "driver_id": "alice", + "order_id": "1", + "user_id": "carol", + "currency": "USD" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "card_settle", + "typeVersion": 1, + "parameters": { + "amount": "3000", + "order_id": "1", + "user_id": "carol", + "currency": "USD" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "restaurant_payout_initiate", + "typeVersion": 1, + "parameters": { + "amount": "2000", + "restaurant_id": "Arbys", + "order_id": "1", + "currency": "USD", + "payout_id": "1" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "restaurant_payout_settle", + "typeVersion": 1, + "parameters": { + "amount": "2000", + "restaurant_id": "Arbys", + "currency": "USD", + "payout_id": "1" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "driver_payout_initiate", + "typeVersion": 1, + "parameters": { + "amount": "500", + "driver_id": "alice", + "order_id": "1", + "currency": "USD", + "payout_id": "2" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "driver_payout_settle", + "typeVersion": 1, + "parameters": { + "amount": "500", + "driver_id": "alice", + "currency": "USD", + "payout_id": "2" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "dispute_payout_initiate", + "typeVersion": 1, + "parameters": { + "amount": "3000", + "order_id": "1", + "user_id": "carol", + "currency": "USD", + "disputes_id": "123", + "payout_id": "tx_123" + } + } + }, + { + "eventType": "entry", + "entry": { + "type": "dispute_payout_settle", + "typeVersion": 1, + "parameters": { + "amount": "3000", + "order_id": "1", + "user_id": "carol", + "currency": "USD", + "disputes_id": "123" + } + } + } + ] + } + ], + "groups": [] +} From a979a34343a88f4bf30942b18b75c01df0d9e024 Mon Sep 17 00:00:00 2001 From: Vigneshwer Vaidyanathan Date: Tue, 4 Aug 2026 19:40:30 -0400 Subject: [PATCH 2/3] test failing snapshot --- tests/snapshots/001-marketing-schema/sdk/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/snapshots/001-marketing-schema/sdk/client.py b/tests/snapshots/001-marketing-schema/sdk/client.py index 199a693..b3ad8bb 100644 --- a/tests/snapshots/001-marketing-schema/sdk/client.py +++ b/tests/snapshots/001-marketing-schema/sdk/client.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: tests/snapshots/001-marketing-schema/ -from typing import Any, Optional +from typing import Any, Optional, Dict from .add_ledger_entry import AddLedgerEntry from .add_ledger_entry_runtime import AddLedgerEntryRuntime From d9b7a3e2490a9adf461c8739cc706f89072892cd Mon Sep 17 00:00:00 2001 From: Vigneshwer Vaidyanathan Date: Tue, 4 Aug 2026 19:42:16 -0400 Subject: [PATCH 3/3] remove breaking snapshot change --- tests/snapshots/001-marketing-schema/sdk/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/snapshots/001-marketing-schema/sdk/client.py b/tests/snapshots/001-marketing-schema/sdk/client.py index b3ad8bb..199a693 100644 --- a/tests/snapshots/001-marketing-schema/sdk/client.py +++ b/tests/snapshots/001-marketing-schema/sdk/client.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: tests/snapshots/001-marketing-schema/ -from typing import Any, Optional, Dict +from typing import Any, Optional from .add_ledger_entry import AddLedgerEntry from .add_ledger_entry_runtime import AddLedgerEntryRuntime