diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..8f8270a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,39 @@ +# Changelog + +All notable changes to `fragment-python` will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/). + +Releases prior to `1.0.0` were published before this changelog was added and +are not documented here. + +## [1.0.0] + +### Changed + +- `GetLedgerAccountBalance` now returns total `balance` (self + children) + instead of `ownBalance`. +- `ListLedgerAccountBalances` and `ListMultiCurrencyLedgerAccountBalances` + now accept `consistencyMode` on `childBalance`, `childBalances`, + `balance`, and `balances` fields. + +### Removed + +- `GetLedgerAccountBalanceWithChildRollup` has been removed. + +### How to Upgrade + +1. Upgrade your schema to use total balance consistency. +2. Edit your schema JSON. Change `ownBalanceUpdates` to + `totalBalanceUpdates` in the ledger account consistency config. +3. Change `ownBalance` to `totalBalance` in entry conditions. +4. Ensure the schema has only one of `ownBalanceUpdates` or + `totalBalanceUpdates`. +5. Deploy the new schema. +6. You can now set `consistencyConfig.totalBalanceUpdates: strong` on any + account in the tree, and its balance will be strongly consistent. +7. Upgrade `fragment-python` to the latest version. +8. Change `$ownBalanceConsistencyMode` to `$balanceConsistencyMode`. +9. Use `GetLedgerAccountBalance` instead of + `GetLedgerAccountBalanceWithChildRollup`. diff --git a/README.md b/README.md index 8d202c0..130c621 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [Fragment](https://fragment.dev/) is the Ledger API for engineers that move money. Stop wrangling payment tables, debugging balance errors, and hacking together data pipelines. Start shipping the features that make a difference. +See [CHANGELOG.md](CHANGELOG.md) for release notes and upgrade guidance. + ## Installation Using `pip`: diff --git a/fragment/sdk/__init__.py b/fragment/sdk/__init__.py index 807b912..7c71fdc 100644 --- a/fragment/sdk/__init__.py +++ b/fragment/sdk/__init__.py @@ -71,12 +71,14 @@ ExternalTxSource, Granularity, IncreaseEnv, + LedgerAccountClearingStatus, LedgerAccountTypes, LedgerDataMigrationStatus, LedgerLinesConsistencyMode, LedgerMigrationStatus, LedgerTypes, LinkType, + PostLinesAs, ReadBalanceConsistencyMode, SceneEventType, SchemaConsistencyMode, @@ -143,10 +145,6 @@ GetLedgerAccountBalance, GetLedgerAccountBalanceLedgerAccount, ) -from .get_ledger_account_balance_with_child_rollup import ( - GetLedgerAccountBalanceWithChildRollup, - GetLedgerAccountBalanceWithChildRollupLedgerAccount, -) from .get_ledger_account_lines import ( GetLedgerAccountLines, GetLedgerAccountLinesLedgerAccount, @@ -180,10 +178,13 @@ ExternalAccountMatchInput, GroupBalanceAccountFilter, GroupFilter, + GroupInput, GroupMatchInput, GroupNotFilter, + GroupReconciliationParametersInput, Int96ConditionInput, Int96Filter, + LedgerAccountClearingStatusFilter, LedgerAccountConditionInput, LedgerAccountConsistencyConfigInput, LedgerAccountDataMigrationsFilterSet, @@ -230,6 +231,7 @@ SchemaLedgerEntryTagInput, SchemaLedgerLineInput, SchemaMatchInput, + SchemaRepeatedConfigInput, SchemaTxMatchInput, StringFilter, StringMatchFilter, @@ -497,8 +499,6 @@ "GetLedger", "GetLedgerAccountBalance", "GetLedgerAccountBalanceLedgerAccount", - "GetLedgerAccountBalanceWithChildRollup", - "GetLedgerAccountBalanceWithChildRollupLedgerAccount", "GetLedgerAccountLines", "GetLedgerAccountLinesLedgerAccount", "GetLedgerAccountLinesLedgerAccountLines", @@ -518,11 +518,15 @@ "Granularity", "GroupBalanceAccountFilter", "GroupFilter", + "GroupInput", "GroupMatchInput", "GroupNotFilter", + "GroupReconciliationParametersInput", "IncreaseEnv", "Int96ConditionInput", "Int96Filter", + "LedgerAccountClearingStatus", + "LedgerAccountClearingStatusFilter", "LedgerAccountConditionInput", "LedgerAccountConsistencyConfigInput", "LedgerAccountDataMigrationsFilterSet", @@ -612,6 +616,7 @@ "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLines", "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodes", "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodesAccount", + "PostLinesAs", "ReadBalanceConsistencyMode", "ReconcileTx", "ReconcileTxReconcileTxBadRequestError", @@ -661,6 +666,7 @@ "SchemaLedgerEntryTagInput", "SchemaLedgerLineInput", "SchemaMatchInput", + "SchemaRepeatedConfigInput", "SchemaTxMatchInput", "StoreSchema", "StoreSchemaStoreSchemaBadRequestError", diff --git a/fragment/sdk/add_ledger_entry.py b/fragment/sdk/add_ledger_entry.py index f33b1cc..d2209a3 100644 --- a/fragment/sdk/add_ledger_entry.py +++ b/fragment/sdk/add_ledger_entry.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -20,11 +20,11 @@ class AddLedgerEntryAddLedgerEntryAddLedgerEntryResult(BaseModel): typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") is_ik_replay: bool = Field(alias="isIkReplay") entry: "AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry" - lines: List["AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines"] + lines: list["AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines"] class AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") id: str ik: str posted: Any diff --git a/fragment/sdk/add_ledger_entry_runtime.py b/fragment/sdk/add_ledger_entry_runtime.py index 054b034..361b226 100644 --- a/fragment/sdk/add_ledger_entry_runtime.py +++ b/fragment/sdk/add_ledger_entry_runtime.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -20,11 +20,11 @@ class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResult(BaseModel): typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") is_ik_replay: bool = Field(alias="isIkReplay") entry: "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry" - lines: List["AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines"] + lines: list["AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines"] class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") id: str ik: str posted: Any diff --git a/fragment/sdk/client.py b/fragment/sdk/client.py index 0ca652e..5896823 100644 --- a/fragment/sdk/client.py +++ b/fragment/sdk/client.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, Dict, List, Optional +from typing import Any, Optional from .add_ledger_entry import AddLedgerEntry from .add_ledger_entry_runtime import AddLedgerEntryRuntime @@ -23,9 +23,6 @@ from .get_entry_data_migrations import GetEntryDataMigrations from .get_ledger import GetLedger from .get_ledger_account_balance import GetLedgerAccountBalance -from .get_ledger_account_balance_with_child_rollup import ( - GetLedgerAccountBalanceWithChildRollup, -) from .get_ledger_account_lines import GetLedgerAccountLines from .get_ledger_entry import GetLedgerEntry from .get_schema import GetSchema @@ -74,8 +71,7 @@ def gql(q: str) -> str: class Client(AsyncFragmentClient): async def store_schema(self, schema: SchemaInput, **kwargs: Any) -> StoreSchema: - query = gql( - """ + query = gql(""" mutation storeSchema($schema: SchemaInput!) { storeSchema(schema: $schema) { __typename @@ -101,9 +97,8 @@ async def store_schema(self, schema: SchemaInput, **kwargs: Any) -> StoreSchema: } } } - """ - ) - variables: Dict[str, object] = {"schema": schema} + """) + variables: dict[str, object] = {"schema": schema} response = await self.execute( query=query, operation_name="storeSchema", variables=variables, **kwargs ) @@ -113,8 +108,7 @@ async def store_schema(self, schema: SchemaInput, **kwargs: Any) -> StoreSchema: async def delete_schema( self, schema: SchemaMatchInput, **kwargs: Any ) -> DeleteSchema: - query = gql( - """ + query = gql(""" mutation deleteSchema($schema: SchemaMatchInput!) { deleteSchema(schema: $schema) { __typename @@ -133,9 +127,8 @@ async def delete_schema( } } } - """ - ) - variables: Dict[str, object] = {"schema": schema} + """) + variables: dict[str, object] = {"schema": schema} response = await self.execute( query=query, operation_name="deleteSchema", variables=variables, **kwargs ) @@ -145,8 +138,7 @@ async def delete_schema( async def create_ledger( self, ik: Any, ledger: CreateLedgerInput, schema_key: Any, **kwargs: Any ) -> CreateLedger: - query = gql( - """ + query = gql(""" mutation createLedger($ik: SafeString!, $ledger: CreateLedgerInput!, $schemaKey: SafeString!) { createLedger(ik: $ik, ledger: $ledger, schema: {key: $schemaKey}) { __typename @@ -174,9 +166,8 @@ async def create_ledger( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ik": ik, "ledger": ledger, "schemaKey": schema_key, @@ -190,8 +181,7 @@ async def create_ledger( async def delete_ledger( self, ledger: LedgerMatchInput, **kwargs: Any ) -> DeleteLedger: - query = gql( - """ + query = gql(""" mutation deleteLedger($ledger: LedgerMatchInput!) { deleteLedger(ledger: $ledger) { __typename @@ -210,9 +200,8 @@ async def delete_ledger( } } } - """ - ) - variables: Dict[str, object] = {"ledger": ledger} + """) + variables: dict[str, object] = {"ledger": ledger} response = await self.execute( query=query, operation_name="deleteLedger", variables=variables, **kwargs ) @@ -223,16 +212,15 @@ async def add_ledger_entry( self, ik: Any, ledger_ik: Any, - type: str, + type_: str, parameters: Any, type_version: Optional[int] = None, posted: Optional[Any] = None, - tags: Optional[List[LedgerEntryTagInput]] = None, - groups: Optional[List[LedgerEntryGroupInput]] = None, + tags: Optional[list[LedgerEntryTagInput]] = None, + groups: Optional[list[LedgerEntryGroupInput]] = None, **kwargs: Any ) -> AddLedgerEntry: - query = gql( - """ + query = gql(""" mutation addLedgerEntry($ik: SafeString!, $ledgerIk: SafeString!, $type: String!, $typeVersion: Int, $posted: DateTime, $parameters: JSON!, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!]) { addLedgerEntry( ik: $ik @@ -268,12 +256,11 @@ async def add_ledger_entry( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ik": ik, "ledgerIk": ledger_ik, - "type": type, + "type": type_, "typeVersion": type_version, "posted": posted, "parameters": parameters, @@ -287,8 +274,7 @@ async def add_ledger_entry( return AddLedgerEntry.model_validate(data) async def reverse_ledger_entry(self, id: str, **kwargs: Any) -> ReverseLedgerEntry: - query = gql( - """ + query = gql(""" mutation reverseLedgerEntry($id: ID!) { reverseLedgerEntry(id: $id) { __typename @@ -343,9 +329,8 @@ async def reverse_ledger_entry(self, id: str, **kwargs: Any) -> ReverseLedgerEnt } } } - """ - ) - variables: Dict[str, object] = {"id": id} + """) + variables: dict[str, object] = {"id": id} response = await self.execute( query=query, operation_name="reverseLedgerEntry", @@ -358,8 +343,7 @@ async def reverse_ledger_entry(self, id: str, **kwargs: Any) -> ReverseLedgerEnt async def migrate_ledger_entry( self, id: str, new_ledger_entry: LedgerEntryInput, **kwargs: Any ) -> MigrateLedgerEntry: - query = gql( - """ + query = gql(""" mutation migrateLedgerEntry($id: ID!, $newLedgerEntry: LedgerEntryInput!) { migrateLedgerEntry(input: {id: $id, newLedgerEntry: $newLedgerEntry}) { __typename @@ -435,9 +419,8 @@ async def migrate_ledger_entry( } } } - """ - ) - variables: Dict[str, object] = {"id": id, "newLedgerEntry": new_ledger_entry} + """) + variables: dict[str, object] = {"id": id, "newLedgerEntry": new_ledger_entry} response = await self.execute( query=query, operation_name="migrateLedgerEntry", @@ -450,17 +433,16 @@ async def migrate_ledger_entry( async def add_ledger_entry_runtime( self, ik: Any, - type: str, + type_: str, ledger_ik: Any, - lines: List[LedgerLineInput], + lines: list[LedgerLineInput], type_version: Optional[int] = None, posted: Optional[Any] = None, - tags: Optional[List[LedgerEntryTagInput]] = None, - groups: Optional[List[LedgerEntryGroupInput]] = None, + tags: Optional[list[LedgerEntryTagInput]] = None, + groups: Optional[list[LedgerEntryGroupInput]] = None, **kwargs: Any ) -> AddLedgerEntryRuntime: - query = gql( - """ + query = gql(""" mutation addLedgerEntryRuntime($ik: SafeString!, $type: String!, $typeVersion: Int, $ledgerIk: SafeString!, $posted: DateTime, $lines: [LedgerLineInput!]!, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!]) { addLedgerEntry( ik: $ik @@ -496,11 +478,10 @@ async def add_ledger_entry_runtime( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ik": ik, - "type": type, + "type": type_, "typeVersion": type_version, "ledgerIk": ledger_ik, "posted": posted, @@ -520,15 +501,14 @@ async def add_ledger_entry_runtime( async def reconcile_tx( self, ledger_ik: Any, - type: str, + type_: str, parameters: Any, type_version: Optional[int] = None, - tags: Optional[List[LedgerEntryTagInput]] = None, - groups: Optional[List[LedgerEntryGroupInput]] = None, + tags: Optional[list[LedgerEntryTagInput]] = None, + groups: Optional[list[LedgerEntryGroupInput]] = None, **kwargs: Any ) -> ReconcileTx: - query = gql( - """ + 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} @@ -564,11 +544,10 @@ async def reconcile_tx( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, - "type": type, + "type": type_, "typeVersion": type_version, "parameters": parameters, "tags": tags, @@ -583,15 +562,14 @@ async def reconcile_tx( async def reconcile_tx_runtime( self, ledger_ik: Any, - type: str, - lines: List[LedgerLineInput], + type_: str, + lines: list[LedgerLineInput], type_version: Optional[int] = None, - tags: Optional[List[LedgerEntryTagInput]] = None, - groups: Optional[List[LedgerEntryGroupInput]] = None, + tags: Optional[list[LedgerEntryTagInput]] = None, + groups: Optional[list[LedgerEntryGroupInput]] = None, **kwargs: Any ) -> ReconcileTxRuntime: - query = gql( - """ + 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} @@ -627,11 +605,10 @@ async def reconcile_tx_runtime( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, - "type": type, + "type": type_, "typeVersion": type_version, "lines": lines, "tags": tags, @@ -653,8 +630,7 @@ async def update_ledger_entry( update: UpdateLedgerEntryInput, **kwargs: Any ) -> UpdateLedgerEntry: - query = gql( - """ + query = gql(""" mutation updateLedgerEntry($entryIk: SafeString!, $ledgerIk: SafeString!, $update: UpdateLedgerEntryInput!) { updateLedgerEntry( ledgerEntry: {ik: $entryIk, ledger: {ik: $ledgerIk}} @@ -699,9 +675,8 @@ async def update_ledger_entry( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "entryIk": entry_ik, "ledgerIk": ledger_ik, "update": update, @@ -718,8 +693,7 @@ async def update_ledger_entry( async def update_ledger( self, ledger_ik: Any, update: UpdateLedgerInput, **kwargs: Any ) -> UpdateLedger: - query = gql( - """ + query = gql(""" mutation updateLedger($ledgerIk: SafeString!, $update: UpdateLedgerInput!) { updateLedger(ledger: {ik: $ledgerIk}, update: $update) { __typename @@ -742,9 +716,8 @@ async def update_ledger( } } } - """ - ) - variables: Dict[str, object] = {"ledgerIk": ledger_ik, "update": update} + """) + variables: dict[str, object] = {"ledgerIk": ledger_ik, "update": update} response = await self.execute( query=query, operation_name="updateLedger", variables=variables, **kwargs ) @@ -754,8 +727,7 @@ async def update_ledger( async def create_custom_link( self, name: str, ik: Any, **kwargs: Any ) -> CreateCustomLink: - query = gql( - """ + query = gql(""" mutation createCustomLink($name: String!, $ik: SafeString!) { createCustomLink(name: $name, ik: $ik) { __typename @@ -779,9 +751,8 @@ async def create_custom_link( } } } - """ - ) - variables: Dict[str, object] = {"name": name, "ik": ik} + """) + variables: dict[str, object] = {"name": name, "ik": ik} response = await self.execute( query=query, operation_name="createCustomLink", @@ -792,10 +763,9 @@ async def create_custom_link( return CreateCustomLink.model_validate(data) async def sync_custom_accounts( - self, link_id: str, accounts: List[CustomAccountInput], **kwargs: Any + self, link_id: str, accounts: list[CustomAccountInput], **kwargs: Any ) -> SyncCustomAccounts: - query = gql( - """ + query = gql(""" mutation syncCustomAccounts($linkId: ID!, $accounts: [CustomAccountInput!]!) { syncCustomAccounts(link: {id: $linkId}, accounts: $accounts) { __typename @@ -822,9 +792,8 @@ async def sync_custom_accounts( } } } - """ - ) - variables: Dict[str, object] = {"linkId": link_id, "accounts": accounts} + """) + variables: dict[str, object] = {"linkId": link_id, "accounts": accounts} response = await self.execute( query=query, operation_name="syncCustomAccounts", @@ -835,10 +804,9 @@ async def sync_custom_accounts( return SyncCustomAccounts.model_validate(data) async def sync_custom_txs( - self, link_id: str, txs: List[CustomTxInput], **kwargs: Any + self, link_id: str, txs: list[CustomTxInput], **kwargs: Any ) -> SyncCustomTxs: - query = gql( - """ + query = gql(""" mutation syncCustomTxs($linkId: ID!, $txs: [CustomTxInput!]!) { syncCustomTxs(link: {id: $linkId}, txs: $txs) { __typename @@ -866,18 +834,16 @@ async def sync_custom_txs( } } } - """ - ) - variables: Dict[str, object] = {"linkId": link_id, "txs": txs} + """) + 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( - """ + async def delete_custom_txs(self, txs: list[str], **kwargs: Any) -> DeleteCustomTxs: + query = gql(""" mutation deleteCustomTxs($txs: [ID!]!) { deleteCustomTxs(txs: $txs) { __typename @@ -907,9 +873,8 @@ async def delete_custom_txs(self, txs: List[str], **kwargs: Any) -> DeleteCustom } } } - """ - ) - variables: Dict[str, object] = {"txs": txs} + """) + variables: dict[str, object] = {"txs": txs} response = await self.execute( query=query, operation_name="deleteCustomTxs", variables=variables, **kwargs ) @@ -917,8 +882,7 @@ async def delete_custom_txs(self, txs: List[str], **kwargs: Any) -> DeleteCustom return DeleteCustomTxs.model_validate(data) async def get_ledger(self, ik: Any, **kwargs: Any) -> GetLedger: - query = gql( - """ + query = gql(""" query getLedger($ik: SafeString!) { ledger(ledger: {ik: $ik}) { id @@ -928,9 +892,8 @@ async def get_ledger(self, ik: Any, **kwargs: Any) -> GetLedger: balanceUTCOffset } } - """ - ) - variables: Dict[str, object] = {"ik": ik} + """) + variables: dict[str, object] = {"ik": ik} response = await self.execute( query=query, operation_name="getLedger", variables=variables, **kwargs ) @@ -940,8 +903,7 @@ async def get_ledger(self, ik: Any, **kwargs: Any) -> GetLedger: async def get_ledger_entry( self, ik: Any, ledger_ik: Any, **kwargs: Any ) -> GetLedgerEntry: - query = gql( - """ + query = gql(""" query getLedgerEntry($ik: SafeString!, $ledgerIk: SafeString!) { ledgerEntry(ledgerEntry: {ik: $ik, ledger: {ik: $ledgerIk}}) { id @@ -960,9 +922,8 @@ async def get_ledger_entry( } } } - """ - ) - variables: Dict[str, object] = {"ik": ik, "ledgerIk": ledger_ik} + """) + variables: dict[str, object] = {"ik": ik, "ledgerIk": ledger_ik} response = await self.execute( query=query, operation_name="getLedgerEntry", variables=variables, **kwargs ) @@ -977,8 +938,7 @@ async def list_ledger_accounts( before: Optional[str] = None, **kwargs: Any ) -> ListLedgerAccounts: - query = gql( - """ + query = gql(""" query listLedgerAccounts($ledgerIk: SafeString!, $after: String, $first: Int, $before: String) { ledger(ledger: {ik: $ledgerIk}) { id @@ -1002,9 +962,8 @@ async def list_ledger_accounts( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, "after": after, "first": first, @@ -1028,11 +987,12 @@ async def list_ledger_account_balances( 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) { + 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 @@ -1050,8 +1010,16 @@ async def list_ledger_account_balances( at: $balanceAt consistencyMode: $ownBalanceConsistencyMode ) - childBalance(currency: $balanceCurrency, at: $balanceAt) - balance(currency: $balanceCurrency, at: $balanceAt) + childBalance( + currency: $balanceCurrency + at: $balanceAt + consistencyMode: $childBalanceConsistencyMode + ) + balance( + currency: $balanceCurrency + at: $balanceAt + consistencyMode: $balanceConsistencyMode + ) } pageInfo { hasNextPage @@ -1062,9 +1030,8 @@ async def list_ledger_account_balances( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, "after": after, "first": first, @@ -1072,6 +1039,8 @@ async def list_ledger_account_balances( "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, @@ -1090,11 +1059,12 @@ async def list_multi_currency_ledger_account_balances( 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) { + 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 @@ -1116,7 +1086,7 @@ async def list_multi_currency_ledger_account_balances( amount } } - childBalances(at: $balanceAt) { + childBalances(at: $balanceAt, consistencyMode: $childBalancesConsistencyMode) { nodes { currency { code @@ -1125,7 +1095,7 @@ async def list_multi_currency_ledger_account_balances( amount } } - balances(at: $balanceAt) { + balances(at: $balanceAt, consistencyMode: $balancesConsistencyMode) { nodes { currency { code @@ -1144,15 +1114,16 @@ async def list_multi_currency_ledger_account_balances( } } } - """ - ) - variables: Dict[str, object] = { + """) + 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, @@ -1170,11 +1141,10 @@ async def get_ledger_account_lines( after: Optional[str] = None, first: Optional[int] = None, before: Optional[str] = None, - filter: Optional[LedgerLinesFilterSet] = None, + filter_: Optional[LedgerLinesFilterSet] = None, **kwargs: Any ) -> GetLedgerAccountLines: - query = gql( - """ + query = gql(""" query getLedgerAccountLines($path: String!, $ledgerIk: SafeString!, $after: String, $first: Int, $before: String, $filter: LedgerLinesFilterSet) { ledgerAccount(ledgerAccount: {ledger: {ik: $ledgerIk}, path: $path}) { id @@ -1196,15 +1166,14 @@ async def get_ledger_account_lines( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "path": path, "ledgerIk": ledger_ik, "after": after, "first": first, "before": before, - "filter": filter, + "filter": filter_, } response = await self.execute( query=query, @@ -1221,30 +1190,28 @@ async def get_ledger_account_balance( ledger_ik: Any, balance_currency: Optional[CurrencyMatchInput] = None, balance_at: Optional[Any] = None, - own_balance_consistency_mode: Optional[ReadBalanceConsistencyMode] = None, + balance_consistency_mode: Optional[ReadBalanceConsistencyMode] = None, **kwargs: Any ) -> GetLedgerAccountBalance: - query = gql( - """ - query getLedgerAccountBalance($path: String!, $ledgerIk: SafeString!, $balanceCurrency: CurrencyMatchInput, $balanceAt: LastMoment, $ownBalanceConsistencyMode: ReadBalanceConsistencyMode) { + query = gql(""" + query getLedgerAccountBalance($path: String!, $ledgerIk: SafeString!, $balanceCurrency: CurrencyMatchInput, $balanceAt: LastMoment, $balanceConsistencyMode: ReadBalanceConsistencyMode) { ledgerAccount(ledgerAccount: {ledger: {ik: $ledgerIk}, path: $path}) { id path - ownBalance( + balance( currency: $balanceCurrency at: $balanceAt - consistencyMode: $ownBalanceConsistencyMode + consistencyMode: $balanceConsistencyMode ) } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "path": path, "ledgerIk": ledger_ik, "balanceCurrency": balance_currency, "balanceAt": balance_at, - "ownBalanceConsistencyMode": own_balance_consistency_mode, + "balanceConsistencyMode": balance_consistency_mode, } response = await self.execute( query=query, @@ -1255,45 +1222,10 @@ async def get_ledger_account_balance( data = self.get_data(response) return GetLedgerAccountBalance.model_validate(data) - async def get_ledger_account_balance_with_child_rollup( - self, - path: str, - ledger_ik: Any, - balance_currency: Optional[CurrencyMatchInput] = None, - balance_at: Optional[Any] = None, - **kwargs: Any - ) -> GetLedgerAccountBalanceWithChildRollup: - query = gql( - """ - query GetLedgerAccountBalanceWithChildRollup($path: String!, $ledgerIk: SafeString!, $balanceCurrency: CurrencyMatchInput, $balanceAt: LastMoment) { - ledgerAccount(ledgerAccount: {ledger: {ik: $ledgerIk}, path: $path}) { - id - path - balance(currency: $balanceCurrency, at: $balanceAt) - } - } - """ - ) - variables: Dict[str, object] = { - "path": path, - "ledgerIk": ledger_ik, - "balanceCurrency": balance_currency, - "balanceAt": balance_at, - } - response = await self.execute( - query=query, - operation_name="GetLedgerAccountBalanceWithChildRollup", - variables=variables, - **kwargs - ) - data = self.get_data(response) - return GetLedgerAccountBalanceWithChildRollup.model_validate(data) - async def get_schema( self, key: Any, version: Optional[int] = None, **kwargs: Any ) -> GetSchema: - query = gql( - """ + query = gql(""" query getSchema($key: SafeString!, $version: Int) { schema(schema: {key: $key, version: $version}) { key @@ -1305,9 +1237,8 @@ async def get_schema( } } } - """ - ) - variables: Dict[str, object] = {"key": key, "version": version} + """) + variables: dict[str, object] = {"key": key, "version": version} response = await self.execute( query=query, operation_name="getSchema", variables=variables, **kwargs ) @@ -1320,11 +1251,10 @@ async def list_ledger_entries( after: Optional[str] = None, first: Optional[int] = None, before: Optional[str] = None, - filter: Optional[LedgerEntriesFilterSet] = None, + filter_: Optional[LedgerEntriesFilterSet] = None, **kwargs: Any ) -> ListLedgerEntries: - query = gql( - """ + 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) { @@ -1350,14 +1280,13 @@ async def list_ledger_entries( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, "after": after, "first": first, "before": before, - "filter": filter, + "filter": filter_, } response = await self.execute( query=query, @@ -1369,17 +1298,15 @@ async def list_ledger_entries( return ListLedgerEntries.model_validate(data) async def get_workspace(self, **kwargs: Any) -> GetWorkspace: - query = gql( - """ + query = gql(""" query getWorkspace { workspace { id name } } - """ - ) - variables: Dict[str, object] = {} + """) + variables: dict[str, object] = {} response = await self.execute( query=query, operation_name="getWorkspace", variables=variables, **kwargs ) @@ -1396,11 +1323,10 @@ async def list_ledger_entry_group_balances( before: Optional[str] = None, first: Optional[int] = None, last: Optional[int] = None, - filter: Optional[LedgerEntryGroupBalanceFilterSet] = None, + filter_: Optional[LedgerEntryGroupBalanceFilterSet] = None, **kwargs: Any ) -> ListLedgerEntryGroupBalances: - query = gql( - """ + 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} @@ -1434,9 +1360,8 @@ async def list_ledger_entry_group_balances( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, "groupKey": group_key, "groupValue": group_value, @@ -1445,7 +1370,7 @@ async def list_ledger_entry_group_balances( "before": before, "first": first, "last": last, - "filter": filter, + "filter": filter_, } response = await self.execute( query=query, @@ -1459,15 +1384,14 @@ async def list_ledger_entry_group_balances( async def get_entry_data_migrations( self, ledger_ik: Any, - filter: Optional[LedgerEntryDataMigrationsFilterSet] = None, + 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 = gql(""" query getEntryDataMigrations($ledgerIk: SafeString!, $filter: LedgerEntryDataMigrationsFilterSet, $after: String, $before: String, $first: Int, $last: Int) { ledger(ledger: {ik: $ledgerIk}) { ledgerEntryDataMigrations( @@ -1521,11 +1445,10 @@ async def get_entry_data_migrations( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, - "filter": filter, + "filter": filter_, "after": after, "before": before, "first": first, @@ -1551,8 +1474,7 @@ async def get_entries_to_migrate_for_ledger_entry_data_migration( last: Optional[int] = None, **kwargs: Any ) -> GetEntriesToMigrateForLedgerEntryDataMigration: - query = gql( - """ + query = gql(""" query getEntriesToMigrateForLedgerEntryDataMigration($ledgerIk: SafeString!, $entryType: String!, $typeVersion: String!, $after: String, $before: String, $first: Int, $last: Int) { ledger(ledger: {ik: $ledgerIk}) { ledgerEntryDataMigrations( @@ -1590,9 +1512,8 @@ async def get_entries_to_migrate_for_ledger_entry_data_migration( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, "entryType": entry_type, "typeVersion": type_version, @@ -1613,15 +1534,14 @@ async def get_entries_to_migrate_for_ledger_entry_data_migration( async def get_account_data_migrations( self, ledger_ik: Any, - filter: Optional[LedgerAccountDataMigrationsFilterSet] = None, + 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 = gql(""" query getAccountDataMigrations($ledgerIk: SafeString!, $filter: LedgerAccountDataMigrationsFilterSet, $after: String, $before: String, $first: Int, $last: Int) { ledger(ledger: {ik: $ledgerIk}) { ledgerAccountDataMigrations( @@ -1674,11 +1594,10 @@ async def get_account_data_migrations( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, - "filter": filter, + "filter": filter_, "after": after, "before": before, "first": first, @@ -1703,8 +1622,7 @@ async def get_entries_to_migrate_for_ledger_account_data_migration( last: Optional[int] = None, **kwargs: Any ) -> GetEntriesToMigrateForLedgerAccountDataMigration: - query = gql( - """ + 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}}) { @@ -1740,9 +1658,8 @@ async def get_entries_to_migrate_for_ledger_account_data_migration( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, "accountPath": account_path, "after": after, @@ -1762,8 +1679,7 @@ async def get_entries_to_migrate_for_ledger_account_data_migration( async def create_custom_currency( self, id: Any, name: str, precision: int, custom_code: str, **kwargs: Any ) -> CreateCustomCurrency: - query = gql( - """ + query = gql(""" mutation createCustomCurrency($id: SafeString!, $name: String!, $precision: Int!, $customCode: String!) { createCustomCurrency( customCurrency: {customCurrencyId: $id, name: $name, precision: $precision, customCode: $customCode} @@ -1790,9 +1706,8 @@ async def create_custom_currency( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "id": id, "name": name, "precision": precision, diff --git a/fragment/sdk/delete_custom_txs.py b/fragment/sdk/delete_custom_txs.py index 7ff39d8..0a9eaf0 100644 --- a/fragment/sdk/delete_custom_txs.py +++ b/fragment/sdk/delete_custom_txs.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -25,7 +25,7 @@ class DeleteCustomTxsDeleteCustomTxsBadRequestError(BaseModel): class DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResult(BaseModel): typename__: Literal["DeleteCustomTxsResult"] = Field(alias="__typename") - txs: List["DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxs"] + txs: list["DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxs"] class DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxs(BaseModel): diff --git a/fragment/sdk/enums.py b/fragment/sdk/enums.py index b66e8cb..b9f0234 100644 --- a/fragment/sdk/enums.py +++ b/fragment/sdk/enums.py @@ -40,6 +40,8 @@ class CurrencyCode(str, Enum): BYR = "BYR" BZD = "BZD" CAD = "CAD" + CADC = "CADC" + CADT = "CADT" CDF = "CDF" CHF = "CHF" CLP = "CLP" @@ -61,6 +63,7 @@ class CurrencyCode(str, Enum): ETB = "ETB" ETH = "ETH" EUR = "EUR" + EURC = "EURC" FJD = "FJD" FKP = "FKP" GBP = "GBP" @@ -170,6 +173,7 @@ class CurrencyCode(str, Enum): UNI = "UNI" USD = "USD" USDC = "USDC" + USDG = "USDG" USDT = "USDT" UYU = "UYU" UZS = "UZS" @@ -215,6 +219,11 @@ class IncreaseEnv(str, Enum): sandbox = "sandbox" +class LedgerAccountClearingStatus(str, Enum): + cleared = "cleared" + pending = "pending" + + class LedgerAccountTypes(str, Enum): asset = "asset" expense = "expense" @@ -251,6 +260,12 @@ class LinkType(str, Enum): 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" diff --git a/fragment/sdk/get_account_data_migrations.py b/fragment/sdk/get_account_data_migrations.py index 2898c5b..72d97e9 100644 --- a/fragment/sdk/get_account_data_migrations.py +++ b/fragment/sdk/get_account_data_migrations.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -20,7 +20,7 @@ class GetAccountDataMigrationsLedger(BaseModel): class GetAccountDataMigrationsLedgerLedgerAccountDataMigrations(BaseModel): - nodes: List["GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodes"] + nodes: list["GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodes"] page_info: "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsPageInfo" = ( Field(alias="pageInfo") ) @@ -48,7 +48,7 @@ class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesCurrentMigra class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntries( BaseModel ): - nodes: List[ + nodes: list[ "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodes" ] page_info: ( @@ -60,7 +60,7 @@ class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntrie BaseModel ): id: str - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") posted: Any parameters: Optional[Any] @@ -75,7 +75,7 @@ class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntrie class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistory(BaseModel): - nodes: List[ + nodes: list[ "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistoryNodes" ] page_info: ( diff --git a/fragment/sdk/get_entries_to_migrate_for_ledger_account_data_migration.py b/fragment/sdk/get_entries_to_migrate_for_ledger_account_data_migration.py index 24ecdeb..e12a36b 100644 --- a/fragment/sdk/get_entries_to_migrate_for_ledger_account_data_migration.py +++ b/fragment/sdk/get_entries_to_migrate_for_ledger_account_data_migration.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -21,7 +21,7 @@ class GetEntriesToMigrateForLedgerAccountDataMigrationLedger(BaseModel): class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrations( BaseModel ): - nodes: List[ + nodes: list[ "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodes" ] @@ -37,7 +37,7 @@ class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMig class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntries( BaseModel ): - nodes: List[ + nodes: list[ "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodes" ] page_info: ( @@ -50,7 +50,7 @@ class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMig ): id: str ik: str - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") type_version: Optional[int] = Field(alias="typeVersion") description: Optional[str] posted: Any @@ -62,7 +62,7 @@ class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMig class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLines( BaseModel ): - nodes: List[ + nodes: list[ "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLinesNodes" ] diff --git a/fragment/sdk/get_entries_to_migrate_for_ledger_entry_data_migration.py b/fragment/sdk/get_entries_to_migrate_for_ledger_entry_data_migration.py index c584d4b..19683c3 100644 --- a/fragment/sdk/get_entries_to_migrate_for_ledger_entry_data_migration.py +++ b/fragment/sdk/get_entries_to_migrate_for_ledger_entry_data_migration.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -21,7 +21,7 @@ class GetEntriesToMigrateForLedgerEntryDataMigrationLedger(BaseModel): class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrations( BaseModel ): - nodes: List[ + nodes: list[ "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodes" ] @@ -37,7 +37,7 @@ class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrati class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntries( BaseModel ): - nodes: List[ + nodes: list[ "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodes" ] page_info: ( @@ -50,7 +50,7 @@ class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrati ): id: str ik: str - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") type_version: Optional[int] = Field(alias="typeVersion") description: Optional[str] posted: Any @@ -62,7 +62,7 @@ class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrati class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLines( BaseModel ): - nodes: List[ + nodes: list[ "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLinesNodes" ] diff --git a/fragment/sdk/get_entry_data_migrations.py b/fragment/sdk/get_entry_data_migrations.py index 001e898..d259ef0 100644 --- a/fragment/sdk/get_entry_data_migrations.py +++ b/fragment/sdk/get_entry_data_migrations.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -20,7 +20,7 @@ class GetEntryDataMigrationsLedger(BaseModel): class GetEntryDataMigrationsLedgerLedgerEntryDataMigrations(BaseModel): - nodes: List["GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodes"] + nodes: list["GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodes"] page_info: "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsPageInfo" = Field( alias="pageInfo" ) @@ -49,7 +49,7 @@ class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesCurrentMigration class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntries( BaseModel ): - nodes: List[ + nodes: list[ "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodes" ] page_info: ( @@ -61,7 +61,7 @@ class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNod BaseModel ): id: str - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") posted: Any parameters: Optional[Any] @@ -76,7 +76,7 @@ class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesPag class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistory(BaseModel): - nodes: List[ + nodes: list[ "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistoryNodes" ] page_info: ( diff --git a/fragment/sdk/get_ledger_account_balance.py b/fragment/sdk/get_ledger_account_balance.py index 725737f..301d1d0 100644 --- a/fragment/sdk/get_ledger_account_balance.py +++ b/fragment/sdk/get_ledger_account_balance.py @@ -17,7 +17,7 @@ class GetLedgerAccountBalance(BaseModel): class GetLedgerAccountBalanceLedgerAccount(BaseModel): id: str path: str - own_balance: Any = Field(alias="ownBalance") + balance: Any GetLedgerAccountBalance.model_rebuild() diff --git a/fragment/sdk/get_ledger_account_lines.py b/fragment/sdk/get_ledger_account_lines.py index 250997a..c3500f3 100644 --- a/fragment/sdk/get_ledger_account_lines.py +++ b/fragment/sdk/get_ledger_account_lines.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -21,7 +21,7 @@ class GetLedgerAccountLinesLedgerAccount(BaseModel): class GetLedgerAccountLinesLedgerAccountLines(BaseModel): - nodes: List["GetLedgerAccountLinesLedgerAccountLinesNodes"] + nodes: list["GetLedgerAccountLinesLedgerAccountLinesNodes"] page_info: "GetLedgerAccountLinesLedgerAccountLinesPageInfo" = Field( alias="pageInfo" ) diff --git a/fragment/sdk/get_ledger_entry.py b/fragment/sdk/get_ledger_entry.py index cc37a3c..d6e03ec 100644 --- a/fragment/sdk/get_ledger_entry.py +++ b/fragment/sdk/get_ledger_entry.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -22,7 +22,7 @@ class GetLedgerEntryLedgerEntry(BaseModel): class GetLedgerEntryLedgerEntryLines(BaseModel): - nodes: List["GetLedgerEntryLedgerEntryLinesNodes"] + nodes: list["GetLedgerEntryLedgerEntryLinesNodes"] class GetLedgerEntryLedgerEntryLinesNodes(BaseModel): diff --git a/fragment/sdk/input_types.py b/fragment/sdk/input_types.py index eb5ddaf..3d1280a 100644 --- a/fragment/sdk/input_types.py +++ b/fragment/sdk/input_types.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: schema.graphql -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -10,11 +10,13 @@ BalanceUpdateConsistencyMode, CurrencyCode, CurrencyMode, + LedgerAccountClearingStatus, LedgerAccountTypes, LedgerDataMigrationStatus, LedgerLinesConsistencyMode, LedgerTypes, LinkType, + PostLinesAs, SceneEventType, SchemaConsistencyMode, SchemaLedgerAccountStatus, @@ -24,97 +26,139 @@ class ChartOfAccountsInput(BaseModel): - accounts: List["SchemaLedgerAccountInput"] + """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/docs/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 - type: Optional[LedgerAccountTypes] = 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( + 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/docs/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/docs/reconcile-payments)." name: str + "The name of the Ledger Account." parent: Optional["LedgerAccountMatchInput"] = None - type: Optional[LedgerAccountTypes] = 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] = None + type_: Optional[LedgerTypes] = Field(alias="type", default=None) class CurrencyFilter(BaseModel): equal_to: Optional["CurrencyMatchInput"] = Field(alias="equalTo", default=None) - in_: Optional[List["CurrencyMatchInput"]] = Field(alias="in", 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) + in_: Optional[list[Any]] = Field(alias="in", default=None) + "Must match one of the values provided. Limited to 100 items maximum." 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): @@ -126,158 +170,311 @@ class ExternalAccountFilter(BaseModel): equal_to: Optional["ExternalAccountMatchInput"] = Field( alias="equalTo", default=None ) - in_: Optional[List["ExternalAccountMatchInput"]] = Field(alias="in", 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) - in_: Optional[List["GroupMatchInput"]] = Field(alias="in", 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) - key_in: Optional[List[Any]] = Field(alias="keyIn", 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) - not_in: Optional[List["GroupMatchInput"]] = Field(alias="notIn", 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) - not_key_in: Optional[List[Any]] = Field(alias="notKeyIn", 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): - key_in: Optional[List[Any]] = Field(alias="keyIn", default=None) + """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): - own_balance: "Int96ConditionInput" = Field(alias="ownBalance") + """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): - groups: Optional[List["LedgerAccountGroupConsistencyConfigInput"]] = None + """The payload configuring the consistency for this Ledger Account. + See [Configure consistency](https://fragment.dev/docs/configure-consistency).""" + + groups: Optional[list["LedgerAccountGroupConsistencyConfigInput"]] = None + "The consistency configuration for Ledger Entry Groups affecting this account.\n\nSee [Configure consistency](https://fragment.dev/docs/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/docs/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/docs/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/docs/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) - in_: Optional[List["LedgerAccountMatchInput"]] = Field(alias="in", 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): - key: str + """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/docs/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) - in_: Optional[List[LedgerAccountTypes]] = Field(alias="in", 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 - type: Optional["LedgerAccountTypeFilter"] = 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 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 show_hidden: Optional[bool] = Field(alias="showHidden", default=None) + "Use this filter to show hidden Ledger Entries." tag: Optional["TagFilter"] = None - type: Optional["StringFilter"] = 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) - in_: Optional[List["LedgerEntryMatchInput"]] = Field(alias="in", 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): @@ -288,73 +485,128 @@ class LedgerEntryGroupMatchInput(BaseModel): 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): - conditions: Optional[List["LedgerEntryConditionInput"]] = None + """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 - groups: Optional[List["LedgerEntryGroupInput"]] = 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 - lines: Optional[List["LedgerLineInput"]] = 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 - tags: Optional[List["LedgerEntryTagInput"]] = None - type: Optional[str] = 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 + "Filter by the posted date of the Ledger Line. This is identical to using `posted`, but only supports day-level granularity." 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>`.\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 + "Filter by the posted timestamp of the Ledger Line." show_hidden: Optional[bool] = Field(alias="showHidden", default=None) - type: Optional["TxTypeFilter"] = 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) + 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"] = None + type_: Optional["LedgerTypeFilter"] = Field(alias="type", default=None) class LinkMatchInput(BaseModel): @@ -362,198 +614,415 @@ class LinkMatchInput(BaseModel): 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 - type: Any + "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"] + 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/docs/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/docs/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 - scenes: Optional[List["SceneInput"]] = 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): - children: Optional[List["SchemaLedgerAccountInput"]] = None + """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/docs/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." status: Optional[SchemaLedgerAccountStatus] = None + "The status of this Ledger Account. Defaults to active." template: Optional[bool] = None - type: Optional[LedgerAccountTypes] = 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): - types: List["SchemaLedgerEntryInput"] + """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): - conditions: Optional[List["SchemaLedgerEntryConditionInput"]] = None + """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 - groups: Optional[List["SchemaLedgerEntryGroupInput"]] = None - lines: Optional[List["SchemaLedgerLineInput"]] = 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 - tags: Optional[List["SchemaLedgerEntryTagInput"]] = None - type: Any + "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/docs/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 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) + 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) - not_in: Optional[List[str]] = Field(alias="notIn", 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) - in_: Optional[List[str]] = Field(alias="in", 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' 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) - in_: Optional[List["TagMatchInput"]] = Field(alias="in", 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) - key_in: Optional[List[Any]] = Field(alias="keyIn", 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) - not_in: Optional[List["TagMatchInput"]] = Field(alias="notIn", 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) - not_key_in: Optional[List[Any]] = Field(alias="notKeyIn", 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) + 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 - tags: Optional[List["LedgerEntryTagInput"]] = None - tags_to_remove: Optional[List["LedgerEntryTagInput"]] = Field( + 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. " + + +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/fragment/sdk/list_ledger_account_balances.py b/fragment/sdk/list_ledger_account_balances.py index 2b9e2a2..5909001 100644 --- a/fragment/sdk/list_ledger_account_balances.py +++ b/fragment/sdk/list_ledger_account_balances.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -24,7 +24,7 @@ class ListLedgerAccountBalancesLedger(BaseModel): class ListLedgerAccountBalancesLedgerLedgerAccounts(BaseModel): - nodes: List["ListLedgerAccountBalancesLedgerLedgerAccountsNodes"] + nodes: list["ListLedgerAccountBalancesLedgerLedgerAccountsNodes"] page_info: "ListLedgerAccountBalancesLedgerLedgerAccountsPageInfo" = Field( alias="pageInfo" ) @@ -34,7 +34,7 @@ class ListLedgerAccountBalancesLedgerLedgerAccountsNodes(BaseModel): id: str path: str name: Optional[str] - type: LedgerAccountTypes + type_: LedgerAccountTypes = Field(alias="type") created: Any own_balance: Any = Field(alias="ownBalance") child_balance: Any = Field(alias="childBalance") diff --git a/fragment/sdk/list_ledger_accounts.py b/fragment/sdk/list_ledger_accounts.py index fcd5d92..10e559b 100644 --- a/fragment/sdk/list_ledger_accounts.py +++ b/fragment/sdk/list_ledger_accounts.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -24,7 +24,7 @@ class ListLedgerAccountsLedger(BaseModel): class ListLedgerAccountsLedgerLedgerAccounts(BaseModel): - nodes: List["ListLedgerAccountsLedgerLedgerAccountsNodes"] + nodes: list["ListLedgerAccountsLedgerLedgerAccountsNodes"] page_info: "ListLedgerAccountsLedgerLedgerAccountsPageInfo" = Field( alias="pageInfo" ) @@ -34,7 +34,7 @@ class ListLedgerAccountsLedgerLedgerAccountsNodes(BaseModel): id: str path: str name: Optional[str] - type: LedgerAccountTypes + type_: LedgerAccountTypes = Field(alias="type") created: Any diff --git a/fragment/sdk/list_ledger_entries.py b/fragment/sdk/list_ledger_entries.py index d79a907..58eb428 100644 --- a/fragment/sdk/list_ledger_entries.py +++ b/fragment/sdk/list_ledger_entries.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -19,19 +19,19 @@ class ListLedgerEntriesLedger(BaseModel): class ListLedgerEntriesLedgerLedgerEntries(BaseModel): - nodes: List["ListLedgerEntriesLedgerLedgerEntriesNodes"] + nodes: list["ListLedgerEntriesLedgerLedgerEntriesNodes"] page_info: "ListLedgerEntriesLedgerLedgerEntriesPageInfo" = Field(alias="pageInfo") class ListLedgerEntriesLedgerLedgerEntriesNodes(BaseModel): ik: str - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") posted: Any lines: "ListLedgerEntriesLedgerLedgerEntriesNodesLines" class ListLedgerEntriesLedgerLedgerEntriesNodesLines(BaseModel): - nodes: List["ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodes"] + nodes: list["ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodes"] class ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodes(BaseModel): diff --git a/fragment/sdk/list_ledger_entry_group_balances.py b/fragment/sdk/list_ledger_entry_group_balances.py index 1deafb3..e233db6 100644 --- a/fragment/sdk/list_ledger_entry_group_balances.py +++ b/fragment/sdk/list_ledger_entry_group_balances.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -23,7 +23,7 @@ class ListLedgerEntryGroupBalancesLedgerEntryGroup(BaseModel): class ListLedgerEntryGroupBalancesLedgerEntryGroupBalances(BaseModel): - nodes: List["ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodes"] + nodes: list["ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodes"] page_info: "ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesPageInfo" = Field( alias="pageInfo" ) diff --git a/fragment/sdk/list_multi_currency_ledger_account_balances.py b/fragment/sdk/list_multi_currency_ledger_account_balances.py index 35b3fb2..f12170b 100644 --- a/fragment/sdk/list_multi_currency_ledger_account_balances.py +++ b/fragment/sdk/list_multi_currency_ledger_account_balances.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -24,7 +24,7 @@ class ListMultiCurrencyLedgerAccountBalancesLedger(BaseModel): class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccounts(BaseModel): - nodes: List["ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes"] + nodes: list["ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes"] page_info: "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsPageInfo" = ( Field(alias="pageInfo") ) @@ -34,7 +34,7 @@ class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes(BaseModel) id: str path: str name: Optional[str] - type: LedgerAccountTypes + type_: LedgerAccountTypes = Field(alias="type") created: Any own_balances: ( "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalances" @@ -48,7 +48,7 @@ class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes(BaseModel) class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalances( BaseModel ): - nodes: List[ + nodes: list[ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodes" ] @@ -70,7 +70,7 @@ class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalances class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalances( BaseModel ): - nodes: List[ + nodes: list[ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodes" ] @@ -92,7 +92,7 @@ class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalanc class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalances( BaseModel ): - nodes: List[ + nodes: list[ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodes" ] diff --git a/fragment/sdk/migrate_ledger_entry.py b/fragment/sdk/migrate_ledger_entry.py index a9a1414..a77e36a 100644 --- a/fragment/sdk/migrate_ledger_entry.py +++ b/fragment/sdk/migrate_ledger_entry.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -51,7 +51,7 @@ class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedge id: str created: Any posted: Any - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") description: Optional[str] reversed_at: Optional[Any] = Field(alias="reversedAt") hidden: bool @@ -61,7 +61,7 @@ class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedge class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLines( BaseModel ): - nodes: List[ + nodes: list[ "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodes" ] @@ -87,7 +87,7 @@ class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedger id: str created: Any posted: Any - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") description: Optional[str] reversed_at: Optional[Any] = Field(alias="reversedAt") hidden: bool @@ -97,7 +97,7 @@ class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedger class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLines( BaseModel ): - nodes: List[ + nodes: list[ "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLinesNodes" ] @@ -123,7 +123,7 @@ class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntry id: str created: Any posted: Any - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") description: Optional[str] reversed_at: Optional[Any] = Field(alias="reversedAt") hidden: bool @@ -133,7 +133,7 @@ class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntry class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLines( BaseModel ): - nodes: List[ + nodes: list[ "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLinesNodes" ] diff --git a/fragment/sdk/reconcile_tx.py b/fragment/sdk/reconcile_tx.py index 29debc4..3d0b9cb 100644 --- a/fragment/sdk/reconcile_tx.py +++ b/fragment/sdk/reconcile_tx.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -33,7 +33,7 @@ class ReconcileTxReconcileTxInternalError(BaseModel): class ReconcileTxReconcileTxReconcileTxResult(BaseModel): typename__: Literal["ReconcileTxResult"] = Field(alias="__typename") entry: "ReconcileTxReconcileTxReconcileTxResultEntry" - lines: List["ReconcileTxReconcileTxReconcileTxResultLines"] + lines: list["ReconcileTxReconcileTxReconcileTxResultLines"] class ReconcileTxReconcileTxReconcileTxResultEntry(BaseModel): diff --git a/fragment/sdk/reconcile_tx_runtime.py b/fragment/sdk/reconcile_tx_runtime.py index 1de3c98..d01280f 100644 --- a/fragment/sdk/reconcile_tx_runtime.py +++ b/fragment/sdk/reconcile_tx_runtime.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -33,7 +33,7 @@ class ReconcileTxRuntimeReconcileTxInternalError(BaseModel): class ReconcileTxRuntimeReconcileTxReconcileTxResult(BaseModel): typename__: Literal["ReconcileTxResult"] = Field(alias="__typename") entry: "ReconcileTxRuntimeReconcileTxReconcileTxResultEntry" - lines: List["ReconcileTxRuntimeReconcileTxReconcileTxResultLines"] + lines: list["ReconcileTxRuntimeReconcileTxReconcileTxResultLines"] class ReconcileTxRuntimeReconcileTxReconcileTxResultEntry(BaseModel): diff --git a/fragment/sdk/reverse_ledger_entry.py b/fragment/sdk/reverse_ledger_entry.py index 326f78c..669120e 100644 --- a/fragment/sdk/reverse_ledger_entry.py +++ b/fragment/sdk/reverse_ledger_entry.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -48,7 +48,7 @@ class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedge id: str created: Any posted: Any - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") description: Optional[str] hidden: bool lines: "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLines" @@ -57,7 +57,7 @@ class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedge class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLines( BaseModel ): - nodes: List[ + nodes: list[ "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLinesNodes" ] @@ -83,7 +83,7 @@ class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedger id: str created: Any posted: Any - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") description: Optional[str] hidden: bool lines: "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLines" @@ -92,7 +92,7 @@ class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedger class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLines( BaseModel ): - nodes: List[ + nodes: list[ "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLinesNodes" ] diff --git a/fragment/sdk/sync_custom_accounts.py b/fragment/sdk/sync_custom_accounts.py index 2f80c28..4897c53 100644 --- a/fragment/sdk/sync_custom_accounts.py +++ b/fragment/sdk/sync_custom_accounts.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -33,7 +33,7 @@ class SyncCustomAccountsSyncCustomAccountsInternalError(BaseModel): class SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResult(BaseModel): typename__: Literal["SyncCustomAccountsResult"] = Field(alias="__typename") - accounts: List[ + accounts: list[ "SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccounts" ] diff --git a/fragment/sdk/sync_custom_txs.py b/fragment/sdk/sync_custom_txs.py index 2fa0ac7..e6a399e 100644 --- a/fragment/sdk/sync_custom_txs.py +++ b/fragment/sdk/sync_custom_txs.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Union +from typing import Any, Literal, Union from pydantic import Field @@ -32,7 +32,7 @@ class SyncCustomTxsSyncCustomTxsInternalError(BaseModel): class SyncCustomTxsSyncCustomTxsSyncCustomTxsResult(BaseModel): typename__: Literal["SyncCustomTxsResult"] = Field(alias="__typename") - txs: List["SyncCustomTxsSyncCustomTxsSyncCustomTxsResultTxs"] + txs: list["SyncCustomTxsSyncCustomTxsSyncCustomTxsResultTxs"] class SyncCustomTxsSyncCustomTxsSyncCustomTxsResultTxs(BaseModel): diff --git a/fragment/sdk/update_ledger_entry.py b/fragment/sdk/update_ledger_entry.py index dd0f1d8..b4c4f98 100644 --- a/fragment/sdk/update_ledger_entry.py +++ b/fragment/sdk/update_ledger_entry.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -42,12 +42,12 @@ class UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntry(BaseModel): created: Any description: Optional[str] lines: "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLines" - groups: List["UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryGroups"] - tags: List["UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryTags"] + groups: list["UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryGroups"] + tags: list["UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryTags"] class UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLines(BaseModel): - nodes: List[ + nodes: list[ "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodes" ] diff --git a/fragment/std_queries/queries.graphql b/fragment/std_queries/queries.graphql index 655e7dc..12118e7 100644 --- a/fragment/std_queries/queries.graphql +++ b/fragment/std_queries/queries.graphql @@ -24,9 +24,7 @@ mutation storeSchema($schema: SchemaInput!) { } } -mutation deleteSchema( - $schema: SchemaMatchInput! -) { +mutation deleteSchema($schema: SchemaMatchInput!) { deleteSchema(schema: $schema) { __typename ... on DeleteSchemaResult { @@ -77,9 +75,7 @@ mutation createLedger( } } -mutation deleteLedger( - $ledger: LedgerMatchInput! -) { +mutation deleteLedger($ledger: LedgerMatchInput!) { deleteLedger(ledger: $ledger) { __typename ... on DeleteLedgerResult { @@ -151,9 +147,7 @@ mutation addLedgerEntry( } } -mutation reverseLedgerEntry( - $id: ID! -) { +mutation reverseLedgerEntry($id: ID!) { reverseLedgerEntry(id: $id) { __typename ... on ReverseLedgerEntryResult { @@ -208,14 +202,8 @@ mutation reverseLedgerEntry( } } -mutation migrateLedgerEntry( - $id: ID! - $newLedgerEntry: LedgerEntryInput! -) { - migrateLedgerEntry(input: { - id: $id - newLedgerEntry: $newLedgerEntry - }) { +mutation migrateLedgerEntry($id: ID!, $newLedgerEntry: LedgerEntryInput!) { + migrateLedgerEntry(input: { id: $id, newLedgerEntry: $newLedgerEntry }) { __typename ... on MigrateLedgerEntryResult { reversingLedgerEntry { @@ -689,6 +677,8 @@ query listLedgerAccountBalances( $balanceCurrency: CurrencyMatchInput $balanceAt: LastMoment $ownBalanceConsistencyMode: ReadBalanceConsistencyMode + $childBalanceConsistencyMode: ReadBalanceConsistencyMode + $balanceConsistencyMode: ReadBalanceConsistencyMode ) { ledger(ledger: { ik: $ledgerIk }) { id @@ -707,8 +697,16 @@ query listLedgerAccountBalances( at: $balanceAt consistencyMode: $ownBalanceConsistencyMode ) - childBalance(currency: $balanceCurrency, at: $balanceAt) - balance(currency: $balanceCurrency, at: $balanceAt) + childBalance( + currency: $balanceCurrency + at: $balanceAt + consistencyMode: $childBalanceConsistencyMode + ) + balance( + currency: $balanceCurrency + at: $balanceAt + consistencyMode: $balanceConsistencyMode + ) } pageInfo { hasNextPage @@ -727,6 +725,8 @@ query listMultiCurrencyLedgerAccountBalances( $before: String $balanceAt: LastMoment $ownBalancesConsistencyMode: ReadBalanceConsistencyMode + $childBalancesConsistencyMode: ReadBalanceConsistencyMode + $balancesConsistencyMode: ReadBalanceConsistencyMode ) { ledger(ledger: { ik: $ledgerIk }) { id @@ -752,7 +752,10 @@ query listMultiCurrencyLedgerAccountBalances( amount } } - childBalances(at: $balanceAt) { + childBalances( + at: $balanceAt + consistencyMode: $childBalancesConsistencyMode + ) { nodes { currency { code @@ -761,7 +764,7 @@ query listMultiCurrencyLedgerAccountBalances( amount } } - balances(at: $balanceAt) { + balances(at: $balanceAt, consistencyMode: $balancesConsistencyMode) { nodes { currency { code @@ -815,24 +818,7 @@ query getLedgerAccountBalance( $ledgerIk: SafeString! $balanceCurrency: CurrencyMatchInput $balanceAt: LastMoment - $ownBalanceConsistencyMode: ReadBalanceConsistencyMode -) { - ledgerAccount(ledgerAccount: { ledger: { ik: $ledgerIk }, path: $path }) { - id - path - ownBalance( - currency: $balanceCurrency - at: $balanceAt - consistencyMode: $ownBalanceConsistencyMode - ) - } -} - -query GetLedgerAccountBalanceWithChildRollup( - $path: String! - $ledgerIk: SafeString! - $balanceCurrency: CurrencyMatchInput - $balanceAt: LastMoment + $balanceConsistencyMode: ReadBalanceConsistencyMode ) { ledgerAccount(ledgerAccount: { ledger: { ik: $ledgerIk }, path: $path }) { id @@ -840,11 +826,11 @@ query GetLedgerAccountBalanceWithChildRollup( balance( currency: $balanceCurrency at: $balanceAt + consistencyMode: $balanceConsistencyMode ) } } - query getSchema($key: SafeString!, $version: Int) { schema(schema: { key: $key, version: $version }) { key @@ -912,21 +898,23 @@ query listLedgerEntryGroupBalances( $last: Int $filter: LedgerEntryGroupBalanceFilterSet ) { - ledgerEntryGroup(ledgerEntryGroup: { - ledger: { ik: $ledgerIk }, - key: $groupKey, - value: $groupValue, - }) { + ledgerEntryGroup( + ledgerEntryGroup: { + ledger: { ik: $ledgerIk } + key: $groupKey + value: $groupValue + } + ) { key value created balances( - after: $after, - before: $before, - first: $first, - last: $last, - filter: $filter, - ){ + after: $after + before: $before + first: $first + last: $last + filter: $filter + ) { nodes { account { path @@ -1020,12 +1008,8 @@ query getEntriesToMigrateForLedgerEntryDataMigration( ledger(ledger: { ik: $ledgerIk }) { ledgerEntryDataMigrations( filter: { - entryType: { - equalTo: $entryType - } - typeVersion: { - equalTo: $typeVersion - } + entryType: { equalTo: $entryType } + typeVersion: { equalTo: $typeVersion } } ) { nodes { @@ -1049,7 +1033,7 @@ query getEntriesToMigrateForLedgerEntryDataMigration( id amount account { - path + path } } } @@ -1136,18 +1120,14 @@ query getEntriesToMigrateForLedgerAccountDataMigration( ) { ledger(ledger: { ik: $ledgerIk }) { ledgerAccountDataMigrations( - filter: { - accountPath: { - equalTo: $accountPath - } - } + filter: { accountPath: { equalTo: $accountPath } } ) { nodes { ledgerEntries( - first: $first - after: $after - last: $last - before: $before + first: $first + after: $after + last: $last + before: $before ) { nodes { id @@ -1181,17 +1161,17 @@ query getEntriesToMigrateForLedgerAccountDataMigration( } mutation createCustomCurrency( - $id: SafeString!, - $name: String!, - $precision: Int!, - $customCode: String!, + $id: SafeString! + $name: String! + $precision: Int! + $customCode: String! ) { createCustomCurrency( customCurrency: { - customCurrencyId: $id, - name: $name, - precision: $precision, - customCode: $customCode, + customCurrencyId: $id + name: $name + precision: $precision + customCode: $customCode } ) { ... on CreateCustomCurrencyResult { diff --git a/fragment/sync_sdk/__init__.py b/fragment/sync_sdk/__init__.py index 60a9145..8615a01 100644 --- a/fragment/sync_sdk/__init__.py +++ b/fragment/sync_sdk/__init__.py @@ -70,12 +70,14 @@ ExternalTxSource, Granularity, IncreaseEnv, + LedgerAccountClearingStatus, LedgerAccountTypes, LedgerDataMigrationStatus, LedgerLinesConsistencyMode, LedgerMigrationStatus, LedgerTypes, LinkType, + PostLinesAs, ReadBalanceConsistencyMode, SceneEventType, SchemaConsistencyMode, @@ -142,10 +144,6 @@ GetLedgerAccountBalance, GetLedgerAccountBalanceLedgerAccount, ) -from .get_ledger_account_balance_with_child_rollup import ( - GetLedgerAccountBalanceWithChildRollup, - GetLedgerAccountBalanceWithChildRollupLedgerAccount, -) from .get_ledger_account_lines import ( GetLedgerAccountLines, GetLedgerAccountLinesLedgerAccount, @@ -179,10 +177,13 @@ ExternalAccountMatchInput, GroupBalanceAccountFilter, GroupFilter, + GroupInput, GroupMatchInput, GroupNotFilter, + GroupReconciliationParametersInput, Int96ConditionInput, Int96Filter, + LedgerAccountClearingStatusFilter, LedgerAccountConditionInput, LedgerAccountConsistencyConfigInput, LedgerAccountDataMigrationsFilterSet, @@ -229,6 +230,7 @@ SchemaLedgerEntryTagInput, SchemaLedgerLineInput, SchemaMatchInput, + SchemaRepeatedConfigInput, SchemaTxMatchInput, StringFilter, StringMatchFilter, @@ -496,8 +498,6 @@ "GetLedger", "GetLedgerAccountBalance", "GetLedgerAccountBalanceLedgerAccount", - "GetLedgerAccountBalanceWithChildRollup", - "GetLedgerAccountBalanceWithChildRollupLedgerAccount", "GetLedgerAccountLines", "GetLedgerAccountLinesLedgerAccount", "GetLedgerAccountLinesLedgerAccountLines", @@ -517,11 +517,15 @@ "Granularity", "GroupBalanceAccountFilter", "GroupFilter", + "GroupInput", "GroupMatchInput", "GroupNotFilter", + "GroupReconciliationParametersInput", "IncreaseEnv", "Int96ConditionInput", "Int96Filter", + "LedgerAccountClearingStatus", + "LedgerAccountClearingStatusFilter", "LedgerAccountConditionInput", "LedgerAccountConsistencyConfigInput", "LedgerAccountDataMigrationsFilterSet", @@ -611,6 +615,7 @@ "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLines", "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodes", "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodesAccount", + "PostLinesAs", "ReadBalanceConsistencyMode", "ReconcileTx", "ReconcileTxReconcileTxBadRequestError", @@ -660,6 +665,7 @@ "SchemaLedgerEntryTagInput", "SchemaLedgerLineInput", "SchemaMatchInput", + "SchemaRepeatedConfigInput", "SchemaTxMatchInput", "StoreSchema", "StoreSchemaStoreSchemaBadRequestError", diff --git a/fragment/sync_sdk/add_ledger_entry.py b/fragment/sync_sdk/add_ledger_entry.py index f33b1cc..d2209a3 100644 --- a/fragment/sync_sdk/add_ledger_entry.py +++ b/fragment/sync_sdk/add_ledger_entry.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -20,11 +20,11 @@ class AddLedgerEntryAddLedgerEntryAddLedgerEntryResult(BaseModel): typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") is_ik_replay: bool = Field(alias="isIkReplay") entry: "AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry" - lines: List["AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines"] + lines: list["AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines"] class AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") id: str ik: str posted: Any diff --git a/fragment/sync_sdk/add_ledger_entry_runtime.py b/fragment/sync_sdk/add_ledger_entry_runtime.py index 054b034..361b226 100644 --- a/fragment/sync_sdk/add_ledger_entry_runtime.py +++ b/fragment/sync_sdk/add_ledger_entry_runtime.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -20,11 +20,11 @@ class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResult(BaseModel): typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename") is_ik_replay: bool = Field(alias="isIkReplay") entry: "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry" - lines: List["AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines"] + lines: list["AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines"] class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry(BaseModel): - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") id: str ik: str posted: Any diff --git a/fragment/sync_sdk/client.py b/fragment/sync_sdk/client.py index 5091819..545b20c 100644 --- a/fragment/sync_sdk/client.py +++ b/fragment/sync_sdk/client.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, Dict, List, Optional +from typing import Any, Optional from .add_ledger_entry import AddLedgerEntry from .add_ledger_entry_runtime import AddLedgerEntryRuntime @@ -22,9 +22,6 @@ from .get_entry_data_migrations import GetEntryDataMigrations from .get_ledger import GetLedger from .get_ledger_account_balance import GetLedgerAccountBalance -from .get_ledger_account_balance_with_child_rollup import ( - GetLedgerAccountBalanceWithChildRollup, -) from .get_ledger_account_lines import GetLedgerAccountLines from .get_ledger_entry import GetLedgerEntry from .get_schema import GetSchema @@ -74,8 +71,7 @@ def gql(q: str) -> str: class Client(SyncFragmentClient): def store_schema(self, schema: SchemaInput, **kwargs: Any) -> StoreSchema: - query = gql( - """ + query = gql(""" mutation storeSchema($schema: SchemaInput!) { storeSchema(schema: $schema) { __typename @@ -101,9 +97,8 @@ def store_schema(self, schema: SchemaInput, **kwargs: Any) -> StoreSchema: } } } - """ - ) - variables: Dict[str, object] = {"schema": schema} + """) + variables: dict[str, object] = {"schema": schema} response = self.execute( query=query, operation_name="storeSchema", variables=variables, **kwargs ) @@ -111,8 +106,7 @@ def store_schema(self, schema: SchemaInput, **kwargs: Any) -> StoreSchema: return StoreSchema.model_validate(data) def delete_schema(self, schema: SchemaMatchInput, **kwargs: Any) -> DeleteSchema: - query = gql( - """ + query = gql(""" mutation deleteSchema($schema: SchemaMatchInput!) { deleteSchema(schema: $schema) { __typename @@ -131,9 +125,8 @@ def delete_schema(self, schema: SchemaMatchInput, **kwargs: Any) -> DeleteSchema } } } - """ - ) - variables: Dict[str, object] = {"schema": schema} + """) + variables: dict[str, object] = {"schema": schema} response = self.execute( query=query, operation_name="deleteSchema", variables=variables, **kwargs ) @@ -143,8 +136,7 @@ def delete_schema(self, schema: SchemaMatchInput, **kwargs: Any) -> DeleteSchema def create_ledger( self, ik: Any, ledger: CreateLedgerInput, schema_key: Any, **kwargs: Any ) -> CreateLedger: - query = gql( - """ + query = gql(""" mutation createLedger($ik: SafeString!, $ledger: CreateLedgerInput!, $schemaKey: SafeString!) { createLedger(ik: $ik, ledger: $ledger, schema: {key: $schemaKey}) { __typename @@ -172,9 +164,8 @@ def create_ledger( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ik": ik, "ledger": ledger, "schemaKey": schema_key, @@ -186,8 +177,7 @@ def create_ledger( return CreateLedger.model_validate(data) def delete_ledger(self, ledger: LedgerMatchInput, **kwargs: Any) -> DeleteLedger: - query = gql( - """ + query = gql(""" mutation deleteLedger($ledger: LedgerMatchInput!) { deleteLedger(ledger: $ledger) { __typename @@ -206,9 +196,8 @@ def delete_ledger(self, ledger: LedgerMatchInput, **kwargs: Any) -> DeleteLedger } } } - """ - ) - variables: Dict[str, object] = {"ledger": ledger} + """) + variables: dict[str, object] = {"ledger": ledger} response = self.execute( query=query, operation_name="deleteLedger", variables=variables, **kwargs ) @@ -219,16 +208,15 @@ def add_ledger_entry( self, ik: Any, ledger_ik: Any, - type: str, + type_: str, parameters: Any, type_version: Optional[int] = None, posted: Optional[Any] = None, - tags: Optional[List[LedgerEntryTagInput]] = None, - groups: Optional[List[LedgerEntryGroupInput]] = None, + tags: Optional[list[LedgerEntryTagInput]] = None, + groups: Optional[list[LedgerEntryGroupInput]] = None, **kwargs: Any ) -> AddLedgerEntry: - query = gql( - """ + query = gql(""" mutation addLedgerEntry($ik: SafeString!, $ledgerIk: SafeString!, $type: String!, $typeVersion: Int, $posted: DateTime, $parameters: JSON!, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!]) { addLedgerEntry( ik: $ik @@ -264,12 +252,11 @@ def add_ledger_entry( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ik": ik, "ledgerIk": ledger_ik, - "type": type, + "type": type_, "typeVersion": type_version, "posted": posted, "parameters": parameters, @@ -283,8 +270,7 @@ def add_ledger_entry( return AddLedgerEntry.model_validate(data) def reverse_ledger_entry(self, id: str, **kwargs: Any) -> ReverseLedgerEntry: - query = gql( - """ + query = gql(""" mutation reverseLedgerEntry($id: ID!) { reverseLedgerEntry(id: $id) { __typename @@ -339,9 +325,8 @@ def reverse_ledger_entry(self, id: str, **kwargs: Any) -> ReverseLedgerEntry: } } } - """ - ) - variables: Dict[str, object] = {"id": id} + """) + variables: dict[str, object] = {"id": id} response = self.execute( query=query, operation_name="reverseLedgerEntry", @@ -354,8 +339,7 @@ def reverse_ledger_entry(self, id: str, **kwargs: Any) -> ReverseLedgerEntry: def migrate_ledger_entry( self, id: str, new_ledger_entry: LedgerEntryInput, **kwargs: Any ) -> MigrateLedgerEntry: - query = gql( - """ + query = gql(""" mutation migrateLedgerEntry($id: ID!, $newLedgerEntry: LedgerEntryInput!) { migrateLedgerEntry(input: {id: $id, newLedgerEntry: $newLedgerEntry}) { __typename @@ -431,9 +415,8 @@ def migrate_ledger_entry( } } } - """ - ) - variables: Dict[str, object] = {"id": id, "newLedgerEntry": new_ledger_entry} + """) + variables: dict[str, object] = {"id": id, "newLedgerEntry": new_ledger_entry} response = self.execute( query=query, operation_name="migrateLedgerEntry", @@ -446,17 +429,16 @@ def migrate_ledger_entry( def add_ledger_entry_runtime( self, ik: Any, - type: str, + type_: str, ledger_ik: Any, - lines: List[LedgerLineInput], + lines: list[LedgerLineInput], type_version: Optional[int] = None, posted: Optional[Any] = None, - tags: Optional[List[LedgerEntryTagInput]] = None, - groups: Optional[List[LedgerEntryGroupInput]] = None, + tags: Optional[list[LedgerEntryTagInput]] = None, + groups: Optional[list[LedgerEntryGroupInput]] = None, **kwargs: Any ) -> AddLedgerEntryRuntime: - query = gql( - """ + query = gql(""" mutation addLedgerEntryRuntime($ik: SafeString!, $type: String!, $typeVersion: Int, $ledgerIk: SafeString!, $posted: DateTime, $lines: [LedgerLineInput!]!, $tags: [LedgerEntryTagInput!], $groups: [LedgerEntryGroupInput!]) { addLedgerEntry( ik: $ik @@ -492,11 +474,10 @@ def add_ledger_entry_runtime( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ik": ik, - "type": type, + "type": type_, "typeVersion": type_version, "ledgerIk": ledger_ik, "posted": posted, @@ -516,15 +497,14 @@ def add_ledger_entry_runtime( def reconcile_tx( self, ledger_ik: Any, - type: str, + type_: str, parameters: Any, type_version: Optional[int] = None, - tags: Optional[List[LedgerEntryTagInput]] = None, - groups: Optional[List[LedgerEntryGroupInput]] = None, + tags: Optional[list[LedgerEntryTagInput]] = None, + groups: Optional[list[LedgerEntryGroupInput]] = None, **kwargs: Any ) -> ReconcileTx: - query = gql( - """ + 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} @@ -560,11 +540,10 @@ def reconcile_tx( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, - "type": type, + "type": type_, "typeVersion": type_version, "parameters": parameters, "tags": tags, @@ -579,15 +558,14 @@ def reconcile_tx( def reconcile_tx_runtime( self, ledger_ik: Any, - type: str, - lines: List[LedgerLineInput], + type_: str, + lines: list[LedgerLineInput], type_version: Optional[int] = None, - tags: Optional[List[LedgerEntryTagInput]] = None, - groups: Optional[List[LedgerEntryGroupInput]] = None, + tags: Optional[list[LedgerEntryTagInput]] = None, + groups: Optional[list[LedgerEntryGroupInput]] = None, **kwargs: Any ) -> ReconcileTxRuntime: - query = gql( - """ + 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} @@ -623,11 +601,10 @@ def reconcile_tx_runtime( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, - "type": type, + "type": type_, "typeVersion": type_version, "lines": lines, "tags": tags, @@ -649,8 +626,7 @@ def update_ledger_entry( update: UpdateLedgerEntryInput, **kwargs: Any ) -> UpdateLedgerEntry: - query = gql( - """ + query = gql(""" mutation updateLedgerEntry($entryIk: SafeString!, $ledgerIk: SafeString!, $update: UpdateLedgerEntryInput!) { updateLedgerEntry( ledgerEntry: {ik: $entryIk, ledger: {ik: $ledgerIk}} @@ -695,9 +671,8 @@ def update_ledger_entry( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "entryIk": entry_ik, "ledgerIk": ledger_ik, "update": update, @@ -714,8 +689,7 @@ def update_ledger_entry( def update_ledger( self, ledger_ik: Any, update: UpdateLedgerInput, **kwargs: Any ) -> UpdateLedger: - query = gql( - """ + query = gql(""" mutation updateLedger($ledgerIk: SafeString!, $update: UpdateLedgerInput!) { updateLedger(ledger: {ik: $ledgerIk}, update: $update) { __typename @@ -738,9 +712,8 @@ def update_ledger( } } } - """ - ) - variables: Dict[str, object] = {"ledgerIk": ledger_ik, "update": update} + """) + variables: dict[str, object] = {"ledgerIk": ledger_ik, "update": update} response = self.execute( query=query, operation_name="updateLedger", variables=variables, **kwargs ) @@ -748,8 +721,7 @@ def update_ledger( return UpdateLedger.model_validate(data) def create_custom_link(self, name: str, ik: Any, **kwargs: Any) -> CreateCustomLink: - query = gql( - """ + query = gql(""" mutation createCustomLink($name: String!, $ik: SafeString!) { createCustomLink(name: $name, ik: $ik) { __typename @@ -773,9 +745,8 @@ def create_custom_link(self, name: str, ik: Any, **kwargs: Any) -> CreateCustomL } } } - """ - ) - variables: Dict[str, object] = {"name": name, "ik": ik} + """) + variables: dict[str, object] = {"name": name, "ik": ik} response = self.execute( query=query, operation_name="createCustomLink", @@ -786,10 +757,9 @@ def create_custom_link(self, name: str, ik: Any, **kwargs: Any) -> CreateCustomL return CreateCustomLink.model_validate(data) def sync_custom_accounts( - self, link_id: str, accounts: List[CustomAccountInput], **kwargs: Any + self, link_id: str, accounts: list[CustomAccountInput], **kwargs: Any ) -> SyncCustomAccounts: - query = gql( - """ + query = gql(""" mutation syncCustomAccounts($linkId: ID!, $accounts: [CustomAccountInput!]!) { syncCustomAccounts(link: {id: $linkId}, accounts: $accounts) { __typename @@ -816,9 +786,8 @@ def sync_custom_accounts( } } } - """ - ) - variables: Dict[str, object] = {"linkId": link_id, "accounts": accounts} + """) + variables: dict[str, object] = {"linkId": link_id, "accounts": accounts} response = self.execute( query=query, operation_name="syncCustomAccounts", @@ -829,10 +798,9 @@ def sync_custom_accounts( return SyncCustomAccounts.model_validate(data) def sync_custom_txs( - self, link_id: str, txs: List[CustomTxInput], **kwargs: Any + self, link_id: str, txs: list[CustomTxInput], **kwargs: Any ) -> SyncCustomTxs: - query = gql( - """ + query = gql(""" mutation syncCustomTxs($linkId: ID!, $txs: [CustomTxInput!]!) { syncCustomTxs(link: {id: $linkId}, txs: $txs) { __typename @@ -860,18 +828,16 @@ def sync_custom_txs( } } } - """ - ) - variables: Dict[str, object] = {"linkId": link_id, "txs": txs} + """) + variables: dict[str, object] = {"linkId": link_id, "txs": txs} response = self.execute( query=query, operation_name="syncCustomTxs", variables=variables, **kwargs ) data = self.get_data(response) return SyncCustomTxs.model_validate(data) - def delete_custom_txs(self, txs: List[str], **kwargs: Any) -> DeleteCustomTxs: - query = gql( - """ + def delete_custom_txs(self, txs: list[str], **kwargs: Any) -> DeleteCustomTxs: + query = gql(""" mutation deleteCustomTxs($txs: [ID!]!) { deleteCustomTxs(txs: $txs) { __typename @@ -901,9 +867,8 @@ def delete_custom_txs(self, txs: List[str], **kwargs: Any) -> DeleteCustomTxs: } } } - """ - ) - variables: Dict[str, object] = {"txs": txs} + """) + variables: dict[str, object] = {"txs": txs} response = self.execute( query=query, operation_name="deleteCustomTxs", variables=variables, **kwargs ) @@ -911,8 +876,7 @@ def delete_custom_txs(self, txs: List[str], **kwargs: Any) -> DeleteCustomTxs: return DeleteCustomTxs.model_validate(data) def get_ledger(self, ik: Any, **kwargs: Any) -> GetLedger: - query = gql( - """ + query = gql(""" query getLedger($ik: SafeString!) { ledger(ledger: {ik: $ik}) { id @@ -922,9 +886,8 @@ def get_ledger(self, ik: Any, **kwargs: Any) -> GetLedger: balanceUTCOffset } } - """ - ) - variables: Dict[str, object] = {"ik": ik} + """) + variables: dict[str, object] = {"ik": ik} response = self.execute( query=query, operation_name="getLedger", variables=variables, **kwargs ) @@ -934,8 +897,7 @@ def get_ledger(self, ik: Any, **kwargs: Any) -> GetLedger: def get_ledger_entry( self, ik: Any, ledger_ik: Any, **kwargs: Any ) -> GetLedgerEntry: - query = gql( - """ + query = gql(""" query getLedgerEntry($ik: SafeString!, $ledgerIk: SafeString!) { ledgerEntry(ledgerEntry: {ik: $ik, ledger: {ik: $ledgerIk}}) { id @@ -954,9 +916,8 @@ def get_ledger_entry( } } } - """ - ) - variables: Dict[str, object] = {"ik": ik, "ledgerIk": ledger_ik} + """) + variables: dict[str, object] = {"ik": ik, "ledgerIk": ledger_ik} response = self.execute( query=query, operation_name="getLedgerEntry", variables=variables, **kwargs ) @@ -971,8 +932,7 @@ def list_ledger_accounts( before: Optional[str] = None, **kwargs: Any ) -> ListLedgerAccounts: - query = gql( - """ + query = gql(""" query listLedgerAccounts($ledgerIk: SafeString!, $after: String, $first: Int, $before: String) { ledger(ledger: {ik: $ledgerIk}) { id @@ -996,9 +956,8 @@ def list_ledger_accounts( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, "after": after, "first": first, @@ -1022,11 +981,12 @@ def list_ledger_account_balances( 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) { + 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 @@ -1044,8 +1004,16 @@ def list_ledger_account_balances( at: $balanceAt consistencyMode: $ownBalanceConsistencyMode ) - childBalance(currency: $balanceCurrency, at: $balanceAt) - balance(currency: $balanceCurrency, at: $balanceAt) + childBalance( + currency: $balanceCurrency + at: $balanceAt + consistencyMode: $childBalanceConsistencyMode + ) + balance( + currency: $balanceCurrency + at: $balanceAt + consistencyMode: $balanceConsistencyMode + ) } pageInfo { hasNextPage @@ -1056,9 +1024,8 @@ def list_ledger_account_balances( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, "after": after, "first": first, @@ -1066,6 +1033,8 @@ def list_ledger_account_balances( "balanceCurrency": balance_currency, "balanceAt": balance_at, "ownBalanceConsistencyMode": own_balance_consistency_mode, + "childBalanceConsistencyMode": child_balance_consistency_mode, + "balanceConsistencyMode": balance_consistency_mode, } response = self.execute( query=query, @@ -1084,11 +1053,12 @@ def list_multi_currency_ledger_account_balances( 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) { + 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 @@ -1110,7 +1080,7 @@ def list_multi_currency_ledger_account_balances( amount } } - childBalances(at: $balanceAt) { + childBalances(at: $balanceAt, consistencyMode: $childBalancesConsistencyMode) { nodes { currency { code @@ -1119,7 +1089,7 @@ def list_multi_currency_ledger_account_balances( amount } } - balances(at: $balanceAt) { + balances(at: $balanceAt, consistencyMode: $balancesConsistencyMode) { nodes { currency { code @@ -1138,15 +1108,16 @@ def list_multi_currency_ledger_account_balances( } } } - """ - ) - variables: Dict[str, object] = { + """) + 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 = self.execute( query=query, @@ -1164,11 +1135,10 @@ def get_ledger_account_lines( after: Optional[str] = None, first: Optional[int] = None, before: Optional[str] = None, - filter: Optional[LedgerLinesFilterSet] = None, + filter_: Optional[LedgerLinesFilterSet] = None, **kwargs: Any ) -> GetLedgerAccountLines: - query = gql( - """ + query = gql(""" query getLedgerAccountLines($path: String!, $ledgerIk: SafeString!, $after: String, $first: Int, $before: String, $filter: LedgerLinesFilterSet) { ledgerAccount(ledgerAccount: {ledger: {ik: $ledgerIk}, path: $path}) { id @@ -1190,15 +1160,14 @@ def get_ledger_account_lines( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "path": path, "ledgerIk": ledger_ik, "after": after, "first": first, "before": before, - "filter": filter, + "filter": filter_, } response = self.execute( query=query, @@ -1215,30 +1184,28 @@ def get_ledger_account_balance( ledger_ik: Any, balance_currency: Optional[CurrencyMatchInput] = None, balance_at: Optional[Any] = None, - own_balance_consistency_mode: Optional[ReadBalanceConsistencyMode] = None, + balance_consistency_mode: Optional[ReadBalanceConsistencyMode] = None, **kwargs: Any ) -> GetLedgerAccountBalance: - query = gql( - """ - query getLedgerAccountBalance($path: String!, $ledgerIk: SafeString!, $balanceCurrency: CurrencyMatchInput, $balanceAt: LastMoment, $ownBalanceConsistencyMode: ReadBalanceConsistencyMode) { + query = gql(""" + query getLedgerAccountBalance($path: String!, $ledgerIk: SafeString!, $balanceCurrency: CurrencyMatchInput, $balanceAt: LastMoment, $balanceConsistencyMode: ReadBalanceConsistencyMode) { ledgerAccount(ledgerAccount: {ledger: {ik: $ledgerIk}, path: $path}) { id path - ownBalance( + balance( currency: $balanceCurrency at: $balanceAt - consistencyMode: $ownBalanceConsistencyMode + consistencyMode: $balanceConsistencyMode ) } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "path": path, "ledgerIk": ledger_ik, "balanceCurrency": balance_currency, "balanceAt": balance_at, - "ownBalanceConsistencyMode": own_balance_consistency_mode, + "balanceConsistencyMode": balance_consistency_mode, } response = self.execute( query=query, @@ -1249,45 +1216,10 @@ def get_ledger_account_balance( data = self.get_data(response) return GetLedgerAccountBalance.model_validate(data) - def get_ledger_account_balance_with_child_rollup( - self, - path: str, - ledger_ik: Any, - balance_currency: Optional[CurrencyMatchInput] = None, - balance_at: Optional[Any] = None, - **kwargs: Any - ) -> GetLedgerAccountBalanceWithChildRollup: - query = gql( - """ - query GetLedgerAccountBalanceWithChildRollup($path: String!, $ledgerIk: SafeString!, $balanceCurrency: CurrencyMatchInput, $balanceAt: LastMoment) { - ledgerAccount(ledgerAccount: {ledger: {ik: $ledgerIk}, path: $path}) { - id - path - balance(currency: $balanceCurrency, at: $balanceAt) - } - } - """ - ) - variables: Dict[str, object] = { - "path": path, - "ledgerIk": ledger_ik, - "balanceCurrency": balance_currency, - "balanceAt": balance_at, - } - response = self.execute( - query=query, - operation_name="GetLedgerAccountBalanceWithChildRollup", - variables=variables, - **kwargs - ) - data = self.get_data(response) - return GetLedgerAccountBalanceWithChildRollup.model_validate(data) - def get_schema( self, key: Any, version: Optional[int] = None, **kwargs: Any ) -> GetSchema: - query = gql( - """ + query = gql(""" query getSchema($key: SafeString!, $version: Int) { schema(schema: {key: $key, version: $version}) { key @@ -1299,9 +1231,8 @@ def get_schema( } } } - """ - ) - variables: Dict[str, object] = {"key": key, "version": version} + """) + variables: dict[str, object] = {"key": key, "version": version} response = self.execute( query=query, operation_name="getSchema", variables=variables, **kwargs ) @@ -1314,11 +1245,10 @@ def list_ledger_entries( after: Optional[str] = None, first: Optional[int] = None, before: Optional[str] = None, - filter: Optional[LedgerEntriesFilterSet] = None, + filter_: Optional[LedgerEntriesFilterSet] = None, **kwargs: Any ) -> ListLedgerEntries: - query = gql( - """ + 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) { @@ -1344,14 +1274,13 @@ def list_ledger_entries( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, "after": after, "first": first, "before": before, - "filter": filter, + "filter": filter_, } response = self.execute( query=query, @@ -1363,17 +1292,15 @@ def list_ledger_entries( return ListLedgerEntries.model_validate(data) def get_workspace(self, **kwargs: Any) -> GetWorkspace: - query = gql( - """ + query = gql(""" query getWorkspace { workspace { id name } } - """ - ) - variables: Dict[str, object] = {} + """) + variables: dict[str, object] = {} response = self.execute( query=query, operation_name="getWorkspace", variables=variables, **kwargs ) @@ -1390,11 +1317,10 @@ def list_ledger_entry_group_balances( before: Optional[str] = None, first: Optional[int] = None, last: Optional[int] = None, - filter: Optional[LedgerEntryGroupBalanceFilterSet] = None, + filter_: Optional[LedgerEntryGroupBalanceFilterSet] = None, **kwargs: Any ) -> ListLedgerEntryGroupBalances: - query = gql( - """ + 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} @@ -1428,9 +1354,8 @@ def list_ledger_entry_group_balances( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, "groupKey": group_key, "groupValue": group_value, @@ -1439,7 +1364,7 @@ def list_ledger_entry_group_balances( "before": before, "first": first, "last": last, - "filter": filter, + "filter": filter_, } response = self.execute( query=query, @@ -1453,15 +1378,14 @@ def list_ledger_entry_group_balances( def get_entry_data_migrations( self, ledger_ik: Any, - filter: Optional[LedgerEntryDataMigrationsFilterSet] = None, + 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 = gql(""" query getEntryDataMigrations($ledgerIk: SafeString!, $filter: LedgerEntryDataMigrationsFilterSet, $after: String, $before: String, $first: Int, $last: Int) { ledger(ledger: {ik: $ledgerIk}) { ledgerEntryDataMigrations( @@ -1515,11 +1439,10 @@ def get_entry_data_migrations( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, - "filter": filter, + "filter": filter_, "after": after, "before": before, "first": first, @@ -1545,8 +1468,7 @@ def get_entries_to_migrate_for_ledger_entry_data_migration( last: Optional[int] = None, **kwargs: Any ) -> GetEntriesToMigrateForLedgerEntryDataMigration: - query = gql( - """ + query = gql(""" query getEntriesToMigrateForLedgerEntryDataMigration($ledgerIk: SafeString!, $entryType: String!, $typeVersion: String!, $after: String, $before: String, $first: Int, $last: Int) { ledger(ledger: {ik: $ledgerIk}) { ledgerEntryDataMigrations( @@ -1584,9 +1506,8 @@ def get_entries_to_migrate_for_ledger_entry_data_migration( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, "entryType": entry_type, "typeVersion": type_version, @@ -1607,15 +1528,14 @@ def get_entries_to_migrate_for_ledger_entry_data_migration( def get_account_data_migrations( self, ledger_ik: Any, - filter: Optional[LedgerAccountDataMigrationsFilterSet] = None, + 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 = gql(""" query getAccountDataMigrations($ledgerIk: SafeString!, $filter: LedgerAccountDataMigrationsFilterSet, $after: String, $before: String, $first: Int, $last: Int) { ledger(ledger: {ik: $ledgerIk}) { ledgerAccountDataMigrations( @@ -1668,11 +1588,10 @@ def get_account_data_migrations( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, - "filter": filter, + "filter": filter_, "after": after, "before": before, "first": first, @@ -1697,8 +1616,7 @@ def get_entries_to_migrate_for_ledger_account_data_migration( last: Optional[int] = None, **kwargs: Any ) -> GetEntriesToMigrateForLedgerAccountDataMigration: - query = gql( - """ + 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}}) { @@ -1734,9 +1652,8 @@ def get_entries_to_migrate_for_ledger_account_data_migration( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "ledgerIk": ledger_ik, "accountPath": account_path, "after": after, @@ -1756,8 +1673,7 @@ def get_entries_to_migrate_for_ledger_account_data_migration( def create_custom_currency( self, id: Any, name: str, precision: int, custom_code: str, **kwargs: Any ) -> CreateCustomCurrency: - query = gql( - """ + query = gql(""" mutation createCustomCurrency($id: SafeString!, $name: String!, $precision: Int!, $customCode: String!) { createCustomCurrency( customCurrency: {customCurrencyId: $id, name: $name, precision: $precision, customCode: $customCode} @@ -1784,9 +1700,8 @@ def create_custom_currency( } } } - """ - ) - variables: Dict[str, object] = { + """) + variables: dict[str, object] = { "id": id, "name": name, "precision": precision, diff --git a/fragment/sync_sdk/delete_custom_txs.py b/fragment/sync_sdk/delete_custom_txs.py index 7ff39d8..0a9eaf0 100644 --- a/fragment/sync_sdk/delete_custom_txs.py +++ b/fragment/sync_sdk/delete_custom_txs.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -25,7 +25,7 @@ class DeleteCustomTxsDeleteCustomTxsBadRequestError(BaseModel): class DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResult(BaseModel): typename__: Literal["DeleteCustomTxsResult"] = Field(alias="__typename") - txs: List["DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxs"] + txs: list["DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxs"] class DeleteCustomTxsDeleteCustomTxsDeleteCustomTxsResultTxs(BaseModel): diff --git a/fragment/sync_sdk/enums.py b/fragment/sync_sdk/enums.py index b66e8cb..b9f0234 100644 --- a/fragment/sync_sdk/enums.py +++ b/fragment/sync_sdk/enums.py @@ -40,6 +40,8 @@ class CurrencyCode(str, Enum): BYR = "BYR" BZD = "BZD" CAD = "CAD" + CADC = "CADC" + CADT = "CADT" CDF = "CDF" CHF = "CHF" CLP = "CLP" @@ -61,6 +63,7 @@ class CurrencyCode(str, Enum): ETB = "ETB" ETH = "ETH" EUR = "EUR" + EURC = "EURC" FJD = "FJD" FKP = "FKP" GBP = "GBP" @@ -170,6 +173,7 @@ class CurrencyCode(str, Enum): UNI = "UNI" USD = "USD" USDC = "USDC" + USDG = "USDG" USDT = "USDT" UYU = "UYU" UZS = "UZS" @@ -215,6 +219,11 @@ class IncreaseEnv(str, Enum): sandbox = "sandbox" +class LedgerAccountClearingStatus(str, Enum): + cleared = "cleared" + pending = "pending" + + class LedgerAccountTypes(str, Enum): asset = "asset" expense = "expense" @@ -251,6 +260,12 @@ class LinkType(str, Enum): 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" diff --git a/fragment/sync_sdk/get_account_data_migrations.py b/fragment/sync_sdk/get_account_data_migrations.py index 2898c5b..72d97e9 100644 --- a/fragment/sync_sdk/get_account_data_migrations.py +++ b/fragment/sync_sdk/get_account_data_migrations.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -20,7 +20,7 @@ class GetAccountDataMigrationsLedger(BaseModel): class GetAccountDataMigrationsLedgerLedgerAccountDataMigrations(BaseModel): - nodes: List["GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodes"] + nodes: list["GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodes"] page_info: "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsPageInfo" = ( Field(alias="pageInfo") ) @@ -48,7 +48,7 @@ class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesCurrentMigra class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntries( BaseModel ): - nodes: List[ + nodes: list[ "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodes" ] page_info: ( @@ -60,7 +60,7 @@ class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntrie BaseModel ): id: str - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") posted: Any parameters: Optional[Any] @@ -75,7 +75,7 @@ class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesLedgerEntrie class GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistory(BaseModel): - nodes: List[ + nodes: list[ "GetAccountDataMigrationsLedgerLedgerAccountDataMigrationsNodesHistoryNodes" ] page_info: ( diff --git a/fragment/sync_sdk/get_entries_to_migrate_for_ledger_account_data_migration.py b/fragment/sync_sdk/get_entries_to_migrate_for_ledger_account_data_migration.py index 24ecdeb..e12a36b 100644 --- a/fragment/sync_sdk/get_entries_to_migrate_for_ledger_account_data_migration.py +++ b/fragment/sync_sdk/get_entries_to_migrate_for_ledger_account_data_migration.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -21,7 +21,7 @@ class GetEntriesToMigrateForLedgerAccountDataMigrationLedger(BaseModel): class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrations( BaseModel ): - nodes: List[ + nodes: list[ "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodes" ] @@ -37,7 +37,7 @@ class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMig class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntries( BaseModel ): - nodes: List[ + nodes: list[ "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodes" ] page_info: ( @@ -50,7 +50,7 @@ class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMig ): id: str ik: str - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") type_version: Optional[int] = Field(alias="typeVersion") description: Optional[str] posted: Any @@ -62,7 +62,7 @@ class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMig class GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLines( BaseModel ): - nodes: List[ + nodes: list[ "GetEntriesToMigrateForLedgerAccountDataMigrationLedgerLedgerAccountDataMigrationsNodesLedgerEntriesNodesLinesNodes" ] diff --git a/fragment/sync_sdk/get_entries_to_migrate_for_ledger_entry_data_migration.py b/fragment/sync_sdk/get_entries_to_migrate_for_ledger_entry_data_migration.py index c584d4b..19683c3 100644 --- a/fragment/sync_sdk/get_entries_to_migrate_for_ledger_entry_data_migration.py +++ b/fragment/sync_sdk/get_entries_to_migrate_for_ledger_entry_data_migration.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -21,7 +21,7 @@ class GetEntriesToMigrateForLedgerEntryDataMigrationLedger(BaseModel): class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrations( BaseModel ): - nodes: List[ + nodes: list[ "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodes" ] @@ -37,7 +37,7 @@ class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrati class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntries( BaseModel ): - nodes: List[ + nodes: list[ "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodes" ] page_info: ( @@ -50,7 +50,7 @@ class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrati ): id: str ik: str - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") type_version: Optional[int] = Field(alias="typeVersion") description: Optional[str] posted: Any @@ -62,7 +62,7 @@ class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrati class GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLines( BaseModel ): - nodes: List[ + nodes: list[ "GetEntriesToMigrateForLedgerEntryDataMigrationLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodesLinesNodes" ] diff --git a/fragment/sync_sdk/get_entry_data_migrations.py b/fragment/sync_sdk/get_entry_data_migrations.py index 001e898..d259ef0 100644 --- a/fragment/sync_sdk/get_entry_data_migrations.py +++ b/fragment/sync_sdk/get_entry_data_migrations.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -20,7 +20,7 @@ class GetEntryDataMigrationsLedger(BaseModel): class GetEntryDataMigrationsLedgerLedgerEntryDataMigrations(BaseModel): - nodes: List["GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodes"] + nodes: list["GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodes"] page_info: "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsPageInfo" = Field( alias="pageInfo" ) @@ -49,7 +49,7 @@ class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesCurrentMigration class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntries( BaseModel ): - nodes: List[ + nodes: list[ "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNodes" ] page_info: ( @@ -61,7 +61,7 @@ class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesNod BaseModel ): id: str - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") posted: Any parameters: Optional[Any] @@ -76,7 +76,7 @@ class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesLedgerEntriesPag class GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistory(BaseModel): - nodes: List[ + nodes: list[ "GetEntryDataMigrationsLedgerLedgerEntryDataMigrationsNodesHistoryNodes" ] page_info: ( diff --git a/fragment/sync_sdk/get_ledger_account_balance.py b/fragment/sync_sdk/get_ledger_account_balance.py index 725737f..301d1d0 100644 --- a/fragment/sync_sdk/get_ledger_account_balance.py +++ b/fragment/sync_sdk/get_ledger_account_balance.py @@ -17,7 +17,7 @@ class GetLedgerAccountBalance(BaseModel): class GetLedgerAccountBalanceLedgerAccount(BaseModel): id: str path: str - own_balance: Any = Field(alias="ownBalance") + balance: Any GetLedgerAccountBalance.model_rebuild() diff --git a/fragment/sync_sdk/get_ledger_account_lines.py b/fragment/sync_sdk/get_ledger_account_lines.py index 250997a..c3500f3 100644 --- a/fragment/sync_sdk/get_ledger_account_lines.py +++ b/fragment/sync_sdk/get_ledger_account_lines.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -21,7 +21,7 @@ class GetLedgerAccountLinesLedgerAccount(BaseModel): class GetLedgerAccountLinesLedgerAccountLines(BaseModel): - nodes: List["GetLedgerAccountLinesLedgerAccountLinesNodes"] + nodes: list["GetLedgerAccountLinesLedgerAccountLinesNodes"] page_info: "GetLedgerAccountLinesLedgerAccountLinesPageInfo" = Field( alias="pageInfo" ) diff --git a/fragment/sync_sdk/get_ledger_entry.py b/fragment/sync_sdk/get_ledger_entry.py index cc37a3c..d6e03ec 100644 --- a/fragment/sync_sdk/get_ledger_entry.py +++ b/fragment/sync_sdk/get_ledger_entry.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -22,7 +22,7 @@ class GetLedgerEntryLedgerEntry(BaseModel): class GetLedgerEntryLedgerEntryLines(BaseModel): - nodes: List["GetLedgerEntryLedgerEntryLinesNodes"] + nodes: list["GetLedgerEntryLedgerEntryLinesNodes"] class GetLedgerEntryLedgerEntryLinesNodes(BaseModel): diff --git a/fragment/sync_sdk/input_types.py b/fragment/sync_sdk/input_types.py index eb5ddaf..3d1280a 100644 --- a/fragment/sync_sdk/input_types.py +++ b/fragment/sync_sdk/input_types.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: schema.graphql -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -10,11 +10,13 @@ BalanceUpdateConsistencyMode, CurrencyCode, CurrencyMode, + LedgerAccountClearingStatus, LedgerAccountTypes, LedgerDataMigrationStatus, LedgerLinesConsistencyMode, LedgerTypes, LinkType, + PostLinesAs, SceneEventType, SchemaConsistencyMode, SchemaLedgerAccountStatus, @@ -24,97 +26,139 @@ class ChartOfAccountsInput(BaseModel): - accounts: List["SchemaLedgerAccountInput"] + """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/docs/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 - type: Optional[LedgerAccountTypes] = 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( + 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/docs/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/docs/reconcile-payments)." name: str + "The name of the Ledger Account." parent: Optional["LedgerAccountMatchInput"] = None - type: Optional[LedgerAccountTypes] = 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] = None + type_: Optional[LedgerTypes] = Field(alias="type", default=None) class CurrencyFilter(BaseModel): equal_to: Optional["CurrencyMatchInput"] = Field(alias="equalTo", default=None) - in_: Optional[List["CurrencyMatchInput"]] = Field(alias="in", 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) + in_: Optional[list[Any]] = Field(alias="in", default=None) + "Must match one of the values provided. Limited to 100 items maximum." 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): @@ -126,158 +170,311 @@ class ExternalAccountFilter(BaseModel): equal_to: Optional["ExternalAccountMatchInput"] = Field( alias="equalTo", default=None ) - in_: Optional[List["ExternalAccountMatchInput"]] = Field(alias="in", 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) - in_: Optional[List["GroupMatchInput"]] = Field(alias="in", 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) - key_in: Optional[List[Any]] = Field(alias="keyIn", 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) - not_in: Optional[List["GroupMatchInput"]] = Field(alias="notIn", 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) - not_key_in: Optional[List[Any]] = Field(alias="notKeyIn", 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): - key_in: Optional[List[Any]] = Field(alias="keyIn", default=None) + """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): - own_balance: "Int96ConditionInput" = Field(alias="ownBalance") + """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): - groups: Optional[List["LedgerAccountGroupConsistencyConfigInput"]] = None + """The payload configuring the consistency for this Ledger Account. + See [Configure consistency](https://fragment.dev/docs/configure-consistency).""" + + groups: Optional[list["LedgerAccountGroupConsistencyConfigInput"]] = None + "The consistency configuration for Ledger Entry Groups affecting this account.\n\nSee [Configure consistency](https://fragment.dev/docs/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/docs/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/docs/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/docs/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) - in_: Optional[List["LedgerAccountMatchInput"]] = Field(alias="in", 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): - key: str + """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/docs/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) - in_: Optional[List[LedgerAccountTypes]] = Field(alias="in", 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 - type: Optional["LedgerAccountTypeFilter"] = 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 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 show_hidden: Optional[bool] = Field(alias="showHidden", default=None) + "Use this filter to show hidden Ledger Entries." tag: Optional["TagFilter"] = None - type: Optional["StringFilter"] = 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) - in_: Optional[List["LedgerEntryMatchInput"]] = Field(alias="in", 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): @@ -288,73 +485,128 @@ class LedgerEntryGroupMatchInput(BaseModel): 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): - conditions: Optional[List["LedgerEntryConditionInput"]] = None + """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 - groups: Optional[List["LedgerEntryGroupInput"]] = 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 - lines: Optional[List["LedgerLineInput"]] = 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 - tags: Optional[List["LedgerEntryTagInput"]] = None - type: Optional[str] = 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 + "Filter by the posted date of the Ledger Line. This is identical to using `posted`, but only supports day-level granularity." 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>`.\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 + "Filter by the posted timestamp of the Ledger Line." show_hidden: Optional[bool] = Field(alias="showHidden", default=None) - type: Optional["TxTypeFilter"] = 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) + 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"] = None + type_: Optional["LedgerTypeFilter"] = Field(alias="type", default=None) class LinkMatchInput(BaseModel): @@ -362,198 +614,415 @@ class LinkMatchInput(BaseModel): 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 - type: Any + "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"] + 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/docs/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/docs/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 - scenes: Optional[List["SceneInput"]] = 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): - children: Optional[List["SchemaLedgerAccountInput"]] = None + """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/docs/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." status: Optional[SchemaLedgerAccountStatus] = None + "The status of this Ledger Account. Defaults to active." template: Optional[bool] = None - type: Optional[LedgerAccountTypes] = 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): - types: List["SchemaLedgerEntryInput"] + """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): - conditions: Optional[List["SchemaLedgerEntryConditionInput"]] = None + """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 - groups: Optional[List["SchemaLedgerEntryGroupInput"]] = None - lines: Optional[List["SchemaLedgerLineInput"]] = 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 - tags: Optional[List["SchemaLedgerEntryTagInput"]] = None - type: Any + "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/docs/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 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) + 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) - not_in: Optional[List[str]] = Field(alias="notIn", 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) - in_: Optional[List[str]] = Field(alias="in", 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' 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) - in_: Optional[List["TagMatchInput"]] = Field(alias="in", 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) - key_in: Optional[List[Any]] = Field(alias="keyIn", 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) - not_in: Optional[List["TagMatchInput"]] = Field(alias="notIn", 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) - not_key_in: Optional[List[Any]] = Field(alias="notKeyIn", 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) + 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 - tags: Optional[List["LedgerEntryTagInput"]] = None - tags_to_remove: Optional[List["LedgerEntryTagInput"]] = Field( + 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. " + + +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/fragment/sync_sdk/list_ledger_account_balances.py b/fragment/sync_sdk/list_ledger_account_balances.py index 2b9e2a2..5909001 100644 --- a/fragment/sync_sdk/list_ledger_account_balances.py +++ b/fragment/sync_sdk/list_ledger_account_balances.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -24,7 +24,7 @@ class ListLedgerAccountBalancesLedger(BaseModel): class ListLedgerAccountBalancesLedgerLedgerAccounts(BaseModel): - nodes: List["ListLedgerAccountBalancesLedgerLedgerAccountsNodes"] + nodes: list["ListLedgerAccountBalancesLedgerLedgerAccountsNodes"] page_info: "ListLedgerAccountBalancesLedgerLedgerAccountsPageInfo" = Field( alias="pageInfo" ) @@ -34,7 +34,7 @@ class ListLedgerAccountBalancesLedgerLedgerAccountsNodes(BaseModel): id: str path: str name: Optional[str] - type: LedgerAccountTypes + type_: LedgerAccountTypes = Field(alias="type") created: Any own_balance: Any = Field(alias="ownBalance") child_balance: Any = Field(alias="childBalance") diff --git a/fragment/sync_sdk/list_ledger_accounts.py b/fragment/sync_sdk/list_ledger_accounts.py index fcd5d92..10e559b 100644 --- a/fragment/sync_sdk/list_ledger_accounts.py +++ b/fragment/sync_sdk/list_ledger_accounts.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -24,7 +24,7 @@ class ListLedgerAccountsLedger(BaseModel): class ListLedgerAccountsLedgerLedgerAccounts(BaseModel): - nodes: List["ListLedgerAccountsLedgerLedgerAccountsNodes"] + nodes: list["ListLedgerAccountsLedgerLedgerAccountsNodes"] page_info: "ListLedgerAccountsLedgerLedgerAccountsPageInfo" = Field( alias="pageInfo" ) @@ -34,7 +34,7 @@ class ListLedgerAccountsLedgerLedgerAccountsNodes(BaseModel): id: str path: str name: Optional[str] - type: LedgerAccountTypes + type_: LedgerAccountTypes = Field(alias="type") created: Any diff --git a/fragment/sync_sdk/list_ledger_entries.py b/fragment/sync_sdk/list_ledger_entries.py index d79a907..58eb428 100644 --- a/fragment/sync_sdk/list_ledger_entries.py +++ b/fragment/sync_sdk/list_ledger_entries.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -19,19 +19,19 @@ class ListLedgerEntriesLedger(BaseModel): class ListLedgerEntriesLedgerLedgerEntries(BaseModel): - nodes: List["ListLedgerEntriesLedgerLedgerEntriesNodes"] + nodes: list["ListLedgerEntriesLedgerLedgerEntriesNodes"] page_info: "ListLedgerEntriesLedgerLedgerEntriesPageInfo" = Field(alias="pageInfo") class ListLedgerEntriesLedgerLedgerEntriesNodes(BaseModel): ik: str - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") posted: Any lines: "ListLedgerEntriesLedgerLedgerEntriesNodesLines" class ListLedgerEntriesLedgerLedgerEntriesNodesLines(BaseModel): - nodes: List["ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodes"] + nodes: list["ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodes"] class ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodes(BaseModel): diff --git a/fragment/sync_sdk/list_ledger_entry_group_balances.py b/fragment/sync_sdk/list_ledger_entry_group_balances.py index 1deafb3..e233db6 100644 --- a/fragment/sync_sdk/list_ledger_entry_group_balances.py +++ b/fragment/sync_sdk/list_ledger_entry_group_balances.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -23,7 +23,7 @@ class ListLedgerEntryGroupBalancesLedgerEntryGroup(BaseModel): class ListLedgerEntryGroupBalancesLedgerEntryGroupBalances(BaseModel): - nodes: List["ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodes"] + nodes: list["ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodes"] page_info: "ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesPageInfo" = Field( alias="pageInfo" ) diff --git a/fragment/sync_sdk/list_multi_currency_ledger_account_balances.py b/fragment/sync_sdk/list_multi_currency_ledger_account_balances.py index 35b3fb2..f12170b 100644 --- a/fragment/sync_sdk/list_multi_currency_ledger_account_balances.py +++ b/fragment/sync_sdk/list_multi_currency_ledger_account_balances.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Optional +from typing import Any, Optional from pydantic import Field @@ -24,7 +24,7 @@ class ListMultiCurrencyLedgerAccountBalancesLedger(BaseModel): class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccounts(BaseModel): - nodes: List["ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes"] + nodes: list["ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes"] page_info: "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsPageInfo" = ( Field(alias="pageInfo") ) @@ -34,7 +34,7 @@ class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes(BaseModel) id: str path: str name: Optional[str] - type: LedgerAccountTypes + type_: LedgerAccountTypes = Field(alias="type") created: Any own_balances: ( "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalances" @@ -48,7 +48,7 @@ class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes(BaseModel) class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalances( BaseModel ): - nodes: List[ + nodes: list[ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodes" ] @@ -70,7 +70,7 @@ class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalances class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalances( BaseModel ): - nodes: List[ + nodes: list[ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodes" ] @@ -92,7 +92,7 @@ class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalanc class ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalances( BaseModel ): - nodes: List[ + nodes: list[ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodes" ] diff --git a/fragment/sync_sdk/migrate_ledger_entry.py b/fragment/sync_sdk/migrate_ledger_entry.py index a9a1414..a77e36a 100644 --- a/fragment/sync_sdk/migrate_ledger_entry.py +++ b/fragment/sync_sdk/migrate_ledger_entry.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -51,7 +51,7 @@ class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedge id: str created: Any posted: Any - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") description: Optional[str] reversed_at: Optional[Any] = Field(alias="reversedAt") hidden: bool @@ -61,7 +61,7 @@ class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedge class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLines( BaseModel ): - nodes: List[ + nodes: list[ "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodes" ] @@ -87,7 +87,7 @@ class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedger id: str created: Any posted: Any - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") description: Optional[str] reversed_at: Optional[Any] = Field(alias="reversedAt") hidden: bool @@ -97,7 +97,7 @@ class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedger class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLines( BaseModel ): - nodes: List[ + nodes: list[ "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversedLedgerEntryLinesNodes" ] @@ -123,7 +123,7 @@ class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntry id: str created: Any posted: Any - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") description: Optional[str] reversed_at: Optional[Any] = Field(alias="reversedAt") hidden: bool @@ -133,7 +133,7 @@ class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntry class MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLines( BaseModel ): - nodes: List[ + nodes: list[ "MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultNewLedgerEntryLinesNodes" ] diff --git a/fragment/sync_sdk/reconcile_tx.py b/fragment/sync_sdk/reconcile_tx.py index 29debc4..3d0b9cb 100644 --- a/fragment/sync_sdk/reconcile_tx.py +++ b/fragment/sync_sdk/reconcile_tx.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -33,7 +33,7 @@ class ReconcileTxReconcileTxInternalError(BaseModel): class ReconcileTxReconcileTxReconcileTxResult(BaseModel): typename__: Literal["ReconcileTxResult"] = Field(alias="__typename") entry: "ReconcileTxReconcileTxReconcileTxResultEntry" - lines: List["ReconcileTxReconcileTxReconcileTxResultLines"] + lines: list["ReconcileTxReconcileTxReconcileTxResultLines"] class ReconcileTxReconcileTxReconcileTxResultEntry(BaseModel): diff --git a/fragment/sync_sdk/reconcile_tx_runtime.py b/fragment/sync_sdk/reconcile_tx_runtime.py index 1de3c98..d01280f 100644 --- a/fragment/sync_sdk/reconcile_tx_runtime.py +++ b/fragment/sync_sdk/reconcile_tx_runtime.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -33,7 +33,7 @@ class ReconcileTxRuntimeReconcileTxInternalError(BaseModel): class ReconcileTxRuntimeReconcileTxReconcileTxResult(BaseModel): typename__: Literal["ReconcileTxResult"] = Field(alias="__typename") entry: "ReconcileTxRuntimeReconcileTxReconcileTxResultEntry" - lines: List["ReconcileTxRuntimeReconcileTxReconcileTxResultLines"] + lines: list["ReconcileTxRuntimeReconcileTxReconcileTxResultLines"] class ReconcileTxRuntimeReconcileTxReconcileTxResultEntry(BaseModel): diff --git a/fragment/sync_sdk/reverse_ledger_entry.py b/fragment/sync_sdk/reverse_ledger_entry.py index 326f78c..669120e 100644 --- a/fragment/sync_sdk/reverse_ledger_entry.py +++ b/fragment/sync_sdk/reverse_ledger_entry.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -48,7 +48,7 @@ class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedge id: str created: Any posted: Any - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") description: Optional[str] hidden: bool lines: "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLines" @@ -57,7 +57,7 @@ class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedge class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLines( BaseModel ): - nodes: List[ + nodes: list[ "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversingLedgerEntryLinesNodes" ] @@ -83,7 +83,7 @@ class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedger id: str created: Any posted: Any - type: Optional[Any] + type_: Optional[Any] = Field(alias="type") description: Optional[str] hidden: bool lines: "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLines" @@ -92,7 +92,7 @@ class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedger class ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLines( BaseModel ): - nodes: List[ + nodes: list[ "ReverseLedgerEntryReverseLedgerEntryReverseLedgerEntryResultReversedLedgerEntryLinesNodes" ] diff --git a/fragment/sync_sdk/sync_custom_accounts.py b/fragment/sync_sdk/sync_custom_accounts.py index 2f80c28..4897c53 100644 --- a/fragment/sync_sdk/sync_custom_accounts.py +++ b/fragment/sync_sdk/sync_custom_accounts.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -33,7 +33,7 @@ class SyncCustomAccountsSyncCustomAccountsInternalError(BaseModel): class SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResult(BaseModel): typename__: Literal["SyncCustomAccountsResult"] = Field(alias="__typename") - accounts: List[ + accounts: list[ "SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccounts" ] diff --git a/fragment/sync_sdk/sync_custom_txs.py b/fragment/sync_sdk/sync_custom_txs.py index 2fa0ac7..e6a399e 100644 --- a/fragment/sync_sdk/sync_custom_txs.py +++ b/fragment/sync_sdk/sync_custom_txs.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Union +from typing import Any, Literal, Union from pydantic import Field @@ -32,7 +32,7 @@ class SyncCustomTxsSyncCustomTxsInternalError(BaseModel): class SyncCustomTxsSyncCustomTxsSyncCustomTxsResult(BaseModel): typename__: Literal["SyncCustomTxsResult"] = Field(alias="__typename") - txs: List["SyncCustomTxsSyncCustomTxsSyncCustomTxsResultTxs"] + txs: list["SyncCustomTxsSyncCustomTxsSyncCustomTxsResultTxs"] class SyncCustomTxsSyncCustomTxsSyncCustomTxsResultTxs(BaseModel): diff --git a/fragment/sync_sdk/update_ledger_entry.py b/fragment/sync_sdk/update_ledger_entry.py index dd0f1d8..b4c4f98 100644 --- a/fragment/sync_sdk/update_ledger_entry.py +++ b/fragment/sync_sdk/update_ledger_entry.py @@ -1,7 +1,7 @@ # Generated by fragment (with the help of ariadne-codegen) # Source: queries/ -from typing import Any, List, Literal, Optional, Union +from typing import Any, Literal, Optional, Union from pydantic import Field @@ -42,12 +42,12 @@ class UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntry(BaseModel): created: Any description: Optional[str] lines: "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLines" - groups: List["UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryGroups"] - tags: List["UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryTags"] + groups: list["UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryGroups"] + tags: list["UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryTags"] class UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLines(BaseModel): - nodes: List[ + nodes: list[ "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodes" ] diff --git a/pyproject.toml b/pyproject.toml index 719686e..6412e95 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ target_package_name = "fragment_graphql_client" [tool.poetry] name = "fragment-python" -version = "0.5.4" +version = "1.0.0" description = "Python SDK for https://fragment.dev/" authors = ["Fragment Foundries Inc"] license = "Apache 2.0"