fragment-python 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. fragment/__init__.py +0 -0
  2. fragment/client/__init__.py +1 -0
  3. fragment/client/async_client.py +67 -0
  4. fragment/codegen/__init__.py +0 -0
  5. fragment/codegen/helpers.py +51 -0
  6. fragment/codegen/main.py +64 -0
  7. fragment/codegen/plugins/__init__.py +0 -0
  8. fragment/codegen/plugins/generate_client_method.py +62 -0
  9. fragment/codegen/plugins/get_file_comment.py +18 -0
  10. fragment/exceptions.py +12 -0
  11. fragment/logger.py +6 -0
  12. fragment/sdk/__init__.py +478 -0
  13. fragment/sdk/add_ledger_entry.py +54 -0
  14. fragment/sdk/add_ledger_entry_runtime.py +54 -0
  15. fragment/sdk/async_client.py +69 -0
  16. fragment/sdk/base_model.py +29 -0
  17. fragment/sdk/client.py +1071 -0
  18. fragment/sdk/create_custom_link.py +40 -0
  19. fragment/sdk/create_ledger.py +49 -0
  20. fragment/sdk/enums.py +263 -0
  21. fragment/sdk/get_ledger.py +23 -0
  22. fragment/sdk/get_ledger_account_balance.py +23 -0
  23. fragment/sdk/get_ledger_account_lines.py +47 -0
  24. fragment/sdk/get_ledger_entry.py +41 -0
  25. fragment/sdk/get_schema.py +28 -0
  26. fragment/sdk/get_workspace.py +16 -0
  27. fragment/sdk/input_types.py +482 -0
  28. fragment/sdk/list_ledger_account_balances.py +53 -0
  29. fragment/sdk/list_ledger_accounts.py +50 -0
  30. fragment/sdk/list_ledger_entries.py +58 -0
  31. fragment/sdk/list_ledger_entry_group_balances.py +57 -0
  32. fragment/sdk/list_multi_currency_ledger_account_balances.py +130 -0
  33. fragment/sdk/reconcile_tx.py +55 -0
  34. fragment/sdk/reconcile_tx_runtime.py +55 -0
  35. fragment/sdk/store_schema.py +45 -0
  36. fragment/sdk/sync_custom_accounts.py +53 -0
  37. fragment/sdk/sync_custom_txs.py +44 -0
  38. fragment/sdk/update_ledger.py +39 -0
  39. fragment/sdk/update_ledger_entry.py +77 -0
  40. fragment/std_queries/queries.graphql +656 -0
  41. fragment_python-0.1.1.dist-info/LICENSE +201 -0
  42. fragment_python-0.1.1.dist-info/METADATA +142 -0
  43. fragment_python-0.1.1.dist-info/RECORD +45 -0
  44. fragment_python-0.1.1.dist-info/WHEEL +4 -0
  45. fragment_python-0.1.1.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,478 @@
1
+ # Generated by fragment (with the help of ariadne-codegen)
2
+
3
+ from .add_ledger_entry import (
4
+ AddLedgerEntry,
5
+ AddLedgerEntryAddLedgerEntryAddLedgerEntryResult,
6
+ AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry,
7
+ AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines,
8
+ AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLinesAccount,
9
+ AddLedgerEntryAddLedgerEntryBadRequestError,
10
+ AddLedgerEntryAddLedgerEntryInternalError,
11
+ )
12
+ from .add_ledger_entry_runtime import (
13
+ AddLedgerEntryRuntime,
14
+ AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResult,
15
+ AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry,
16
+ AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines,
17
+ AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLinesAccount,
18
+ AddLedgerEntryRuntimeAddLedgerEntryBadRequestError,
19
+ AddLedgerEntryRuntimeAddLedgerEntryInternalError,
20
+ )
21
+ from .async_client import AsyncFragmentClient
22
+ from .base_model import BaseModel, Upload
23
+ from .client import Client
24
+ from .create_custom_link import (
25
+ CreateCustomLink,
26
+ CreateCustomLinkCreateCustomLinkBadRequestError,
27
+ CreateCustomLinkCreateCustomLinkCreateCustomLinkResult,
28
+ CreateCustomLinkCreateCustomLinkCreateCustomLinkResultLink,
29
+ CreateCustomLinkCreateCustomLinkInternalError,
30
+ )
31
+ from .create_ledger import (
32
+ CreateLedger,
33
+ CreateLedgerCreateLedgerBadRequestError,
34
+ CreateLedgerCreateLedgerCreateLedgerResult,
35
+ CreateLedgerCreateLedgerCreateLedgerResultLedger,
36
+ CreateLedgerCreateLedgerCreateLedgerResultLedgerSchema,
37
+ CreateLedgerCreateLedgerInternalError,
38
+ )
39
+ from .enums import (
40
+ BalanceUpdateConsistencyMode,
41
+ CurrencyCode,
42
+ CurrencyMode,
43
+ ExternalTransferType,
44
+ ExternalTxSource,
45
+ IncreaseEnv,
46
+ LedgerAccountTypes,
47
+ LedgerLinesConsistencyMode,
48
+ LedgerMigrationStatus,
49
+ LedgerTypes,
50
+ ReadBalanceConsistencyMode,
51
+ SceneEventType,
52
+ SchemaConsistencyMode,
53
+ StripeEnv,
54
+ TxType,
55
+ UnitEnv,
56
+ )
57
+ from .get_ledger import GetLedger, GetLedgerLedger
58
+ from .get_ledger_account_balance import (
59
+ GetLedgerAccountBalance,
60
+ GetLedgerAccountBalanceLedgerAccount,
61
+ )
62
+ from .get_ledger_account_lines import (
63
+ GetLedgerAccountLines,
64
+ GetLedgerAccountLinesLedgerAccount,
65
+ GetLedgerAccountLinesLedgerAccountLines,
66
+ GetLedgerAccountLinesLedgerAccountLinesNodes,
67
+ GetLedgerAccountLinesLedgerAccountLinesPageInfo,
68
+ )
69
+ from .get_ledger_entry import (
70
+ GetLedgerEntry,
71
+ GetLedgerEntryLedgerEntry,
72
+ GetLedgerEntryLedgerEntryLines,
73
+ GetLedgerEntryLedgerEntryLinesNodes,
74
+ GetLedgerEntryLedgerEntryLinesNodesAccount,
75
+ )
76
+ from .get_schema import GetSchema, GetSchemaSchema, GetSchemaSchemaVersion
77
+ from .get_workspace import GetWorkspace, GetWorkspaceWorkspace
78
+ from .input_types import (
79
+ ChartOfAccountsInput,
80
+ CreateCustomCurrencyInput,
81
+ CreateLedgerAccountInput,
82
+ CreateLedgerAccountsInput,
83
+ CreateLedgerInput,
84
+ CurrencyFilter,
85
+ CurrencyMatchInput,
86
+ CustomAccountInput,
87
+ CustomTxInput,
88
+ DateFilter,
89
+ DateTimeFilter,
90
+ EntryGroupMatchInput,
91
+ ExternalAccountFilter,
92
+ ExternalAccountMatchInput,
93
+ GroupBalanceAccountFilter,
94
+ Int96ConditionInput,
95
+ Int96Filter,
96
+ LedgerAccountConditionInput,
97
+ LedgerAccountConsistencyConfigInput,
98
+ LedgerAccountFilter,
99
+ LedgerAccountGroupConsistencyConfigInput,
100
+ LedgerAccountMatchInput,
101
+ LedgerAccountsFilterSet,
102
+ LedgerAccountTypeFilter,
103
+ LedgerEntriesFilterSet,
104
+ LedgerEntryConditionInput,
105
+ LedgerEntryFilter,
106
+ LedgerEntryGroupBalanceFilterSet,
107
+ LedgerEntryGroupInput,
108
+ LedgerEntryGroupMatchInput,
109
+ LedgerEntryGroupsFilterSet,
110
+ LedgerEntryInput,
111
+ LedgerEntryMatchInput,
112
+ LedgerEntryTagInput,
113
+ LedgerLineInput,
114
+ LedgerLineMatchInput,
115
+ LedgerLinesFilterSet,
116
+ LedgerMatchInput,
117
+ LedgersFilterSet,
118
+ LedgerTypeFilter,
119
+ LinkMatchInput,
120
+ SceneEntryInput,
121
+ SceneEventInput,
122
+ SceneInput,
123
+ SchemaConditionInput,
124
+ SchemaConsistencyConfigInput,
125
+ SchemaCurrencyMatchInput,
126
+ SchemaExternalAccountMatchInput,
127
+ SchemaInput,
128
+ SchemaInt96ConditionInput,
129
+ SchemaLedgerAccountInput,
130
+ SchemaLedgerAccountMatchInput,
131
+ SchemaLedgerEntriesInput,
132
+ SchemaLedgerEntryConditionInput,
133
+ SchemaLedgerEntryGroupInput,
134
+ SchemaLedgerEntryInput,
135
+ SchemaLedgerEntryTagInput,
136
+ SchemaLedgerLineInput,
137
+ SchemaMatchInput,
138
+ SchemaTxMatchInput,
139
+ StringFilter,
140
+ StringMatchFilter,
141
+ TagFilter,
142
+ TagMatchInput,
143
+ TxMatchInput,
144
+ TxTypeFilter,
145
+ UpdateLedgerAccountInput,
146
+ UpdateLedgerEntryInput,
147
+ UpdateLedgerInput,
148
+ )
149
+ from .list_ledger_account_balances import (
150
+ ListLedgerAccountBalances,
151
+ ListLedgerAccountBalancesLedger,
152
+ ListLedgerAccountBalancesLedgerLedgerAccounts,
153
+ ListLedgerAccountBalancesLedgerLedgerAccountsNodes,
154
+ ListLedgerAccountBalancesLedgerLedgerAccountsPageInfo,
155
+ )
156
+ from .list_ledger_accounts import (
157
+ ListLedgerAccounts,
158
+ ListLedgerAccountsLedger,
159
+ ListLedgerAccountsLedgerLedgerAccounts,
160
+ ListLedgerAccountsLedgerLedgerAccountsNodes,
161
+ ListLedgerAccountsLedgerLedgerAccountsPageInfo,
162
+ )
163
+ from .list_ledger_entries import (
164
+ ListLedgerEntries,
165
+ ListLedgerEntriesLedger,
166
+ ListLedgerEntriesLedgerLedgerEntries,
167
+ ListLedgerEntriesLedgerLedgerEntriesNodes,
168
+ ListLedgerEntriesLedgerLedgerEntriesNodesLines,
169
+ ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodes,
170
+ ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodesAccount,
171
+ ListLedgerEntriesLedgerLedgerEntriesPageInfo,
172
+ )
173
+ from .list_ledger_entry_group_balances import (
174
+ ListLedgerEntryGroupBalances,
175
+ ListLedgerEntryGroupBalancesLedgerEntryGroup,
176
+ ListLedgerEntryGroupBalancesLedgerEntryGroupBalances,
177
+ ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodes,
178
+ ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodesAccount,
179
+ ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodesCurrency,
180
+ ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesPageInfo,
181
+ )
182
+ from .list_multi_currency_ledger_account_balances import (
183
+ ListMultiCurrencyLedgerAccountBalances,
184
+ ListMultiCurrencyLedgerAccountBalancesLedger,
185
+ ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccounts,
186
+ ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes,
187
+ ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalances,
188
+ ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodes,
189
+ ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodesCurrency,
190
+ ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalances,
191
+ ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodes,
192
+ ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodesCurrency,
193
+ ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalances,
194
+ ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodes,
195
+ ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodesCurrency,
196
+ ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsPageInfo,
197
+ )
198
+ from .reconcile_tx import (
199
+ ReconcileTx,
200
+ ReconcileTxReconcileTxBadRequestError,
201
+ ReconcileTxReconcileTxInternalError,
202
+ ReconcileTxReconcileTxReconcileTxResult,
203
+ ReconcileTxReconcileTxReconcileTxResultEntry,
204
+ ReconcileTxReconcileTxReconcileTxResultLines,
205
+ ReconcileTxReconcileTxReconcileTxResultLinesAccount,
206
+ )
207
+ from .reconcile_tx_runtime import (
208
+ ReconcileTxRuntime,
209
+ ReconcileTxRuntimeReconcileTxBadRequestError,
210
+ ReconcileTxRuntimeReconcileTxInternalError,
211
+ ReconcileTxRuntimeReconcileTxReconcileTxResult,
212
+ ReconcileTxRuntimeReconcileTxReconcileTxResultEntry,
213
+ ReconcileTxRuntimeReconcileTxReconcileTxResultLines,
214
+ ReconcileTxRuntimeReconcileTxReconcileTxResultLinesAccount,
215
+ )
216
+ from .store_schema import (
217
+ StoreSchema,
218
+ StoreSchemaStoreSchemaBadRequestError,
219
+ StoreSchemaStoreSchemaInternalError,
220
+ StoreSchemaStoreSchemaStoreSchemaResult,
221
+ StoreSchemaStoreSchemaStoreSchemaResultSchema,
222
+ StoreSchemaStoreSchemaStoreSchemaResultSchemaVersion,
223
+ )
224
+ from .sync_custom_accounts import (
225
+ SyncCustomAccounts,
226
+ SyncCustomAccountsSyncCustomAccountsBadRequestError,
227
+ SyncCustomAccountsSyncCustomAccountsInternalError,
228
+ SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResult,
229
+ SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccounts,
230
+ SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccountsCurrency,
231
+ )
232
+ from .sync_custom_txs import (
233
+ SyncCustomTxs,
234
+ SyncCustomTxsSyncCustomTxsBadRequestError,
235
+ SyncCustomTxsSyncCustomTxsInternalError,
236
+ SyncCustomTxsSyncCustomTxsSyncCustomTxsResult,
237
+ SyncCustomTxsSyncCustomTxsSyncCustomTxsResultTxs,
238
+ )
239
+ from .update_ledger import (
240
+ UpdateLedger,
241
+ UpdateLedgerUpdateLedgerBadRequestError,
242
+ UpdateLedgerUpdateLedgerInternalError,
243
+ UpdateLedgerUpdateLedgerUpdateLedgerResult,
244
+ UpdateLedgerUpdateLedgerUpdateLedgerResultLedger,
245
+ )
246
+ from .update_ledger_entry import (
247
+ UpdateLedgerEntry,
248
+ UpdateLedgerEntryUpdateLedgerEntryBadRequestError,
249
+ UpdateLedgerEntryUpdateLedgerEntryInternalError,
250
+ UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResult,
251
+ UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntry,
252
+ UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryGroups,
253
+ UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLines,
254
+ UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodes,
255
+ UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodesAccount,
256
+ UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryTags,
257
+ )
258
+
259
+ __all__ = [
260
+ "AddLedgerEntry",
261
+ "AddLedgerEntryAddLedgerEntryAddLedgerEntryResult",
262
+ "AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry",
263
+ "AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines",
264
+ "AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLinesAccount",
265
+ "AddLedgerEntryAddLedgerEntryBadRequestError",
266
+ "AddLedgerEntryAddLedgerEntryInternalError",
267
+ "AddLedgerEntryRuntime",
268
+ "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResult",
269
+ "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry",
270
+ "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines",
271
+ "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLinesAccount",
272
+ "AddLedgerEntryRuntimeAddLedgerEntryBadRequestError",
273
+ "AddLedgerEntryRuntimeAddLedgerEntryInternalError",
274
+ "AsyncFragmentClient",
275
+ "BalanceUpdateConsistencyMode",
276
+ "BaseModel",
277
+ "ChartOfAccountsInput",
278
+ "Client",
279
+ "CreateCustomCurrencyInput",
280
+ "CreateCustomLink",
281
+ "CreateCustomLinkCreateCustomLinkBadRequestError",
282
+ "CreateCustomLinkCreateCustomLinkCreateCustomLinkResult",
283
+ "CreateCustomLinkCreateCustomLinkCreateCustomLinkResultLink",
284
+ "CreateCustomLinkCreateCustomLinkInternalError",
285
+ "CreateLedger",
286
+ "CreateLedgerAccountInput",
287
+ "CreateLedgerAccountsInput",
288
+ "CreateLedgerCreateLedgerBadRequestError",
289
+ "CreateLedgerCreateLedgerCreateLedgerResult",
290
+ "CreateLedgerCreateLedgerCreateLedgerResultLedger",
291
+ "CreateLedgerCreateLedgerCreateLedgerResultLedgerSchema",
292
+ "CreateLedgerCreateLedgerInternalError",
293
+ "CreateLedgerInput",
294
+ "CurrencyCode",
295
+ "CurrencyFilter",
296
+ "CurrencyMatchInput",
297
+ "CurrencyMode",
298
+ "CustomAccountInput",
299
+ "CustomTxInput",
300
+ "DateFilter",
301
+ "DateTimeFilter",
302
+ "EntryGroupMatchInput",
303
+ "ExternalAccountFilter",
304
+ "ExternalAccountMatchInput",
305
+ "ExternalTransferType",
306
+ "ExternalTxSource",
307
+ "GetLedger",
308
+ "GetLedgerAccountBalance",
309
+ "GetLedgerAccountBalanceLedgerAccount",
310
+ "GetLedgerAccountLines",
311
+ "GetLedgerAccountLinesLedgerAccount",
312
+ "GetLedgerAccountLinesLedgerAccountLines",
313
+ "GetLedgerAccountLinesLedgerAccountLinesNodes",
314
+ "GetLedgerAccountLinesLedgerAccountLinesPageInfo",
315
+ "GetLedgerEntry",
316
+ "GetLedgerEntryLedgerEntry",
317
+ "GetLedgerEntryLedgerEntryLines",
318
+ "GetLedgerEntryLedgerEntryLinesNodes",
319
+ "GetLedgerEntryLedgerEntryLinesNodesAccount",
320
+ "GetLedgerLedger",
321
+ "GetSchema",
322
+ "GetSchemaSchema",
323
+ "GetSchemaSchemaVersion",
324
+ "GetWorkspace",
325
+ "GetWorkspaceWorkspace",
326
+ "GroupBalanceAccountFilter",
327
+ "IncreaseEnv",
328
+ "Int96ConditionInput",
329
+ "Int96Filter",
330
+ "LedgerAccountConditionInput",
331
+ "LedgerAccountConsistencyConfigInput",
332
+ "LedgerAccountFilter",
333
+ "LedgerAccountGroupConsistencyConfigInput",
334
+ "LedgerAccountMatchInput",
335
+ "LedgerAccountTypeFilter",
336
+ "LedgerAccountTypes",
337
+ "LedgerAccountsFilterSet",
338
+ "LedgerEntriesFilterSet",
339
+ "LedgerEntryConditionInput",
340
+ "LedgerEntryFilter",
341
+ "LedgerEntryGroupBalanceFilterSet",
342
+ "LedgerEntryGroupInput",
343
+ "LedgerEntryGroupMatchInput",
344
+ "LedgerEntryGroupsFilterSet",
345
+ "LedgerEntryInput",
346
+ "LedgerEntryMatchInput",
347
+ "LedgerEntryTagInput",
348
+ "LedgerLineInput",
349
+ "LedgerLineMatchInput",
350
+ "LedgerLinesConsistencyMode",
351
+ "LedgerLinesFilterSet",
352
+ "LedgerMatchInput",
353
+ "LedgerMigrationStatus",
354
+ "LedgerTypeFilter",
355
+ "LedgerTypes",
356
+ "LedgersFilterSet",
357
+ "LinkMatchInput",
358
+ "ListLedgerAccountBalances",
359
+ "ListLedgerAccountBalancesLedger",
360
+ "ListLedgerAccountBalancesLedgerLedgerAccounts",
361
+ "ListLedgerAccountBalancesLedgerLedgerAccountsNodes",
362
+ "ListLedgerAccountBalancesLedgerLedgerAccountsPageInfo",
363
+ "ListLedgerAccounts",
364
+ "ListLedgerAccountsLedger",
365
+ "ListLedgerAccountsLedgerLedgerAccounts",
366
+ "ListLedgerAccountsLedgerLedgerAccountsNodes",
367
+ "ListLedgerAccountsLedgerLedgerAccountsPageInfo",
368
+ "ListLedgerEntries",
369
+ "ListLedgerEntriesLedger",
370
+ "ListLedgerEntriesLedgerLedgerEntries",
371
+ "ListLedgerEntriesLedgerLedgerEntriesNodes",
372
+ "ListLedgerEntriesLedgerLedgerEntriesNodesLines",
373
+ "ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodes",
374
+ "ListLedgerEntriesLedgerLedgerEntriesNodesLinesNodesAccount",
375
+ "ListLedgerEntriesLedgerLedgerEntriesPageInfo",
376
+ "ListLedgerEntryGroupBalances",
377
+ "ListLedgerEntryGroupBalancesLedgerEntryGroup",
378
+ "ListLedgerEntryGroupBalancesLedgerEntryGroupBalances",
379
+ "ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodes",
380
+ "ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodesAccount",
381
+ "ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesNodesCurrency",
382
+ "ListLedgerEntryGroupBalancesLedgerEntryGroupBalancesPageInfo",
383
+ "ListMultiCurrencyLedgerAccountBalances",
384
+ "ListMultiCurrencyLedgerAccountBalancesLedger",
385
+ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccounts",
386
+ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodes",
387
+ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalances",
388
+ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodes",
389
+ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesBalancesNodesCurrency",
390
+ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalances",
391
+ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodes",
392
+ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesChildBalancesNodesCurrency",
393
+ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalances",
394
+ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodes",
395
+ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsNodesOwnBalancesNodesCurrency",
396
+ "ListMultiCurrencyLedgerAccountBalancesLedgerLedgerAccountsPageInfo",
397
+ "ReadBalanceConsistencyMode",
398
+ "ReconcileTx",
399
+ "ReconcileTxReconcileTxBadRequestError",
400
+ "ReconcileTxReconcileTxInternalError",
401
+ "ReconcileTxReconcileTxReconcileTxResult",
402
+ "ReconcileTxReconcileTxReconcileTxResultEntry",
403
+ "ReconcileTxReconcileTxReconcileTxResultLines",
404
+ "ReconcileTxReconcileTxReconcileTxResultLinesAccount",
405
+ "ReconcileTxRuntime",
406
+ "ReconcileTxRuntimeReconcileTxBadRequestError",
407
+ "ReconcileTxRuntimeReconcileTxInternalError",
408
+ "ReconcileTxRuntimeReconcileTxReconcileTxResult",
409
+ "ReconcileTxRuntimeReconcileTxReconcileTxResultEntry",
410
+ "ReconcileTxRuntimeReconcileTxReconcileTxResultLines",
411
+ "ReconcileTxRuntimeReconcileTxReconcileTxResultLinesAccount",
412
+ "SceneEntryInput",
413
+ "SceneEventInput",
414
+ "SceneEventType",
415
+ "SceneInput",
416
+ "SchemaConditionInput",
417
+ "SchemaConsistencyConfigInput",
418
+ "SchemaConsistencyMode",
419
+ "SchemaCurrencyMatchInput",
420
+ "SchemaExternalAccountMatchInput",
421
+ "SchemaInput",
422
+ "SchemaInt96ConditionInput",
423
+ "SchemaLedgerAccountInput",
424
+ "SchemaLedgerAccountMatchInput",
425
+ "SchemaLedgerEntriesInput",
426
+ "SchemaLedgerEntryConditionInput",
427
+ "SchemaLedgerEntryGroupInput",
428
+ "SchemaLedgerEntryInput",
429
+ "SchemaLedgerEntryTagInput",
430
+ "SchemaLedgerLineInput",
431
+ "SchemaMatchInput",
432
+ "SchemaTxMatchInput",
433
+ "StoreSchema",
434
+ "StoreSchemaStoreSchemaBadRequestError",
435
+ "StoreSchemaStoreSchemaInternalError",
436
+ "StoreSchemaStoreSchemaStoreSchemaResult",
437
+ "StoreSchemaStoreSchemaStoreSchemaResultSchema",
438
+ "StoreSchemaStoreSchemaStoreSchemaResultSchemaVersion",
439
+ "StringFilter",
440
+ "StringMatchFilter",
441
+ "StripeEnv",
442
+ "SyncCustomAccounts",
443
+ "SyncCustomAccountsSyncCustomAccountsBadRequestError",
444
+ "SyncCustomAccountsSyncCustomAccountsInternalError",
445
+ "SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResult",
446
+ "SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccounts",
447
+ "SyncCustomAccountsSyncCustomAccountsSyncCustomAccountsResultAccountsCurrency",
448
+ "SyncCustomTxs",
449
+ "SyncCustomTxsSyncCustomTxsBadRequestError",
450
+ "SyncCustomTxsSyncCustomTxsInternalError",
451
+ "SyncCustomTxsSyncCustomTxsSyncCustomTxsResult",
452
+ "SyncCustomTxsSyncCustomTxsSyncCustomTxsResultTxs",
453
+ "TagFilter",
454
+ "TagMatchInput",
455
+ "TxMatchInput",
456
+ "TxType",
457
+ "TxTypeFilter",
458
+ "UnitEnv",
459
+ "UpdateLedger",
460
+ "UpdateLedgerAccountInput",
461
+ "UpdateLedgerEntry",
462
+ "UpdateLedgerEntryInput",
463
+ "UpdateLedgerEntryUpdateLedgerEntryBadRequestError",
464
+ "UpdateLedgerEntryUpdateLedgerEntryInternalError",
465
+ "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResult",
466
+ "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntry",
467
+ "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryGroups",
468
+ "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLines",
469
+ "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodes",
470
+ "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodesAccount",
471
+ "UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryTags",
472
+ "UpdateLedgerInput",
473
+ "UpdateLedgerUpdateLedgerBadRequestError",
474
+ "UpdateLedgerUpdateLedgerInternalError",
475
+ "UpdateLedgerUpdateLedgerUpdateLedgerResult",
476
+ "UpdateLedgerUpdateLedgerUpdateLedgerResultLedger",
477
+ "Upload",
478
+ ]
@@ -0,0 +1,54 @@
1
+ # Generated by fragment (with the help of ariadne-codegen)
2
+ # Source: queries/
3
+
4
+ from typing import Any, List, Literal, Optional, Union
5
+
6
+ from pydantic import Field
7
+
8
+ from .base_model import BaseModel
9
+
10
+
11
+ class AddLedgerEntry(BaseModel):
12
+ add_ledger_entry: Union[
13
+ "AddLedgerEntryAddLedgerEntryAddLedgerEntryResult",
14
+ "AddLedgerEntryAddLedgerEntryBadRequestError",
15
+ "AddLedgerEntryAddLedgerEntryInternalError",
16
+ ] = Field(alias="addLedgerEntry", discriminator="typename__")
17
+
18
+
19
+ class AddLedgerEntryAddLedgerEntryAddLedgerEntryResult(BaseModel):
20
+ typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename")
21
+ is_ik_replay: bool = Field(alias="isIkReplay")
22
+ entry: "AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry"
23
+ lines: List["AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines"]
24
+
25
+
26
+ class AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry(BaseModel):
27
+ type: Optional[Any]
28
+ id: str
29
+ ik: str
30
+ posted: Any
31
+ created: Any
32
+
33
+
34
+ class AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines(BaseModel):
35
+ id: str
36
+ amount: Any
37
+ account: "AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLinesAccount"
38
+
39
+
40
+ class AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLinesAccount(BaseModel):
41
+ path: str
42
+
43
+
44
+ class AddLedgerEntryAddLedgerEntryBadRequestError(BaseModel):
45
+ typename__: Literal["BadRequestError"] = Field(alias="__typename")
46
+
47
+
48
+ class AddLedgerEntryAddLedgerEntryInternalError(BaseModel):
49
+ typename__: Literal["InternalError"] = Field(alias="__typename")
50
+
51
+
52
+ AddLedgerEntry.model_rebuild()
53
+ AddLedgerEntryAddLedgerEntryAddLedgerEntryResult.model_rebuild()
54
+ AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines.model_rebuild()
@@ -0,0 +1,54 @@
1
+ # Generated by fragment (with the help of ariadne-codegen)
2
+ # Source: queries/
3
+
4
+ from typing import Any, List, Literal, Optional, Union
5
+
6
+ from pydantic import Field
7
+
8
+ from .base_model import BaseModel
9
+
10
+
11
+ class AddLedgerEntryRuntime(BaseModel):
12
+ add_ledger_entry: Union[
13
+ "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResult",
14
+ "AddLedgerEntryRuntimeAddLedgerEntryBadRequestError",
15
+ "AddLedgerEntryRuntimeAddLedgerEntryInternalError",
16
+ ] = Field(alias="addLedgerEntry", discriminator="typename__")
17
+
18
+
19
+ class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResult(BaseModel):
20
+ typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename")
21
+ is_ik_replay: bool = Field(alias="isIkReplay")
22
+ entry: "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry"
23
+ lines: List["AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines"]
24
+
25
+
26
+ class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry(BaseModel):
27
+ type: Optional[Any]
28
+ id: str
29
+ ik: str
30
+ posted: Any
31
+ created: Any
32
+
33
+
34
+ class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines(BaseModel):
35
+ id: str
36
+ amount: Any
37
+ account: "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLinesAccount"
38
+
39
+
40
+ class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLinesAccount(BaseModel):
41
+ path: str
42
+
43
+
44
+ class AddLedgerEntryRuntimeAddLedgerEntryBadRequestError(BaseModel):
45
+ typename__: Literal["BadRequestError"] = Field(alias="__typename")
46
+
47
+
48
+ class AddLedgerEntryRuntimeAddLedgerEntryInternalError(BaseModel):
49
+ typename__: Literal["InternalError"] = Field(alias="__typename")
50
+
51
+
52
+ AddLedgerEntryRuntime.model_rebuild()
53
+ AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResult.model_rebuild()
54
+ AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines.model_rebuild()
@@ -0,0 +1,69 @@
1
+ # Generated by fragment (with the help of ariadne-codegen)
2
+
3
+ # Ignore untyped authlib
4
+ # mypy: disable-error-code="import-untyped"
5
+ import time
6
+ from typing import Any, Dict, Optional
7
+
8
+ import httpx
9
+ from ariadne_codegen.client_generators.dependencies.async_base_client import (
10
+ AsyncBaseClient,
11
+ )
12
+ from authlib.integrations.httpx_client import AsyncOAuth2Client
13
+
14
+ from fragment.exceptions import MissingArgumentException, MissingTokenException
15
+
16
+
17
+ class AsyncFragmentClient(AsyncBaseClient):
18
+ def __init__(
19
+ self,
20
+ api_url: str = "",
21
+ auth_url: str = "",
22
+ auth_scope: str = "",
23
+ client_id: str = "",
24
+ client_secret: str = "",
25
+ http_client: Optional[httpx.AsyncClient] = None,
26
+ ):
27
+ if api_url == "":
28
+ raise MissingArgumentException("api_url")
29
+ if auth_url == "":
30
+ raise MissingArgumentException("auth_url")
31
+ if auth_scope == "":
32
+ raise MissingArgumentException("auth_scope")
33
+ if client_id == "":
34
+ raise MissingArgumentException("client_id")
35
+ if client_secret == "":
36
+ raise MissingArgumentException("client_secret")
37
+ super().__init__(url=api_url, http_client=http_client)
38
+
39
+ self.auth_url = auth_url
40
+ self.expiration_time = None
41
+ self.token = None
42
+ self.oauth2_client = AsyncOAuth2Client(
43
+ client_id, client_secret, scope=auth_scope
44
+ )
45
+
46
+ async def refresh_token(self):
47
+ now = time.time()
48
+ if self.expiration_time is None or self.expiration_time <= now:
49
+ self.token = await self.oauth2_client.fetch_token(self.auth_url)
50
+ self.expiration_time = now + self.token["expires_in"]
51
+
52
+ async def execute(
53
+ self,
54
+ query: str,
55
+ operation_name: Optional[str] = None,
56
+ variables: Optional[Dict[str, Any]] = None,
57
+ **kwargs: Any,
58
+ ) -> httpx.Response:
59
+ await self.refresh_token()
60
+ if self.token is None:
61
+ raise MissingTokenException()
62
+ headers = kwargs.get("headers", {})
63
+ kwargs.update(
64
+ headers={
65
+ "Authorization": f'Bearer {self.token["access_token"]}',
66
+ **headers,
67
+ }
68
+ )
69
+ return await super().execute(query, operation_name, variables, **kwargs)
@@ -0,0 +1,29 @@
1
+ # Generated by fragment (with the help of ariadne-codegen)
2
+
3
+ from io import IOBase
4
+
5
+ from pydantic import BaseModel as PydanticBaseModel, ConfigDict
6
+
7
+
8
+ class UnsetType:
9
+ def __bool__(self) -> bool:
10
+ return False
11
+
12
+
13
+ UNSET = UnsetType()
14
+
15
+
16
+ class BaseModel(PydanticBaseModel):
17
+ model_config = ConfigDict(
18
+ populate_by_name=True,
19
+ validate_assignment=True,
20
+ arbitrary_types_allowed=True,
21
+ protected_namespaces=(),
22
+ )
23
+
24
+
25
+ class Upload:
26
+ def __init__(self, filename: str, content: IOBase, content_type: str):
27
+ self.filename = filename
28
+ self.content = content
29
+ self.content_type = content_type